当前位置: 首页>>代码示例>>C++>>正文


C++ Observable::SetBkgAcceptance方法代码示例

本文整理汇总了C++中Observable::SetBkgAcceptance方法的典型用法代码示例。如果您正苦于以下问题:C++ Observable::SetBkgAcceptance方法的具体用法?C++ Observable::SetBkgAcceptance怎么用?C++ Observable::SetBkgAcceptance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Observable的用法示例。


在下文中一共展示了Observable::SetBkgAcceptance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

double Bd2JpsiKstar_sWave_Fs::angularFactor( )
{
	double returnValue=0.;

	int globalbin=-1;
	int xbin=-1, ybin=-1, zbin=-1;
	double num_entries_bin=-1.;

	//Observable* cos1Obs = cos1Obs = _datapoint->GetObservable( cosPsiName );
	Observable* cos1Obs = _datapoint->GetObservable( cosPsiName );

	if( cos1Obs->GetBkgBinNumber() != -1 )
	{
		return cos1Obs->GetBkgAcceptance();
	}
	else
	{
		Observable* cos2Obs = _datapoint->GetObservable( cosThetaName );
		Observable* phiObs = _datapoint->GetObservable( phiName );

		//Find global bin number for values of angles, find number of entries per bin, divide by volume per bin and normalise with total number of entries in the histogram
		xbin = xaxis->FindFixBin( cosPsi ); if( xbin > nxbins ) xbin = nxbins; if( xbin == 0 ) xbin = 1;
		ybin = yaxis->FindFixBin( cosTheta ); if( ybin > nybins ) ybin = nybins; if( ybin == 0 ) ybin = 1;
		zbin = zaxis->FindFixBin( phi ); if( zbin > nzbins ) zbin = nzbins; if( zbin == 0 ) zbin = 1;

		globalbin = histo->GetBin( xbin, ybin, zbin );
		num_entries_bin = (double)histo->GetBinContent(globalbin);

		//Angular factor normalized with phase space of histogram and total number of entries in the histogram
		returnValue = (double)num_entries_bin;// / (deltax * deltay * deltaz) / (double)total_num_entries;
		//returnValue = (double)num_entries_bin / histo->Integral();

		cos1Obs->SetBkgBinNumber( xbin ); cos1Obs->SetBkgAcceptance( returnValue );
		cos2Obs->SetBkgBinNumber( ybin ); cos2Obs->SetBkgAcceptance( returnValue );
		phiObs->SetBkgBinNumber( zbin ); phiObs->SetBkgAcceptance( returnValue );
	}

	return returnValue;
}
开发者ID:abmorris,项目名称:RapidFit,代码行数:39,代码来源:Bd2JpsiKstar_sWave_Fs.cpp


注:本文中的Observable::SetBkgAcceptance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。