CbmRoot
Loading...
Searching...
No Matches
CbmKresConversionGeneral.cxx
Go to the documentation of this file.
1/* Copyright (C) 2017-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Ievgenii Kres, Florian Uhlig [committer] */
4
18
19#include "CbmGlobalTrack.h"
20#include "CbmMCTrack.h"
21#include "CbmRichHit.h"
22#include "CbmRichPoint.h"
23#include "CbmRichRing.h"
25#include "CbmRichRingLight.h"
26#include "CbmRichUtil.h"
27#include "CbmStsTrack.h"
28#include "CbmTrackMatchNew.h"
29
30#include "FairRootManager.h"
31
32#include "TGraph.h"
33#include "TH1.h"
34#include "TH1D.h"
35#include "TH2D.h"
36#include "TH3D.h"
37#include "TProfile2D.h"
38
39#include <iostream>
40
41using namespace std;
42
44 : fMcTracks(nullptr)
45 , fGlobalTracks(nullptr)
46 , fStsTracks(nullptr)
47 , fStsTrackMatches(nullptr)
48 , fRichPoints(nullptr)
49 , fRichHits(nullptr)
50 , fRichRings(nullptr)
51 , fRichRingMatches(nullptr)
52 , fRichProjections(nullptr)
53 , fArrayCentrality(nullptr)
54 , fTauFit(nullptr)
55 , fMinAaxis(0.)
56 , fMaxAaxis(0.)
57 , fMinBaxis(0.)
58 , fMaxBaxis(0.)
59 , fMinRadius(0.)
60 , fMaxRadius(0.)
61 , fitt(nullptr)
62 , imageellipse(nullptr)
63 , imagehits(nullptr)
64 , fHistoList()
65 , fHistoList_MC()
66 , ForChristian_P_vs_R(nullptr)
67 , AllPoints2D(nullptr)
68 , AllPoints3D(nullptr)
69 , MC_PdgCodes(nullptr)
70 , MC_All_photons_Pt(nullptr)
71 , MC_Not_Direct_photons_Pt(nullptr)
72 , MC_Direct_photons_Pt(nullptr)
73 , MC_All_photons_P(nullptr)
74 , MC_Not_Direct_photons_P(nullptr)
75 , MC_Direct_photons_P(nullptr)
76 , MC_photons_mother_Pdg(nullptr)
77 , MC_Not_Direct_photons_theta(nullptr)
78 , MC_Not_Direct_photons_theta_vs_rap(nullptr)
79 , MC_Direct_photons_theta(nullptr)
80 , MC_Direct_photons_theta_vs_rap(nullptr)
81 , MC_Direct_photons_Pt_vs_rap(nullptr)
82 , MC_Direct_photons_Pt_vs_rap_est(nullptr)
83 , MC_electrons_Pt_vs_rap_est(nullptr)
84 , MC_Reconstructed_electrons_Pt_vs_rap_est(nullptr)
85 , MC_omega_Pt_vs_rap_est(nullptr)
86 , MC_pi0_Pt(nullptr)
87 , MC_pi0_Pt_est(nullptr)
88 , MC_pi0_Pt_vs_rap(nullptr)
89 , MC_pi0_Pt_vs_rap_primary(nullptr)
90 , Pi0_pt_vs_rap_est(nullptr)
91 , Pi0_pt_vs_rap_est_primary(nullptr)
92 , MC_pi0_theta(nullptr)
93 , MC_pi0_phi(nullptr)
94 , MC_pi0_Rapidity(nullptr)
95 , MC_pi0_theta_vs_rap(nullptr)
96 , MC_leptons_conversion_ZY(nullptr)
97 , MC_leptons_conversion_XY(nullptr)
98 , MC_leptons_conversion_XZ(nullptr)
99 , MC_leptons_from_pi0_start_vertex(nullptr)
100 , MC_leptons_from_pi0_P(nullptr)
101 , MC_eta_Pt(nullptr)
102 , MC_eta_Pt_vs_rap(nullptr)
103 , MC_eta_Pt_vs_rap_primary(nullptr)
104 , MC_eta_theta(nullptr)
105 , MC_eta_theta_vs_rap(nullptr)
106 , BoA_electrons(nullptr)
107 , BoA_1d_electrons(nullptr)
108 , A_1d_electrons(nullptr)
109 , B_1d_electrons(nullptr)
110 , A_electrons(nullptr)
111 , B_electrons(nullptr)
112 , NumberOfRings_electrons(nullptr)
113 , AllHits_electrons(nullptr)
114 , dR_electrons(nullptr)
115 , dR2d_electrons(nullptr)
116 , Distance_electron(nullptr)
117 , Distance_positron(nullptr)
118 , Tracks_electrons(nullptr)
119 , Rings_electrons(nullptr)
120 , fhBoverAXYZ(nullptr)
121 , fhBaxisXYZ(nullptr)
122 , fhAaxisXYZ(nullptr)
123 , fhdRXYZ(nullptr)
124 , Test_rings(nullptr)
125 , AllPointsPerPMT(nullptr)
126 , AllPointsPerPixel(nullptr)
127 , AllHits2D(nullptr)
128 , AllHits3D(nullptr)
129 , AllHitsPerPMT(nullptr)
130 , AllHitsPerPixel(nullptr)
131 , temporarygraph(nullptr)
132 , HitsPerPmtFullPlane(nullptr)
133 , HitsPerPmtFullMiddle(nullptr)
134{
135 // ranges for the good rings. A and B are major and minor axes of the ellipse.
136 fMinAaxis = 3.;
137 fMaxAaxis = 7.;
138 fMinBaxis = 3.;
139 fMaxBaxis = 7.;
140 fMinRadius = 3.;
141 fMaxRadius = 7.;
142}
143
145
147{
149
150 FairRootManager* ioman = FairRootManager::Instance();
151 if (nullptr == ioman) { Fatal("CbmKresConversionGeneral::Init", "RootManager not instantised!"); }
152
153 fMcTracks = (TClonesArray*) ioman->GetObject("MCTrack");
154 if (nullptr == fMcTracks) { Fatal("CbmKresConversionGeneral::Init", "No MCTrack array!"); }
155
156 fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
157 if (nullptr == fGlobalTracks) { Fatal("CbmKresConversionGeneral::Init", "No GlobalTrack array!"); }
158
159 fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
160 if (nullptr == fStsTracks) { Fatal("CbmKresConversionGeneral::Init", "No StsTrack array!"); }
161
162 fStsTrackMatches = (TClonesArray*) ioman->GetObject("StsTrackMatch");
163 if (nullptr == fStsTrackMatches) { Fatal("CbmKresConversionGeneral::Init", "No StsTrackMatch array!"); }
164
165 fRichPoints = (TClonesArray*) ioman->GetObject("RichPoint");
166 if (nullptr == fRichPoints) { Fatal("CbmKresConversionGeneral::Init", "No RichPoint array!"); }
167
168 fRichHits = (TClonesArray*) ioman->GetObject("RichHit");
169 if (nullptr == fRichHits) { Fatal("CbmKresConversionGeneral::Init", "No RichHit array!"); }
170
171 fRichRings = (TClonesArray*) ioman->GetObject("RichRing");
172 if (nullptr == fRichRings) { Fatal("CbmKresConversionGeneral::Init", "No RichRing array!"); }
173
174 fRichRingMatches = (TClonesArray*) ioman->GetObject("RichRingMatch");
175 if (nullptr == fRichRingMatches) { Fatal("CbmKresConversionGeneral::Init", "No RichRingMatch array!"); }
176
177 fRichProjections = (TClonesArray*) ioman->GetObject("RichProjection");
178 if (nullptr == fRichProjections) { Fatal("CbmKresConversionGeneral::Init", "No RichProjection array!"); }
179
180 fArrayCentrality = (FairMCEventHeader*) ioman->GetObject("MCEventHeader.");
181 if (nullptr == fArrayCentrality) { Fatal("CbmAnaConversion2::Init", "No fArrayCentrality array!"); }
182
184}
185
186
187void CbmKresConversionGeneral::Exec(int /*fEventNumGen*/)
188{
189 // cout << "CbmKresConversionGeneral, event No. " << fEventNumGen << endl;
190
191 // ========================================================================================
193 CbmRichRingLight ringPoint;
194 int nofRichPoints = fRichPoints->GetEntriesFast();
195 for (int i = 0; i < nofRichPoints; i++) {
196 CbmRichPoint* point = (CbmRichPoint*) fRichPoints->At(i);
197 if (point == nullptr) continue;
198 // cout << "Point: id = " << point->GetTrackID() << endl;
199 double xPOINT = point->GetX();
200 double yPOINT = point->GetY();
201 double zPOINT = point->GetZ();
202 AllPoints3D->Fill(xPOINT, yPOINT, zPOINT);
203 AllPoints2D->Fill(xPOINT, yPOINT);
204 AllPointsPerPMT->Fill(xPOINT, yPOINT);
205 AllPointsPerPixel->Fill(xPOINT, yPOINT);
206 }
208 // ========================================================================================
209
210 temporarygraph->Reset();
211 // ========================================================================================
213 int nofRichHits = fRichHits->GetEntriesFast();
214 for (int i = 0; i < nofRichHits; i++) {
215 CbmRichHit* hit = (CbmRichHit*) fRichHits->At(i);
216 if (hit == nullptr) continue;
217 // cout << "Hits: id = " << hit->GetRefId() << endl;
218 double xHIT = hit->GetX();
219 double yHIT = hit->GetY();
220 double zHIT = hit->GetZ();
221 AllHits3D->Fill(xHIT, yHIT, zHIT);
222 AllHits2D->Fill(xHIT, yHIT);
223 AllHitsPerPMT->Fill(xHIT, yHIT);
224 AllHitsPerPixel->Fill(xHIT, yHIT);
225 temporarygraph->Fill(xHIT, yHIT);
226 }
228 // ========================================================================================
229
230 for (int ix = 1; ix <= temporarygraph->GetNbinsX(); ix++) {
231 for (int iy = 1; iy <= temporarygraph->GetNbinsY(); iy++) {
232 if (temporarygraph->GetBinContent(ix, iy) == 0) continue;
233 HitsPerPmtFullPlane->Fill(temporarygraph->GetBinContent(ix, iy));
234 if (iy <= 6) HitsPerPmtFullMiddle->Fill(temporarygraph->GetBinContent(ix, iy));
235 }
236 }
237
238 // ========================================================================================
240 Int_t nofMcTracks = fMcTracks->GetEntriesFast();
241 for (int i = 0; i < nofMcTracks; i++) {
242 CbmMCTrack* mctrack = (CbmMCTrack*) fMcTracks->At(i);
243 if (mctrack == nullptr) continue;
244 // cout << "Track: id = " << i << "; pdg = " << mctrack->GetPdgCode() << "; motherID = " << mctrack->GetMotherId() << endl;
245 MC_PdgCodes->Fill(TMath::Abs(mctrack->GetPdgCode()));
246
247
248 //***** pi0 analysis
249 if (TMath::Abs(mctrack->GetPdgCode()) == 111) {
250 TVector3 v, momentum;
251 mctrack->GetStartVertex(v);
252 mctrack->GetMomentum(momentum);
253 MC_pi0_Pt->Fill(mctrack->GetPt());
254 MC_pi0_Rapidity->Fill(mctrack->GetRapidity());
255 if (mctrack->GetRapidity() > 1.2 && mctrack->GetRapidity() < 4.0) MC_pi0_Pt_est->Fill(mctrack->GetPt());
256 MC_pi0_Pt_vs_rap->Fill(mctrack->GetRapidity(), mctrack->GetPt());
257 Pi0_pt_vs_rap_est->Fill(mctrack->GetRapidity(), mctrack->GetPt());
258 if (mctrack->GetMotherId() == -1) {
259 MC_pi0_Pt_vs_rap_primary->Fill(mctrack->GetRapidity(), mctrack->GetPt());
260 Pi0_pt_vs_rap_est_primary->Fill(mctrack->GetRapidity(), mctrack->GetPt());
261 }
262 MC_pi0_theta->Fill(momentum.Theta() * 180. / TMath::Pi());
263 MC_pi0_phi->Fill(momentum.Phi() * 180. / TMath::Pi());
264 MC_pi0_theta_vs_rap->Fill(momentum.Theta() * 180. / TMath::Pi(), mctrack->GetRapidity());
265 }
266
267 //***** eta analysis
268 if (TMath::Abs(mctrack->GetPdgCode()) == 221) {
269 TVector3 v, momentum;
270 mctrack->GetStartVertex(v);
271 mctrack->GetMomentum(momentum);
272 MC_eta_Pt->Fill(mctrack->GetPt());
273 MC_eta_Pt_vs_rap->Fill(mctrack->GetRapidity(), mctrack->GetPt());
274 if (mctrack->GetMotherId() == -1) MC_eta_Pt_vs_rap_primary->Fill(mctrack->GetRapidity(), mctrack->GetPt());
275 MC_eta_theta->Fill(momentum.Theta() * 180. / TMath::Pi());
276 MC_eta_theta_vs_rap->Fill(momentum.Theta() * 180. / TMath::Pi(), mctrack->GetRapidity());
277 }
278
279 //***** photons analysis
280 if (mctrack->GetPdgCode() == 22) {
281 TVector3 v, momentum;
282 mctrack->GetStartVertex(v);
283 mctrack->GetMomentum(momentum);
284
285 MC_All_photons_Pt->Fill(mctrack->GetPt());
286 MC_All_photons_P->Fill(mctrack->GetP());
287 if (mctrack->GetMotherId() != -1) {
288 CbmMCTrack* mcTrackmama = (CbmMCTrack*) fMcTracks->At(mctrack->GetMotherId());
289 MC_photons_mother_Pdg->Fill(mcTrackmama->GetPdgCode());
290 MC_Not_Direct_photons_Pt->Fill(mctrack->GetPt());
291 MC_Not_Direct_photons_P->Fill(mctrack->GetP());
292 MC_Not_Direct_photons_theta->Fill(momentum.Theta() * 180. / TMath::Pi());
293 MC_Not_Direct_photons_theta_vs_rap->Fill(momentum.Theta() * 180. / TMath::Pi(), mctrack->GetRapidity());
294 }
295 if (mctrack->GetMotherId() == -1) {
296 MC_photons_mother_Pdg->Fill(mctrack->GetMotherId());
297 MC_Direct_photons_Pt->Fill(mctrack->GetPt());
298 MC_Direct_photons_P->Fill(mctrack->GetP());
299 MC_Direct_photons_Pt_vs_rap->Fill(mctrack->GetRapidity(), mctrack->GetPt());
300 MC_Direct_photons_Pt_vs_rap_est->Fill(mctrack->GetRapidity(), mctrack->GetPt());
301 MC_Direct_photons_theta->Fill(momentum.Theta() * 180. / TMath::Pi());
302 MC_Direct_photons_theta_vs_rap->Fill(momentum.Theta() * 180. / TMath::Pi(), mctrack->GetRapidity());
303 }
304 }
305
306 //***** electrons and positrons from -> gamma conversion -> pi0
307 if (TMath::Abs(mctrack->GetPdgCode()) == 11) {
308 int motherId = mctrack->GetMotherId();
309 MC_electrons_Pt_vs_rap_est->Fill(mctrack->GetRapidity(), mctrack->GetPt());
310 if (motherId == -1) continue;
311 CbmMCTrack* mother = (CbmMCTrack*) fMcTracks->At(motherId);
312 if (nullptr == mother) continue;
313 int grandmotherId = mother->GetMotherId();
314 if (grandmotherId == -1) continue;
315 CbmMCTrack* grandmother = (CbmMCTrack*) fMcTracks->At(grandmotherId);
316 if (nullptr == grandmother) continue;
317 int mcGrandmotherPdg = grandmother->GetPdgCode();
318 if (mcGrandmotherPdg == 111) {
319 MC_leptons_from_pi0_start_vertex->Fill(mctrack->GetStartZ(), mctrack->GetStartY());
320 MC_leptons_from_pi0_P->Fill(mctrack->GetP());
321 }
322 MC_leptons_conversion_ZY->Fill(mctrack->GetStartZ(), mctrack->GetStartY());
323 MC_leptons_conversion_XY->Fill(mctrack->GetStartX(), mctrack->GetStartY());
324 MC_leptons_conversion_XZ->Fill(mctrack->GetStartX(), mctrack->GetStartZ());
325 }
326
327 // omega
328 if (TMath::Abs(mctrack->GetPdgCode()) == 223) {
329 MC_omega_Pt_vs_rap_est->Fill(mctrack->GetRapidity(), mctrack->GetPt());
330 }
331 }
333 // ========================================================================================
334
335
338 // ========================================================================================
339 Int_t ngTracks = fGlobalTracks->GetEntriesFast();
340 for (Int_t iTr = 0; iTr < ngTracks; iTr++) {
341 CbmGlobalTrack* gTrack = (CbmGlobalTrack*) fGlobalTracks->At(iTr);
342 if (nullptr == gTrack) continue;
343 int stsInd = gTrack->GetStsTrackIndex();
344 int richInd = gTrack->GetRichRingIndex();
345
346 // ========================================================================================
348 if (stsInd < 0) continue;
349 CbmStsTrack* stsTrack = (CbmStsTrack*) fStsTracks->At(stsInd);
350 if (stsTrack == nullptr) continue;
351 CbmTrackMatchNew* stsMatch =
352 (CbmTrackMatchNew*) fStsTrackMatches->At(stsInd);
353 if (stsMatch == nullptr) continue;
354 if (stsMatch->GetNofLinks() <= 0) continue;
355 int stsMcTrackId = stsMatch->GetMatchedLink().GetIndex();
356 if (stsMcTrackId < 0) continue;
357 CbmMCTrack* mcTrackSTS = (CbmMCTrack*) fMcTracks->At(stsMcTrackId);
358 if (mcTrackSTS == nullptr) continue;
359 int pdgSTS = mcTrackSTS->GetPdgCode();
360
362 if (TMath::Abs(mcTrackSTS->GetPdgCode()) == 11 || TMath::Abs(mcTrackSTS->GetPdgCode()) == 211) {
363 if (richInd >= 0) {
364 CbmRichRing* richRing = (CbmRichRing*) fRichRings->At(richInd);
365 if (richRing == nullptr) continue;
366 CbmTrackMatchNew* richMatch = (CbmTrackMatchNew*) fRichRingMatches->At(richInd);
367 if (richMatch == nullptr) continue;
368 if (richMatch->GetNofLinks() <= 0) continue;
369 int richMcTrackId = richMatch->GetMatchedLink().GetIndex();
370 if (richMcTrackId < 0) continue;
371 CbmMCTrack* mcTrackRICH = (CbmMCTrack*) fMcTracks->At(richMcTrackId);
372 if (mcTrackRICH == nullptr) continue;
373 int pdgRICH = mcTrackRICH->GetPdgCode();
374 if (TMath::Abs(pdgRICH) != 11 && TMath::Abs(pdgRICH) != 211) continue;
375 if (stsMcTrackId != richMcTrackId) continue;
376 ForChristian_P_vs_R->Fill(mcTrackSTS->GetP(), richRing->GetRadius());
377 }
378 }
379
380 if (TMath::Abs(pdgSTS) != 11) continue;
381
382
383 Tracks_electrons->Fill(1);
385 // ========================================================================================
386
387 // ========================================================================================
389 if (richInd < 0) continue;
390 CbmRichRing* richRing = (CbmRichRing*) fRichRings->At(richInd);
391 if (richRing == nullptr) continue;
392 CbmTrackMatchNew* richMatch =
393 (CbmTrackMatchNew*) fRichRingMatches->At(richInd);
394 if (richMatch == nullptr) continue;
395 if (richMatch->GetNofLinks() <= 0) continue;
396 int richMcTrackId = richMatch->GetMatchedLink().GetIndex();
397 if (richMcTrackId < 0) continue;
398 CbmMCTrack* mcTrackRICH = (CbmMCTrack*) fMcTracks->At(richMcTrackId);
399 if (mcTrackRICH == nullptr) continue;
400 int pdgRICH = mcTrackRICH->GetPdgCode();
401 if (TMath::Abs(pdgRICH) != 11) continue;
403 // ========================================================================================
404
405 if (stsMcTrackId != richMcTrackId) continue;
406
407 Rings_electrons->Fill(1);
408
409 // ========================================================================================
411 CbmRichRingLight ringHit;
412 int nofHits = richRing->GetNofHits();
413 for (int i = 0; i < nofHits; i++) {
414 Int_t hitInd = richRing->GetHit(i);
415 CbmRichHit* hit = (CbmRichHit*) fRichHits->At(hitInd);
416 if (nullptr == hit) continue;
417 CbmRichHitLight hl(hit->GetX(), hit->GetY());
418 ringHit.AddHit(hl);
419 }
420 FitAndFillHistEllipse(&ringHit); // fit hits with ellipse
421
422 if (ringHit.GetAaxis() > fMinAaxis && ringHit.GetAaxis() < fMaxAaxis && ringHit.GetBaxis() > fMinBaxis
423 && ringHit.GetAaxis() < fMaxBaxis) {
424 if (mcTrackRICH->GetPdgCode() == -11)
425 Distance_positron->Fill(richRing->GetCenterX(), richRing->GetCenterY(), CbmRichUtil::GetRingTrackDistance(iTr));
426 if (mcTrackRICH->GetPdgCode() == 11)
427 Distance_electron->Fill(richRing->GetCenterX(), richRing->GetCenterY(), CbmRichUtil::GetRingTrackDistance(iTr));
428 double a = ringHit.GetAaxis();
429 double b = ringHit.GetBaxis();
430 double p = ringHit.GetPhi();
431 double xc = ringHit.GetCenterX();
432 double yc = ringHit.GetCenterY();
433 BoA_electrons->Fill(xc, yc, b / a);
434 BoA_1d_electrons->Fill(b / a);
435 A_1d_electrons->Fill(a);
436 B_1d_electrons->Fill(b);
437 A_electrons->Fill(xc, yc, a);
438 B_electrons->Fill(xc, yc, b);
439 NumberOfRings_electrons->Fill(xc, yc);
440
441 fhBoverAXYZ->Fill(xc, yc, b / a);
442 fhBaxisXYZ->Fill(xc, yc, b);
443 fhAaxisXYZ->Fill(xc, yc, a);
444
445 MC_Reconstructed_electrons_Pt_vs_rap_est->Fill(mcTrackRICH->GetRapidity(), mcTrackRICH->GetPt());
446
447 // ding a closest position of the ring to the hit
448 double minAngle = 0.;
449 double maxAngle = 2 * 3.14159265358979323846;
450 double stepAngle = 0.01;
451 for (int iH = 0; iH < ringHit.GetNofHits(); iH++) {
452 double xh = ringHit.GetHit(iH).fX;
453 double yh = ringHit.GetHit(iH).fY;
454 AllHits_electrons->Fill(xh, yh);
455 double Lmin = 50.;
456 double xmin = 0.;
457 double ymin = 0.;
458 for (double iT = minAngle; iT < maxAngle; iT = iT + stepAngle) {
459 double xEll = a * cos(iT) * cos(p) - b * sin(iT) * sin(p) + xc;
460 double yEll = a * cos(iT) * sin(p) + b * sin(iT) * cos(p) + yc;
461 double L = sqrt((xh - xEll) * (xh - xEll) + (yh - yEll) * (yh - yEll));
462 if (L < Lmin) {
463 Lmin = L;
464 xmin = xEll;
465 ymin = yEll;
466 }
467 }
468 Double_t sign = sqrt((xmin - xc) * (xmin - xc) + (ymin - yc) * (ymin - yc))
469 - sqrt((xh - xc) * (xh - xc) + (yh - yc) * (yh - yc));
470 double dr = Lmin;
471 if (sign < 0) { dr = -Lmin; }
472 dR_electrons->Fill(dr);
473 dR2d_electrons->Fill(xc, yc, dr);
474 fhdRXYZ->Fill(xc, yc, dr);
475 }
476 }
478 // ========================================================================================
479 }
481 // ========================================================================================
482}
483
485
486
488{
489 BoA_electrons->SetMaximum(1.);
490 BoA_electrons->SetMinimum(0.8);
491 A_electrons->SetMaximum(5.5);
492 A_electrons->SetMinimum(4.);
493 B_electrons->SetMaximum(5.);
494 B_electrons->SetMinimum(4.);
495 dR2d_electrons->SetMaximum(0.35);
496 dR2d_electrons->SetMinimum(0.15);
497 Distance_electron->SetMaximum(2.);
498 Distance_electron->SetMinimum(0.);
499 Distance_positron->SetMaximum(2.);
500 Distance_positron->SetMinimum(0.);
501
502 gDirectory->mkdir("General");
503 gDirectory->cd("General");
504 gDirectory->mkdir("MC_info");
505 gDirectory->cd("MC_info");
506 for (size_t i = 0; i < fHistoList_MC.size(); i++) {
507 fHistoList_MC[i]->Write();
508 }
509 gDirectory->cd("..");
510 for (size_t i = 0; i < fHistoList.size(); i++) {
511 fHistoList[i]->Write();
512 }
513 gDirectory->cd("..");
514}
515
516
518{
519 //***** photons analysis
521 new TH1D("MC_All_photons_Pt", "Monte Carlo, all #gamma, p_{t} distribution; p_{t} in GeV/c", 200, 0, 2);
523
524 MC_Not_Direct_photons_Pt = new TH1D(
525 "MC_Not_Direct_photons_Pt", "Monte Carlo, #gamma from decays, p_{t} distribution; p_{t} in GeV/c", 200, 0, 2);
527
529 new TH1D("MC_Direct_photons_Pt", "Monte Carlo, direct #gamma, p_{t} distribution; p_{t} in GeV/c", 200, 0, 2);
531
533 new TH1D("MC_All_photons_P", "Monte Carlo, all #gamma, p distribution; p in GeV/c", 1000, 0, 10);
535
537 new TH1D("MC_Not_Direct_photons_P", "Monte Carlo, #gamma from decays, p distribution; p in GeV/c", 1000, 0, 10);
539
541 new TH1D("MC_Direct_photons_P", "Monte Carlo, direct #gamma, p distribution; p in GeV/c", 1000, 0, 10);
543
544 MC_Direct_photons_Pt_vs_rap = new TH2D("MC_Direct_photons_Pt_vs_rap",
545 "Monte Carlo, direct #gamma, p_{t} vs rapidity distribution; "
546 "rapidity y; p_{t} in GeV/c ",
547 90, -2., 7., 60, -1., 5.);
549
550 MC_Direct_photons_Pt_vs_rap_est = new TH2D("MC_Direct_photons_Pt_vs_rap_est",
551 "Monte Carlo, direct #gamma, p_{t} vs rapidity distribution; "
552 "rapidity y; p_{t} in GeV/c ",
553 10, 0., 4., 40, 0., 4.);
555
556 MC_photons_mother_Pdg = new TH1D("MC_photons_mother_Pdg", "MC_photons_mother_Pdg; Id;#", 2500, -10, 2511);
558
559 MC_Not_Direct_photons_theta = new TH1D("MC_Not_Direct_photons_theta",
560 "Monte Carlo, #gamma from decays, #theta distribution; "
561 "emission angle #theta in deg;Entries",
562 180., 0., 180.);
564
565 MC_Not_Direct_photons_theta_vs_rap = new TH2D("MC_Not_Direct_photons_theta_vs_rap",
566 "Monte Carlo, #gamma from decays, #theta vs rapidity "
567 "distribution; emission angle #theta in deg; rapidity y",
568 180., 0., 180., 270, -2., 7.);
570
571 MC_Direct_photons_theta = new TH1D("MC_Direct_photons_theta",
572 "Monte Carlo, direct #gamma, #theta distribution; emission "
573 "angle #theta in deg;Entries",
574 180., 0., 180.);
576
577 MC_Direct_photons_theta_vs_rap = new TH2D("MC_Direct_photons_theta_vs_rap",
578 "Monte Carlo, direct #gamma, #theta vs rapidity distribution; "
579 "emission angle #theta in deg; rapidity y",
580 180., 0., 180., 270, -2., 7.);
582
583 MC_electrons_Pt_vs_rap_est = new TH2D("MC_electrons_Pt_vs_rap_est",
584 "Monte Carlo, direct e, p_{t} vs rapidity distribution; "
585 "rapidity y; p_{t} in GeV/c ",
586 10, 0., 4., 40, 0., 4.);
588
589 MC_Reconstructed_electrons_Pt_vs_rap_est = new TH2D("MC_Reconstructed_electrons_Pt_vs_rap_est",
590 "Monte Carlo, reconstructed e, p_{t} vs rapidity "
591 "distribution; rapidity y; p_{t} in GeV/c ",
592 10, 0., 4., 40, 0., 4.);
594
595 MC_omega_Pt_vs_rap_est = new TH2D("MC_omega_Pt_vs_rap_est",
596 "Monte Carlo, #omega, p_{t} vs rapidity distribution; "
597 "rapidity y; p_{t} in GeV/c ",
598 10, 0., 4., 40, 0., 4.);
600
601
602 //***** pi0 analysis
603 MC_pi0_Pt =
604 new TH1D("MC_pi0_Pt", "Monte Carlo, #pi^{0}, p_{t} distribution;p_{t} in GeV/c; Entries", 200., 0., 10.);
605 fHistoList_MC.push_back(MC_pi0_Pt);
606
608 new TH1D("MC_pi0_Pt_est", "Monte Carlo, #pi^{0}, p_{t} distribution;p_{t} in GeV/c; Entries", 20., 0., 2.);
609 fHistoList_MC.push_back(MC_pi0_Pt_est);
610
611 MC_pi0_Pt_vs_rap = new TH2D("MC_pi0_Pt_vs_rap",
612 "Monte Carlo, #pi^{0}, p_{t} vs rapidity "
613 "distribution; rapidity y; p_{t} in GeV/c ",
614 90, -2., 7., 60, -1., 5.);
616
617 MC_pi0_Pt_vs_rap_primary = new TH2D("MC_pi0_Pt_vs_rap_primary",
618 "Monte Carlo, primary #pi^{0}, p_{t} vs rapidity "
619 "distribution; rapidity y; p_{t} in GeV/c ",
620 90, -2., 7., 60, -1., 5.);
622
624 new TH2D("Pi0_pt_vs_rap_est", "Pi0_pt_vs_rap_est; rapidity y; p_{t} in GeV/c ", 10, 0., 4., 40, 0., 4.);
626
627 Pi0_pt_vs_rap_est_primary = new TH2D(
628 "Pi0_pt_vs_rap_est_primary", "Pi0_pt_vs_rap_est_primary; rapidity y; p_{t} in GeV/c ", 10, 0., 4., 40, 0., 4.);
630
631 MC_pi0_theta = new TH1D("MC_pi0_theta",
632 "Monte Carlo, #pi^{0}, #theta distribution; "
633 "emission angle #theta in deg;Entries",
634 180., 0., 180.);
635 fHistoList_MC.push_back(MC_pi0_theta);
636
637 MC_pi0_phi = new TH1D("MC_pi0_phi",
638 "Monte Carlo, #pi^{0}, #phi distribution; emission "
639 "angle #phi in deg; Entries",
640 180., -180., 180.);
641 fHistoList_MC.push_back(MC_pi0_phi);
642
643 MC_pi0_Rapidity = new TH1D("MC_pi0_Rapidity",
644 "Monte Carlo, #pi^{0}, #rapidity distribution; emission angle "
645 "#phi in deg; Entries",
646 90, -2., 7.);
648
649 MC_pi0_theta_vs_rap = new TH2D("MC_pi0_theta_vs_rap",
650 "Monte Carlo, #pi^{0}, #theta vs rapidity distribution; "
651 "emission angle #theta in deg; rapidity y",
652 180., 0., 180., 270, -2., 7.);
654
656 new TH2D("MC_leptons_conversion_ZY", "Start vertices of leptons coming from #gamma; z[cm]; y[cm]", 800, -1, 400,
657 880, -220, 220);
660 new TH2D("MC_leptons_conversion_XY", "Start vertices of leptons coming from #gamma; x[cm]; y[cm]", 1200, -300, 300,
661 880, -220, 220);
664 new TH2D("MC_leptons_conversion_XZ", "Start vertices of leptons coming from #gamma; x[cm]; z[cm]", 1200, -300, 300,
665 800, -1, 400);
667
669 new TH2D("MC_leptons_from_pi0_start_vertex", "Start vertices of leptons coming from #pi^{0}; z[cm]; y[cm]", 200, -1,
670 100, 200, -50, 50);
672
673 MC_leptons_from_pi0_P = new TH1D("MC_leptons_from_pi0_P", "MC_leptons_from_pi0_P; P_{e} in GeV/c", 200, 0, 5);
675
676 //***** eta analysis
677 MC_eta_Pt = new TH1D("MC_eta_Pt", "Monte Carlo, #eta, p_{t} distribution; p_{t} in GeV/c;Entries", 200., 0., 10.);
678 fHistoList_MC.push_back(MC_eta_Pt);
679
680 MC_eta_Pt_vs_rap = new TH2D("MC_eta_Pt_vs_rap",
681 "Monte Carlo, #eta, p_{t} vs rapidity "
682 "distribution; rapidity y; p_{t} in GeV/c ",
683 90, -2., 7., 60, -1., 5.);
685
686 MC_eta_Pt_vs_rap_primary = new TH2D("MC_eta_Pt_vs_rap_primary",
687 "Monte Carlo, primary #eta, p_{t} vs rapidity distribution; "
688 "rapidity y; p_{t} in GeV/c ",
689 90, -2., 7., 60, -1., 5.);
691
692 MC_eta_theta = new TH1D("MC_eta_theta",
693 "Monte Carlo, #eta, #theta distribution; "
694 "emission angle #theta in deg; Entries",
695 180., 0., 180.);
696 fHistoList_MC.push_back(MC_eta_theta);
697
698 MC_eta_theta_vs_rap = new TH2D("MC_eta_theta_vs_rap",
699 "Monte Carlo, #eta, #theta vs rapidity distribution; emission "
700 "angle #theta in deg; rapidity y",
701 180., 0., 180., 270, -2., 7.);
703
704 //***** RICH analysis: A, B, dR, points, hits
706 new TH2D("ForChristian_P_vs_R", "ForChristian_P_vs_R; P [GeV]; R [cm]; Nof", 100, 0, 10, 100, 0, 8);
708
709 AllPoints2D = new TH2D("AllPoints2D", "AllPoints2D; X [cm]; Y [cm]; Nof", 300, -150, 150, 120, 120, 240);
710 fHistoList.push_back(AllPoints2D);
711
713 new TH3D("AllPoints3D", "AllPoints3D; X [cm]; Y [cm]; Z [cm]", 300, -150, 150, 120, 120, 240, 100, 160, 260);
714 fHistoList.push_back(AllPoints3D);
715
716 MC_PdgCodes = new TH1D("MC_PdgCodes", "All PdgCodes from Monte Carlo; PDG code", 3500, 0, 3500);
717 fHistoList.push_back(MC_PdgCodes);
718
719 BoA_electrons = new TProfile2D("BoA_electrons", "B/A for electrons; X [cm]; Y [cm]", 60, -150, 150, 20, 120, 220);
720 fHistoList.push_back(BoA_electrons);
721
722 A_1d_electrons = new TH1D("A_1d_electrons", "A for electrons; A [cm]", 200, 3., 7.);
723 fHistoList.push_back(A_1d_electrons);
724
725 B_1d_electrons = new TH1D("B_1d_electrons", "B for electrons; B [cm]", 200, 3., 7.);
726 fHistoList.push_back(B_1d_electrons);
727
728 BoA_1d_electrons = new TH1D("BoA_1d_electrons", "BoA for electrons; B/A", 250, 0.5, 1.);
729 fHistoList.push_back(BoA_1d_electrons);
730
731 Tracks_electrons = new TH1D("Tracks_electrons", "Electron tracks in STS", 3, -0.5, 2.5);
732 fHistoList.push_back(Tracks_electrons);
733
734 Rings_electrons = new TH1D("Rings_electrons", "Electron tracks in STS+RICH", 3, -0.5, 2.5);
735 fHistoList.push_back(Rings_electrons);
736
737 A_electrons = new TProfile2D("A_electrons", "A for electrons; X [cm]; Y [cm]", 60, -150, 150, 20, 120, 220);
738 fHistoList.push_back(A_electrons);
739
740 B_electrons = new TProfile2D("B_electrons", "B for electrons; X [cm]; Y [cm]", 60, -150, 150, 20, 120, 220);
741 fHistoList.push_back(B_electrons);
742
743 NumberOfRings_electrons = new TH2D("NumberOfRings_electrons", "Number of rings from electrons; X [cm]; Y [cm]; Nof",
744 60, -150, 150, 20, 120, 220);
746
747 AllHits_electrons = new TH2D("AllHits_electrons", "Hits from electrons after unfolding; X [cm]; Y [cm]; Nof", 300,
748 -150, 150, 120, 120, 240);
749 fHistoList.push_back(AllHits_electrons);
750
751 dR_electrons = new TH1D("dR_electrons", "dR for electrons; dR [cm]", 100, -2., 2.);
752 fHistoList.push_back(dR_electrons);
753
755 new TProfile2D("dR2d_electrons", "dR for electrons; X [cm]; Y [cm]", 60, -150, 150, 20, 120, 220, 0, 1);
756 fHistoList.push_back(dR2d_electrons);
757
758 Distance_electron = new TProfile2D("Distance_electron",
759 "Distance between projected track and center of the ring "
760 "for electrons; X [cm];Y [cm]; Nof",
761 60, -150, 150, 20, 120, 220);
762 fHistoList.push_back(Distance_electron);
763
764 Distance_positron = new TProfile2D("Distance_positron",
765 "Distance between projected track and center of the ring "
766 "for positrons; X [cm];Y [cm]; Nof",
767 60, -150, 150, 20, 120, 220);
768 fHistoList.push_back(Distance_positron);
769
770 fhBoverAXYZ = new TH3D("fhBoverAXYZ", "fhBoverAXYZ; X [cm]; Y [cm]; B/A", 60, -150, 150, 20, 120, 220, 50, 0., 1.);
771 fHistoList.push_back(fhBoverAXYZ);
772 fhBaxisXYZ = new TH3D("fhBaxisXYZ", "fhBaxisXYZ; X [cm]; Y [cm]; B [cm]", 60, -150, 150, 20, 120, 220, 80, 3., 7.);
773 fHistoList.push_back(fhBaxisXYZ);
774 fhAaxisXYZ = new TH3D("fhAaxisXYZ", "fhAaxisXYZ; X [cm]; Y [cm]; A [cm]", 60, -150, 150, 20, 120, 220, 80, 3., 7.);
775 fHistoList.push_back(fhAaxisXYZ);
776 fhdRXYZ = new TH3D("fhdRXYZ", "fhdRXYZ; X [cm]; Y [cm]; dR [cm]", 60, -150, 150, 20, 120, 220, 100, -1., 1.);
777 fHistoList.push_back(fhdRXYZ);
778
779 Test_rings = new TH2D("Test_rings", "Test_rings", 60, -150, 150, 20, 120, 220);
780 fHistoList.push_back(Test_rings);
781
782 AllPointsPerPMT = new TH2D("AllPointsPerPMT", "AllPointsPerPMT; X [cm]; Y [cm]; Nof", 41, -105, 105, 17, 125, 210);
783 fHistoList.push_back(AllPointsPerPMT);
785 new TH2D("AllPointsPerPixel", "AllPointsPerPixel; X [cm]; Y [cm]; Nof", 350, -105, 105, 142, 125, 210);
786 fHistoList.push_back(AllPointsPerPixel);
787 AllHitsPerPMT = new TH2D("AllHitsPerPMT", "AllHitsPerPMT; X [cm]; Y [cm]; Nof", 41, -105, 105, 17, 125, 210);
788 fHistoList.push_back(AllHitsPerPMT);
789 AllHitsPerPixel = new TH2D("AllHitsPerPixel", "AllHitsPerPixel; X [cm]; Y [cm]; Nof", 350, -105, 105, 142, 125, 210);
790 fHistoList.push_back(AllHitsPerPixel);
791
792 AllHits2D = new TH2D("AllHits2D", "AllHits2D; X [cm]; Y [cm]; Nof", 300, -150, 150, 120, 120, 240);
793 fHistoList.push_back(AllHits2D);
794 AllHits3D = new TH3D("AllHits3D", "AllHits3D; X [cm]; Y [cm]; Z [cm]", 300, -150., 150, 120, 120, 240, 100, 160, 260);
795 fHistoList.push_back(AllHits3D);
796
797 temporarygraph = new TH2D("temporarygraph", "temporarygraph; X [cm]; Y [cm]; Nof", 41, -105, 105, 17, 125, 210);
798 fHistoList.push_back(temporarygraph);
800 new TH1D("HitsPerPmtFullPlane", "Number of hits per PMT. Distribution for all PMTs; Nof photons", 50, -0.5, 49.5);
802 HitsPerPmtFullMiddle = new TH1D("HitsPerPmtFullMiddle",
803 "Number of hits per PMT. Distribution for all PMT in "
804 "y={125#;155}, x={-105#;105}; Nof photons",
805 50, -0.5, 49.5);
807
808 fitt = new TH2D("fitt", "fitt; x; y", 500, -110, 110, 50, 100, 200);
809 fHistoList.push_back(fitt);
810
811 imagehits = new TGraph(10);
812 imageellipse = new TGraph(10);
813}
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
Data class for STS tracks.
friend fvec sqrt(const fvec &a)
friend fvec cos(const fvec &a)
friend fvec sin(const fvec &a)
fscal v[fmask::Size]
Definition KfSimdPseudo.h:4
int32_t GetStsTrackIndex() const
int32_t GetRichRingIndex() const
double GetZ() const
Definition CbmHit.h:71
CbmRichRingFitterEllipseTau * fTauFit
void FitAndFillHistEllipse(CbmRichRingLight *ring)
double GetPt() const
Definition CbmMCTrack.h:97
double GetP() const
Definition CbmMCTrack.h:98
void GetMomentum(TVector3 &momentum) const
Definition CbmMCTrack.h:170
double GetStartZ() const
Definition CbmMCTrack.h:75
int32_t GetMotherId() const
Definition CbmMCTrack.h:69
double GetStartX() const
Definition CbmMCTrack.h:73
int32_t GetPdgCode() const
Definition CbmMCTrack.h:68
double GetStartY() const
Definition CbmMCTrack.h:74
double GetRapidity() const
void GetStartVertex(TVector3 &vertex) const
Definition CbmMCTrack.h:176
int32_t GetNofLinks() const
Definition CbmMatch.h:42
const CbmLink & GetMatchedLink() const
Definition CbmMatch.h:41
double GetY() const
Definition CbmPixelHit.h:74
double GetX() const
Definition CbmPixelHit.h:73
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
virtual void DoFit(CbmRichRingLight *ring)
Inherited from CbmRichRingFitterBase.
float GetCenterX() const
float GetAaxis() const
float GetCenterY() const
float GetPhi() const
int GetNofHits() const
Return number of hits in ring.
float GetBaxis() const
CbmRichHitLight GetHit(int ind)
Return hit by the index.
void AddHit(CbmRichHitLight hit)
Add new hit to the ring.
uint32_t GetHit(int32_t i) const
Definition CbmRichRing.h:39
float GetRadius() const
Definition CbmRichRing.h:79
int32_t GetNofHits() const
Definition CbmRichRing.h:37
float GetCenterX() const
Definition CbmRichRing.h:77
float GetCenterY() const
Definition CbmRichRing.h:78
static double GetRingTrackDistance(int globalTrackId)
Hash for CbmL1LinkKey.