From 76ede8b378f6fd4b96ad3d796eb7dda56be78ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Renata=20Kopecn=C3=A1?= Date: Mon, 31 Jan 2022 09:37:22 +0100 Subject: [PATCH] Update 'GlobalFunctions.hh' --- GlobalFunctions.hh.md | 180 +++++++++++++++--------------------------- 1 file changed, 65 insertions(+), 115 deletions(-) diff --git a/GlobalFunctions.hh.md b/GlobalFunctions.hh.md index 0206044..e80c7e4 100644 --- a/GlobalFunctions.hh.md +++ b/GlobalFunctions.hh.md @@ -7,7 +7,6 @@ # Global variables -* int verboseLevel = 2 ### Decay Options * const bool KshortChannel = [GetKSfromExePath()](bool-getksfromexepath) * const bool SplitDDandLL = KshortChannel ? true : false //for pi0 SplitDDandLL is always false! @@ -80,6 +79,9 @@ * const double cut_K_plus_ProbNNk = 0.25 * const double cut_gamma_CL = 0.15 //gamma confidence level, explained in my [thesis](http://www.physi.uni-heidelberg.de/Publications/thesis_Kopecna_final.pdf), page 48 * const bool SplitInQ2 = KshortChannel ? false : false //rather obsolete, but still allows you to split the sample based on Q2 below and above J/psi +* const float SignalRegionNsigma = 2.; //How many sigmas around the signal peak comprises the signal region + + ### Constants @@ -117,27 +119,37 @@ * const Int_t J_PSI = 443 * const Int_t ELECTRON = 11 +* const double BR_sig = 8.668e-7; +* const double BR_sig = 8.668e-7; //BR for B+ -> K*+ mu mu without resonances from flavio (09-05-19) +* const double BR_ref = 1.43e-3 * 5.961e-2; //PDG value for B+ -> J/psi K*+ times J/psi -> mu mu +* const double BR_ref2 = 6.7e-4 * 8.0e-3; //PDG value for B+ -> psi(2s) K*+ times psi(2s) -> mu mu - const double BR_sig = 8.668e-7; +### output levels +* int verboseLevel = 2 + * verboseLevel 0: cout Tests, Debugs, Infos, Warnings and Errors + * verboseLevel 1: cout Debugs, Infos, Warnings and Errors + * verboseLevel 2: cout Infos, Warnings and Errors + * verboseLevel 3: cout Warnings and Errors + * verboseLevel 4: cout Errors (always cout errors) -//branching ratios - //const double BR_sig = 9.6e-7; //PDG value for B+ -> K*+ mu mu - //const double BR_sig = 6.09576e-7; //BR for B+ -> K*+ mu mu without resonances from LHCb-PAPER-2014-006 - const double BR_sig = 8.668e-7; //BR for B+ -> K*+ mu mu without resonances from flavio (09-05-19) - const double BR_ref = 1.43e-3 * 5.961e-2; //PDG value for B+ -> J/psi K*+ times J/psi -> mu mu - const double BR_ref2 = 6.7e-4 * 8.0e-3; //PDG value for B+ -> psi(2s) K*+ times psi(2s) -> mu mu +### colors +Colors are defined using \#define as it is a constant everywhere +* cBOLDWHITE // Bold White +* cBOLDRED // Bold Red +* cBOLDGREEN // Bold Green +* cGREEN // Green +* cBOLDCYAN // Bold Cyan +* cCYAN // Cyan +* cRED // Red +* cBOLDRED // Bold red +* cYELLOW // Yellow +* cBOLDYELLOW // Bold Yellow +* cRESET // Resets the colors - const float SignalRegionNsigma = 2.; //How many sigmas around the signal peak comprises the signal region - - double getTMVAcut(int Run){ - if (Run == 1) return 0.9985; - else if (Run == 2) return 0.996; - else return 1; - } # Classes -* struct SignalFitParameters{ //TODO: possibly add the K1 to ParamValues at some point -* struct FixedParameters{//TODO: possibly add the K1 to ParamValues at some point +* struct SignalFitParameters //Obsolete, used to be the starting parameters in the B mass fit +* struct FixedParameters //Obsolete, used to be the fixed parameters in the B mass fit * struct stat buffer # Functions and their parameters: @@ -155,218 +167,155 @@ Takes the truth-matching response and checks whether the event passes the select * **Return** * 1 if event passes truthmatching, 0 if not -### inline bool exists_test () +### double getTMVAcut(int Run) +* **Parameters** + * int Run +* **Return** + * Returns the TMVA cut for given Run. +### inline bool exists_test() * **Parameters** * const std::string& name * **Return** + * True if the `name` exists, false otherwise. -### return () -* **Parameters** - * stat -* **Return** - -### //verboseLevel 4: cout Errors () - -* **Parameters** - * always cout errors) -* **Return** ### void setVerboseLevel() - +Changes the [verbosity level](#output-levels). * **Parameters** * int level -* **Return** ### bool set_gErrorIgnoreLevel() * **Parameters** - * + * Sets root to be quiet based on the [verbosity level](#output-levels). * **Return** + * Always true ### bool get_gErrorIgnoreLevel = set_gErrorIgnoreLevel() - -* **Parameters** - * ); -* **Return** +I am also confused what would be this good for. Take if for obsoletel. ### void coutTest() - +Prints a test message. * **Parameters** * string message -* **Return** ### void coutDebug() - +Prints a debug message. * **Parameters** * string message -* **Return** ### void coutInfo() - +Prints an info message. * **Parameters** * string message -* **Return** ### void coutWarning() - +Prints a warning message. * **Parameters** * string message -* **Return** ### void coutERROR() - +Prints an error message. * **Parameters** * string message -* **Return** ### double get_cut_B_plus_M_low() - +We have tested different lower B plus cuts for different Run. Now it is obsolete. * **Parameters** * int Run = 2 //setting lower B mass cut for different run/years * **Return** + * Lower B plus mass cut for given Run. ### double get_cut_B_plus_M_low() - +We have tested different lower B plus cuts for different years. Now it is obsolete. * **Parameters** * std::string year = "2015" * **Return** + * Lower B plus mass cut for given year. ### bool IsDST() - * **Parameters** * std::string year * bool MC * bool ReferenceChannel * bool PHSP * **Return** + * True if the given sample is DST, False if it is mDST ### void addLHCbtag() - +Creates and draws the LHCb + `suffix` tag. * **Parameters** * Float_t x = 0.6 * Float_t y = 0.85 * std::string suffix = "" * Int_t color = 1 * Float_t Scaling = 1.0 -* **Return** ### std::string Float2Comma() - +Takes float and the precision and converts the float to a string. * **Parameters** * Float_t f * Int_t d * **Return** + * String made of floats. -### if() - -* **Parameters** - * d > 5 -* **Return** - -### if() - -* **Parameters** - * d <= 0)return out; -* **Return** - -### for() - -* **Parameters** - * Int_t n = 0; n <= d; n++ -* **Return** - -### N[n] = static_cast() - -* **Parameters** - * -* **Return** - -### for() - -* **Parameters** - * Int_t m = 0; m < n; m++)N[n] -= N[m] \* TMath::Power -* **Return** - -### if() - -* **Parameters** - * n != 0)out.append -* **Return** ### bool replace() - +Takes a string with a substring `from` and replaces it to `to`. * **Parameters** * std::string& str * const std::string& from * const std::string& to * **Return** + * False is the `from` string doesn't exist, otherwise true. ### void printVector () - +Overloaded function, takes an int, double or a string vector and prints it as a single string, separated by a space. * **Parameters** - * std::vector\ vector -* **Return** - -### void printVector () - -* **Parameters** - * std::vector\ vector -* **Return** - -### void printVector () - -* **Parameters** - * std::vector\ vector -* **Return** - -### void printVector () - -* **Parameters** - * std::vector\ vector -* **Return** + * std::vector\ vector ### std::vector\ yearsMC () - * **Parameters** * bool Reference = false * bool PHSP = false * int Run = 1 * **Return** + * A vector of strings containing all available years for the given MC sample. ### std::vector\ yearsData () - * **Parameters** * int Run = 1 * **Return** + * A vector of strings containing the years corresponding to the given Run. ### std::vector\ yearsVector () - * **Parameters** * bool MC = false * bool Reference = false * bool PHSP = false * int Run = 1 * **Return** + * A vector of strings containing the years corresponding to the given sample and Run. ### std::vector\ yearsVectorInt() - * **Parameters** * bool MC = false * bool Reference = false * bool PHSP = false * int Run = 1 * **Return** + * A vector of integers containing the years corresponding to the given sample and Run. + ### std::vector\ yearsInc() - * **Parameters** * int Run * **Return** + * A vector of strings containing all available years for the inclusive MC sample. ### std::vector\ yearsBkgMC() - * **Parameters** * bool Reference * bool B0 @@ -374,9 +323,10 @@ Takes the truth-matching response and checks whether the event passes the select * bool Inc * int Run * **Return** + * A vector of strings containing all available years for the given background MC sample. ### int getRunID() - * **Parameters** * string year * **Return** + * Run number for the given run (eg 2017 will return 2, 2011 will return 1)