13 #include "TClonesArray.h"
28 #include <boost/assign/list_of.hpp>
31 using boost::assign::list_of;
40 fRichRingMatches(NULL),
41 fRichProjections(NULL),
47 fh_nof_rings_1hit(NULL),
48 fh_nof_rings_7hits(NULL),
49 fh_nof_rings_prim_1hit(NULL),
50 fh_nof_rings_prim_7hits(NULL),
51 fh_nof_rings_target_1hit(NULL),
52 fh_nof_rings_target_7hits(NULL),
54 fh_gamma_target_mom(NULL),
55 fh_gamma_nontarget_mom(NULL),
59 fh_nof_hits_per_event(NULL),
62 fh_hitrate_xy_u(NULL),
63 fh_hitrate_xy_d(NULL),
64 fh_nof_proj_per_event(NULL),
78 cout <<
"CbmRichUrqmdTest::Init"<<endl;
80 if (NULL == ioman) { Fatal(
"CbmRichUrqmdTest::Init",
"RootManager not instantised!"); }
83 if ( NULL ==
fRichHits) { Fatal(
"CbmRichUrqmdTest::Init",
"No RichHit array!"); }
86 if ( NULL ==
fRichRings) { Fatal(
"CbmRichUrqmdTest::Init",
"No RichRing array!"); }
89 if ( NULL ==
fRichPoints) { Fatal(
"CbmRichUrqmdTest::Init",
"No RichPoint array!"); }
92 if ( NULL ==
fMcTracks) { Fatal(
"CbmRichUrqmdTest::Init",
"No MCTrack array!"); }
95 if ( NULL ==
fRichRingMatches) { Fatal(
"CbmRichUrqmdTest::Init",
"No RichRingMatch array!"); }
98 if ( NULL ==
fRichProjections) { Fatal(
"CbmRichUrqmdTest::Init",
"No fRichProjections array!"); }
110 cout <<
"CbmRichUrqmdTest, event No. " <<
fEventNum << endl;
123 fh_vertex_z =
new TH1D(
"fh_vertex_z",
"fh_vertex_z;z [cm];Number of vertices per event", 200, -1., 200);
124 fh_nof_rings_1hit =
new TH1D(
"fh_nof_rings_1hit",
"fh_nof_rings_1hit;Number of detected particles/event;Yield", 100, -.5, 99.5);
125 fh_nof_rings_7hits =
new TH1D(
"fh_nof_rings_7hits",
"fh_nof_rings_7hits;Number of detected particles/event;Yield", 100, -.5, 99.5 );
126 fh_nof_rings_prim_1hit =
new TH1D(
"fh_nof_rings_prim_1hit",
"fh_nof_rings_prim_1hit;Number of detected particles/event;Yield", 50, -.5, 49.5);
127 fh_nof_rings_prim_7hits =
new TH1D(
"fh_nof_rings_prim_7hits",
"fh_nof_rings_prim_7hits;Number of detected particles/event;Yield", 50, -.5, 49.5 );
128 fh_nof_rings_target_1hit =
new TH1D(
"fh_nof_rings_target_1hit",
"fh_nof_rings_target_1hit;Number of detected particles/event;Yield", 60, -.5, 59.5);
129 fh_nof_rings_target_7hits =
new TH1D(
"fh_nof_rings_target_7hits",
"fh_nof_rings_target_7hits;Number of detected particles/event;Yield", 60, -.5, 59.5 );
131 fh_secel_mom =
new TH1D(
"fh_secel_mom",
"fh_secel_mom;p [GeV/c];Number per event", 100, 0., 20);
132 fh_gamma_target_mom =
new TH1D(
"fh_gamma_target_mom",
"fh_gamma_target_mom;p [GeV/c];Number per event", 100, 0., 20);
133 fh_gamma_nontarget_mom =
new TH1D(
"fh_gamma_nontarget_mom",
"fh_gamma_nontarget_mom;p [GeV/c];Number per event", 100, 0., 20);
134 fh_pi_mom =
new TH1D(
"fh_pi_mom",
"fh_pi_mom;p [GeV/c];Number per event", 100, 0., 20);
135 fh_kaon_mom =
new TH1D(
"fh_pi_mom",
"fh_pi_mom;p [GeV/c];Number per event", 100, 0., 20);
136 fh_mu_mom =
new TH1D(
"fh_mu_mom",
"fh_mu_mom;p [GeV/c];Number per event", 100, 0., 20);
138 fh_nof_hits_per_event =
new TH1D(
"fh_nof_hits_per_event",
"fh_nof_hits_per_event;Number of hits per event;Yield", 50, 0, 1500);
139 fh_hits_xy_u =
new TH2D(
"fh_hits_xy_u",
"fh_hits_xy_u;x [cm];y [cm];Number of hits/cm^{2}/event", 110, -110, 110, 45, 90, 180);
140 fh_hits_xy_d =
new TH2D(
"fh_hits_xy_d",
"fh_hits_xy_d;x [cm];y [cm];Number of hits/cm^{2}/event", 110, -110, 110, 45, -180, -90);
143 fh_hitrate_xy_u =
new TH2D(
"fh_hitrate_xy_u",
"fh_hitrate_xy_u;x [cm];y [cm];Number of hits/pixel/s", 184, -110, 110, 75, 90, 180);
144 fh_hitrate_xy_d =
new TH2D(
"fh_hitrate_xy_d",
"fh_hitrate_xy_d;x [cm];y [cm];Number of hits/pixel/s", 184, -110, 110, 75, -180, -90);
146 fh_nof_proj_per_event =
new TH1D(
"fh_nof_proj_per_event",
"fh_nof_proj_per_event;Number of tracks per event;Yield", 50, 200, 600);
147 fh_proj_xy_u =
new TH2D(
"fh_proj_xy_u",
"fh_proj_xy_u;x [cm];y [cm];Number of tracks/cm^{2}/event", 220, -110, 110, 90, 90, 180);
148 fh_proj_xy_d =
new TH2D(
"fh_proj_xy_d",
"fh_proj_xy_d;x [cm];y [cm];Number of tracks/cm^{2}/event", 220, -110, 110, 90, -180, -90);
154 Int_t nofRichHits =
fRichHits->GetEntriesFast();
155 for (Int_t iHit=0; iHit < nofRichHits; iHit++) {
157 if (NULL == hit)
continue;
160 if (iPoint < 0)
continue;
163 if (NULL == point)
continue;
167 if (NULL == track)
continue;
170 if (iMother == -1)
continue;
178 Int_t nofRings =
fRichRings->GetEntriesFast();
179 int nRings1hit = 0, nRings7hits = 0;
180 int nRingsPrim1hit = 0, nRingsPrim7hits = 0;
181 int nRingsTarget1hit = 0, nRingsTarget7hits = 0;
182 for (Int_t iR = 0; iR < nofRings; iR++){
184 if (NULL == ring)
continue;
186 if (NULL == ringMatch)
continue;
188 if (mcTrackId < 0)
continue;
190 if (NULL == mcTrack)
continue;
196 double dZ = vert.Z();
198 if (motherId == -1 && pdg == 11)
continue;
201 if (nofHits >= 1) nRings1hit++;
204 if (motherId == -1 && nofHits >= 1) nRingsPrim1hit++;
205 if (motherId == -1 && nofHits >=
fMinNofHits) nRingsPrim7hits++;
207 if (dZ < 0.1 && nofHits >= 1) nRingsTarget1hit++;
208 if (dZ < 0.1 && nofHits >=
fMinNofHits) nRingsTarget7hits++;
211 if (motherId != -1) {
214 if (NULL != mother) motherPdg = mother->
GetPdgCode();
215 if (motherId != -1 && pdg == 11 && motherPdg != 22)
fh_secel_mom->Fill(mom);
217 if (motherId != -1 && pdg == 11 && motherPdg == 22){
243 int nofHits =
fRichHits->GetEntriesFast();
244 int nofNoiseHits = 0;
245 int nofHitsUrqmd = 0;
247 for (
int i = 0; i < nofHits; i++) {
249 if (NULL == hit)
continue;
258 if (NULL == point)
continue;
262 if (NULL == track)
continue;
265 if (iMother == -1)
continue;
268 if (NULL == track2)
continue;
271 if (motherId == -1 && pdg == 11){
276 double x = hit->
GetX();
277 double y = hit->
GetY();
290 cout <<
"nofHits = " << nofHits << endl;
291 cout <<
"nofNoiseHits = " << nofNoiseHits << endl;
292 cout <<
"nofHitsUrqmd = " << nofHitsUrqmd << endl;
293 cout <<
"nofHitsEl = " << nofHitsEl << endl;
300 for (
int i = 0; i < nofProj; i++){
302 if (NULL == proj)
continue;
303 double x = proj->
GetX();
304 double y = proj->
GetY();
310 if (proj->
GetX() != 0 && proj->
GetY() != 0) nofGoodProj++;
320 for (
int i = 0; i < nMcTracks; i++){
336 TCanvas* cVertex =
CreateCanvas(
"rich_urqmd_vertex_z",
"rich_urqmd_vertex_z", 800, 800);
340 TCanvas*
c2 =
CreateCanvas(
"rich_urqmd_nof_rings",
"rich_urqmd_nof_rings", 800, 800);
345 cout <<
"Mean nof rings per event (1 hit) = " <<
fh_nof_rings_1hit->GetMean() << endl;
346 cout <<
"Mean nof rings per event (7 hits) = " <<
fh_nof_rings_7hits->GetMean() << endl;
348 TCanvas*
c3 =
CreateCanvas(
"rich_urqmd_nof_rings_prim",
"rich_urqmd_nof_rings_prim", 800, 800);
356 TCanvas* cTarget =
CreateCanvas(
"rich_urqmd_nof_rings_target",
"rich_urqmd_nof_rings_target", 800, 800);
365 TCanvas*
c4 =
CreateCanvas(
"rich_urqmd_sources_mom",
"rich_urqmd_sources_mom", 800, 800);
373 list_of(
"e^{#pm}_{target} from #gamma")(
"e^{#pm}_{not target} from #gamma")(
"e^{#pm}_{sec} other")(
"#pi^{#pm}")(
"K^{#pm}")(
"#mu^{#pm}"),
384 TCanvas *
c5 =
CreateCanvas(
"rich_urqmd_hits_xy",
"rich_urqmd_hits_xy", 800, 800);
386 cout <<
"binArea = " << binArea << endl;
395 gPad->SetLeftMargin(0.1);
396 gPad->SetRightMargin(0.15);
401 gPad->SetLeftMargin(0.1);
402 gPad->SetRightMargin(0.15);
404 TCanvas*
c6 =
CreateCanvas(
"rich_urqmd_nof_hits_per_event",
"rich_urqmd_nof_hits_per_event", 800, 800);
409 TCanvas *cHitRate =
CreateCanvas(
"rich_urqmd_hitrate_xy",
"rich_urqmd_hitrate_xy", 800, 800);
412 cHitRate->Divide(1, 2);
417 gPad->SetLeftMargin(0.1);
418 gPad->SetRightMargin(0.15);
423 gPad->SetLeftMargin(0.1);
424 gPad->SetRightMargin(0.15);
426 TCanvas *c7 =
CreateCanvas(
"rich_urqmd_proj_xy",
"rich_urqmd_proj_xy", 800, 800);
434 gPad->SetLeftMargin(0.1);
435 gPad->SetRightMargin(0.15);
440 gPad->SetLeftMargin(0.1);
441 gPad->SetRightMargin(0.15);
443 TCanvas* c8 =
CreateCanvas(
"rich_urqmd_nof_proj_per_event",
"rich_urqmd_nof_proj_per_event", 800, 800);
452 for (Int_t i = 0; i <
fHists.size(); i++){
465 TCanvas*
c =
new TCanvas(name.c_str(), title.c_str(),
width, height);
472 for (
int i = 0; i <
fCanvas.size(); i++)