Update 'MassFit.cpp'
parent
5dae033c29
commit
bf1bfce36b
126
MassFit.cpp.md
126
MassFit.cpp.md
@ -27,8 +27,7 @@
|
|||||||
# Functions and their parameters:
|
# Functions and their parameters:
|
||||||
|
|
||||||
### TMefficiencyClass::TMefficiencyClass()
|
### TMefficiencyClass::TMefficiencyClass()
|
||||||
Constructor of the TMefficiencyClass. Based on the varName input parameter, it sets the
|
Constructor of the TMefficiencyClass. Based on the varName input parameter, it initializes all the class variables.
|
||||||
|
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* string varName
|
* string varName
|
||||||
|
|
||||||
@ -55,7 +54,7 @@ This functions checks whether the used extra variable is listed in the binning s
|
|||||||
* **Return**
|
* **Return**
|
||||||
|
|
||||||
### string GetsWeightPlots()
|
### string GetsWeightPlots()
|
||||||
|
Retrieves and returns the path of the sWeight plots.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* string year
|
* string year
|
||||||
* bool UseOnlyJpsiEvents
|
* bool UseOnlyJpsiEvents
|
||||||
@ -66,45 +65,66 @@ This functions checks whether the used extra variable is listed in the binning s
|
|||||||
* string BkgType
|
* string BkgType
|
||||||
* bool ConstrainParameters
|
* bool ConstrainParameters
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* sWeight plot path
|
||||||
|
|
||||||
### double massFit()
|
### double massFit()
|
||||||
|
Performs the fit. Loads the already compiled source files (see [[B mass model|b-mass-model]]), performs basic sanity checks. If the parameters need to be taken from MC/MVAed data, perform the MC/MVA data fit (unless loopFit is true, than it performs the fit only when running the code for the first time!). The fit shape is defined by SigType and BkgType, creates all the RooVars and RooPDFs needed for the fit. Performs the fit and calculates the signal and background yields together with their errors. Saves these values, together with the effective sigma, in a separate file and calculates significance from this. Then, the fit is plotted, including the pulls, and saved.
|
||||||
|
Furthermore, when sWeight is set to true, it calculates and saves the sWeights in the data tuple and creates control plots.
|
||||||
|
|
||||||
|
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* string year
|
* string year (which year?)
|
||||||
* string magnet
|
* string magnet (which polarity?)
|
||||||
* int Run
|
* int Run (which Run? If 0, do year, if 1 or 2, do run)
|
||||||
* bool MC
|
* bool MC (use MC?)
|
||||||
* bool Preselected
|
* bool Preselected (fit preselected sample?)
|
||||||
* bool TM
|
* bool TM (fit truth-matched MC?)
|
||||||
* bool PHSP
|
* bool PHSP (fit PHSP MC?)
|
||||||
* bool UseOnlyJpsiEvents
|
* bool UseOnlyJpsiEvents (fit only events in Jpsi Q2?)
|
||||||
* bool UseOnlyMuMuEvents
|
* bool UseOnlyMuMuEvents (fit only events in rare Q2?)
|
||||||
* bool GetShapeFromMC
|
* bool GetShapeFromMC (Fix/constrain parameters to the MC/MVA data shape?)
|
||||||
* string SigType
|
* string SigType
|
||||||
|
* LeftCB, RightCB, DoubleCB, OneCB, SingleGaussian, DoubleGaussian, NoSig
|
||||||
* string BkgType
|
* string BkgType
|
||||||
* bool ConstrainParameters
|
* SingleExponential, DoubleExponential, ExpGaus, NoBackground, OneCB
|
||||||
* bool KshortDecaysInVelo
|
* bool ConstrainParameters (Constrain parameters to the MC/MVA data fit?)
|
||||||
* bool UseLowQ2Range
|
* bool KshortDecaysInVelo (Long-Long or Down-Down?)
|
||||||
* Double_t TMVAcut
|
* bool UseLowQ2Range (Only use events with Q2<Jpsi)
|
||||||
* int randomSubset
|
* Double_t TMVAcut (What TMVA cut should be applied?)
|
||||||
* bool fixedMassRegion
|
* int randomSubset (use a random half of the sample?)
|
||||||
* bool yieldOverFullRange
|
* bool fixedMassRegion (calculate yield in a fixed window or based on sigma?)
|
||||||
* bool sWeight
|
* bool yieldOverFullRange (calculate the yield over the full range?)
|
||||||
* bool loopFit
|
* bool sWeight (calculate and save sWeights?)
|
||||||
* bool IsEfficiency
|
* bool loopFit (prevents the MC/MVA data fit to be performed every time the fit is run)
|
||||||
* int nExtraBin
|
* bool IsEfficiency (are you fitting to get an efficiency? (required for proper path handling))
|
||||||
* bool removeMultiple
|
* string sExtraVar (are you fiting in a bin of some other variable, such as cos(thetak)? what variable?)
|
||||||
* bool weighted
|
* int nExtraBin (what fit of this variable are you fitting in?)
|
||||||
* bool weightedFromPi0
|
* bool removeMultiple (remove multiple candidates)
|
||||||
* string whichWeight
|
* bool weighted (use weighted data)
|
||||||
* bool nonTM
|
* bool weightedFromPi0 (use weights from pi0s)
|
||||||
* string customTMbranch
|
* string whichWeight (what branch to use for the pi0 weights?)
|
||||||
* bool gammaTM
|
* bool nonTM (fit MC not passing the truth matching?)
|
||||||
* bool InclusiveSample
|
* string customTMbranch (define the truth-matching branch)
|
||||||
|
* bool gammaTM (truth-match gammas?)
|
||||||
|
* bool InclusiveSample (fit the B->XMuMu MC sample)
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int quickFit()
|
### int quickFit()
|
||||||
|
Calls [massFit(year,"both", 0,\
|
||||||
|
MC, true, MC, false,\
|
||||||
|
UseOnlyJpsiEvents, UseOnlyMuMuEvents,\
|
||||||
|
GetShapeFromMC,SigType,BkgType,ConstrainParameters,\
|
||||||
|
KshortDecaysInVelo,false,\
|
||||||
|
-1.0, 0,\
|
||||||
|
false, false,\
|
||||||
|
sWeight,\
|
||||||
|
false, false,\
|
||||||
|
"",-1,\
|
||||||
|
false,\
|
||||||
|
false, false, "",\
|
||||||
|
false, "", false,\
|
||||||
|
false)](#double-massfit).
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* string year
|
* string year
|
||||||
* bool MC
|
* bool MC
|
||||||
@ -117,16 +137,17 @@ This functions checks whether the used extra variable is listed in the binning s
|
|||||||
* string BkgType
|
* string BkgType
|
||||||
* bool ConstrainParameters
|
* bool ConstrainParameters
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int quickTest()
|
### int quickTest()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* bool gammaTM = false
|
* bool gammaTM = false
|
||||||
* string customTMbranch = "TMed"
|
* string customTMbranch = "TMed"
|
||||||
* **Return**
|
* **Return**
|
||||||
|
|
||||||
### int testOneCbBackground()
|
### int testOneCbBackground()
|
||||||
|
Sets verbosity to 1. Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* bool MC = false
|
* bool MC = false
|
||||||
* string SigType = "OneCB"
|
* string SigType = "OneCB"
|
||||||
@ -134,9 +155,10 @@ This functions checks whether the used extra variable is listed in the binning s
|
|||||||
* string customTMbranch = ""
|
* string customTMbranch = ""
|
||||||
* bool gammaTM = false
|
* bool gammaTM = false
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int efficiencyFit()
|
### int efficiencyFit()
|
||||||
|
Calls [massFit](#double-massfit) with predefined options optimized for an efficiency fit. For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* string year = "2011"
|
* string year = "2011"
|
||||||
* string magnet = "down"
|
* string magnet = "down"
|
||||||
@ -163,9 +185,10 @@ This functions checks whether the used extra variable is listed in the binning s
|
|||||||
* string customTMbranch = ""
|
* string customTMbranch = ""
|
||||||
* bool gammaTM = false
|
* bool gammaTM = false
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int basicYieldFit()
|
### int basicYieldFit()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* string year
|
* string year
|
||||||
* int Run
|
* int Run
|
||||||
@ -184,9 +207,10 @@ This functions checks whether the used extra variable is listed in the binning s
|
|||||||
* bool loopFit
|
* bool loopFit
|
||||||
* //yield calculation regionbool removeMultiple //remove multiple candidates //TODO: shape from MC if TMVA cut?
|
* //yield calculation regionbool removeMultiple //remove multiple candidates //TODO: shape from MC if TMVA cut?
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int basicYieldFitAllYears()
|
### int basicYieldFitAllYears()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* //Fits all years separatelybool MC = true
|
* //Fits all years separatelybool MC = true
|
||||||
* bool PHSP = false
|
* bool PHSP = false
|
||||||
@ -202,10 +226,9 @@ This functions checks whether the used extra variable is listed in the binning s
|
|||||||
* //TMVA optionsbool fixedMassRegion = !Kst2Kspiplus
|
* //TMVA optionsbool fixedMassRegion = !Kst2Kspiplus
|
||||||
* bool loopFit = false
|
* bool loopFit = false
|
||||||
* //yield calculation regionbool removeMultiple = false //remove multiple candidates
|
* //yield calculation regionbool removeMultiple = false //remove multiple candidates
|
||||||
* **Return**
|
|
||||||
|
|
||||||
### int basicFitAllYearsAndRegions()
|
### int basicFitAllYearsAndRegions()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* bool MC = true
|
* bool MC = true
|
||||||
* bool PHSP = false
|
* bool PHSP = false
|
||||||
@ -218,9 +241,10 @@ This functions checks whether the used extra variable is listed in the binning s
|
|||||||
* //LL/DD? q2range?Double_t TMVAcut = -1.0
|
* //LL/DD? q2range?Double_t TMVAcut = -1.0
|
||||||
* bool removeMultiple = false //TMVA options
|
* bool removeMultiple = false //TMVA options
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int getYieldBasicOptionsMC()
|
### int getYieldBasicOptionsMC()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* bool TM
|
* bool TM
|
||||||
* string year
|
* string year
|
||||||
@ -231,23 +255,25 @@ This functions checks whether the used extra variable is listed in the binning s
|
|||||||
* **Return**
|
* **Return**
|
||||||
|
|
||||||
### int getYieldBasicOptionsMCAllYears()
|
### int getYieldBasicOptionsMCAllYears()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* bool TM
|
* bool TM
|
||||||
* bool ReferenceChannel
|
* bool ReferenceChannel
|
||||||
* bool PHSP
|
* bool PHSP
|
||||||
* bool removeMultiple
|
* bool removeMultiple
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int getYieldAllYearsBasicOptions()
|
### int getYieldAllYearsBasicOptions()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* bool TM
|
* bool TM
|
||||||
* bool removeMultiple
|
* bool removeMultiple
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int basicYieldFitAllRuns()
|
### int basicYieldFitAllRuns()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* //Fits data per yearbool MC = true
|
* //Fits data per yearbool MC = true
|
||||||
* bool PHSP = false
|
* bool PHSP = false
|
||||||
@ -264,32 +290,36 @@ This functions checks whether the used extra variable is listed in the binning s
|
|||||||
* bool loopFit = false
|
* bool loopFit = false
|
||||||
* //yield calculation regionbool removeMultiple = false //remove multiple candidates
|
* //yield calculation regionbool removeMultiple = false //remove multiple candidates
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int massFitTestAll()
|
### int massFitTestAll()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* bool GetShapeFromMC = true
|
* bool GetShapeFromMC = true
|
||||||
* bool ConstrainParameters = false
|
* bool ConstrainParameters = false
|
||||||
* int Run = 1
|
* int Run = 1
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int massFitTestQ2All()
|
### int massFitTestQ2All()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* int Run
|
* int Run
|
||||||
* bool PHSP
|
* bool PHSP
|
||||||
* bool UseOnlyMuMuEvents
|
* bool UseOnlyMuMuEvents
|
||||||
* bool UseOnlyJpsiEvents
|
* bool UseOnlyJpsiEvents
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int PrintFitResults()
|
### int PrintFitResults()
|
||||||
|
Prints out the fitted parameter values and their uncertainty.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* RooFitResult\* fitRes
|
* RooFitResult\* fitRes
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* Signal yield is everything went well, 0 if something failed.
|
||||||
|
|
||||||
### int fitJpsi()
|
### int fitJpsi()
|
||||||
|
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* string year
|
* string year
|
||||||
* int Run
|
* int Run
|
||||||
|
Loading…
Reference in New Issue
Block a user