Add 'Selection code'

Renata Kopecná 2022-01-24 10:38:34 +01:00
parent 6cebe0bd7d
commit 75dcaaeb37

113
Selection-code.md Normal file

@ -0,0 +1,113 @@
The selection code is a set of C++ scripts.
# Running the code
When re-running everything do the following
.L BDTSelection.cpp+
runAllSignalData(1); runAllSignalData(2);
runAllSignalMC(1); runAllSignalMC(2);
runAllRefMC(1); runAllRefMC(2);
runAllPHSPMC(1); runAllPHSPMC(2);
lb-conda default python Rescale_pi0momentum.py
.L MCtruthmatching.cpp+
TruthMatchAllAll(1); TruthMatchAllAll(2);
.L CodeForTests/AddVariable.cpp+
addAllXMuMuMass(true,true,1); addAllXMuMuMass(false,true,1); applyAllVetoKplusMuMuMass(1);
addAllXMuMuMass(true,true,2); addAllXMuMuMass(false,true,2); applyAllVetoKplusMuMuMass(2);
.L nTrackWeights.cpp+
WeightAll(true,1,true); ReweightReferenceMC(true,1,true); ReweightPHSPMC(true,1,true);
WeightAll(true,2,true); ReweightReferenceMC(true,2,true); ReweightPHSPMC(true,2,true);
*** now compare all the variables ***
.L MVA.cpp+
RunMVA(1); RunMVA(2);
.L TMVAClassApp.cpp+
TMVAClassAppAll(1); TMVAClassAppAll(2);
python RemoveMultipleCandidates.py -all
*** Now rerunning the weights as they are fixed to after-mva ***
.L nTrackWeights.cpp+
WeightAll(true,1,true); ReweightReferenceMC(true,1,true); ReweightPHSPMC(true,1,true);
WeightAll(true,2,true); ReweightReferenceMC(true,2,true); ReweightPHSPMC(true,2,true);
.L CodeForTests/compareVariables.cc+
compareAll(1); compareAll(2);
.L MVA.cpp+
RunMVA(1); RunMVA(2);
.L PlotMVA.cpp+
SaveAllFromOneFile(2011,1,false,false,0,false,"",false);
SaveAllFromOneFile(2016,2,false,false,0,false,"",false);
testFunction(1); testFunction(2)
.L TMVAClassApp.cpp+
TMVAClassAppAll(1); TMVAClassAppAll(2);
python RemoveMultipleCandidates.py -all
.L CodeForTests/AddVariable.cpp+
addAllVariablesAllMCSamples(1); addAllVariablesAllMCSamples(2);
.L Efficiency.cpp+
runAllEff();
.L BDTcutScanner.cpp+
ScanSignalAndBckgndEstimation("2012",1,0.01,false,false,false,true)
ScanSignalAndBckgndEstimation("2016",2,0.01,false,false,false,true)
getMaxBDTresponse("2012",1,true,true,0,false,false)
getMaxBDTresponse("2016",2,true,false,0,false,false)
python ReorganizeTGraph.py
.L SignalStudy.cpp+
plotYieldInQ2(true); plotYieldInQ2(false);
ApplyCutPerYearAll(1); ApplyCutPerYearAll(2);
printYileds(false); printYileds(true)
yieldComparison(1,getTMVAcut(1));
yieldComparison(2,getTMVAcut(2));
Recompile mass fit
.L BmassShape/SignalType.cpp+
.L BmassShape/SignalPdf.cpp+
.L BmassShape/BackgroundType.cpp+
.L BmassShape/BackgroundPdf.cpp+
.L BmassShape/ParamValues.cpp+
.L MassFit.cpp+
Check the inclusive sample
.L BDTSelection.cpp+
runAllIncMC(1); runAllIncMC(2)
lb-conda default python Rescale_pi0momentum.py (CAREFUL, NEEDS TO BE SET BY HAND)
.L MCtruthmatching.cpp+
TruthMatchAllBkg(true,1,false,false,true); TruthMatchAllBkg(true,2,false,false,true);
.L CodeForTests/AddVariable.cpp+ (CAREFUL, NEEDS TO BE SET BY HAND)
addAllXMuMuMass(true,true,1,true,true,false); addAllXMuMuMass(false,true,1,true,true,false); applyAllVetoKplusMuMuMass(1,true,true,false);
addAllXMuMuMass(true,true,2,true,true,false); addAllXMuMuMass(false,true,2,true,true,false); applyAllVetoKplusMuMuMass(2,true,true,false);
lb-conda default python Rescale_pi0momentum.py (CAREFUL, NEEDS TO BE SET BY HAND)
.L TMVAClassApp.cpp+
TMVAClassAppInc(1); TMVAClassAppInc(2);
python RemoveMultipleCandidates.py -all (CAREFUL, NEEDS TO BE SET BY HAND)
.L CodeForTests/InclusiveCheck.cpp+
plotTM(1,true); plotTM(2,true)
plotTM(1,false); plotTM(2,false)