64#if !(!defined(__CLING__) || defined(__MAKECLING__))
69 const Int_t nColors = 16;
70 Int_t ColorMap[nColors] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 49, 11, 12, 13, 14, 15, 16};
81 const TString drawExpPseudoRapEve =
82 TString(
"-log(") +
"MCTrack.GetPt()" +
"/(" +
"MCTrack.fPz + " +
"MCTrack.GetP()" +
"))";
86 const TString drawExpPseudoRapDst =
TString(
"-log(") +
"sqrt(" +
"sq(BmnGlobalTrack.fParamFirst.fTx) + "
87 +
"sq(BmnGlobalTrack.fParamFirst.fTy)" +
")/(" +
"1 + sqrt(" +
"1 + "
88 +
"sq(BmnGlobalTrack.fParamFirst.fTx) + " +
"sq(BmnGlobalTrack.fParamFirst.fTy)"
90 const TString drawExpPDst =
TString(
"1/BmnGlobalTrack.fParamFirst.fQp");
91 const TString drawExpNHitsDst =
TString(
"BmnGlobalTrack.GetNHits()>>");
95 TString eveEmb =
Form(
"merged-%d-qgsm-4h-isAll.root", runID);
97 TString dstLam =
"dst-lam.root";
98 TString dstEmb =
"dst-emb.root";
101 TString exHitNames[
nDetTypes] = {
"BmnGemStripHit",
"BmnSiliconHit",
"BmnCSCHit"};
104 TString valueName[
ROWS] = {
"eta",
"momentum",
"eta_momentum_eve",
"eta_momentum_dst",
"mult"};
105 TString valueShow[
ROWS] = {
"\\eta",
"P",
"\\eta X P",
"\\eta\\ X\\ P",
"NHits"};
110 TClass* hitsMCClasses[
nDetTypes] = {CbmStsPoint::Class(), BmnSiliconPoint::Class(), BmnCSCPoint::Class()};
126 vector<vector<PadInfo*>> pads;
174 for (
auto& pad : pads[iCase]) {
178 for (
Int_t iVal = 0; iVal <
ROWS; iVal++) {
184 TH1* h = (iVal == 2 || iVal == 3)
186 pName[iParticle].
Data()),
187 Form(
"%s\\ %s", pName[iParticle].Data(), valueShow[iVal].Data()),
190 pName[iParticle].
Data()),
191 Form(
"%s\\ %s", pName[iParticle].Data(), valueShow[iVal].Data()),
193 if (iVal == 2 || iVal == 3)
194 pads[iCase][iVal *
nParticles + iParticle]->opt =
"colz";
196 if (!
i || (!
i && iVal == 2) || (
i && iVal == 3))
197 pads[iCase][iVal *
nParticles + iParticle]->current = h;
199 pads[iCase][iVal *
nParticles + iParticle]->ref = h;
211 printf(
"case %d\n", iCase);
212 filesMC[iCase] =
new TFile(namesMC[iCase].Data(),
"READ");
213 if (filesMC[iCase]->IsOpen())
214 printf(
"file %s opened\n", namesMC[iCase].Data());
216 fprintf(stderr,
"file %s open error\n", namesMC[iCase].Data());
219 filesEx[iCase] =
new TFile(namesEx[iCase].Data(),
"READ");
220 if (filesEx[iCase]->IsOpen())
221 printf(
"file %s opened\n", namesEx[iCase].Data());
223 fprintf(stderr,
"file %s open error\n", namesEx[iCase].Data());
226 treesMC[iCase] = (
TTree*)filesMC[iCase]->Get(treeName.
Data());
227 treesEx[iCase] = (
TTree*)filesEx[iCase]->Get(treeName.
Data());
246 if (pads[iCase][
i]->current)
248 if (pads[iCase][
i]->ref)
259 TString cond =
Form(
"MCTrack.fPdgCode==%d", pdg[iParticle]);
260 TString drawExp = drawExpPseudoRapEve +
">>" + pads[iCase][iParticle]->current->GetName();
261 treesMC[iCase]->
Draw(drawExp.
Data(), cond.
Data(),
"goff");
262 drawExp =
TString((iParticle ?
"-" :
"")) + drawExpPEve +
">>"
263 + pads[iCase][
nParticles + iParticle]->current->GetName();
264 treesMC[iCase]->
Draw(drawExp.
Data(), cond.
Data(),
"goff");
265 drawExp = drawExpPseudoRapEve +
":" +
TString((iParticle ?
"-" :
"")) + drawExpPEve +
">>"
266 + pads[iCase][2 *
nParticles + iParticle]->current->GetName();
267 treesMC[iCase]->
Draw(drawExp.
Data(), cond.
Data(),
"goff");
269 cond =
TString(
"BmnGlobalTrack.GetP()") + (pdg[iParticle] > 0 ?
">" :
"<") +
"0";
270 drawExp = drawExpPseudoRapDst +
">>" + pads[iCase][iParticle]->ref->GetName();
271 treesEx[iCase]->
Draw(drawExp.
Data(), cond.
Data(),
"goff");
272 drawExp = drawExpPDst +
">>" + pads[iCase][
nParticles + iParticle]->ref->GetName();
273 treesEx[iCase]->
Draw(drawExp.
Data(), cond.
Data(),
"goff");
274 drawExp = drawExpPseudoRapDst +
":" +
TString((iParticle ?
"-" :
"")) + drawExpPDst +
">>"
275 + pads[iCase][3 *
nParticles + iParticle]->current->GetName();
276 treesEx[iCase]->
Draw(drawExp.
Data(), cond.
Data(),
"goff");
293 Int_t TrackID = stsPoint->GetTrackID();
294 if (TrackID != iTrack)
301 pads[iCase][4 *
nParticles + iParticle]->current->Fill(nHits);
320 if (track->GetSilTrackIndex() != -1)
321 silTr = (
BmnTrack*)exTracksSil[iCase]->UncheckedAt(track->GetSilTrackIndex());
325 if (track->
GetP() * (pdg[iParticle]) > 0) {
331 if (track->GetCscHitIndex() > -1)
334 pads[iCase][4 *
nParticles + iParticle]->ref->Fill(nHits);
354 DrawRef(cans[iCase], &pads[iCase]);
355 cans[iCase]->
SaveAs(
Form(
"can-emb-%d.png", iCase));
371 filesMC[iCase]->
Close();
373 filesEx[iCase]->
Close();