Exemple #1
0
// Constructor
Bs2PhiPhi::Bs2PhiPhi(PDFConfigurator* config) :
	// Dependent variables
	  phi     (0.0)
	, ctheta_1(0.0)
	, ctheta_2(0.0)
	// Dependent variable names
	, phiName     (config->getName("phi"     ))
	, ctheta_1Name(config->getName("ctheta_1"))
	, ctheta_2Name(config->getName("ctheta_2"))
	// Physics parameters
	, dGsGs(0.0)
	, Aperpsq(0.0)
	, Azerosq(0.0)
	, Aparasq(0.0)
	, deltaperp(0.0)
	, deltazero(0.0)
	, deltapara(0.0)
	// Width splitting
	, dGsGsName(config->getName("dGsGs"))
	// Magnitude-squared of helicity amplitudes
	, AperpsqName(config->getName("phi1020_Aperpsq"))
	, AzerosqName(config->getName("phi1020_Azerosq"))
	// Phases of helicity amplitudes
	, deltaperpName(config->getName("phi1020_deltaperp"))
	, deltazeroName(config->getName("phi1020_deltazero"))
	, deltaparaName(config->getName("phi1020_deltapara"))
	// Options
	, compName("0")
	, numerical(config->isTrue("Numerical"))
{
	MakePrototypes();
	componentlist.push_back("Pwave-even");
	componentlist.push_back("Pwave-odd");
	Initialise();
}
Bs2PhiKKPeakingBackground::Bs2PhiKKPeakingBackground(PDFConfigurator* config) :
  // Dependent variables
    mKK     (0.0)
  , phi     (0.0)
  , ctheta_1(0.0)
  , ctheta_2(0.0)
  // Physics parameters
  , mean    (0.0)
  , sigma   (0.0)
  , alpha   (0.0)
  , n       (0.0)
  // Dependent variable names
  , mKKName     (config->getName("mKK"     ))
  , ctheta_1Name(config->getName("ctheta_1"))
  , ctheta_2Name(config->getName("ctheta_2"))
  , phiName     (config->getName("phi"     ))
{
  MakePrototypes();
  // Get the prefix for the physics parameters in the configuration file
  // This allows for the sum of multiple instances of the same PDF with different parameters
  mode = config->getConfigurationValue("DecayMode");
  // Physics parameter names
  meanName  = config->getName(mode+"mean" );
  sigmaName = config->getName(mode+"sigma");
  alphaName = config->getName(mode+"alpha");
  nName     = config->getName(mode+"n"    );
  // Create the angular function
  shape = new LegendreMomentShape(config->getConfigurationValue("CoefficientsFile"));
  this->SetNumericalNormalisation( true );
	this->TurnCachingOff();
}
//Constructor
Bs2JpsiPhiPromptBkg_withTimeRes::Bs2JpsiPhiPromptBkg_withTimeRes( PDFConfigurator* configurator ) : 
	// Physics parameters
	  sigmaPrName	( configurator->getName("sigmaPr") )
        // Observables
        , timeName      ( configurator->getName("time") )
	, timeconstraintName( configurator->getName("time") )
{
	MakePrototypes();
	cout << "Constructing Bs2JpsiPhi prompt background with time resolution" << endl;
}
//Constructor
Bs2DsPiBkg_withTimeRes::Bs2DsPiBkg_withTimeRes(PDFConfigurator* configurator) : 
	// Physics parameters
	  lifetimeBdName	( configurator->getName("lifetimeBd") )
	, timeResName	( configurator->getName("timeRes_DsPi_background") )
        // Observables
        , timeName      ( configurator->getName("time") )
	, timeconstraintName( configurator->getName("time") )
{
	MakePrototypes();
}
Exemple #5
0
//Constructor
Novosibirsk::Novosibirsk(PDFConfigurator* configurator) :
	// Physics parameters
	BasePDF()
	, widthName	( configurator->getName("width") )
	, peakName	( configurator->getName("peak") )
	, tailName	( configurator->getName("tail") )
	// Observables
	, xName	( configurator->getName("x") )
{
	MakePrototypes();
}
//Constructor
Bs2JpsiPhiPromptBkg_tripleGaussian::Bs2JpsiPhiPromptBkg_tripleGaussian( PDFConfigurator* configurator ) :
	// Physics parameters
	  frac_sigmaPr1Name	( configurator->getName("frac_sigmaPr1") )
	, frac_sigmaPr23Name	( configurator->getName("frac_sigmaPr23" ))
	, sigmaPr1Name	( configurator->getName("sigmaPr1") )
	, sigmaPr2Name	( configurator->getName("sigmaPr2") )
	, sigmaPr3Name	( configurator->getName("sigmaPr3") )
	// Observables
	, timeName	( configurator->getName("time") )
	, timeconstraintName( configurator->getName("time") )
{
	MakePrototypes();
	cout << "Constructing Bs2JpsiPhi prompt background with triple Gaussian" << endl;
}
// Constructor
Bs2PhiKKBackground::Bs2PhiKKBackground(PDFConfigurator* config) : Bs2PhiKK(config)
{
	std::cout << "\nBuilding Bs → ϕ K+ K− background PDF\n\n";
	std::vector<std::string> componentlist = StringProcessing::SplitString(config->getConfigurationValue("components"), ' ');
	std::cout << "┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n";
	std::cout << "┃ Component     │ Type          ┃\n";
	std::cout << "┠───────────────┼───────────────┨\n";
	for(const auto& name: componentlist)
	{
		if(name=="") continue;
		components[name] = ParseComponent(config,name);
	}
	std::cout << "┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛" << std::endl;
	MakePrototypes();
	Initialise();
}
Exemple #8
0
//Constructor
DPBackground::DPBackground( PDFConfigurator* configurator) :
    // Observables
	  m23Name	( configurator->getName("m23") )
	, cosTheta1Name	( configurator->getName("cosTheta1") )
	, cosTheta2Name	( configurator->getName("cosTheta2") )
	, phiName	( configurator->getName("phi") )

   	, m23(), cosTheta1(), cosTheta2(), phi()
{
	MakePrototypes();

	this->SetNumericalNormalisation( true );
	//this->TurnCachingOff();
    for ( int l = 0; l < l_max + 1; l++ )
    {
        for ( int i = 0; i < i_max + 1; i++ )
        {
            for ( int k = 0; k < k_max + 1; k++ )
            {
                for ( int j = 0; j < j_max + 1; j++ )
                {
                    c[l][i][k][j] = 0.;
                }
            }
        }
    }

  c[0][0][0][0] = 0.070524;// +- 0.000000
  c[0][0][0][2] = -0.006140;// +- 0.001129
  c[0][0][1][2] = 0.005151;// +- 0.001165
  c[1][1][0][0] = 0.013604;// +- 0.003015
  c[1][1][1][2] = -0.009820;// +- 0.003020
  c[2][0][0][0] = -0.047773;// +- 0.002055
  c[2][0][0][2] = 0.011558;// +- 0.002108
  c[2][1][0][0] = -0.019409;// +- 0.003751
  c[2][2][0][0] = 0.021200;// +- 0.004837
  c[3][0][0][0] = 0.015202;// +- 0.002853
  c[3][1][0][0] = -0.017231;// +- 0.004905
  c[4][0][0][0] = -0.024147;// +- 0.003050
  c[4][1][0][0] = 0.029003;// +- 0.005208
  c[5][0][0][0] = -0.024514;// +- 0.003292
  c[5][4][2][2] = 0.030472;// +- 0.010019
  c[6][0][0][0] = 0.029808;// +- 0.003891
}
Bs2JpsiPhi_mistagObservable_alt::Bs2JpsiPhi_mistagObservable_alt() : 
	// Physics parameters
	  gammaName     ( "gamma" )
	, deltaGammaName( "deltaGamma" )
	, deltaMName    ( "deltaM")
	, Phi_sName     ( "Phi_s")
	, Azero_sqName  ( "Azero_sq" )
	, Aperp_sqName  ( "Aperp_sq" )
	, delta_zeroName( "delta_zero" )
	, delta_paraName( "delta_para" )
	, delta_perpName( "delta_perp" )
	// Detector parameters
	, res1Name	( "timeResolution1" )
	, res2Name	( "timeResolution2" )
	, res1FractionName	( "timeResolution1Fraction" )
	, timeOffsetName	( "timeOffset" )
	// Angular acceptance factors
	, angAccI1Name ( "angAccI1" )
	, angAccI2Name ( "angAccI2" )
	, angAccI3Name ( "angAccI3" )
	, angAccI4Name ( "angAccI4" )
	, angAccI5Name ( "angAccI5" )
	, angAccI6Name ( "angAccI6" )
	// Observables
	, timeName	    ( "time" )
	, cosThetaName	( "cosTheta" )
	, phiName	    ( "phi" )
	, cosPsiName	( "cosPsi" )
	, tagName	    ( "tag" )
	, mistagName	( "mistag" )
	// Other things
	, normalisationCacheValid(false)
{
	MakePrototypes();
	
	std::cout << "Constructing signal PDF: Bs2JpsiPhi_mistagObservable_alt " << std::endl ;
}
//Constructor
Bd2JpsiKstar_sWave::Bd2JpsiKstar_sWave(PDFConfigurator* configurator ) :
    cachedAzeroAzeroIntB(), cachedAparaAparaIntB(), cachedAperpAperpIntB(), cachedAparaAperpIntB(), cachedAzeroAparaIntB(), cachedAzeroAperpIntB(),
    cachedAsAsIntB(), cachedAparaAsIntB(), cachedAperpAsIntB(), cachedAzeroAsIntB(), AzeroAzeroB(), AparaAparaB(), AperpAperpB(), AsAsB(), ImAparaAperpB(),
    ReAzeroAparaB(), ImAzeroAperpB(), ReAparaAsB(), ImAperpAsB(), ReAzeroAsB(), cachedSinDeltaPerpPara(), cachedCosDeltaPara(), cachedSinDeltaPerp(),
    cachedCosDeltaParaS(), cachedSinDeltaPerpS(), cachedCosDeltaS(), cachedAzero(), cachedApara(), cachedAperp(), cachedAs(), timeAcc(NULL),
    // Physics parameters
    gammaName     ( "gamma" )
    , Azero_sqName ( "Azero_sq")
    , Apara_sqName  ( "Apara_sq" )
    , Aperp_sqName  ( "Aperp_sq" )
    , As_sqName	( "As_sq" )
    , delta_zeroName( "delta_zero" )
    , delta_paraName( "delta_para" )
    , delta_perpName( "delta_perp" )
    , delta_sName	( "delta_s" )
    , angAccI1Name	( "angAccI1" )
    , angAccI2Name	( "angAccI2" )
    , angAccI3Name	( "angAccI3" )
    , angAccI4Name	( "angAccI4" )
    , angAccI5Name	( "angAccI5" )
    , angAccI6Name	( "angAccI6" )
    , angAccI7Name  ( "angAccI7" )
    , angAccI8Name  ( "angAccI8" )
    , angAccI9Name  ( "angAccI9" )
    , angAccI10Name ( "angAccI10" )
    , timeRes1Name	( "timeResolution1" )
    , timeRes2Name	( "timeResolution2" )
    , timeRes1FractionName	( "timeResolution1Fraction" )
    , _useTimeAcceptance(false)

    // Observables (What we want to gain from the pdf after inserting physics parameter values)
    , normalisationCacheValid(false)
    , evaluationCacheValid(false)
    , timeName	( "time" )
    , cosThetaName	( "cosTheta" )
    , phiName	( "phi" )
    , cosPsiName	( "cosPsi" )
    , KstarFlavourName  ( "KstarFlavour" )
    //, timeres	( "resolution" )

    , timeconstraintName( "time" )
    , gamma(), Azero_sq(), Apara_sq(), Aperp_sq(), As_sq(), AzeroApara(), AzeroAperp(), AparaAperp(), AparaAs(), AperpAs(), AzeroAs(),
    delta_zero(), delta_para(), delta_perp(), delta_s(), omega(), timeRes(), timeRes1(), timeRes2(), timeRes1Frac(), angAccI1(), angAccI2(),
    angAccI3(), angAccI4(), angAccI5(), angAccI6(), angAccI7(), angAccI8(), angAccI9(), angAccI10(), Ap_sq(), Ap(), time(), cosTheta(), phi(),
    cosPsi(), KstarFlavour(), tlo(), thi(), useFlatAngularDistribution(true)
{
    MakePrototypes();
    _useTimeAcceptance = configurator->isTrue( "UseTimeAcceptance" ) ;

    if( useTimeAcceptance() ) {
        timeAcc = new SlicedAcceptance( 0., 14.0, 0.0171 ) ;
        cout << "Bd2JpsiKstar_sWave:: Constructing timeAcc: Upper time acceptance beta=0.0171 [0 < t < 14] " << endl ;
    }
    else {
        timeAcc = new SlicedAcceptance( 0., 14. ) ;
        cout << "Bd2JpsiKstar_sWave:: Constructing timeAcc: DEFAULT FLAT [0 < t < 14]  " << endl ;
    }


//AILSA
    //Find name of histogram needed to define 3-D angular distribution
    string fileName = configurator->getConfigurationValue( "AngularDistributionHistogram" ) ;

    //Initialise depending upon whether configuration parameter was found
    if( fileName == "" )
    {
        cout << "   No AngularAcceptanceHisto found" << endl ;
        useFlatAngularDistribution = true ;
    }
    else
    {
        cout << "   AngularAcceptanceHisto requested: " << fileName << endl ;
        useFlatAngularDistribution = false ;



        ifstream input_file2;
        input_file2.open( fileName.c_str(), ifstream::in );
        input_file2.close();
        bool local_fail2 = input_file2.fail();
        if( !getenv("RAPIDFITROOT") && local_fail2 )
        {
            cerr << "\n" << endl;
            //cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
            cerr << "$RAPIDFITROOT NOT DEFINED, PLEASE DEFINE IT SO I CAN USE ACCEPTANCE DATA" << endl;
            //cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
            cerr << "\n" << endl;
            exit(-987);
        }


        string fullFileName;

        //File location
        //ifstream input_file2;
        //input_file2.open( fileName.c_str(), ifstream::in );
        //input_file2.close();
        //bool local_fail2 = input_file2.fail();

        if( getenv("RAPIDFITROOT") )
        {
            string path( getenv("RAPIDFITROOT") ) ;

            cout << "RAPIDFITROOT defined as: " << path << endl;
            fullFileName = path+"/pdfs/configdata/"+fileName ;

            input_file2.open( fullFileName.c_str(), ifstream::in );
            input_file2.close();
        }
        bool elsewhere_fail = input_file2.fail();

        if( elsewhere_fail && local_fail2 )
        {
            cerr << "\n\tFileName:\t" << fullFileName << "\t NOT FOUND PLEASE CHECK YOUR RAPIDFITROOT" << endl;
            cerr << "\t\tAlternativley make sure your XML points to the correct file, or that the file is in the current working directory\n" <<
                 endl;
            exit(-89);
        }

        if( fullFileName.empty() || !local_fail2 )
        {
            fullFileName = fileName;
        }

        TFile* f =  TFile::Open(fullFileName.c_str());
        histo = (TH3D*) f->Get("histo"); //(fileName.c_str())));

        xaxis = histo->GetXaxis();
        cout << "X axis Name: " << xaxis->GetName() << "\tTitle: " << xaxis->GetTitle() << endl;
        xmin = xaxis->GetXmin();
        xmax = xaxis->GetXmax();
        nxbins = histo->GetNbinsX();
        cout << "X axis Min: " << xmin << "\tMax: " << xmax << "\tBins: " << nxbins << endl;
        deltax = (xmax-xmin)/nxbins;

        yaxis = histo->GetYaxis();
        cout << "Y axis Name: " << yaxis->GetName() << "\tTitle: " << yaxis->GetTitle() << endl;
        ymin = yaxis->GetXmin();
        ymax = yaxis->GetXmax();
        nybins = histo->GetNbinsY();
        cout << "Y axis Min: " << ymin << "\tMax: " << ymax << "\tBins: " << nybins << endl;
        deltay = (ymax-ymin)/nybins;

        zaxis = histo->GetZaxis();
        cout << "Z axis Name: " << zaxis->GetName() << "\tTitle: " << zaxis->GetTitle() << endl;
        zmin = zaxis->GetXmin();
        zmax = zaxis->GetXmax();
        nzbins = histo->GetNbinsZ();
        cout << "Z axis Min: " << zmin << "\tMax: " << zmax << "\tBins: " << nzbins << endl;
        deltaz = (zmax-zmin)/nzbins;

        //method for Checking whether histogram is sensible

        total_num_entries = histo->GetEntries();
        int total_num_bins = nxbins * nybins * nzbins;
        int sum = 0;

        vector<int> zero_bins;
        //loop over each bin in histogram and print out how many zero bins there are
        for (int i=1; i < nxbins+1; ++i)
        {
            for (int j=1; j < nybins+1; ++j)
            {
                for (int k=1; k < nzbins+1; ++k)
                {
                    double bin_content = histo->GetBinContent(i,j,k);
                    //cout << "Bin content: " << bin_content << endl;
                    if(bin_content<=0)
                    {
                        zero_bins.push_back(1);
                    }
                    //cout << " Zero bins " << zero_bins.size() << endl;}
                    else if (bin_content>0)                                        {
                        sum += (int) bin_content;
                    }
                }
            }
        }

        int average_bin_content = sum / total_num_bins;

        cout << "\n\n\t\t" << "****" << "For total number of bins " << total_num_bins << " there are " << zero_bins.size() << " bins containing zero events " << "****" << endl;
        cout <<  "\t\t\t" << "***" << "Average number of entries of non-zero bins: " << average_bin_content << "***" << endl;
        cout << endl;
        cout << endl;

        // Check.  This order works for both bases since phi is always the third one.
        if ((xmax-xmin) < 2. || (ymax-ymin) < 2. || (zmax-zmin) < 2.*TMath::Pi() )
        {
            cout << "In LongLivedBkg_3Dangular::LongLivedBkg_3Dangular: The full angular range is not used in this histogram - the PDF does not support this case" << endl;
            exit(1);
        }

        cout << "Finishing processing histo" << endl;
    }

}
//Constructor
Bd2JpsiKstar_sWave_Fscopy::Bd2JpsiKstar_sWave_Fscopy(PDFConfigurator* configurator ) :
	cachedAzeroAzeroIntB(), cachedAparaAparaIntB(), cachedAperpAperpIntB(), cachedAparaAperpIntB(), cachedAzeroAparaIntB(), cachedAzeroAperpIntB(),
	cachedAsAsIntB(), cachedAparaAsIntB(), cachedAperpAsIntB(), cachedAzeroAsIntB(), AzeroAzeroB(), AparaAparaB(), AperpAperpB(), AsAsB(), ImAparaAperpB(),
	ReAzeroAparaB(), ImAzeroAperpB(), ReAparaAsB(), ImAperpAsB(), ReAzeroAsB(), cachedSinDeltaPerpPara(), cachedCosDeltaPara(), cachedSinDeltaPerp(),
	cachedCosDeltaParaS(), cachedSinDeltaPerpS(), cachedCosDeltaS(), cachedAzero(), cachedApara(), cachedAperp(), cachedAs(), timeAcc(NULL),
	// Physics parameters
	gammaName             ( configurator->getName("gamma" ))
	, Rzero_sqName ( configurator->getName("Rzero_sq"))
	, Rpara_sqName  ( configurator->getName("Rpara_sq" ))
	, Rperp_sqName  ( configurator->getName("Rperp_sq" ))
	, As_sqName     ( configurator->getName("As_sq" ))
	, delta_zeroName( configurator->getName("delta_zero" ))
	, delta_paraName( configurator->getName("delta_para" ))
	, delta_perpName( configurator->getName("delta_perp" ))
	, delta_sName   ( configurator->getName("delta_s" ))
	, CspName   ( configurator->getName("Csp" ))
	, angAccI1Name  ( configurator->getName("angAccI1" ))
	, angAccI2Name  ( configurator->getName("angAccI2" ))
	, angAccI3Name  ( configurator->getName("angAccI3" ))
	, angAccI4Name  ( configurator->getName("angAccI4" ))
	, angAccI5Name  ( configurator->getName("angAccI5" ))
	, angAccI6Name  ( configurator->getName("angAccI6" ))
	, angAccI7Name  ( configurator->getName("angAccI7" ))
	, angAccI8Name  ( configurator->getName("angAccI8" ))
	, angAccI9Name  ( configurator->getName("angAccI9" ))
	, angAccI10Name ( configurator->getName("angAccI10" ))
	, timeRes1Name  ( configurator->getName("timeResolution1") )
	, timeRes2Name  ( configurator->getName("timeResolution2" ))
	, timeRes1FractionName  ( configurator->getName("timeResolution1Fraction" ))
	, _useTimeAcceptance(false)
	, _plotAllComponents(false)
    , _useHelicityBasis(false)
    , _useNumericalNormalisation(false)

	// Observables (What we want to gain from the pdf after inserting physics parameter values)
	, normalisationCacheValid(false)
    , evaluationCacheValid(false)
	, timeName      ( configurator->getName("time" ))
	, cosThetaName  ( configurator->getName("cosTheta" ))
	, phiName       ( configurator->getName("phi" ))
	, cosPsiName    ( configurator->getName("cosPsi" ))
    , helcosthetaLName    ( configurator->getName("helcosthetaL" ))
    , helcosthetaKName    ( configurator->getName("helcosthetaK" ))
    , helphiName    ( configurator->getName("helphi" ))
	, KstarFlavourName  ( configurator->getName("KstarFlavour" ))

	, timeconstraintName( "time" )
    , gamma(), Rzero_sq(), Rpara_sq(), Rperp_sq(), As_sq(), AzeroApara(), AzeroAperp(), AparaAperp(), AparaAs(), AperpAs(), AzeroAs(),
	delta_zero(), delta_para(), delta_perp(), delta_s(), omega(), timeRes(), timeRes1(), timeRes2(), timeRes1Frac(), angAccI1(), angAccI2(),
	angAccI3(), angAccI4(), angAccI5(), angAccI6(), angAccI7(), angAccI8(), angAccI9(), angAccI10(), Ap_sq(), Ap(), time(), cosTheta(), phi(),
	cosPsi(), KstarFlavour(), tlo(), thi(), useFlatAngularDistribution(true), _datapoint(NULL),
    helcosthetaK(),helcosthetaL(),helphi()
{
	componentIndex = 0;

	_useTimeAcceptance = configurator->isTrue( "UseTimeAcceptance" ) ;
	_useHelicityBasis = configurator->isTrue( "UseHelicityBasis" ) ;
	_plotAllComponents = configurator->isTrue( "PlotAllComponents" ) ;
	_useNumericalNormalisation = configurator->isTrue( "UseNumericalNormalisation" ) ;
	useFlatAngularDistribution = configurator->isTrue( "UseFlatAngularAcceptanceInNumerator" ) ;

	if( useTimeAcceptance() ) {
		timeAcc = new SlicedAcceptance( 0., 14.0, 0.0171 ) ;
		cout << "Bd2JpsiKstar_sWave_Fscopy:: Constructing timeAcc: Upper time acceptance beta=0.0171 [0 < t < 14] " << endl ;
	}
	else {
		timeAcc = new SlicedAcceptance( 0., 14. ) ;
		cout << "Bd2JpsiKstar_sWave_Fscopy:: Constructing timeAcc: DEFAULT FLAT [0 < t < 14]  " << endl ;
	}
    for ( int i = 0; i < i_max + 1; i++ )
    {
        for ( int k = 0; k < k_max + 1; k++ )
        {
            for ( int j = 0; j < j_max + 1; j++ )
            {
                c[i][k][j] = 0.;
            }
        }
    }
    // From the Bd -> JpsiK* PDF using helicity angles
    c[0][0][0] = 3.751739;// +- 0.003279
    c[0][0][2] = 0.389560;// +- 0.007650
    c[0][0][4] = 0.030697;// +- 0.007622
    c[0][1][2] = -0.070511;// +- 0.007140
    c[0][2][2] = 0.024214;// +- 0.006402
    c[1][0][0] = -0.901940;// +- 0.010273
    c[1][0][2] = -0.127523;// +- 0.013467
    c[1][1][2] = -0.113126;// +- 0.010785
    c[2][0][0] = -1.017514;// +- 0.014660
    c[2][0][2] = -0.112034;// +- 0.018161
    c[3][0][0] = -0.323717;// +- 0.017012
    c[3][0][2] = -0.065125;// +- 0.021149
    c[3][1][2] = 0.071616;// +- 0.017404
    c[4][0][0] = -0.203903;// +- 0.019563

    MakePrototypes();
}
//......................................
//Constructor(s)
//New one with configurator
Bs2JpsiPhi_SignalAlt_MO_v4::Bs2JpsiPhi_SignalAlt_MO_v4(PDFConfigurator* configurator) : 
// Physics parameters
gammaName				( configurator->getName("gamma") )
, deltaGammaName		( configurator->getName("deltaGamma") )
, deltaMName			( configurator->getName("deltaM") )
, Phi_sName				( configurator->getName("Phi_s") )
, Azero_sqName			( configurator->getName("Azero_sq") )
, Apara_sqName			( configurator->getName("Apara_sq") )
, Aperp_sqName			( configurator->getName("Aperp_sq") )
, As_sqName				( configurator->getName("As_sq") )
, delta_zeroName		( configurator->getName("delta_zero") )
, delta_paraName		( configurator->getName("delta_para") )
, delta_perpName		( configurator->getName("delta_perp") )
, delta_sName			( configurator->getName("delta_s") )
, cosdparName			( configurator->getName("cosdpar") ) //PELC-COSDPAR Special for fitting cosdpar separately
// PELC NEW additions for v2
, cosphisName			( configurator->getName("cosphis") )
, sinphisName			( configurator->getName("sinphis") )
// Detector parameters
, mistagName			( configurator->getName("mistag") )
, mistagP1Name			( configurator->getName("mistagP1") )
, mistagP0Name			( configurator->getName("mistagP0") )
, mistagSetPointName	( configurator->getName("mistagSetPoint") )
// Detector parameters
, resScaleName			( configurator->getName("timeResolutionScale") )
, eventResolutionName	( configurator->getName("eventResolution") )
, res1Name				( configurator->getName("timeResolution1") )
, res2Name				( configurator->getName("timeResolution2") )
, res3Name				( configurator->getName("timeResolution3") )
, res2FractionName		( configurator->getName("timeResolution2Fraction") )
, res3FractionName		( configurator->getName("timeResolution3Fraction") )
, timeOffsetName		( configurator->getName("timeOffset") )
// Angular acceptance factors
, angAccI1Name			( configurator->getName("angAccI1") )
, angAccI2Name			( configurator->getName("angAccI2") )
, angAccI3Name			( configurator->getName("angAccI3") )
, angAccI4Name			( configurator->getName("angAccI4") )
, angAccI5Name			( configurator->getName("angAccI5") )
, angAccI6Name			( configurator->getName("angAccI6") )
, angAccI7Name			( configurator->getName("angAccI7") )
, angAccI8Name			( configurator->getName("angAccI8") )
, angAccI9Name			( configurator->getName("angAccI9") )
, angAccI10Name			( configurator->getName("angAccI10") )
// Observables
, timeName				( configurator->getName("time") )
, cosThetaName			( configurator->getName("cosTheta") )
, cosPsiName			( configurator->getName("cosPsi") )
, phiName				( configurator->getName("phi") )
, cthetakName 			( configurator->getName("helcosthetaK") )
, cthetalName			( configurator->getName("helcosthetaL") )
, phihName				( configurator->getName("helphi") )
, tagName				( configurator->getName("tag") )
// Other things
, _useEventResolution(false)
, _useTimeAcceptance(false)
, _useHelicityBasis(false)
, _numericIntegralForce(false)
, _numericIntegralTimeOnly(false)
, _useCosAndSin(false) 
, _useCosDpar(false)
, allowNegativeAsSq(false)
//objects
,t(), ctheta_tr(), phi_tr(), ctheta_1(), ctheta_k(), phi_h(), ctheta_l(), tag(), 
_gamma(), dgam(), Aperp_sq(), Apara_sq(), Azero_sq(), As_sq(), delta_para(),
delta_perp(), delta_zero(), delta_s(), delta1(), delta2(), delta_ms(), phi_s(), _cosphis(), _sinphis(), _mistag(), _mistagP1(), _mistagP0(), _mistagSetPoint(),
resolutionScale(), resolution1(), resolution2(), resolution3(), resolution2Fraction(), resolution3Fraction(), timeOffset(), 
angAccI1(), angAccI2(), angAccI3(), angAccI4(), angAccI5(), angAccI6(), angAccI7(), angAccI8(), angAccI9(), angAccI10(), 
tlo(), thi(), expL_stored(), expH_stored(), expSin_stored(), expCos_stored(),
intExpL_stored(), intExpH_stored(), intExpSin_stored(), intExpCos_stored(), timeAcc(NULL), normalisationCacheValid(false),
CachedA1(), CachedA2(), CachedA3(), CachedA4(), CachedA5(), CachedA6(), CachedA7(), CachedA8(), CachedA9(), CachedA10(),
resolution(), eventResolution(),timeIntegralCacheValid(), storeExpL(), storeExpH(), storeExpSin(), storeExpCos(), normalisationCacheUntagged()
{
	componentIndex = 0;

	std::cout << "Constructing PDF: Bs2JpsiPhi_SignalAlt_MO_v4 " << std::endl ;
	
	/*
	// PUT IN BUT DISABLED AS I WANTED _V4 TO BE FROZEN AS THE PDF USED AT MORIOND
	// THIS IS ALL ENABLED IN _V5
	//...............................................
	// Configure to use angular acceptance machinery
	string angAccFile = configurator->getConfigurationValue( "AngularAcceptanceFile" ) ;
	_angAccIgnoreNumerator = configurator->isTrue( "AngularAcceptanceIgnoreNumerator" ) ;
	if( angAccFile == "" ) cout << "Bs2JpsiPhi_SignalAlt_MO_v4:: Using flat angular acceptance " << endl ;
	else cout << "Bs2JpsiPhi_SignalAlt_MO_v4:: Constructing angAcc using file: " << angAccFile << endl ;
	angAcc = new AngularAcceptance( angAccFile, _angAccIgnoreNumerator ) ;
	angAccI1 = angAcc->af1() ;  cout << "  af1 = " << angAccI1 << endl ;
	angAccI2 = angAcc->af2() ;	cout << "  af2 = " << angAccI2 << endl ;
	angAccI3 = angAcc->af3() ;	cout << "  af3 = " << angAccI3 << endl ;
	angAccI4 = angAcc->af4() ;	cout << "  af4 = " << angAccI4 << endl ;
	angAccI5 = angAcc->af5() ;	cout << "  af5 = " << angAccI5 << endl ;
	angAccI6 = angAcc->af6() ;	cout << "  af6 = " << angAccI6 << endl ;
	angAccI7 = angAcc->af7() ;	cout << "  af7 = " << angAccI7 << endl ;
	angAccI8 = angAcc->af8() ;	cout << "  af8 = " << angAccI8 << endl ;
	angAccI9 = angAcc->af9() ;	cout << "  af9 = " << angAccI9 << endl ;
	angAccI10 = angAcc->af10();	cout << "  af10 = " << angAccI10 << endl ;
	if( _angAccIgnoreNumerator ) cout << "Bs2JpsiPhi_SignalAlt_MO_v4:: Ignoring angular acceptance numerator " << endl ;
	*/
	
	//...........................................
	// Configure to use time acceptance machinery 
	_useTimeAcceptance = configurator->isTrue( "UseTimeAcceptance" ) ;
	if( useTimeAcceptance() ) {
		if( configurator->hasConfigurationValue( "TimeAcceptanceType", "Upper" ) ) {
			timeAcc = new SlicedAcceptance( 0., 14.0, /*0.0157*/ 0.0112) ;
			cout << "Bs2JpsiPhi_SignalAlt_MO_v4:: Constructing timeAcc: Upper time acceptance beta=0.0112 [0 < t < 14] " << endl ;
		}
		else if( configurator->getConfigurationValue( "TimeAcceptanceFile" ) != "" ) {
			timeAcc = new SlicedAcceptance( "File" , configurator->getConfigurationValue( "TimeAcceptanceFile" ) ) ;
			cout << "Bs2JpsiPhi_SignalAlt_MO_v4:: Constructing timeAcc: using file: " << configurator->getConfigurationValue( "TimeAcceptanceFile" ) << endl ;
		}
	}
	else {
		timeAcc = new SlicedAcceptance( 0., 14. ) ;
		cout << "Bs2JpsiPhi_SignalAlt_MO_v4:: Constructing timeAcc: DEFAULT FLAT [0 < t < 14]  " << endl ;
	}
	
	//Make empty Cache for the time integrals. This has to be done now after the SlicedAcceptance is created
	vector<double> empty ;
	for( unsigned int islice = 0; islice < timeAcc->numberOfSlices(); ++islice ) empty.push_back(0.0) ;
	for( int ires=0; ires < 4 ; ++ires ) {			
		storeExpL.push_back( empty ) ;
		storeExpH.push_back( empty ) ;
		storeExpSin.push_back( empty ) ;
		storeExpCos.push_back( empty ) ;
	}
	
	//...........................................
	// Configure numerical integration options 
	_numericIntegralForce    = configurator->isTrue( "NumericIntegralForce") ;
	_numericIntegralTimeOnly = configurator->isTrue( "NumericIntegralTimeOnly" ) ;
	
	//...........................................
	// Configure other options 
	_useEventResolution = configurator->isTrue( "UseEventResolution" ) ;
	_useCosAndSin = configurator->isTrue( "UseCosAndSin" ) ;
	_useCosDpar = configurator->isTrue( "UseCosDpar" ) ;
	_useHelicityBasis = configurator->isTrue( "UseHelicityBasis" ) ;
	allowNegativeAsSq = configurator->isTrue( "AllowNegativeAsSq" ) ;

	this->TurnCachingOff();

	this->SetNumericalNormalisation( false );
	
	//........................
	// Now do some actual work
	MakePrototypes();	
	

	//PELC  - debug to plot the distribution of PDF values for each event 
	//histOfPdfValues = new TH1D( "HistOfPdfValue" ,  "HistOfPdfValue" , 110, -0.00001, 0.00001 ) ;
	//c0  = new TCanvas;
	//histCounter = 0;
	//~PELC
	
	
}
Exemple #13
0
//Constructor
WrongPVAssocBkg::WrongPVAssocBkg( PDFConfigurator* config ) :

	// Observables
	  massName		( config->getName("mass") )
	, timeName		( config->getName("time") )
	, eventResolutionName   ( config->getName("eventResolution") )
	, mass(), time()
	, xaxis(), yaxis()
	, nxbins(), nybins() 
	, xmin(), xmax()
	, ymin(), ymax()
	, deltax(), deltay()
	, total_num_entries()
	, total_num_entries_phase_space()
	, normalisationDone(false)
	, _makeFlat(false)
{

	cout << "Constructing PDF: WrongPVAssocBkg  " << endl ;

	//Make prototypes
	MakePrototypes();

	// If the flat distribution is chosen, ther eis nothing needed 
	_makeFlat  = config->isTrue( "MakeFlat") ;
	if( _makeFlat ) {
		cout << " WrongPVAssocBkg::WrongPVAssocBkg: constructing with flat time and mass distributions " << endl ;
		return ;
	}
	
	//Find name of histogram needed to define 3-D angular distribution
	string fileName = config->getConfigurationValue( "TimeMassHistogram" ) ;

	//Initialise depending upon whether configuration parameter was found
	if( fileName == "" )
	{
		cout << "   No background histogram found: using flat background " << endl ;
		exit(-1);
	}
	else
	{
		cout << "   Background histogram requested: " << fileName << endl ;

		//File location
		ifstream input_file;
		input_file.open( fileName.c_str(), ifstream::in );
		input_file.close();

		bool local_fail = input_file.fail();

		if( !getenv("RAPIDFITROOT") && local_fail )
		{
			cerr << "\n" << endl;
			//cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
			cerr << "$RAPIDFITROOT NOT DEFINED, PLEASE DEFINE IT SO I CAN USE ACCEPTANCE DATA" << endl;
			//cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
			cerr << "\n" << endl;
			exit(-987);
		}

		string fullFileName;

		if( getenv("RAPIDFITROOT") )
		{
			string path( getenv("RAPIDFITROOT") ) ;

			cout << "RAPIDFITROOT defined as: " << path << endl;

			fullFileName = path+"/pdfs/configdata/"+fileName ;

			input_file.open( fullFileName.c_str(), ifstream::in );
			input_file.close();
		}
		bool elsewhere_fail = input_file.fail();

		if( elsewhere_fail && local_fail )
		{
			cerr << "\n\tFileName:\t" << fullFileName << "\t NOT FOUND PLEASE CHECK YOUR RAPIDFITROOT" << endl;
			cerr << "\t\tAlternativley make sure your XML points to the correct file, or that the file is in the current working directory\n" << endl;
			exit(-89);
		}

		if( fullFileName.empty() || !local_fail )
		{
			fullFileName = fileName;
		}

		//Read in histo
		TFile* f =  TFile::Open(fullFileName.c_str());
		histo = (TH2D*) f->Get("Bs_time_and_mass"); //(fileName.c_str())));

		// time
		xaxis = histo->GetXaxis();
		cout << "X axis Name: " << xaxis->GetName() << "\tTitle: " << xaxis->GetTitle() << endl;
		xmin = xaxis->GetXmin();
		xmax = xaxis->GetXmax();
		nxbins = xaxis->GetNbins();
		cout << "X axis Min: " << xmin << "\tMax: " << xmax << "\tBins: " << nxbins << endl;
		deltax = (xmax-xmin)/nxbins;

		// mass
		yaxis = histo->GetYaxis();
		cout << "Y axis Name: " << yaxis->GetName() << "\tTitle: " << yaxis->GetTitle() << endl;
		ymin = yaxis->GetXmin();
		ymax = yaxis->GetXmax();
		nybins = yaxis->GetNbins();
		cout << "Y axis Min: " << ymin << "\tMax: " << ymax << "\tBins: " << nybins << endl;
		deltay = (ymax-ymin)/nybins;

		//method for Checking whether histogram is sensible

		total_num_entries = histo->GetEntries();
		int total_num_bins = nxbins * nybins;
		int sum = 0;

		vector<int> zero_bins;

		//loop over each bin in histogram and print out how many zero bins there are
		for (int i=1; i < nxbins+1; ++i)
		{
			for (int j=1; j < nybins+1; ++j)
			{
						double bin_content = histo->GetBinContent(i, j);
						//cout << "Bin content: " << bin_content << endl;
						if(bin_content<=0)
						{
							zero_bins.push_back(1);
						}
						//cout << " Zero bins " << zero_bins.size() << endl;}
						else if (bin_content>0)
						{
							sum += (int) bin_content;
						}
			}
		}

		int average_bin_content = sum / total_num_bins;

		cout << "\n\n\t\t" << "****" << "For total number of bins " << total_num_bins << " there are " << zero_bins.size() << " bins containing zero events " << "****" << endl;
		cout <<  "\t\t\t" << "***" << "Average number of entries of non-zero bins: " << average_bin_content << "***" << endl;
		cout << endl;
		cout << endl;

		// Check.  This order works for both bases since phi is always the third one.
		if (xmin>0.3 || xmax<14.0 || ymin >5200. || ymax<5550. ) 
		{
			cout << "In WrongPVAssocBkg::WrongPVAssocBkg: The histo range does not cover t[0.3-14] m[5200-5550]- *****you should worry******" << endl;
			//exit(1);
		}

		cout << "Finishing processing histo" << endl;
	}
}
//Constructor
Bd2JpsiKstar_sWave_Fs_withAcc::Bd2JpsiKstar_sWave_Fs_withAcc(PDFConfigurator* configurator ) :
    cachedAzeroAzeroIntB(), cachedAparaAparaIntB(), cachedAperpAperpIntB(), cachedAparaAperpIntB(), cachedAzeroAparaIntB(), cachedAzeroAperpIntB(),
    cachedAsAsIntB(), cachedAparaAsIntB(), cachedAperpAsIntB(), cachedAzeroAsIntB(), AzeroAzeroB(), AparaAparaB(), AperpAperpB(), AsAsB(), ImAparaAperpB(),
    ReAzeroAparaB(), ImAzeroAperpB(), ReAparaAsB(), ImAperpAsB(), ReAzeroAsB(), cachedSinDeltaPerpPara(), cachedCosDeltaPara(), cachedSinDeltaPerp(),
    cachedCosDeltaParaS(), cachedSinDeltaPerpS(), cachedCosDeltaS(), cachedAzero(), cachedApara(), cachedAperp(), cachedAs(), timeAcc(NULL),
    // Physics parameters
    gammaName             ( configurator->getName("gamma" ))
                                                            , Rzero_sqName ( configurator->getName("Rzero_sq"))
                                                                                                               , Rpara_sqName  ( configurator->getName("Rpara_sq" ))
                                                                                                                                                                    , Rperp_sqName  ( configurator->getName("Rperp_sq" ))
                                                                                                                                                                                                                         , As_sqName     ( configurator->getName("As_sq" ))
                                                                                                                                                                                                                                                                           , delta_zeroName( configurator->getName("delta_zero" ))
                                                                                                                                                                                                                                                                                                                                  , delta_paraName( configurator->getName("delta_para" ))
                                                                                                                                                                                                                                                                                                                                                                                         , delta_perpName( configurator->getName("delta_perp" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                , delta_sName   ( configurator->getName("delta_s" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       , CspName   ( configurator->getName("Csp" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   , angAccI1Name  ( configurator->getName("angAccI1" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        , angAccI2Name  ( configurator->getName("angAccI2" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             , angAccI3Name  ( configurator->getName("angAccI3" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  , angAccI4Name  ( configurator->getName("angAccI4" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              , angAccI5Name  ( configurator->getName("angAccI5" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   , angAccI6Name  ( configurator->getName("angAccI6" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        , angAccI7Name  ( configurator->getName("angAccI7" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             , angAccI8Name  ( configurator->getName("angAccI8" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       , angAccI9Name  ( configurator->getName("angAccI9" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            , angAccI10Name ( configurator->getName("angAccI10" ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  , timeRes1Name  ( configurator->getName("timeResolution1") )
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              , timeRes2Name  ( configurator->getName("timeResolution2" ))
    , timeRes1FractionName  ( configurator->getName("timeResolution1Fraction" ))
    , _useTimeAcceptance(false)
                               , _plotAllComponents(false)

                                                          // Observables (What we want to gain from the pdf after inserting physics parameter values)
    , normalisationCacheValid(false)
, evaluationCacheValid(false)
    , timeName      ( configurator->getName("time" ))
    , cosThetaName  ( configurator->getName("cosTheta" ))
    , phiName       ( configurator->getName("phi" ))
    , cosPsiName    ( configurator->getName("cosPsi" ))
    , KstarFlavourName  ( configurator->getName("KstarFlavour" ))

    , timeconstraintName( "time" )
, gamma(), Rzero_sq(), Rpara_sq(), Rperp_sq(), As_sq(), AzeroApara(), AzeroAperp(), AparaAperp(), AparaAs(), AperpAs(), AzeroAs(),
    delta_zero(), delta_para(), delta_perp(), delta_s(), omega(), timeRes(), timeRes1(), timeRes2(), timeRes1Frac(), angAccI1(), angAccI2(),
    angAccI3(), angAccI4(), angAccI5(), angAccI6(), angAccI7(), angAccI8(), angAccI9(), angAccI10(), Ap_sq(), Ap(), time(), cosTheta(), phi(),
    cosPsi(), KstarFlavour(), tlo(), thi(), useFlatAngularDistribution(true), _datapoint(NULL), f(NULL)
{
    componentIndex = 0;
    MakePrototypes();
    _useTimeAcceptance = configurator->isTrue( "UseTimeAcceptance" ) ;
    _plotAllComponents = configurator->isTrue( "PlotAllComponents" ) ;

    if( useTimeAcceptance() ) {
        timeAcc = new SlicedAcceptance( 0., 14.0, 0.0171 ) ;
        cout << "Bd2JpsiKstar_sWave_Fs_withAcc:: Constructing timeAcc: Upper time acceptance beta=0.0171 [0 < t < 14] " << endl ;
    }
    else {
        timeAcc = new SlicedAcceptance( 0., 14. ) ;
        cout << "Bd2JpsiKstar_sWave_Fs_withAcc:: Constructing timeAcc: DEFAULT FLAT [0 < t < 14]  " << endl ;
    }
    for ( int i = 0; i < i_max + 1; i++ )
    {
        for ( int k = 0; k < k_max + 1; k++ )
        {
            for ( int j = 0; j < j_max + 1; j++ )
            {
                c[i][k][j] = 0.;
            }
        }
    }
    c[0][0][0] = 0.060966;// +- 0.000113
    c[0][0][2] = 0.006298;// +- 0.000167
    c[0][1][2] = -0.001045;// +- 0.000154
    c[1][0][0] = -0.014011;// +- 0.000224
    c[1][0][2] = -0.001668;// +- 0.000295
    c[1][1][2] = -0.001731;// +- 0.000233
    c[2][0][0] = -0.016459;// +- 0.000319
    c[3][0][0] = -0.004929;// +- 0.000368
    c[4][0][0] = -0.002989;// +- 0.000421
}
//.....................................................
//Constructor
Bs2DsPi_lowmassbkg_updated::Bs2DsPi_lowmassbkg_updated(PDFConfigurator* configurator ) :

	// Physics parameters
	//alphaM_llName	( "alphaM_ll" )
	// Observables
	//, recoMassName  ( "mass" )

	massName  ( configurator->getName("mass") )
	,constraint_massName( configurator->getName("mass") )
, histo(), xaxis(), nxbins(), xmin(), xmax(), deltax(), total_num_entries()
{

	cout << "Constructing PDF:Bs2DsPi_lowmassbkg_updated" << endl ;


	{
		MakePrototypes();
	}

	//Find name of histogram needed to define 1-D mass distribution
	string fileName = configurator->getConfigurationValue( "MassDistributionHistogram" ) ;

	//Initialise depending upon whether configuration parameter was found
	if( fileName == "" )
	{
		cout << "   No MassDistributionHistogram found" << endl;
		exit(1);
	}
	else
	{
		cout << "   MassDistributionHistogram found: " << fileName << endl ;

		//Read in histo
		TFile* f =  TFile::Open(fileName.c_str());
		if( f == NULL ) exit(1) ;
		histo = new TH1D(  *(    (TH1D*)f ->Get("hist")      )     ); //(fileName.c_str())));

		xaxis = histo->GetXaxis();
		xmin = xaxis->GetXmin();
		xmax = xaxis->GetXmax();
		nxbins = histo->GetNbinsX();
		deltax = (xmax-xmin)/nxbins;

		//method for Checking whether histogram is sensible

		total_num_entries = histo->GetEntries();
		int total_num_bins = nxbins;
		int sum = 0;

		vector<int> zero_bins;

		//loop over each bin in histogram and print out how many zero bins there are
		for (int i=1; i < nxbins+1; i++)
		{
			double bin_content = histo->GetBinContent(i);
			//cout << "Bin content: " << bin_content << endl;
			if(bin_content<=0)
			{
				zero_bins.push_back(1);
			}
			//cout << " Zero bins " << zero_bins.size() << endl;}
			else if (bin_content>0)
			{
				sum += (int) bin_content;
			}
		}

		int average_bin_content = sum / total_num_bins;

		cout << "\n\n\t\t" << "****" << "For total number of bins " << total_num_bins << " there are " << zero_bins.size() << " bins containing zero events " << "****" << endl;
		cout <<  "\t\t\t" << "***" << "Average number of entries of non-zero bins: " << average_bin_content << "***" << endl;
		cout << endl;
		cout << endl;

		if ((xmax-xmin) < 2.)
		{
			cout << "In Bs2DsPi_lowmassbkg_updated::Bs2DsPi_lowmassbkg_updated: The full mass range is not used in this histogram" << endl;
			exit(1);
		}

		cout << "Finishing processing histo" << endl;
	}
}
Exemple #16
0
//Constructor allowing you to specify the parameter names
LinearPDF::LinearPDF(string CInterceptName, string MGradientName) : gradientName( MGradientName ), interceptName( CInterceptName ), observableName( "Observable" )
{
	MakePrototypes();
}
Exemple #17
0
//Constructor
LinearPDF::LinearPDF() : gradientName( "mGradient" ), interceptName( "cIntercept" ), observableName( "Observable" )
{
	MakePrototypes();
}
//Constructor
DPTotalAmplitudePDF_withAcc_withBkg::DPTotalAmplitudePDF_withAcc_withBkg( PDFConfigurator* configurator) :

	// Physics parameters
	  fractionName		( configurator->getName("BkgFraction") )
	, magA0ZplusName		( configurator->getName("magA0Zplus") )
	, magApZplusName		( configurator->getName("magApZplus") )
	, magAmZplusName		( configurator->getName("magAmZplus") )
	, phaseA0ZplusName	( configurator->getName("phaseA0Zplus") )
	, phaseApZplusName	( configurator->getName("phaseApZplus") )
	, phaseAmZplusName	( configurator->getName("phaseAmZplus") )

	, magA0Kst892Name	( configurator->getName("magA0Kst892") )
	, magApKst892Name	( configurator->getName("magApKst892") )
	, magAmKst892Name	( configurator->getName("magAmKst892") )
	, phaseA0Kst892Name	( configurator->getName("phaseA0Kst892") )
	, phaseApKst892Name	( configurator->getName("phaseApKst892") )
	, phaseAmKst892Name	( configurator->getName("phaseAmKst892") )

	, magA0Kst1410Name	( configurator->getName("magA0Kst1410") )
	, magApKst1410Name	( configurator->getName("magApKst1410") )
	, magAmKst1410Name	( configurator->getName("magAmKst1410") )
	, phaseA0Kst1410Name	( configurator->getName("phaseA0Kst1410") )
	, phaseApKst1410Name	( configurator->getName("phaseApKst1410") )
	, phaseAmKst1410Name	( configurator->getName("phaseAmKst1410") )

	, magA0Kst1680Name	( configurator->getName("magA0Kst1680") )
	, magApKst1680Name	( configurator->getName("magApKst1680") )
	, magAmKst1680Name	( configurator->getName("magAmKst1680") )
	, phaseA0Kst1680Name	( configurator->getName("phaseA0Kst1680") )
	, phaseApKst1680Name	( configurator->getName("phaseApKst1680") )
	, phaseAmKst1680Name	( configurator->getName("phaseAmKst1680") )

	, magA0K01430Name	( configurator->getName("magA0K01430") )
	, phaseA0K01430Name	( configurator->getName("phaseA0K01430") )

	, magA0K21430Name	( configurator->getName("magA0K21430") )
	, magApK21430Name	( configurator->getName("magApK21430") )
	, magAmK21430Name	( configurator->getName("magAmK21430") )
	, phaseA0K21430Name	( configurator->getName("phaseA0K21430") )
	, phaseApK21430Name	( configurator->getName("phaseApK21430") )
	, phaseAmK21430Name	( configurator->getName("phaseAmK21430") )

	, magA0K31780Name	( configurator->getName("magA0K31780") )
	, magApK31780Name	( configurator->getName("magApK31780") )
	, magAmK31780Name	( configurator->getName("magAmK31780") )
	, phaseA0K31780Name	( configurator->getName("phaseA0K31780") )
	, phaseApK31780Name	( configurator->getName("phaseApK31780") )
	, phaseAmK31780Name	( configurator->getName("phaseAmK31780") )

	, magA0K42045Name	( configurator->getName("magA0K42045") )
	, magApK42045Name	( configurator->getName("magApK42045") )
	, magAmK42045Name	( configurator->getName("magAmK42045") )
	, phaseA0K42045Name	( configurator->getName("phaseA0K42045") )
	, phaseApK42045Name	( configurator->getName("phaseApK42045") )
	, phaseAmK42045Name	( configurator->getName("phaseAmK42045") )

	, magA0K52380Name	( configurator->getName("magA0K52380") )
	, magApK52380Name	( configurator->getName("magApK52380") )
	, magAmK52380Name	( configurator->getName("magAmK52380") )
	, phaseA0K52380Name	( configurator->getName("phaseA0K52380") )
	, phaseApK52380Name	( configurator->getName("phaseApK52380") )
	, phaseAmK52380Name	( configurator->getName("phaseAmK52380") )

	, magA0K800Name		( configurator->getName("magA0K800") )
	, phaseA0K800Name	( configurator->getName("phaseA0K800") )

	, magA0NRName		( configurator->getName("magA0NR") )
	, phaseA0NRName  	( configurator->getName("phaseA0NR") )

	, massZplusName		( configurator->getName("massZplus") )
	, widthZplusName	( configurator->getName("widthZplus") )
	, massKst892Name	( configurator->getName("massKst892") )
	, widthKst892Name	( configurator->getName("widthKst892") )
	, massKst1410Name	( configurator->getName("massKst1410") )
	, widthKst1410Name	( configurator->getName("widthKst1410") )
	, massKst1680Name	( configurator->getName("massKst1680") )
	, widthKst1680Name	( configurator->getName("widthKst1680") )
	, massK01430Name	( configurator->getName("massK01430") )
	, widthK01430Name	( configurator->getName("widthK01430") )
	, massK21430Name	( configurator->getName("massK21430") )
	, widthK21430Name	( configurator->getName("widthK21430") )
	, massK31780Name	( configurator->getName("massK31780") )
	, widthK31780Name	( configurator->getName("widthK31780") )
	, massK42045Name	( configurator->getName("massK42045") )
	, widthK42045Name	( configurator->getName("widthK42045") )
	, massK52380Name	( configurator->getName("massK52380") )
	, widthK52380Name	( configurator->getName("widthK52380") )
	, massK800Name	( configurator->getName("massK800") )
	, widthK800Name	( configurator->getName("widthK800") )
	// Observables
	, m23Name	( configurator->getName("m23") )
	, cosTheta1Name	( configurator->getName("cosTheta1") )
	, cosTheta2Name	( configurator->getName("cosTheta2") )
	, phiName	( configurator->getName("phi") )
	, m13Name	( configurator->getName("m13") )
	, cosZName	( configurator->getName("cosZ") )
	, cosPsiZName	( configurator->getName("cosPsiZ") )
	, phiZName	( configurator->getName("phiZ") )
	, alphaName	( configurator->getName("alpha") )
    , pionIDName( configurator->getName("pionID") )

    , mag_LASSName	( configurator->getName("mag_LASS") )
  	, phase_LASSName	( configurator->getName("phase_LASS") )
	, a_LASSName	( configurator->getName("a_LASS") )
	, r_LASSName	( configurator->getName("r_LASS") )
	// The actual values of the parameters and observables
	, fraction()
    , magA0Zplus(),  magApZplus(),  magAmZplus(),  phaseA0Zplus(),  phaseApZplus(),  phaseAmZplus()
	, magA0Kst892(),  magApKst892(), magAmKst892(), phaseA0Kst892(),  phaseApKst892(),  phaseAmKst892()
	, magA0Kst1410(), magApKst1410(), magAmKst1410(), phaseA0Kst1410(), phaseApKst1410(), phaseAmKst1410()
	, magA0Kst1680(), magApKst1680(), magAmKst1680(), phaseA0Kst1680(), phaseApKst1680(), phaseAmKst1680()
	, magA0K01430(),  				  phaseA0K01430()
	, magA0K21430(), magApK21430(), magAmK21430(), phaseA0K21430(), phaseApK21430(), phaseAmK21430()
	, magA0K31780(), magApK31780(), magAmK31780(), phaseA0K31780(), phaseApK31780(), phaseAmK31780()
	, magA0K42045(), magApK42045(), magAmK42045(), phaseA0K42045(), phaseApK42045(), phaseAmK42045()
	, magA0K52380(), magApK52380(), magAmK52380(), phaseA0K52380(), phaseApK52380(), phaseAmK52380()
	, magA0K800(),  				  phaseA0K800()
	, magA0NR(),    				  phaseA0NR()
	, massZplus(), widthZplus()
	, massKst892(), widthKst892()
	, massKst1410(), widthKst1410()
	, massKst1680(), widthKst1680()
	, massK01430(), widthK01430()
	, massK21430(), widthK21430()
	, massK31780(), widthK31780()
	, massK42045(), widthK42045()
	, massK52380(), widthK52380()
	, massK800(), widthK800()
	, m23(), cosTheta1(), cosTheta2(), phi(), pionID()
	, m13(), cosZ(), cosPsiZ(), phiZ(), alpha()
	//LASS parameters
	, a_LASS(), r_LASS(), mag_LASS(), phase_LASS()
// 	, massPsi(3.096916) // Jpsi
    , massPsi(3.686093) // psi(2S)
    , massB(5.2794) // B0
//    , massB(5.36677) // B_s0
	, pMuPlus(0., 0., 0., 0.), pMuMinus(0., 0., 0., 0.), pPi(0., 0., 0., 0.), pK(0., 0., 0., 0.), pB(0., 0., 0., massB)
	, cosARefs(0.)
{
	MakePrototypes();

	componentIndex = 0;

	// Construct all components we need
	DPComponent * tmp;
	// B0 --> Z+ K-
 	//tmp=new DPZplusK(1,0,massB,4.430,0.100,0.493677,
 	//		 0.13957018, 1.6, 1.6, massPsi, 1, 23); // spin 1 Z, for MC testing

	tmp=new DPZplusK(0,1,massB,1.430,0.0100,0.493677,
			0.13957018, 1.6, 1.6, massPsi, 0, 23); // spin 0 Z for datafit
	ZComponents.push_back(tmp);
	// B0 --> J/psi K*
	tmp=new DPJpsiKaon(0, 1, massB, 0.89594, 0.0487, 0.493677,
			0.13957018, 1.6, 1.6, massPsi, 1);
	KpiComponents.push_back(tmp);
	// B0 --> J/psi K*(1410)
	tmp=new DPJpsiKaon(0, 1, massB, 1.414, 0.232, 0.493677,
			0.13957018, 1.6, 1.6, massPsi, 1);
	KpiComponents.push_back(tmp);
	// B0 --> J/psi K*(1680)
	tmp=new DPJpsiKaon(0, 1, massB, 1.717, 0.322, 0.493677,
			0.13957018, 1.6, 1.6, massPsi, 1);
	KpiComponents.push_back(tmp);
	// B0 --> J/psi K0(1430)
	tmp=new DPJpsiKaon(1, 0, massB, 1.425, 0.270, 0.493677,
			0.13957018, 1.6, 1.6, massPsi, 0);
	KpiComponents.push_back(tmp);
	// B0 --> J/psi K2(1430)
	tmp=new DPJpsiKaon(1, 2, massB, 1.4324, 0.109, 0.493677,
			0.13957018, 1.6, 1.6, massPsi, 2);
	KpiComponents.push_back(tmp);
	// B0 --> J/psi K3(1780)
	tmp=new DPJpsiKaon(2, 3, massB, 1.4324, 0.109, 0.493677,
			0.13957018, 1.6, 1.6, massPsi, 3);
	KpiComponents.push_back(tmp);
	// B0 --> J/psi K4(2045)
	tmp=new DPJpsiKaon(3, 4, massB, 1.4324, 0.109, 0.493677,
			0.13957018, 1.6, 1.6, massPsi, 4);
	KpiComponents.push_back(tmp);
	// B0 --> J/psi K5(2380)
	tmp=new DPJpsiKaon(4, 5, massB, 1.4324, 0.109, 0.493677,
			0.13957018, 1.6, 1.6, massPsi, 5);
	KpiComponents.push_back(tmp);
	// B0 --> J/psi K(800)
	tmp=new DPJpsiKaon(1, 0, massB, 0.682, 0.574, 0.493677,
			0.13957018, 1.6, 1.6, massPsi, 0);
	KpiComponents.push_back(tmp);

	// Kpi s-wave using LASS
  	tmp=new DPJpsiKaon(1, 0, massB, 1.425, 0.270, 0.493677,
                     0.13957018, 1.6, 1.6, massPsi, 0,
                     "LASS", 1.94, 1.76);

	KpiComponents.push_back(tmp);

	// Kpi s-wave using Non Resonnant
  	tmp=new DPJpsiKaon(1, 0, massB, 1., 0.270, 0.493677,
                     0.13957018, 1.6, 1.6, massPsi, 0,
                     "NR", 1.94, 1.76);

	KpiComponents.push_back(tmp);

	this->SetNumericalNormalisation( true );
	//this->TurnCachingOff();
    useAngularAcceptance = false;
    for ( int l = 0; l < l_max + 1; l++ )
    {
        for ( int i = 0; i < i_max + 1; i++ )
        {
            for ( int k = 0; k < k_max + 1; k++ )
            {
                for ( int j = 0; j < j_max + 1; j++ )
                {
                    c[l][i][k][j] = 0.;
                }
            }
        }
    }
    for ( int l = 0; l < l_max_b + 1; l++ )
    {
        for ( int i = 0; i < i_max_b + 1; i++ )
        {
            for ( int k = 0; k < k_max_b + 1; k++ )
            {
                for ( int j = 0; j < j_max_b + 1; j++ )
                {
                    b[l][i][k][j] = 0.;
                }
            }
        }
    }
	useAngularAcceptance = configurator->isTrue( "UseAngularAcceptance" );

    // From this PDF
    // This is for the JpsiK* analysis, using 70MeV window around K*.
    // Acceptance is flat in Kpi mass.
    /*
    c[0][0][0] = 0.063365;// +- 0.000111
    c[0][0][2] = 0.006549;// +- 0.000168
    c[0][0][4] = 0.000538;// +- 0.000168
    c[0][1][2] = -0.001093;// +- 0.000155
    c[0][2][2] = 0.000539;// +- 0.000140
    c[1][0][0] = -0.014598;// +- 0.000225
    c[1][0][2] = -0.001741;// +- 0.000296
    c[1][1][2] = -0.001824;// +- 0.000234
    c[2][0][0] = -0.017138;// +- 0.000321
    c[2][0][2] = -0.001622;// +- 0.000397
    c[3][0][0] = -0.005164;// +- 0.000370
    c[4][0][0] = -0.003148;// +- 0.000424
    */

    // This is for the psi(2S)Kpi analysis.
    // First dimension is mKpi
c[0][0][0][0] = 0.070537;// +- 0.000042
c[0][0][0][2] = 0.003374;// +- 0.000108
c[0][0][1][2] = -0.000793;// +- 0.000108
c[0][0][2][2] = 0.004150;// +- 0.000104
c[0][1][0][0] = -0.009559;// +- 0.000175
c[0][1][0][2] = -0.001790;// +- 0.000180
c[0][1][1][2] = 0.001620;// +- 0.000180
c[0][1][2][2] = 0.000894;// +- 0.000172
c[0][2][0][0] = -0.014521;// +- 0.000227
c[0][2][1][2] = 0.001962;// +- 0.000233
c[0][2][2][2] = -0.002894;// +- 0.000224
c[0][4][0][0] = -0.002925;// +- 0.000307
c[1][0][0][0] = 0.014735;// +- 0.000218
c[1][0][0][2] = -0.004731;// +- 0.000224
c[1][0][1][2] = 0.001244;// +- 0.000223
c[1][0][2][2] = 0.004222;// +- 0.000215
c[1][1][0][0] = 0.013788;// +- 0.000366
c[1][1][1][2] = 0.008654;// +- 0.000375
c[1][2][0][0] = 0.013075;// +- 0.000476
c[1][2][0][2] = 0.008135;// +- 0.000492
c[1][2][2][2] = -0.003336;// +- 0.000467
c[1][3][1][2] = -0.004594;// +- 0.000575
c[2][0][0][0] = 0.002701;// +- 0.000294
c[2][1][1][2] = 0.004370;// +- 0.000507
c[2][2][0][0] = 0.008449;// +- 0.000640
c[2][2][0][2] = 0.006358;// +- 0.000663
c[2][3][0][0] = -0.004795;// +- 0.000759
c[2][3][1][2] = -0.004152;// +- 0.000771
c[3][1][0][0] = -0.007938;// +- 0.000598
c[3][2][0][0] = -0.006623;// +- 0.000772
c[4][1][0][0] = 0.004372;// +- 0.000681
c[4][3][0][0] = 0.006850;// +- 0.001044
c[5][0][0][0] = -0.003132;// +- 0.000446
c[6][0][0][0] = 0.004619;// +- 0.000485
c[6][1][0][0] = -0.005224;// +- 0.000822

    // Background - with my phi-angle definition or Belle's
b[0][0][0][0] = 0.070524;// +- 0.000000
b[0][0][0][2] = -0.007277;// +- 0.001296
b[0][0][1][2] = 0.005762;// +- 0.001339
b[1][0][0][0] = 0.006331;// +- 0.001999
b[1][1][0][0] = 0.012922;// +- 0.003488
b[2][0][0][0] = -0.047201;// +- 0.002412
b[2][0][0][2] = 0.013230;// +- 0.002452
b[2][1][0][0] = -0.023220;// +- 0.004386
b[2][2][0][0] = 0.018912;// +- 0.005656
b[3][0][0][0] = 0.011316;// +- 0.003258
b[3][1][0][0] = -0.017484;// +- 0.005588
b[4][0][0][0] = -0.020099;// +- 0.003545
b[4][1][0][0] = 0.029596;// +- 0.006075
b[5][0][0][0] = -0.024536;// +- 0.003844
b[6][0][0][0] = 0.019579;// +- 0.004502
}