1 #ifndef MUSCLEFITBASE_C
2 #define MUSCLEFITBASE_C
30 LogDebug(
"MuScleFitBase") <<
"Creating new histograms" << std::endl;
39 mapHisto_[
"hRecBestResAllEvents"] =
new HParticle(
"hRecBestResAllEvents", minMass, maxMass, maxPt);
55 new HResolutionVSPart(outputFile,
"hResolMassVSMu", maxPt, 0., yMaxEta, 0., yMaxPt,
true);
57 new HResolutionVSPart(outputFile,
"hFunctionResolMassVSMu", maxPt, 0, 0.1, 0, 0.1,
true);
61 new HResolutionVSPart(outputFile,
"hResolEtaGenVSMu", maxPt, -0.02, 0.02, -0.02, 0.02);
63 new HResolutionVSPart(outputFile,
"hResolEtaSimVSMu", maxPt, -0.02, 0.02, -0.02, 0.02);
65 new HResolutionVSPart(outputFile,
"hResolThetaGenVSMu", maxPt, -0.02, 0.02, -0.02, 0.02);
67 new HResolutionVSPart(outputFile,
"hResolThetaSimVSMu", maxPt, -0.02, 0.02, -0.02, 0.02);
69 new HResolutionVSPart(outputFile,
"hResolCotgThetaGenVSMu", maxPt, -0.02, 0.02, -0.02, 0.02);
71 new HResolutionVSPart(outputFile,
"hResolCotgThetaSimVSMu", maxPt, -0.02, 0.02, -0.02, 0.02);
73 new HResolutionVSPart(outputFile,
"hResolPhiGenVSMu", maxPt, -0.02, 0.02, -0.02, 0.02);
75 new HResolutionVSPart(outputFile,
"hResolPhiSimVSMu", maxPt, -0.02, 0.02, -0.02, 0.02);
87 new HTH2D(outputFile,
"hPtRecoVsPtGen",
"Pt reco vs Pt gen",
"hPtRecoVsPtGen", 120, 0., 120., 120, 0, 120.);
88 (*recoGenHisto)->SetXTitle(
"Pt gen (GeV)");
89 (*recoGenHisto)->SetYTitle(
"Pt reco (GeV)");
90 mapHisto_[
"hPtRecoVsPtGen"] = recoGenHisto;
92 new HTH2D(outputFile,
"hPtRecoVsPtSim",
"Pt reco vs Pt sim",
"hPtRecoVsPtSim", 120, 0., 120., 120, 0, 120.);
93 (*recoSimHisto)->SetXTitle(
"Pt sim (GeV)");
94 (*recoSimHisto)->SetYTitle(
"Pt reco (GeV)");
95 mapHisto_[
"hPtRecoVsPtSim"] = recoSimHisto;
105 mapHisto_[
"hMass_P"] =
new HTProfile(outputFile,
"Mass_P",
"Mass probability", 4000, 0., 200., 0., 50.);
106 mapHisto_[
"hMass_fine_P"] =
new HTProfile(outputFile,
"Mass_fine_P",
"Mass probability", 4000, 0., 20., 0., 50.);
107 mapHisto_[
"hMass_Probability"] =
new HTH1D(outputFile,
"Mass_Probability",
"Mass probability", 4000, 0., 200.);
109 new HTH1D(outputFile,
"Mass_fine_Probability",
"Mass probability", 4000, 0., 20.);
117 "DeltaMassOverGenMassVsPt",
118 "DeltaMassOverGenMassVsPt",
119 "DeltaMassOverGenMass",
127 "DeltaMassOverGenMassVsEta",
128 "DeltaMassOverGenMassVsEta",
129 "DeltaMassOverGenMass",
146 delete (*histo).second;
155 (*histo).second->Write();
160 std::array<TH2D*, 6> GLZ = {{
nullptr}};
161 std::array<TH2D*, 6>
GL = {{
nullptr}};
162 std::unique_ptr<TFile> ProbsFile;
171 ProbsFile = std::make_unique<TFile>(
file.fullPath().c_str());
176 bool resfindEmpty =
true;
178 resfindEmpty =
false;
179 for (
unsigned char i = 0;
i < GLZ.size();
i++) {
181 snprintf(nameh, 6,
"GLZ%hhu",
i);
182 GLZ[
i] =
dynamic_cast<TH2D*
>(ProbsFile->Get(nameh));
185 GL[0] =
dynamic_cast<TH2D*
>(ProbsFile->Get(
"GL0"));
186 resfindEmpty =
false;
188 for (
unsigned char i = 1;
i < GL.size(); ++
i) {
191 snprintf(nameh, 6,
"GL%hhu", i);
192 GL[
i] =
dynamic_cast<TH2D*
>(ProbsFile->Get(nameh));
193 resfindEmpty =
false;
197 std::cout <<
"[MuScleFit-Constructor]: No resonance selected, please fill the resfind array" << std::endl;
214 for (
unsigned int i = 1;
i < GL.size(); ++
i) {
229 for (
unsigned int iY = 0; iY < GLZ.size(); iY++) {
230 int nBinsX = GLZ[iY]->GetNbinsX();
231 int nBinsY = GLZ[iY]->GetNbinsY();
235 std::cout <<
"nBinsX = " << nBinsX <<
", nBinsY = " << nBinsY << std::endl;
250 int nBinsX = GL[0]->GetNbinsX();
251 int nBinsY = GL[0]->GetNbinsY();
255 std::cout <<
"nBinsX = " << nBinsX <<
", nBinsY = " << nBinsY << std::endl;
276 int nBinsX = GL[
ires]->GetNbinsX();
277 int nBinsY = GL[
ires]->GetNbinsY();
281 std::cout <<
"nBinsX = " << nBinsX <<
", nBinsY = " << nBinsY << std::endl;
301 for (
unsigned int i = 0;
i < GLZ.size();
i++) {
static double GLValue[6][1001][1001]
static bool debugMassResol_
static double ResMinMass[6]
A wrapper for the TH1D histogram to allow it to be put inside the same map as all the other classes i...
std::map< std::string, Histograms * > mapHisto_
The map of histograms.
A wrapper for the TProfile histogram to allow it to be put inside the same map as all the other class...
static double GLZNorm[40][1001]
void clearHistoMap()
Clean the histograms map.
static double ResMaxSigma[6]
static double GLZValue[40][1001][1001]
void writeHistoMap(const unsigned int iLoop)
Save the histograms map to file.
static bool rapidityBinsForZ_
void fillHistoMap(TFile *outputFile, unsigned int iLoop)
Create the histograms map.
std::vector< TFile * > theFiles_
The files were the histograms are saved.
static double GLNorm[6][1001]
A wrapper for the TH2D histogram to allow it to be put inside the same map as all the other classes i...
static std::vector< int > resfind
static double ResHalfWidth[6]
void readProbabilityDistributionsFromFile()
Read probability distributions from a local root file.
std::string probabilitiesFileInPath_
A set of histograms for resolution.
std::string probabilitiesFile_