Update 'MassFit.cpp'
parent
5dae033c29
commit
bf1bfce36b
126
MassFit.cpp.md
126
MassFit.cpp.md
@ -27,8 +27,7 @@
|
||||
# Functions and their parameters:
|
||||
|
||||
### 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**
|
||||
* string varName
|
||||
|
||||
@ -55,7 +54,7 @@ This functions checks whether the used extra variable is listed in the binning s
|
||||
* **Return**
|
||||
|
||||
### string GetsWeightPlots()
|
||||
|
||||
Retrieves and returns the path of the sWeight plots.
|
||||
* **Parameters**
|
||||
* string year
|
||||
* bool UseOnlyJpsiEvents
|
||||
@ -66,45 +65,66 @@ This functions checks whether the used extra variable is listed in the binning s
|
||||
* string BkgType
|
||||
* bool ConstrainParameters
|
||||
* **Return**
|
||||
* sWeight plot path
|
||||
|
||||
### 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**
|
||||
* string year
|
||||
* string magnet
|
||||
* int Run
|
||||
* bool MC
|
||||
* bool Preselected
|
||||
* bool TM
|
||||
* bool PHSP
|
||||
* bool UseOnlyJpsiEvents
|
||||
* bool UseOnlyMuMuEvents
|
||||
* bool GetShapeFromMC
|
||||
* string year (which year?)
|
||||
* string magnet (which polarity?)
|
||||
* int Run (which Run? If 0, do year, if 1 or 2, do run)
|
||||
* bool MC (use MC?)
|
||||
* bool Preselected (fit preselected sample?)
|
||||
* bool TM (fit truth-matched MC?)
|
||||
* bool PHSP (fit PHSP MC?)
|
||||
* bool UseOnlyJpsiEvents (fit only events in Jpsi Q2?)
|
||||
* bool UseOnlyMuMuEvents (fit only events in rare Q2?)
|
||||
* bool GetShapeFromMC (Fix/constrain parameters to the MC/MVA data shape?)
|
||||
* string SigType
|
||||
* LeftCB, RightCB, DoubleCB, OneCB, SingleGaussian, DoubleGaussian, NoSig
|
||||
* string BkgType
|
||||
* bool ConstrainParameters
|
||||
* bool KshortDecaysInVelo
|
||||
* bool UseLowQ2Range
|
||||
* Double_t TMVAcut
|
||||
* int randomSubset
|
||||
* bool fixedMassRegion
|
||||
* bool yieldOverFullRange
|
||||
* bool sWeight
|
||||
* bool loopFit
|
||||
* bool IsEfficiency
|
||||
* int nExtraBin
|
||||
* bool removeMultiple
|
||||
* bool weighted
|
||||
* bool weightedFromPi0
|
||||
* string whichWeight
|
||||
* bool nonTM
|
||||
* string customTMbranch
|
||||
* bool gammaTM
|
||||
* bool InclusiveSample
|
||||
* SingleExponential, DoubleExponential, ExpGaus, NoBackground, OneCB
|
||||
* bool ConstrainParameters (Constrain parameters to the MC/MVA data fit?)
|
||||
* bool KshortDecaysInVelo (Long-Long or Down-Down?)
|
||||
* bool UseLowQ2Range (Only use events with Q2<Jpsi)
|
||||
* Double_t TMVAcut (What TMVA cut should be applied?)
|
||||
* int randomSubset (use a random half of the sample?)
|
||||
* bool fixedMassRegion (calculate yield in a fixed window or based on sigma?)
|
||||
* bool yieldOverFullRange (calculate the yield over the full range?)
|
||||
* bool sWeight (calculate and save sWeights?)
|
||||
* bool loopFit (prevents the MC/MVA data fit to be performed every time the fit is run)
|
||||
* bool IsEfficiency (are you fitting to get an efficiency? (required for proper path handling))
|
||||
* string sExtraVar (are you fiting in a bin of some other variable, such as cos(thetak)? what variable?)
|
||||
* int nExtraBin (what fit of this variable are you fitting in?)
|
||||
* bool removeMultiple (remove multiple candidates)
|
||||
* bool weighted (use weighted data)
|
||||
* bool weightedFromPi0 (use weights from pi0s)
|
||||
* string whichWeight (what branch to use for the pi0 weights?)
|
||||
* bool nonTM (fit MC not passing the truth matching?)
|
||||
* string customTMbranch (define the truth-matching branch)
|
||||
* bool gammaTM (truth-match gammas?)
|
||||
* bool InclusiveSample (fit the B->XMuMu MC sample)
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### 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**
|
||||
* string year
|
||||
* bool MC
|
||||
@ -117,16 +137,17 @@ This functions checks whether the used extra variable is listed in the binning s
|
||||
* string BkgType
|
||||
* bool ConstrainParameters
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### int quickTest()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* bool gammaTM = false
|
||||
* string customTMbranch = "TMed"
|
||||
* **Return**
|
||||
|
||||
### int testOneCbBackground()
|
||||
|
||||
Sets verbosity to 1. Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* bool MC = false
|
||||
* string SigType = "OneCB"
|
||||
@ -134,9 +155,10 @@ This functions checks whether the used extra variable is listed in the binning s
|
||||
* string customTMbranch = ""
|
||||
* bool gammaTM = false
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### 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**
|
||||
* string year = "2011"
|
||||
* string magnet = "down"
|
||||
@ -163,9 +185,10 @@ This functions checks whether the used extra variable is listed in the binning s
|
||||
* string customTMbranch = ""
|
||||
* bool gammaTM = false
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### int basicYieldFit()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* string year
|
||||
* int Run
|
||||
@ -184,9 +207,10 @@ This functions checks whether the used extra variable is listed in the binning s
|
||||
* bool loopFit
|
||||
* //yield calculation regionbool removeMultiple //remove multiple candidates //TODO: shape from MC if TMVA cut?
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### int basicYieldFitAllYears()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* //Fits all years separatelybool MC = true
|
||||
* 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
|
||||
* bool loopFit = false
|
||||
* //yield calculation regionbool removeMultiple = false //remove multiple candidates
|
||||
* **Return**
|
||||
|
||||
### int basicFitAllYearsAndRegions()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* bool MC = true
|
||||
* 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
|
||||
* bool removeMultiple = false //TMVA options
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### int getYieldBasicOptionsMC()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* bool TM
|
||||
* string year
|
||||
@ -231,23 +255,25 @@ This functions checks whether the used extra variable is listed in the binning s
|
||||
* **Return**
|
||||
|
||||
### int getYieldBasicOptionsMCAllYears()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* bool TM
|
||||
* bool ReferenceChannel
|
||||
* bool PHSP
|
||||
* bool removeMultiple
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### int getYieldAllYearsBasicOptions()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* bool TM
|
||||
* bool removeMultiple
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### int basicYieldFitAllRuns()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* //Fits data per yearbool MC = true
|
||||
* bool PHSP = false
|
||||
@ -264,32 +290,36 @@ This functions checks whether the used extra variable is listed in the binning s
|
||||
* bool loopFit = false
|
||||
* //yield calculation regionbool removeMultiple = false //remove multiple candidates
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### int massFitTestAll()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* bool GetShapeFromMC = true
|
||||
* bool ConstrainParameters = false
|
||||
* int Run = 1
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### int massFitTestQ2All()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* int Run
|
||||
* bool PHSP
|
||||
* bool UseOnlyMuMuEvents
|
||||
* bool UseOnlyJpsiEvents
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### int PrintFitResults()
|
||||
|
||||
Prints out the fitted parameter values and their uncertainty.
|
||||
* **Parameters**
|
||||
* RooFitResult\* fitRes
|
||||
* **Return**
|
||||
* Signal yield is everything went well, 0 if something failed.
|
||||
|
||||
### int fitJpsi()
|
||||
|
||||
Calls [massFit](#double-massfit). For the details the fastest is to see the code.
|
||||
* **Parameters**
|
||||
* string year
|
||||
* int Run
|
||||
|
Loading…
Reference in New Issue
Block a user