FairRoot/PandaRoot
analysis_point_hit_fwendcap.C
Go to the documentation of this file.
1 {
2  gROOT->LoadMacro("$VMCWORKDIR/macro/mvd/Tools.C");
3  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
4 
5  TFile* fsim = new TFile("../../emc_complete_1GeVphoton_FwEndCap.root");
6 
7  TTree *tsim=(TTree *) fsim->Get("pndsim") ;
8  TClonesArray* mctrack_array=new TClonesArray("PndMCTrack");
9  tsim->SetBranchAddress("MCTrack",&mctrack_array);
10 
11  // -----Point -----
12  TClonesArray* point_array=new TClonesArray("PndEmcPoint");
13  tsim->SetBranchAddress("EmcPoint",&point_array);
14 
15  // -----Hit -----
16  TClonesArray* hit_array=new TClonesArray("PndEmcHit");
17  tsim->SetBranchAddress("EmcHit",&hit_array);
18 
21  x_p, y_p, z_p, module_p,
24 
25  TVector3 photon_momentum;
26  TLorentzVector p4mom;
27 
28  TH2F *hypad_xpad_p = new TH2F("ypad_xpad","crystal row vs col number (derived from POINT)",74,-37,37,74,-37,37);
29  TH2F *hx_y_p = new TH2F("x_y_p","x vs y (derived from POINT)",1000,-100,100,1000,-100,100);
30  TH1F *hid_p = new TH1F("id_p","id (derived from POINT)",140000000,300000000,340000000);
31  TH1F *hx_p = new TH1F("x_p","X (derived from POINT)",200,-100,100);
32  TH1F *hy_p = new TH1F("y_p","Y (derived from POINT)",200,-100,100);
33  TH1F *hz_p = new TH1F("z_p","Z (derived from POINT)",100,200,300);
34  TH1F *hmodule_p = new TH1F("module_p","Module (derived from POINT)",5,0.5,5.5);
35 
36  TH2F *hxpad_x_p = new TH2F("xpad_x_p","x vs xpad (derived from POINT)",2*37.5,-37.5,37.5,211,-105,105);
37  TH2F *hypad_y_p = new TH2F("ypad_y_p","y vs ypad (derived from POINT)",2*37.5,-37.5,37.5,211,-105,105);
38 
39  //--------- Energy: HITS & DIGIS ----------------------------------------------------------
40  TH1F *hene_mc= new TH1F("hene_mc","MC energy (GeV)",100,0.0,1.05);
41  TH1F *hene_p= new TH1F("hene_p","DATA energy (GeV)",1000,0.0,0.1);
42 
43  TH1F *hpoi_ene= new TH1F("hpoi_ene","SUM of Point energies (GeV)",100,0.0,1.05);
44  TH1F *hpoi_ene11_12= new TH1F("hpoi_ene11_12","crystal [11,12] dep. energy (GeV)",100,0.0001,0.2);
45  TH1F *hpoi_ene12_12= new TH1F("hpoi_ene12_12","crystal [12,12] dep. energy (GeV)",100,0.0001,0.2);
46  TH1F *hpoi_ene13_12= new TH1F("hpoi_ene13_12","crystal [13,12] dep. energy (GeV)",100,0.0001,0.2);
47  TH1F *hpoi_ene14_12= new TH1F("hpoi_ene14_12","crystal [14,12] dep. energy (GeV)",100,0.0001,0.2);
48 
49 
50  //--------- Theta & Phi (reconstructed & real): CLUSTER -----------------------------------
51  TH1F *h10= new TH1F("h10","POINT Theta (MC)",180,0.,180.);
52  TH1F *h20= new TH1F("h20","POINT Phi (MC)",360,0.,360.);
53  TH1F *h10d= new TH1F("h10d","POINT Theta (data)",180,0.,180.);
54  TH1F *h20d= new TH1F("h20d","POINT Phi (data)",360,0.,360.);
55 
56  TH1F *h1= new TH1F("h1","POINT Theta difference",100,-2.,2.);
57  TH1F *h2= new TH1F("h2","POINT Phi difference",100,-2.,2.);
58 
59  Int_t ncounts = tsim->GetEntriesFast();
60  cout << "Number of events = " << ncounts<< endl;
61  //ncounts=2000; //in case you want to analyse specific number of events
62 /*
63  Double_t crystalDepEnergy[36][37];
64  for (Int_t i=0; i<=35; i++) //presetting of variables
65  for (Int_t j=0; j<=36; j++)
66  crystalDepEnergy[i][j]=0;
67 
68  Int_t totalpoints=0;//counter on the total number of MC points in all events
69  for(int j = 0; j < ncounts; j++){ //loop repeated per event
70  tsim->GetEntry(j);
71  Int_t npoints = point_array->GetEntries(); //number of points per event
72  if (npoints>=1) //in case you want to analyse only the first interaction point per event
73  {npoints = 1;
74  totalpoints+=npoints;
75  }
76  }
77  cout<<"totalpoints = "<<totalpoints<<"\n";
78 
79  Double_t x[totalpoints], xx[totalpoints], y[totalpoints], yy[totalpoints], zz[totalpoints];//here xx,yy,zz represent the point position WHILE x and y represent the column and row numbers, respectively
80  //columns 3,7,11,15,19,23,27,31,35 are critical columns & rows 2,6,10,14,18,22,26,30,34 are critical rows:
81  Double_t z3[totalpoints], z7[totalpoints], z11[totalpoints], z15[totalpoints], z19[totalpoints], z23[totalpoints], z27[totalpoints], z31[totalpoints], z35[totalpoints];//z-positions for the "x_point vs column number"
82  Double_t z2[totalpoints], z6[totalpoints], z10[totalpoints], z14[totalpoints], z18[totalpoints], z22[totalpoints], z26[totalpoints], z30[totalpoints], z34[totalpoints];//z-positions for the "y_point vs row number"
83  for (Int_t k=0; k<totalpoints; k++) {//presetting variables
84  z3[k]=z7[k]=z11[k]=z15[k]=z19[k]=z23[k]=z27[k]=z31[k]=z35[k]=0;
85  z2[k]=z6[k]=z10[k]=z14[k]=z18[k]=z22[k]=z26[k]=z30[k]=z34[k]=0;
86  }
87  Int_t ii=0; //counter on the number of points per event (increases up until "totalpoints")
88  //Double_t x3[totalpoints]=0;
89  //Double_t y3[totalpoints]=0;
90 
91  for(int j = 0; j < ncounts; j++){
92  Double_t sum_point_ene=0;
93  tsim->GetEntry(j);
94 
95  PndMCTrack *mctrack=(PndMCTrack *) mctrack_array->At(0); // 1st element in mctrack_array
96  photon_momentum=mctrack->GetMomentum();
97  theta_mc=photon_momentum.Theta()*(180./TMath::Pi());
98  phi_mc=photon_momentum.Phi()*(180./TMath::Pi());
99  //p4mom=mctrack->Get4Momentum();
100 
101  Int_t npoints = point_array->GetEntries();
102  //cout << "point_array size= " << npoints << endl;
103  if (npoints>=1) //in case you want to analyse only the first interaction point per event
104  npoints = 1;
105 
106  for (Int_t i=0; i<npoints; i++) //loop repeated per MC point
107  {
108  PndEmcPoint *point=(PndEmcPoint*)point_array->At(i); // get the i-th point of the event
109  module_p = point->GetModule();
110 
111  if (module_p==3){
112  //hene_mc->Fill(p4mom.E());
113  point_ene=point->GetEnergyLoss();
114  hene_p->Fill(point_ene);
115  sum_point_ene+=point_ene;
116 
117  TVector3 point_pos(point->GetX(),point->GetY(),point->GetZ());
118  point_theta=point_pos.Theta()*(180./TMath::Pi());
119  point_phi=point_pos.Phi()*(180./TMath::Pi());
120 
121  h10->Fill(theta_mc);
122  h20->Fill(phi_mc);
123  h10d->Fill(point_theta);
124  h20d->Fill(point_phi);
125  h1->Fill(point_theta-theta_mc);
126  h2->Fill(point_phi-phi_mc);
127 
128  id_p = point->GetDetectorID();
129  crystal_pid = -(id_p%10000 - 36); // crystal column number (see PndEmcPoint.cxx)
130  row_pid = (id_p/1000000)%100 - 37; // crystal row number
131 
132  x_p = point->GetX();
133  y_p = point->GetY();
134  z_p = point->GetZ();
135 
137  zz[ii]=z_p;
138  xx[ii]=x_p;
139  yy[ii]=y_p;
140  if (point->GetXPad() < 0)
141  x[ii]=point->GetXPad() + 1;
142  else
143  x[ii]=point->GetXPad();
144  if (point->GetYPad() < 0)
145  y[ii]=point->GetYPad() + 1;
146  else
147  y[ii]=point->GetYPad();
148 
149 
150  if (x[ii]==3) // && fabs(y[ii])>8
151  {
152  z3[ii]=z_p;
153  //x3[ii]=x_p;
154  //y3[ii]=y_p;
155  }
156  else if (x[ii]==7)
157  z7[ii]=z_p;
158  else if (x[ii]==11)
159  z11[ii]=z_p;
160  else if (x[ii]==15)
161  z15[ii]=z_p;
162  else if (x[ii]==19)
163  z19[ii]=z_p;
164  else if (x[ii]==23)
165  z23[ii]=z_p;
166  else if (x[ii]==27)
167  z27[ii]=z_p;
168  else if (x[ii]==31)
169  z31[ii]=z_p;
170 
171  if (y[ii]==2) // && fabs(x[ii])>15
172  z2[ii]=z_p;
173  else if (y[ii]==6)
174  z6[ii]=z_p;
175  else if (y[ii]==10)
176  z10[ii]=z_p;
177  else if (y[ii]==14)
178  z14[ii]=z_p;
179  else if (y[ii]==18)
180  z18[ii]=z_p;
181  else if (y[ii]==22)
182  z22[ii]=z_p;
183  else if (y[ii]==26)
184  z26[ii]=z_p;
185  else if (y[ii]==30)
186  z30[ii]=z_p;
187  else if (y[ii]==34)
188  z34[ii]=z_p;
189 
190  ii+=1;
192  hz_p->Fill(z_p);
193  hxpad_x_p->Fill(point->GetXPad(),x_p);
194  hypad_y_p->Fill(point->GetYPad(),y_p);
195  hypad_xpad_p->Fill(point->GetXPad(),point->GetYPad());
196  hmodule_p->Fill(module_p);
197  hx_p->Fill(x_p);
198  hy_p->Fill(y_p);
199  hx_y_p->Fill(x_p,y_p);
200  hid_p->Fill(id_p);
201 
202  if (crystal_pid == 11 && row_pid == 12) // deposited energy per event in the crystal[col=11,row=12]
203  crystalDepEnergy[11][12]+=point_ene;
204  else if (crystal_pid == 12 && row_pid == 12)
205  crystalDepEnergy[12][12]+=point_ene;
206  else if (crystal_pid == 13 && row_pid == 12)
207  crystalDepEnergy[13][12]+=point_ene;
208  else if (crystal_pid == 14 && row_pid == 12)
209  crystalDepEnergy[14][12]+=point_ene;
210  }
211  }
212  hpoi_ene->Fill(sum_point_ene); // deposited energy per event in the whole FwEndCap
213  hpoi_ene11_12->Fill(crystalDepEnergy[11][12]);
214  hpoi_ene12_12->Fill(crystalDepEnergy[12][12]);
215  hpoi_ene13_12->Fill(crystalDepEnergy[13][12]);
216  hpoi_ene14_12->Fill(crystalDepEnergy[14][12]);
217 
218  crystalDepEnergy[11][12]=crystalDepEnergy[12][12]=crystalDepEnergy[13][12]=crystalDepEnergy[14][12]=0;
219  }
220  */
222  Int_t module_h, id_h, crystal_hid, row_hid;
223  TH1F *HISTene_h= new TH1F("HISTene_h","energy (hit)",1000,0.0001,1.01); // deposited energy per hit in the whole FwEndCap
224  TH1F *HISThit_ene= new TH1F("HISThit_ene","FwEndCap energy (hit)",1000,0.0,1.05); // deposited energy per event in the whole FwEndCap
225  TH1F *HISTz_h = new TH1F("HISTz_h","z (hit)",100,200,300);
226  TH2F *HISTrow_x_h = new TH2F("HISTrow_x_h","row vs x (hit)",200,-100,100,2*38.5,-38.5,38.5);
227  TH2F *HISTrow_crystal_h = new TH2F("HISTrow_crystal_h","row vs column (hit)",2*38.5,-38.5,38.5,2*38.5,-38.5,38.5);
228  TH2F *HISTy_x_h = new TH2F("HISTy_x_h","y vs x (hit)",211,-105,105,211,-105,105); // y- versus x-position of the center of the hit crystal
229  TH1F *HISTtheta_h = new TH1F("HISTtheta_h","theta (hit)",180,0,180); // theta of the
230  TH2I *HISTxpad_x_h = new TH2I("HISTxpad_x_h","",10500,-105,105,100*38.5,-38.5,38.5);
231  TH2I *HISTypad_y_h = new TH2I("HISTypad_y_h","",10500,-105,105,100*38.5,-38.5,38.5);
232 
233  //TH1F *HISTid_h = new TH1F("HISTid_h","id (HIT)",140000000,300000000,340000000);
234  TH1F *HISTOhit_ene11_12= new TH1F("HISTOhit_ene11_12","crystal [11,12] dep. energy (GeV)",100,0.0001,1.01);
235  TH1F *HISTOhit_ene12_12= new TH1F("HISTOhit_ene12_12","crystal [12,12] dep. energy (GeV)",100,0.0001,1.01);
236  TH1F *HISTOhit_ene13_12= new TH1F("HISTOhit_ene13_12","crystal [13,12] dep. energy (GeV)",100,0.0001,1.01);
237  TH1F *HISTOhit_ene14_12= new TH1F("HISTOhit_ene14_12","crystal [14,12] dep. energy (GeV)",100,0.0001,1.01);
238 
239 
240  Int_t totalhits=0; //counter on the total number of hits (fired detectors) in all events
241  Int_t efficiencyCounter=0;
243  for(int j = 0; j < ncounts; j++){
244  Int_t efficiencyFlag=0;
246  Double_t sum_hit_ene=0;
247 
248  tsim->GetEntry(j);
249 
250  PndMCTrack *mctrack=(PndMCTrack *) mctrack_array->At(0);
251  photon_momentum=mctrack->GetMomentum();
252  theta_mc=photon_momentum.Theta()*(180./TMath::Pi());
253  phi_mc=photon_momentum.Phi()*(180./TMath::Pi());
254  //p4mom=mctrack->Get4Momentum();
255 
256  Int_t nhits = hit_array->GetEntries();
257  totalhits+=nhits;
258  if (nhits!=0)
259  atLeastOneHitPerEventFlag = 1;
260 
261  for (Int_t i=0; i<nhits; i++)
262  {
263  PndEmcHit *hit=(PndEmcHit*)hit_array->At(i); // get the i-th hit (detector) of the event
264  module_h = hit->GetModule();
265 
266  if (module_h==3){
267  //hene_mc->Fill(p4mom.E());
268  hit_ene=hit->GetEnergy();
269  HISTene_h->Fill(hit_ene);
270  if (hit_ene >= 0.010) // 10 MeV threshold used (here only) to calculate the efficiency of the FwEndCap geometry
271  efficiencyFlag = 1;
272 
273 
274  //filling some histograms for a few crystals
275  if (hit->GetXPad()==11 && hit->GetYPad()==12)
276  HISTOhit_ene11_12->Fill(hit_ene);
277  else if (hit->GetXPad()==12 && hit->GetYPad()==12)
278  HISTOhit_ene12_12->Fill(hit_ene);
279  else if (hit->GetXPad()==13 && hit->GetYPad()==12)
280  HISTOhit_ene13_12->Fill(hit_ene);
281  else if (hit->GetXPad()==14 && hit->GetYPad()==12)
282  HISTOhit_ene14_12->Fill(hit_ene);
283 
284  sum_hit_ene+=hit_ene;
285 
286  TVector3 hit_pos(hit->GetX(),hit->GetY(),hit->GetZ()); // position of the center of the hit crystal
287  hit_theta=hit_pos.Theta()*(180./TMath::Pi());
288  hit_phi=hit_pos.Phi()*(180./TMath::Pi());
289 
290  h10->Fill(theta_mc);
291  h20->Fill(phi_mc);
292  h10d->Fill(hit_theta);
293  h20d->Fill(hit_phi);
294  h1->Fill(hit_theta-theta_mc);
295  h2->Fill(hit_phi-phi_mc);
296 
297  HISTz_h->Fill(hit->GetZ());
298  if (hit->GetXPad() >= 1)
299  HISTxpad_x_h->Fill(hit->GetX(),hit->GetXPad()-1);
300  else
301  HISTxpad_x_h->Fill(hit->GetX(),hit->GetXPad());
302 
303  if (hit->GetYPad() >= 1)
304  HISTypad_y_h->Fill(hit->GetY(),hit->GetYPad()-1);
305  else
306  HISTypad_y_h->Fill(hit->GetY(),hit->GetYPad());
307 
308  if (hit->GetYPad() >= 1)
309  HISTrow_x_h->Fill(hit->GetX(),hit->GetYPad()-1);
310  else
311  HISTrow_x_h->Fill(hit->GetX(),hit->GetYPad());
312 
313  id_h = hit->GetDetectorID();
314  crystal_hid = -(id_h%10000 -36); //crystal column number (the same as GetXPad())
315  row_hid = (id_h/1000000)%100 - 37; //crystal row number (the same as GetYPad())
316 
317  if (hit->GetXPad() <= -1 && hit->GetYPad() <= -1)
318  HISTrow_crystal_h->Fill(hit->GetXPad(),hit->GetYPad());
319  else if (hit->GetXPad() <= -1 && hit->GetYPad() >= 1)
320  HISTrow_crystal_h->Fill(hit->GetXPad(),hit->GetYPad()-1);
321  else if (hit->GetXPad() >= 1 && hit->GetYPad() <= -1)
322  HISTrow_crystal_h->Fill(hit->GetXPad()-1,hit->GetYPad());
323  else //if (hit->GetXPad() >= 1 && hit->GetYPad() >= 1)
324  HISTrow_crystal_h->Fill(hit->GetXPad()-1,hit->GetYPad()-1);
325 
326  HISTy_x_h->Fill(hit->GetX(),hit->GetY());
327  }
328  }
329  HISThit_ene->Fill(sum_hit_ene); // deposited energy per event in all hits (whole FwEndCap)
330  if (efficiencyFlag==1)
331  efficiencyCounter+=1;
332  if (atLeastOneHitPerEventFlag==1)
333  atLeastOneHitPerEventCounter+=1;
334 
335  if (j%1000 ==0)
336  cout<<"Evt. No. "<< j<<endl;
337  }
338  cout<<"totalhits = "<<totalhits<<"\n";
339  cout<<"efficiencyCounter = "<<efficiencyCounter<<" , atLeastOneHitPerEventCounter = "<<atLeastOneHitPerEventCounter<<"\n";
340  cout<<"FwEndCap efficiency (more than 10 MeV deposition in at least one crystal) = "<< (double)efficiencyCounter/atLeastOneHitPerEventCounter<<"\n";
341 
343  gStyle->SetPalette(1);
344  /* TCanvas* c1 = new TCanvas("c1","", 10, 20, 1200, 900);
345  //c1->SetFillColor(10);
346  c1->Divide(4,2);
347  c1->cd(1);
348  hypad_xpad_p->Draw("colz");
349  hypad_xpad_p->GetXaxis()->SetTitle("column number");
350  hypad_xpad_p->GetYaxis()->SetTitle("row number");
351 
352  c1->cd(2);
353  hx_y_p->Draw("colz");
354  hx_y_p->GetXaxis()->SetTitle("X position");
355  hx_y_p->GetYaxis()->SetTitle("Y position");
356 
357 
358  //TGraph2D* gr3D = new TGraph2D(totalpoints,x3,y3,z3);
359  //gr3D->Draw("P");
360  //gr3D->SetMarkerColor(2);
361  //gr3D->SetMarkerStyle(8);
362  //gr3D->SetMarkerSize(.2);
363 
364 
365  c1->cd(3);
366  h10->SetLineColor(4); // theta MC (POINTS)
367  h10->Draw();
368  h10d->SetLineColor(1); // theta DATA (POINTS)
369  h10d->Draw("same");
370  h10->GetXaxis()->SetTitle("#theta (deg)");
371 
372  c1->cd(4);
373  h20->SetLineColor(4); // phi MC (POINTS)
374  h20->Draw();
375  h20d->SetLineColor(1); //phi DATA (POINTS)
376  h20d->Draw("same");
377  h20->GetXaxis()->SetTitle("#phi (deg)");
378 
379  c1->cd(5);
380  hxpad_x_p->Draw("colz");
381  hxpad_x_p->GetXaxis()->SetTitle("crystal column number");
382  hxpad_x_p->GetYaxis()->SetTitle("x_point");
383 
384  c1->cd(6);
385  hypad_y_p->Draw("colz");
386  hypad_y_p->GetXaxis()->SetTitle("crystal row number");
387  hypad_y_p->GetYaxis()->SetTitle("y_point");
388 
389  c1->cd(7);
390  h1->Draw(); // point_theta-theta_monte_carlo
391  h1->GetXaxis()->SetTitle("#theta_{POINT}-#theta_{MC}");
392  h1->GetYaxis()->SetTitle("Counts");
393 
394  c1->cd(8);
395  h2->Draw(); // point_phi-phi_monte_carlo
396  h2->GetXaxis()->SetTitle("#phi_{POINT}-#phi_{MC}");
397  h2->GetYaxis()->SetTitle("Counts");
398 */
399 
400 /*
401  TCanvas* c2 = new TCanvas("c2","", 100, 100, 800, 800);
402  c2->Divide(3,2);
403  c2->cd(1);
404  hpoi_ene11_12->Draw();
405  c2->cd(2);
406  hpoi_ene12_12->Draw();
407  c2->cd(3);
408  hpoi_ene13_12->Draw();
409  c2->cd(4);
410  hpoi_ene14_12->Draw();
411  c2->cd(6);
412  hpoi_ene->SetLineColor(1);
413  hpoi_ene->Draw();
414  hpoi_ene->GetXaxis()->SetTitle("FwEndCap Deposited Energy (point analysis)");
415  */
416 
417 
418  /* TCanvas* c3 = new TCanvas("c3","", 100, 100, 800, 800);//x_point vs z_point for the critical columns (those proceeding after the inter-subunit gaps)
419  c3->SetFillColor(10);
420  c3->SetFrameFillColor(10);
421  c3->Divide(3,3);
422  c3->cd(1);
423  gr = new TGraph(totalpoints,x,xx);
424  gr->Draw("AP");
425  gr->SetMarkerColor(2);
426  c3->cd(2);
427  gr2 = new TGraph(totalpoints,z3,xx);
428  gr2->Draw("AP");
429  c3->cd(3);
430  gr2 = new TGraph(totalpoints,z7,xx);
431  gr2->Draw("AP");
432  c3->cd(4);
433  gr2 = new TGraph(totalpoints,z11,xx);
434  gr2->Draw("AP");
435  c3->cd(5);
436  gr2 = new TGraph(totalpoints,z15,xx);
437  gr2->Draw("AP");
438  c3->cd(6);
439  gr2 = new TGraph(totalpoints,z19,xx);
440  gr2->Draw("AP");
441  c3->cd(7);
442  gr2 = new TGraph(totalpoints,z23,xx);
443  gr2->Draw("AP");
444  c3->cd(8);
445  gr2 = new TGraph(totalpoints,z27,xx);
446  gr2->Draw("AP");
447  c3->cd(9);
448  gr2 = new TGraph(totalpoints,z31,xx);
449  gr2->Draw("AP");
450  */
451 
452  /*
453  TCanvas* c4 = new TCanvas("c4","", 100, 100, 800, 800);//y_point vs z_point for the critical rows (those proceeding above the inter-subunit gaps)
454  c4->SetFillColor(10);
455  c4->SetFrameFillColor(10);
456  c4->Divide(3,3);
457  c4->cd(1);
458  gr = new TGraph(totalpoints,y,yy);
459  gr->Draw("AP");
460  gr->SetMarkerColor(2);
461  c4->cd(2);
462  gr2 = new TGraph(totalpoints,z2,yy);
463  gr2->Draw("AP");
464  c4->cd(3);
465  gr2 = new TGraph(totalpoints,z6,yy);
466  gr2->Draw("AP");
467  c4->cd(4);
468  gr2 = new TGraph(totalpoints,z10,yy);
469  gr2->Draw("AP");
470  c4->cd(5);
471  gr2 = new TGraph(totalpoints,z14,yy);
472  gr2->Draw("AP");
473  c4->cd(6);
474  gr2 = new TGraph(totalpoints,z18,yy);
475  gr2->Draw("AP");
476  c4->cd(7);
477  gr2 = new TGraph(totalpoints,z22,yy);
478  gr2->Draw("AP");
479  c4->cd(8);
480  gr2 = new TGraph(totalpoints,z26,yy);
481  gr2->Draw("AP");
482  c4->cd(9);
483  gr2 = new TGraph(totalpoints,z30,yy);
484  gr2->Draw("AP");
485  */
486 
487  /*
488  TCanvas* c5 = new TCanvas("c5","", 100, 100, 800, 800);
489  c5->Divide(3,2);
490  c5->cd(1);
491  HISTOhit_ene11_12->Draw();
492  c5->cd(2);
493  HISTOhit_ene12_12->Draw();
494  c5->cd(3);
495  HISTOhit_ene13_12->Draw();
496  c5->cd(4);
497  HISTOhit_ene14_12->Draw();
498  c5->cd(5);
499  HISTene_h->Draw();
500  HISTene_h->GetXaxis()->SetTitle("FwEndCap Deposited Energy per hit (hit analysis)");
501  c5->cd(6);
502  HISThit_ene->SetLineColor(1);
503  HISThit_ene->Draw();
504  HISThit_ene->GetXaxis()->SetTitle("FwEndCap Deposited Energy per event (hit analysis)");
505  */
506 
507  /*
508  TCanvas* c6 = new TCanvas("c6","", 100, 100, 800, 800);
509  c6->Divide(3,2);
510  c6->cd(1);
511  HISTy_x_h->Draw("colz");
512  c6->cd(2);
513  HISTrow_crystal_h->Draw("colz");
514  c6->cd(3);
515  HISTxpad_x_h->Draw("colz");
516  c6->cd(4);
517  HISTypad_y_h->Draw("colz");
518  c6->cd(5);
519  HISTrow_x_h->Draw("colz");
520 */
521 
522  TCanvas* c7 = new TCanvas("c7","", 100, 100, 1000, 700);
523  c7->SetFillColor(10);
524  gStyle->SetOptStat(0);
525  c7->Divide(2,1);
526  c7->cd(1)->SetRightMargin(0.02);
527  HISTxpad_x_h->Draw("box");
528  HISTxpad_x_h->GetYaxis()->SetTitle("crystal column number");
529  HISTxpad_x_h->GetYaxis()->SetTitleSize(0.05);
530  HISTxpad_x_h->GetYaxis()->CenterTitle();
531  HISTxpad_x_h->GetYaxis()->SetTitleOffset(1.);
532  HISTxpad_x_h->GetXaxis()->SetTitle("x [cm]");
533  HISTxpad_x_h->GetXaxis()->SetTitleSize(0.07);
534  HISTxpad_x_h->GetXaxis()->SetTitleOffset(0.6);
535  HISTxpad_x_h->GetXaxis()->CenterTitle();
536  c7->cd(2)->SetRightMargin(0.02);
537  HISTypad_y_h->Draw("box");
538  HISTypad_y_h->GetYaxis()->SetTitle("crystal row number");
539  HISTypad_y_h->GetYaxis()->SetTitleSize(0.05);
540  HISTypad_y_h->GetYaxis()->CenterTitle();
541  HISTypad_y_h->GetYaxis()->SetTitleOffset(1.);
542  HISTypad_y_h->GetXaxis()->SetTitle("y [cm]");
543  HISTypad_y_h->GetXaxis()->SetTitleSize(0.07);
544  HISTypad_y_h->GetXaxis()->SetTitleOffset(0.6);
545  HISTypad_y_h->GetXaxis()->CenterTitle();
546 
547  //TString outfile= "./HISTxPad_x.root";
548  //TFile* file_out = new TFile(outfile,"RECREATE");
549  //HISTxpad_x_h->Write();
550  //HISTypad_y_h->Write();
551  //file_out->Close();
552 
553 }
PndMCTrack * mctrack
TClonesArray * point_array
TH1F * hpoi_ene12_12
Double_t hit_theta
Double_t z_p
Short_t GetXPad() const
Definition: PndEmcHit.cxx:87
TVector3 hit_pos(hit->GetX(), hit->GetY(), hit->GetZ())
Double_t theta_mc
Double_t point_phi
Int_t i
Definition: run_full.C:25
TVector3 photon_momentum
TH2F * hypad_y_p
TCanvas * c7
TH1F * hpoi_ene14_12
TVector3 GetMomentum() const
Definition: PndMCTrack.h:78
TH1F * hy_p
Int_t id_p
Double_t x_p
TH1F * hpoi_ene
Double_t crystal_hid
TH1F * hene_p
TClonesArray * hit_array
Double_t crystal_pid
TH1F * hpoi_ene11_12
Double_t module_h
Short_t GetYPad() const
Definition: PndEmcHit.cxx:120
TH1F * hpoi_ene13_12
Double_t
virtual Double_t GetEnergy() const
Definition: PndEmcHit.h:54
Double_t hit_phi
Double_t point_ene
Double_t row_hid
TH1F * hz_p
TH1F * hx_p
represents the deposited energy of one emc crystal from simulation
Definition: PndEmcHit.h:26
TH2F * hypad_xpad_p
Double_t y_p
Double_t point_theta
Double_t row_pid
TH2F * hxpad_x_p
PndSdsMCPoint * hit
Definition: anasim.C:70
TClonesArray * mctrack_array
TLorentzVector p4mom
TH2F * hx_y_p
Double_t Pi
Short_t GetModule() const
Definition: PndEmcHit.h:58
Double_t hit_ene
Double_t module_p
TH1F * hmodule_p
TH1F * hid_p