35 , fRichRingMatches(NULL)
38 , fStsTrackMatches(NULL)
41 , fHistoList_richrings()
43 , fRichRings_nofRings(NULL)
44 , fRichRings_motherpdg(NULL)
45 , fRichRings_richpdg(NULL)
46 , fRichRings_electronspE(NULL)
47 , fRichRings_sourcePI0(NULL)
48 , fRichRings_test(NULL)
49 , fRichRings_detectedParticles(NULL)
50 , fRichRings_detParticlesMother(NULL)
51 , fRichRings_Aaxis(NULL)
52 , fRichRings_Aaxis_part1(NULL)
53 , fRichRings_Aaxis_part2(NULL)
54 , fRichRings_Aaxis_part3(NULL)
55 , fRichRings_Aaxis_electrons(NULL)
56 , fRichRings_Baxis(NULL)
57 , fRichRings_Baxis_part1(NULL)
58 , fRichRings_Baxis_part2(NULL)
59 , fRichRings_Baxis_part3(NULL)
60 , fRichRings_Baxis_electrons(NULL)
61 , fRichRings_radius(NULL)
62 , fRichRings_radius_electrons(NULL)
63 , fRichRings_radius_vs_momentum(NULL)
64 , fRichRings_radius_vs_pt(NULL)
65 , fRichRings_distance(NULL)
66 , fRichRings_distance_electrons(NULL)
68 , fhRichRings_AaxisVSmom(NULL)
69 , fhRichRings_BaxisVSmom(NULL)
70 , fhRichRings_test1(NULL)
71 , fhRichRings_test2(NULL)
72 , fhRichRings_test3(NULL)
73 , fhRichRings_test4(NULL)
74 , fhRichRings_test5(NULL)
75 , fhRichRings_test6(NULL)
76 , fhRichRings_pos(NULL)
77 , fhRichRings_protons(NULL)
78 , fhRichRings_protons2(NULL)
79 , fhRichRings_start(NULL)
90 FairRootManager* ioman = FairRootManager::Instance();
91 if (NULL == ioman) { Fatal(
"CbmAnaConversion::Init",
"RootManager not instantised!"); }
93 fRichPoints = (TClonesArray*) ioman->GetObject(
"RichPoint");
94 if (NULL ==
fRichPoints) { Fatal(
"CbmAnaConversion::Init",
"No RichPoint array!"); }
96 fMcTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
97 if (NULL ==
fMcTracks) { Fatal(
"CbmAnaConversion::Init",
"No MCTrack array!"); }
99 fStsTracks = (TClonesArray*) ioman->GetObject(
"StsTrack");
100 if (NULL ==
fStsTracks) { Fatal(
"CbmAnaConversion::Init",
"No StsTrack array!"); }
103 if (NULL ==
fStsTrackMatches) { Fatal(
"CbmAnaConversion::Init",
"No StsTrackMatch array!"); }
105 fGlobalTracks = (TClonesArray*) ioman->GetObject(
"GlobalTrack");
106 if (NULL ==
fGlobalTracks) { Fatal(
"CbmAnaConversion::Init",
"No GlobalTrack array!"); }
113 if (
nullptr ==
fPrimVertex) { LOG(fatal) <<
"No PrimaryVertex array!"; }
115 fRichRings = (TClonesArray*) ioman->GetObject(
"RichRing");
116 if (NULL ==
fRichRings) { Fatal(
"CbmAnaConversion::Init",
"No RichRing array!"); }
119 if (NULL ==
fRichRingMatches) { Fatal(
"CbmAnaConversion::Init",
"No RichRingMatch array!"); }
129 fTest =
new TH2D(
"fTest",
"fTest; X; Y", 200, -100, 100, 400, -200, 200);
135 fRichRings_nofRings =
new TH1D(
"fRichRings_nofRings",
"fRichRings_nofRings;nof rings per Event;#", 101, -0.5, 100.5);
136 fRichRings_motherpdg =
new TH1D(
"fRichRings_motherpdg",
"fRichRings_motherpdg;pdg code;#", 5002, -1.5, 5000.5);
137 fRichRings_richpdg =
new TH1D(
"fRichRings_richpdg",
"fRichRings_richpdg;pdg code;#", 5001, -0.5, 5000.5);
139 new TH1D(
"fRichRings_electronspE",
"fRichRings_electronspE;nof electrons per event;#", 60, -0.5, 59.5);
141 new TH1D(
"fRichRings_sourcePI0",
"fRichRings_sourcePI0;nof electrons from pi0;#", 60, -0.5, 59.5);
142 fRichRings_test =
new TH1D(
"fRichRings_test",
"fRichRings_test;nof electrons from pi0;#", 20, -0.5, 19.5);
165 new TH1D(
"fRichRings_detParticlesMother",
"fRichRings_detParticlesMother;;#", 22, 0., 22.);
205 fRichRings_Aaxis =
new TH1D(
"fRichRings_Aaxis",
"fRichRings_Aaxis;A-axis;#", 300, 0., 30.);
206 fRichRings_Aaxis_part1 =
new TH1D(
"fRichRings_Aaxis_part1",
"fRichRings_Aaxis_part1;A-axis;#", 300, 0., 30.);
207 fRichRings_Aaxis_part2 =
new TH1D(
"fRichRings_Aaxis_part2",
"fRichRings_Aaxis_part2;A-axis;#", 300, 0., 30.);
208 fRichRings_Aaxis_part3 =
new TH1D(
"fRichRings_Aaxis_part3",
"fRichRings_Aaxis_part3;A-axis;#", 300, 0., 30.);
210 new TH1D(
"fRichRings_Aaxis_electrons",
"fRichRings_Aaxis_electrons;A-axis;#", 300, 0., 30.);
211 fRichRings_Baxis =
new TH1D(
"fRichRings_Baxis",
"fRichRings_Baxis;B-axis;#", 300, 0., 30.);
212 fRichRings_Baxis_part1 =
new TH1D(
"fRichRings_Baxis_part1",
"fRichRings_Baxis_part1;B-axis;#", 300, 0., 30.);
213 fRichRings_Baxis_part2 =
new TH1D(
"fRichRings_Baxis_part2",
"fRichRings_Baxis_part2;B-axis;#", 300, 0., 30.);
214 fRichRings_Baxis_part3 =
new TH1D(
"fRichRings_Baxis_part3",
"fRichRings_Baxis_part3;B-axis;#", 300, 0., 30.);
216 new TH1D(
"fRichRings_Baxis_electrons",
"fRichRings_Baxis_electrons;B-axis;#", 300, 0., 30.);
217 fRichRings_radius =
new TH1D(
"fRichRings_radius",
"fRichRings_radius;radius;#", 300, 0., 30.);
219 new TH1D(
"fRichRings_radius_electrons",
"fRichRings_radius_electrons;radius;#", 300, 0., 30.);
221 "fRichRings_radius_vs_momentum;momentum;radius", 100, 0., 10., 300, 0., 30.);
223 new TH2D(
"fRichRings_radius_vs_pt",
"fRichRings_radius_vs_pt;pt;radius", 100, 0., 10., 300, 0., 30.);
224 fRichRings_distance =
new TH1D(
"fRichRings_distance",
"fRichRings_distance;distance;#", 500, 0., 5.);
226 new TH1D(
"fRichRings_distance_electrons",
"fRichRings_distance_electrons;distance;#", 500, 0., 5.);
227 fhRingtest =
new TH2D(
"fhRingtest",
"fhRingtest;momentum [GeV/c];radius [cm]", 200, 0., 10., 200, 0., 10.);
228 fhRichRings_AaxisVSmom =
new TH2D(
"fhRichRings_AaxisVSmom",
"fhRichRings_AaxisVSmom;momentum [GeV/c];a-axis [cm]",
229 200, 0., 10., 200, 0., 10.);
230 fhRichRings_BaxisVSmom =
new TH2D(
"fhRichRings_BaxisVSmom",
"fhRichRings_BaxisVSmom;momentum [GeV/c];b-axis [cm]",
231 200, 0., 10., 200, 0., 10.);
252 fhRichRings_test1 =
new TH1D(
"fRichRings_test1",
"fRichRings_test1;A-axis;#", 300, 0., 30.);
253 fhRichRings_test2 =
new TH1D(
"fRichRings_test2",
"fRichRings_test2;A-axis;#", 300, 0., 30.);
254 fhRichRings_test3 =
new TH1D(
"fRichRings_test3",
"fRichRings_test3;A-axis;#", 300, 0., 5.);
255 fhRichRings_test4 =
new TH1D(
"fRichRings_test4",
"fRichRings_test4;A-axis;#", 300, 0., 30.);
256 fhRichRings_test5 =
new TH1D(
"fRichRings_test5",
"fRichRings_test5;A-axis;#", 300, 0., 30.);
257 fhRichRings_test6 =
new TH1D(
"fRichRings_test6",
"fRichRings_test6;A-axis;#", 300, 0., 30.);
258 fhRichRings_pos =
new TH2D(
"fRichRings_pos",
"fRichRings_pos;x;y", 400, -200., 200., 400, -200., 200.);
269 fhRichRings_protons =
new TH2D(
"fhRichRings_protons",
"fhRichRings_protons;px;py", 1000, -10, 10, 1000, -10, 10);
271 fhRichRings_protons2 =
new TH1D(
"fhRichRings_protons2",
"fhRichRings_protons2;nof hits;#", 40, -0.5, 39.5);
275 fhRichRings_start =
new TH1D(
"fhRichRings_start",
"fhRichRings_start;z;#", 1000, 0, 100);
299 Int_t nofMC =
fMcTracks->GetEntriesFast();
300 cout <<
"CbmAnaConversionRich: nof mc tracks " << nofMC << endl;
304 for (
int i = 0; i < nofPoints; i++) {
306 if (point == NULL)
continue;
308 fTest->Fill(point->GetX(), point->GetY());
314 Int_t nofElectrons = 0;
324 Int_t nofRings =
fRichRings->GetEntriesFast();
326 for (
int i = 0; i < nofRings; i++) {
328 if (richRing == NULL)
continue;
338 cout <<
"CbmAnaConversionRich: nof global tracks " << nofGlobalTracks << endl;
339 for (
int iG = 0; iG < nofGlobalTracks; iG++) {
341 if (NULL == gTrack)
continue;
344 if (richInd < 0)
continue;
349 if (stsInd < 0)
continue;
351 if (stsTrack == NULL)
continue;
354 if (stsMatch == NULL)
continue;
356 if (stsMcTrackId < 0)
continue;
358 if (mcTrack1 == NULL)
continue;
361 if (richMatch == NULL)
continue;
363 if (richMcTrackId < 0)
continue;
365 if (mcTrack2 == NULL)
continue;
369 if (stsMcTrackId != richMcTrackId)
continue;
410 if (motherId != -1) {
412 motherpdg = TMath::Abs(mothermcTrack1->
GetPdgCode());
414 if (motherId == -1) {
416 if (pdg == 11) primEl++;
417 if (pdg == 13) primMu++;
418 if (pdg == 211) primPi++;
419 if (pdg == 321) primK++;
432 int grandmotherpdg = 0;
433 int grandmotherId = 0;
434 if (motherpdg == 22) {
436 if (grandmotherId != -1) {
438 grandmotherpdg = TMath::Abs(grandmothermcTrack1->
GetPdgCode());
440 if (grandmotherId == -1) { grandmotherpdg = -1; }
442 if (motherpdg == 111 || grandmotherpdg == 111) {
444 if (motherpdg == 111) { pi0ids.push_back(motherId); }
445 else if (grandmotherpdg == 111) {
446 pi0ids.push_back(grandmotherId);
456 TH1I* zwischenhisto =
new TH1I(
"zwischenhisto",
"zwischenhisto", 1000000, 0, 1000000);
457 for (
unsigned int i = 0; i < pi0ids.size(); i++) {
458 zwischenhisto->Fill(pi0ids[i]);
461 if (zwischenhisto->GetMaximum() >= 4) {
464 cout <<
"CbmAnaConversionRich: MAXIMUM BIN: " << zwischenhisto->GetMaximum() <<
"\t"
465 <<
"bin id: " << zwischenhisto->GetMaximumBin() - 1 << endl;
466 cout <<
"CbmAnaConversionRich: pdg code: " << pdg << endl;
467 cout <<
"CbmAnaConversionRich: \t";
469 std::sort(pi0ids.begin(), pi0ids.end());
470 for (
unsigned int i = 0; i < pi0ids.size(); i++) {
471 cout << pi0ids[i] <<
"\t";
475 cout <<
"CbmAnaConversionRich: number of electrons: " << nofElectrons <<
"\t e from pi0: " << sourcePI0
476 <<
"\t pi0ids size: " << pi0ids.size() << endl;
478 zwischenhisto->Delete();
481 int photoncounter = 0;
482 std::multimap<int, int> electronMap;
483 for (
unsigned int i = 0; i < pi0ids.size(); i++) {
484 electronMap.insert(std::pair<int, int>(pi0ids[i], i));
488 for (std::map<int, int>::iterator it = electronMap.begin(); it != electronMap.end(); ++it) {
489 if (it == electronMap.begin()) check = 1;
490 if (it != electronMap.begin()) {
491 std::map<int, int>::iterator zwischen = it;
494 int id_old = zwischen->first;
498 cout <<
"CbmAnaConversionRich: richmap - photon found " <<
id << endl;
512 for (Int_t iGTrack = 0; iGTrack < nGTracks; iGTrack++) {
514 if (NULL == gTrack)
continue;
517 if (richInd < 0)
continue;
518 if (stsInd < 0)
continue;
522 if (richMatch == NULL)
continue;
526 if (mctrack == NULL)
continue;
530 Double_t momentum = mctrack->
GetP();
532 Double_t axisA = richRing->
GetAaxis();
533 Double_t axisB = richRing->
GetBaxis();
552 if (
sqrt(ringX * ringX + (abs(ringY) - 105) * (abs(ringY) - 105)) <= 50) {
fhRichRings_test2->Fill(axisA); }
556 if (abs(ringX) <= 30 && abs(ringY) <= 130) {
560 if (abs(ringX) > 30 && abs(ringY) > 130 && abs(ringX) <= 70 && abs(ringY) <= 155) {
564 if (abs(ringX) > 70 && abs(ringY) > 155) {
627 vector<int> electronids;
632 for (
int iG = 0; iG < nofGlobalTracks; iG++) {
634 if (NULL == gTrack)
continue;
638 if (stsInd < 0)
continue;
641 if (stsTrack == NULL)
continue;
643 if (stsMatch == NULL)
continue;
646 if (stsMcTrackId < 0)
continue;
648 if (mcTrack1 == NULL)
continue;
675 int grandmotherpdg = 0;
678 int grandmotherId = 0;
680 if (motherId != -1) {
682 motherpdg = TMath::Abs(mothermcTrack1->
GetPdgCode());
684 else if (motherId == -1) {
689 if (motherpdg == 22) {
691 if (grandmotherId != -1) {
693 grandmotherpdg = TMath::Abs(grandmothermcTrack1->
GetPdgCode());
695 if (grandmotherId == -1) { grandmotherpdg = -1; }
698 if (motherpdg == 111) {
699 ids.push_back(motherId);
700 electronids.push_back(stsMcTrackId);
702 if (motherpdg == 22 && grandmotherpdg == 111) {
703 ids.push_back(grandmotherId);
704 electronids.push_back(stsMcTrackId);
709 cout <<
"CbmAnaConversionRich: vector ids contains " << ids.size() <<
" entries." << endl;
710 cout <<
"CbmAnaConversionRich: ids entries: ";
711 for (
unsigned int i = 0; i < ids.size(); i++) {
712 cout << ids[i] <<
" / ";
715 cout <<
"CbmAnaConversionRich: electronids entries: ";
716 for (
unsigned int i = 0; i < electronids.size(); i++) {
717 cout << electronids[i] <<
" / ";
721 int photoncounter = 0;
722 std::multimap<int, int> electronMap;
723 for (
unsigned int i = 0; i < ids.size(); i++) {
724 electronMap.insert(std::pair<int, int>(ids[i], i));
728 for (std::map<int, int>::iterator it = electronMap.begin(); it != electronMap.end(); ++it) {
729 if (it == electronMap.begin()) check = 1;
730 if (it != electronMap.begin()) {
731 std::map<int, int>::iterator zwischen = it;
734 int id_old = zwischen->first;
738 cout <<
"CbmAnaConversionRich: richmap - photon found " <<
id << endl;