HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
drawAnalyse.cxx
Go to the documentation of this file.
1 #include "TH1F.h"
2 #include "TH2F.h"
3 #include "TFile.h"
4 #include "TCanvas.h"
5 #include "TLatex.h"
6 #include "TProfile.h"
7 #include <THStack.h>
8 #include "TLegend.h"
9 #include "TROOT.h"
10 #include "TStyle.h"
11 #include "TLegend.h"
12 #include "TPaveText.h"
13 #include <iostream>
14 #include <fstream>
15 #include "TMath.h"
16 #include "TChain.h"
17 //#include "T.h"
18 //#include "${HARPO_USER_DIR}/bin/MakeNiceHisto.C"
19 #include "MakeNiceHisto.h"
20 using namespace std;
21 
22 void drawAnalyse(const char* input, const char* output = "UNDEFINED", const char* outputtex = "UNDEFINED");
23 
24 
25 int main(int argc, char** argv)
26 {
27 
28  Char_t inputfilename[256];
29  Char_t outputfilename[256];
30  Char_t outputtexname[256];
31 
32  sprintf(outputfilename,"UNDEFINED");
33  for(int i = 1; i<argc; i++){
34  switch(argv[i][0]){
35  case '-':
36  switch(argv[i][1]){
37  case 'h':
38  printf("Run Simulation\n");
39  printf("-i <filename>: input file (must be .root)\n");
40  printf("-o <filename>: output file (must be .pdf, default inputfilename.pdf)\n");
41  return 0;
42  case 'i':
43  i++;
44  if(strstr(argv[i],".root") != NULL){
45  //sprintf(inputfilename, argv[i]);
46  strcpy(inputfilename, argv[i]);
47  printf("input file: %s\n", argv[i]);
48  break;
49  }else{
50  printf("Invalid input file %s",argv[i]);
51  return 0;
52  }
53  case 'o':
54  i++;
55  if(strstr(argv[i],".pdf") != NULL){
56  //sprintf(outputfilename, argv[i]);
57  strcpy(outputfilename, argv[i]);
58  printf("output file: %s\n", argv[i]);
59  break;
60  }else{
61  printf("Invalid output file %s",argv[i]);
62  return 0;
63  }
64  case 't':
65  i++;
66  if(strstr(argv[i],".tex") != NULL){
67  //sprintf(outputtexname, argv[i]);
68  strcpy(outputtexname, argv[i]);
69  printf("output tex file: %s\n", argv[i]);
70  break;
71  }else{
72  printf("Invalid output file %s",argv[i]);
73  return 0;
74  }
75  default:
76  printf("unknown option: %s\n", argv[i]);
77  return 0;
78  }
79  break;
80 
81  default:
82  printf("invalid parameter: %s\n", argv[i]);
83  return 0;
84  }
85  }
86 
87  gROOT->SetStyle("Plain");
88  gStyle->SetPalette(1);
89 
90  drawAnalyse(inputfilename,outputfilename,outputtexname);
91  return 0;
92 
93 }
94 
95 
96 void drawAnalyse(const char * inputfile, const char* outputfilename, const char* outputtexname)
97 {
98  using namespace std;
99  // gROOT->SetStyle("Plain"); gStyle->SetPalette(1);
100 
101  char outputfile[256];
102 
103  if(strcmp(outputfilename,"UNDEFINED") == 0){
104  sprintf(outputfile,"%s.pdf",inputfile);
105  printf("Set default output file %s\n",outputfile);
106  }else{
107  sprintf(outputfile,"%s",outputfilename);
108  }
109 
110 
111 
112  char outputtex[256];
113  if(strcmp(outputtexname,"UNDEFINED") == 0){
114  sprintf(outputtex,"%s_results.tex",inputfile);
115  printf("Set default output file %s\n",outputtex);
116  }else{
117  sprintf(outputtex,"%s",outputtexname);
118  }
119 
120 
121  // const char *type = ".root";
122  // const char *outputtype = ".pdf";
123  // const char *outputopen = ".pdf[";
124  // const char *outputclose = ".pdf]";
125  // char inputfile[256];
126  // char *inputfile = new char[20];
127  // char inputfile[256];
128  // char outputfile[256];
129  char outputfileopen[256];
130  char outputfileclose[256];
131  // strcpy(inputfile, input);
132  // strncat(inputfile,type,5);
133  // //char *outputfile = new char[20];
134  // strcpy(outputfile, input);
135  // strncat(outputfile,outputtype,4);
136  // //char *outputfileopen = new char[20];
137  // strcpy(outputfileopen, input);
138  // strncat(outputfileopen,outputopen,5);
139  // //char *outputfileclose = new char[20];
140  // strcpy(outputfileclose, input);
141  // strncat(outputfileclose,outputclose,5);
142 
143  sprintf(outputfileopen,"%s[",outputfile);
144  sprintf(outputfileclose,"%s]",outputfile);
145 
146  //TFile *f = new TFile("RunData1142.root");
147  TFile *f = new TFile(inputfile);
148  f->ls();
149 
150  TH1F *h1_tmin;
151  TH1F *h1_tmax;
152  TH1F *h1_xmin;
153  TH1F *h1_xmax;
154  TH1F *h1_ymin;
155  TH1F *h1_ymax;
156  TH1F *h1_dtime;
157 
158  TH1F *h1_Qpix_x;
159  TH1F *h1_Q_time_x;
160  TH1F *h1_Q_channel_x;
161 
162  TH1F *h1_QTcluster_x;
163  TH1F *h1_QCcluster_x;
164  TH1F *h1_SigTcluster_x;
165  TH1F *h1_SigCcluster_x;
166  TH1F *h1_WidthTcluster_x;
167  TH1F *h1_WidthCcluster_x;
168  TH1F *h1_IndexTcluster_x;
169  TH1F *h1_IndexCcluster_x;
170  TH1F *h1_MeanTcluster_x;
171  TH1F *h1_MeanCcluster_x;
172 
173  TH1F *h1_theta_x;
174  TH1F *h1_rho_x;
175  TH1F *h1_sigtheta_x;
176  TH1F *h1_sigrho_x;
177  TH1F *h1_QcAssoc_x;
178  TH1F *h1_QcNAssoc_x;
179  TH1F *h1_QtAssoc_x;
180  TH1F *h1_QtNAssoc_x;
181  TH1F *h1_TypeTrack_x;
182  TH1F *h1_angleTrack_x;
183 
184  TH2F *h2_distortion_dc_t_x ;
185  TH2F *h2_distortion_dc_c_x;
186  TH2F *h2_distortion_dt_t_x;
187  TH2F *h2_distortion_dt_c_x;
188  TH1F *h1_distortion_dt_x;
189  TH1F *h1_distortion_dc_x;
190 
191  TProfile *h2_prof_dc_t_x;
192  TProfile *h2_prof_dc_c_x;
193  TProfile *h2_prof_dt_t_x;
194  TProfile *h2_prof_dt_c_x;
195 
196  TH1F *h1_QtAssocN_x;
197  TH1F *h1_QtAssocN_time_x;
198  TH1F *h1_QtAssocN_channel_x;
199 
200  // TH2F *h2_QtAssocN_time_x;
201  //TH2F *h2_QtAssocN_time_y;
202 
203  //alignement
204  TH1F* h1xd;
205  TH1F* h1yd;
206  TH1F* h1zxd;
207  TH1F* h1zyd;
208  TH2F* h2xz;
209  TH2F* h2yz;
210  TH2F* h2xzn;
211  TH2F* h2yzn;
212  TH2F* h2xyn;
213  //poca doca
214  TH1F* h1Doca;
215  TH1F* h1Poca_x;
216  TH1F* h1Poca_y;
217  TH1F* h1Poca_z;
218  TH2F* h2Poca_xz;
219  TH2F* h2Poca_yz;
220 
221  TH1F* h1Px;
222  TH1F* h1Py;
223  TH1F* h1Pz;
224 
225  TH1F* h1Azimutal;
226  TH1F* h1AOpen;
228 
229 
230  TH1F *h1_Qpix_y;
231  TH1F *h1_Q_time_y;
232  TH1F *h1_Q_channel_y;
233 
234  TH1F *h1_QTcluster_y;
235  TH1F *h1_QCcluster_y;
236  TH1F *h1_SigTcluster_y;
237  TH1F *h1_SigCcluster_y;
238  TH1F *h1_WidthTcluster_y;
239  TH1F *h1_WidthCcluster_y;
240  TH1F *h1_IndexTcluster_y;
241  TH1F *h1_IndexCcluster_y;
242  TH1F *h1_MeanTcluster_y;
243  TH1F *h1_MeanCcluster_y;
244 
245  TH1F *h1_theta_y;
246  TH1F *h1_rho_y;
247  TH1F *h1_sigtheta_y;
248  TH1F *h1_sigrho_y;
249  TH1F *h1_QcAssoc_y;
250  TH1F *h1_QcNAssoc_y;
251  TH1F *h1_QtAssoc_y;
252  TH1F *h1_QtNAssoc_y;
253  TH1F *h1_TypeTrack_y;
254  TH1F *h1_angleTrack_y;
255 
256  TH1F *h1_QtAssocN_y;
257  TH1F *h1_QtAssocN_time_y;
258  TH1F *h1_QtAssocN_channel_y;
259 
260  TH2F *h2_distortion_dc_t_y ;
261  TH2F *h2_distortion_dc_c_y;
262  TH2F *h2_distortion_dt_t_y;
263  TH2F *h2_distortion_dt_c_y;
264  TH1F *h1_distortion_dt_y;
265  TH1F *h1_distortion_dc_y;
266  TProfile *h2_prof_dc_t_y;
267  TProfile *h2_prof_dc_c_y;
268  TProfile *h2_prof_dt_t_y;
269  TProfile *h2_prof_dt_c_y;
270 
271  //TProfile *h2_Qprof_x;
272  //TProfile *h2_Qprof_y;
273  //cluster<--->track
274 
275  TH1F* h1NTrackX;
276  TH1F* h1NTrackY;
277  TH1F* h1NClusterX;
278  TH1F* h1NClusterY;
279  TH1F* h1NClusterNX;
280  TH1F* h1NClusterNY;
281 
282  //trigger
283 
284  TH1F* hTriggerCreated;
285  TH1F* hTriggerEmpty;
286  TH1F* hTriggerTraversing;
287  TH1F* hTriggerShower;
288  TH1F* hTriggerOther;
289  TH1F* hTriggerContained;
290  TH1F* hTriggerDepot;
291  TH1F* hTriggerTwoTrGamma;
292  TH1F* hTriggerTwoTrDelta;
293  TH1F* hTriggerTwoTrOther;
294  TH1F* hTriggerTTZ;
295 
296 
298  TH1F * helen;
299  TH1F * heprof;
300  TH1F* hPmm2;
301  TH1F* hPmm2Missed;
302  TH1F* hPmm2Triggered;
303  TH2F* hPmm2Spectrum2D;
304  TH2F* hPmm2Coincidence;
305  TH1F* hTriggerType;
306 
307  TLegend* lTrigger = new TLegend(0.1,0.5,0.3,0.9);
308  THStack* hTrigger = new THStack("hTrigger",";");
309  hTriggerCreated=(TH1F*)f->Get("hTriggerCreated");
310  hTriggerEmpty=(TH1F*)f->Get("hTriggerEmpty");
311  hTriggerTraversing=(TH1F*)f->Get("hTriggerTraversing");
312  hTriggerShower=(TH1F*)f->Get("hTriggerShower");
313  hTriggerOther=(TH1F*)f->Get("hTriggerOther");
314 
315  hTriggerDepot=(TH1F*)f->Get("hTriggerDepot");
316  hTriggerTwoTrGamma=(TH1F*)f->Get("hTriggerTwoTrGamma");
317  hTriggerTwoTrDelta=(TH1F*)f->Get("hTriggerTwoTrDelta");
318  hTriggerTwoTrOther=(TH1F*)f->Get("hTriggerTwoTrOther");
319  hTriggerContained=(TH1F*)f->Get("hTriggerContained");
320  hTriggerTTZ=(TH1F*)f->Get("hTriggerTTZ");
321 
322  hTriggerOther->GetXaxis()->SetBinLabel(1,"Unknown");
323  hTriggerOther->GetXaxis()->SetBinLabel(2,"Traversing Z");
324 
325  hTriggerOther->GetXaxis()->SetBinLabel(3,"------");
326  hTriggerOther->GetXaxis()->SetBinLabel(4,"Gamma");
327  hTriggerOther->GetXaxis()->SetBinLabel(5,"No Mesh");
328  hTriggerOther->GetXaxis()->SetBinLabel(6,"Inv Mesh");
329  hTriggerOther->GetXaxis()->SetBinLabel(7,"No Up");
330  hTriggerOther->GetXaxis()->SetBinLabel(8,"------");
331  hTriggerOther->GetXaxis()->SetBinLabel(9,"Gamma, L");
332  hTriggerOther->GetXaxis()->SetBinLabel(10,"No Mesh, L");
333  hTriggerOther->GetXaxis()->SetBinLabel(11,"Inv Mesh, L");
334  hTriggerOther->GetXaxis()->SetBinLabel(12,"No Up, L");
335  hTriggerOther->GetXaxis()->SetBinLabel(13,"No PM, L");
336  hTriggerOther->GetXaxis()->SetBinLabel(14,"No L");
337  hTriggerOther->GetXaxis()->SetBinLabel(15,"------");
338  hTriggerOther->GetXaxis()->SetBinLabel(16,"Cosmic");
339 
340  hTriggerOther->SetFillColor(7);
341  hTriggerEmpty->SetFillColor(10);
342  hTriggerShower->SetFillColor(4);
343  hTriggerTraversing->SetFillColor(5);
344 
345  hTriggerCreated->SetFillColor(6);
346  hTriggerTwoTrGamma->SetFillColor(2);
347  hTriggerTwoTrDelta->SetFillColor(8);
348  hTriggerTwoTrOther->SetFillColor(9);
349  hTriggerDepot->SetFillColor(11);
350 
351  hTriggerTTZ->SetFillColor(3);
352  hTriggerContained->SetFillColor(12);
353 
354  hTrigger->Add(hTriggerOther);
355  hTrigger->Add(hTriggerEmpty);
356  hTrigger->Add(hTriggerDepot);
357  hTrigger->Add(hTriggerTTZ);
358  hTrigger->Add(hTriggerTraversing);
359  hTrigger->Add(hTriggerCreated);
360  hTrigger->Add(hTriggerContained);
361  hTrigger->Add(hTriggerTwoTrGamma);
362  hTrigger->Add(hTriggerTwoTrDelta);
363  hTrigger->Add(hTriggerTwoTrOther);
364  hTrigger->Add(hTriggerShower);
365 
366  // ////////////////////////////////////////////////////////////////////////////////////////////////
367 
368  hTriggerCreated->SetStats(0);
369  hTriggerEmpty->SetStats(0);
370  hTriggerTraversing->SetStats(0);
371  hTriggerShower->SetStats(0);
372  hTriggerOther->SetStats(0);
373  hTriggerTwoTrGamma->SetStats(0);
374  hTriggerTwoTrDelta->SetStats(0);
375  hTriggerTwoTrOther->SetStats(0);
376  hTriggerDepot->SetStats(0);
377  hTriggerTTZ->SetStats(0);
378  hTriggerContained->SetStats(0);
379 
380 
381  h2_prof_dc_t_x=(TProfile *)f->Get("h2_prof_dc_t_x");
382  h2_prof_dc_c_x=(TProfile *)f->Get("h2_prof_dc_c_x");
383  h2_prof_dt_t_x=(TProfile *)f->Get("h2_prof_dt_t_x");
384  h2_prof_dt_c_x=(TProfile *)f->Get("h2_prof_dt_c_x");
385  h2_prof_dc_t_y=(TProfile *)f->Get("h2_prof_dc_t_y");
386  h2_prof_dc_c_y=(TProfile *)f->Get("h2_prof_dc_c_y");
387  h2_prof_dt_t_y=(TProfile *)f->Get("h2_prof_dt_t_y");
388  h2_prof_dt_c_y=(TProfile *)f->Get("h2_prof_dt_c_y");
389  // h2_Qprof_x=(TProfile *)f->Get("h2_Qprof_x");
390  // h2_Qprof_y=(TProfile *)f->Get("h2_Qprof_y");
391 
392  h1_tmin= (TH1F*)f->Get("h1_tmin");
393  h1_tmax= (TH1F*)f->Get("h1_tmax");
394  h1_xmin= (TH1F*)f->Get("h1_xmin");
395  h1_xmax= (TH1F*)f->Get("h1_xmax");
396  h1_ymin= (TH1F*)f->Get("h1_ymin");
397  h1_ymax= (TH1F*)f->Get("h1_ymax");
398  h1_dtime= (TH1F*)f->Get("h1_dtime");
399  hTriggerType=(TH1F*)f->Get("hTriggerType");
400 
401  helen=(TH1F*)f->Get("helen");
402  heprof=(TH1F*)f->Get("heprof");
403  hPmm2=(TH1F*)f->Get("hPmm2");
404  hPmm2Missed=(TH1F*)f->Get("hPmm2Missed");
405  hPmm2Triggered=(TH1F*)f->Get("hPmm2Triggered");
406  hPmm2Spectrum2D=(TH2F*)f->Get("hPmm2Spectrum2D");
407  hPmm2Coincidence=(TH2F*)f->Get("hPmm2Coincidence");
408 
409  // h2_QtAssocN_time_x=(TH2F*)f->Get("h2_QtAssocN_time_x");
410  // h2_QtAssocN_time_y=(TH2F*)f->Get("h2_QtAssocN_time_y");
411 
412  // h2_QtAssocN_time_x->SetStats(0);
413  // h2_QtAssocN_time_y->SetStats(0);
414 
415  h1_tmin->SetStats(0);
416  h1_tmax->SetStats(0);
417  h1_xmin->SetStats(0);
418  h1_xmax->SetStats(0);
419  h1_ymin->SetStats(0);
420  h1_ymax->SetStats(0);
421  h1_dtime->SetStats(0);
422 
423  //
424  //cout<<"drt="<<drt<<endl;
425  hTriggerType->SetStats(0);
426  helen->SetStats(0);
427  heprof->SetStats(0);
428  hPmm2->SetStats(0);
429  hPmm2Missed->SetStats(0);
430  hPmm2Triggered->SetStats(0);
431  hPmm2Spectrum2D->SetStats(0);
432  hPmm2Coincidence->SetStats(0);
433 
434  h1_Qpix_x=(TH1F*)f->Get("h1_Qpix_x");
435  h1_Q_time_x=(TH1F*)f->Get("h1_Q_time_x");
436  h1_Q_channel_x=(TH1F*)f->Get("h1_Q_channel_x");
437 
438  h1_QTcluster_x=(TH1F*)f->Get("h1_QTcluster_x");
439  h1_QCcluster_x=(TH1F*)f->Get("h1_QCcluster_x");
440  h1_SigTcluster_x=(TH1F*)f->Get("h1_SigTcluster_x");
441  h1_SigCcluster_x=(TH1F*)f->Get("h1_SigCcluster_x");
442  h1_WidthTcluster_x=(TH1F*)f->Get("h1_WidthTcluster_x");
443  h1_WidthCcluster_x=(TH1F*)f->Get("h1_WidthCcluster_x");
444  h1_IndexTcluster_x=(TH1F*)f->Get("h1_IndexTcluster_x");
445  h1_IndexCcluster_x=(TH1F*)f->Get("h1_IndexCcluster_x");
446  h1_MeanTcluster_x=(TH1F*)f->Get("h1_MeanTcluster_x");
447  h1_MeanCcluster_x=(TH1F*)f->Get("h1_MeanCcluster_x");
448 
449  h1_theta_x=(TH1F*)f->Get("h1_theta_x");
450  h1_rho_x=(TH1F*)f->Get("h1_rho_x");
451  h1_sigtheta_x=(TH1F*)f->Get("h1_sigtheta_x");
452  h1_sigrho_x=(TH1F*)f->Get("h1_sigrho_x");
453  h1_QcAssoc_x=(TH1F*)f->Get("h1_QcAssoc_x");
454  h1_QcNAssoc_x=(TH1F*)f->Get("h1_QcNAssoc_x");
455  h1_QtAssoc_x=(TH1F*)f->Get("h1_QtAssoc_x");
456  h1_QtNAssoc_x=(TH1F*)f->Get("h1_QtNAssoc_x");
457  h1_TypeTrack_x=(TH1F*)f->Get("h1_TypeTrack_x");
458  h1_angleTrack_x=(TH1F*)f->Get("h1_angleTrack_x");
459 
460  h2_distortion_dc_t_x = (TH2F*)f->Get("h2_distortion_dc_t_x");
461  h2_distortion_dc_c_x=(TH2F*)f->Get("h2_distortion_dc_c_x");
462  h2_distortion_dt_t_x=(TH2F*)f->Get("h2_distortion_dt_t_x");
463  h2_distortion_dt_c_x=(TH2F*)f->Get("h2_distortion_dt_c_x");
464  h1_distortion_dt_x= (TH1F*)f->Get("h1_distortion_dt_x");
465  h1_distortion_dc_x=(TH1F*)f->Get("h1_distortion_dc_x");
466 
467  h1_QtAssocN_x=(TH1F*)f->Get("h1_QtAssocN_x");
468  h1_QtAssocN_time_x=(TH1F*)f->Get("h1_QtAssocN_time_x");
469  h1_QtAssocN_channel_x=(TH1F*)f->Get("h1_QtAssocN_channel_x");
470 
471 
472 
473  h1_Qpix_x->SetLineColor(2);
474  h1_Q_time_x->SetLineColor(2);
475  h1_Q_channel_x->SetLineColor(2);
476 
477  h1_QTcluster_x->SetLineColor(2);
478  h1_QCcluster_x->SetLineColor(2);
479  h1_SigTcluster_x->SetLineColor(2);
480  h1_SigCcluster_x->SetLineColor(2);
481  h1_WidthTcluster_x->SetLineColor(2);
482  h1_WidthCcluster_x->SetLineColor(2);
483  h1_IndexTcluster_x->SetLineColor(2);
484  h1_IndexCcluster_x->SetLineColor(2);
485  h1_MeanTcluster_x->SetLineColor(2);
486  h1_MeanCcluster_x->SetLineColor(2);
487 
488  h1_theta_x->SetLineColor(2);
489  h1_rho_x->SetLineColor(2);
490  h1_sigtheta_x->SetLineColor(2);
491  h1_sigrho_x->SetLineColor(2);
492  h1_QcAssoc_x->SetLineColor(2);
493  h1_QcNAssoc_x->SetLineColor(2);
494  h1_QtAssoc_x->SetLineColor(2);
495  h1_QtNAssoc_x->SetLineColor(2);
496  h1_TypeTrack_x->SetLineColor(2);
497  h1_angleTrack_x->SetLineColor(2);
498 
499  h1_QtAssocN_x->SetLineColor(2);
500  h1_QtAssocN_time_x->SetLineColor(2);
501  h1_QtAssocN_channel_x->SetLineColor(2);
502 
503 
504 
505  h1_Qpix_x->SetStats(0);
506  h1_Q_time_x->SetStats(0);
507  h1_Q_channel_x->SetStats(0);
508 
509  h1_QTcluster_x->SetStats(0);
510  h1_QCcluster_x->SetStats(0);
511  h1_SigTcluster_x->SetStats(0);
512  h1_SigCcluster_x->SetStats(0);
513  h1_WidthTcluster_x->SetStats(0);
514  h1_WidthCcluster_x->SetStats(0);
515  h1_IndexTcluster_x->SetStats(0);
516  h1_IndexCcluster_x->SetStats(0);
517  h1_MeanTcluster_x->SetStats(0);
518  h1_MeanCcluster_x->SetStats(0);
519 
520  h1_theta_x->SetStats(0);
521  h1_rho_x->SetStats(0);
522  h1_sigtheta_x->SetStats(0);
523  h1_sigrho_x->SetStats(0);
524  h1_QcAssoc_x->SetStats(0);
525  h1_QcNAssoc_x->SetStats(0);
526  h1_QtAssoc_x->SetStats(0);
527  h1_QtNAssoc_x->SetStats(0);
528  h1_TypeTrack_x->SetStats(0);
529  h1_angleTrack_x->SetStats(0);
530 
531  h1_QtAssocN_x->SetStats(0);
532  // h1_QtAssocN_time_x->SetStats(0);
533  h1_QtAssocN_channel_x->SetStats(0);
534 
535  h1_Qpix_y=(TH1F*)f->Get("h1_Qpix_y");
536  h1_Q_time_y=(TH1F*)f->Get("h1_Q_time_y");
537  h1_Q_channel_y=(TH1F*)f->Get("h1_Q_channel_y");
538 
539  h1_QTcluster_y=(TH1F*)f->Get("h1_QTcluster_y");
540  h1_QCcluster_y=(TH1F*)f->Get("h1_QCcluster_y");
541  h1_SigTcluster_y=(TH1F*)f->Get("h1_SigTcluster_y");
542  h1_SigCcluster_y=(TH1F*)f->Get("h1_SigCcluster_y");
543  h1_WidthTcluster_y=(TH1F*)f->Get("h1_WidthTcluster_y");
544  h1_WidthCcluster_y=(TH1F*)f->Get("h1_WidthCcluster_y");
545  h1_IndexTcluster_y=(TH1F*)f->Get("h1_IndexTcluster_y");
546  h1_IndexCcluster_y=(TH1F*)f->Get("h1_IndexCcluster_y");
547  h1_MeanTcluster_y=(TH1F*)f->Get("h1_MeanTcluster_y");
548  h1_MeanCcluster_y=(TH1F*)f->Get("h1_MeanCcluster_y");
549 
550 
551  h1_theta_y=(TH1F*)f->Get("h1_theta_y");
552  h1_rho_y=(TH1F*)f->Get("h1_rho_y");
553  h1_sigtheta_y=(TH1F*)f->Get("h1_sigtheta_y");
554  h1_sigrho_y=(TH1F*)f->Get("h1_sigrho_y");
555  h1_QcAssoc_y=(TH1F*)f->Get("h1_QcAssoc_y");
556  h1_QcNAssoc_y=(TH1F*)f->Get("h1_QcNAssoc_y");
557  h1_QtAssoc_y=(TH1F*)f->Get("h1_QtAssoc_y");
558  h1_QtNAssoc_y=(TH1F*)f->Get("h1_QtNAssoc_y");
559  h1_TypeTrack_y=(TH1F*)f->Get("h1_TypeTrack_y");
560  h1_angleTrack_y=(TH1F*)f->Get("h1_angleTrack_y");
561 
562  h2_distortion_dc_t_y = (TH2F*)f->Get("h2_distortion_dc_t_y");
563  h2_distortion_dc_c_y=(TH2F*)f->Get("h2_distortion_dc_c_y");
564  h2_distortion_dt_t_y=(TH2F*)f->Get("h2_distortion_dt_t_y");
565  h2_distortion_dt_c_y=(TH2F*)f->Get("h2_distortion_dt_c_y");
566  h1_distortion_dt_y= (TH1F*)f->Get("h1_distortion_dt_y");
567  h1_distortion_dc_y=(TH1F*)f->Get("h1_distortion_dc_y");
568 
569  h1_QtAssocN_y=(TH1F*)f->Get("h1_QtAssocN_y");
570  h1_QtAssocN_time_y=(TH1F*)f->Get("h1_QtAssocN_time_y");
571  h1_QtAssocN_channel_y=(TH1F*)f->Get("h1_QtAssocN_channel_y");
572 
573 
574 
575  TH1F *h1_NEvent;
576  TH1F *h1_TimeSt;
577  TH1F* h1_sigrho_gamma_x;
578  TH1F* h1_sigrho_gamma_y;
579  TH1F* h1_sigrho_TTZ_x;
580  TH1F* h1_sigrho_TTZ_y;
581 
582  h1_NEvent=(TH1F*)f->Get("h1_NEvent");
583  h1_TimeSt=(TH1F*)f->Get("h1_TimeSt");
584  h1_NEvent->SetStats(0);
585  h1_TimeSt->SetStats(0);
586  h1_sigrho_gamma_x=(TH1F*)f->Get("h1_sigrho_gamma_x");
587  h1_sigrho_gamma_y=(TH1F*)f->Get("h1_sigrho_gamma_y");
588  h1_sigrho_TTZ_x=(TH1F*)f->Get("h1_sigrho_TTZ_x");
589  h1_sigrho_TTZ_y=(TH1F*)f->Get("h1_sigrho_TTZ_y");
590 
591  h1_sigrho_gamma_x->SetStats(0);
592  h1_sigrho_gamma_y->SetStats(0);
593  h1_sigrho_TTZ_x->SetStats(0);
594  h1_sigrho_TTZ_y->SetStats(0);
595 
596  h1_sigrho_gamma_x->SetLineColor(2);
597  h1_sigrho_gamma_y->SetLineColor(4);
598  h1_sigrho_TTZ_x->SetLineColor(2);
599  h1_sigrho_TTZ_y->SetLineColor(4);
600 
601 
602  h1xd=(TH1F*)f->Get("h1xd");
603  h1yd=(TH1F*)f->Get("h1yd");
604  h1zxd=(TH1F*)f->Get("h1zxd");
605  h1zyd=(TH1F*)f->Get("h1zyd");
606  h2xz=(TH2F*)f->Get("h2xz");
607  h2yz=(TH2F*)f->Get("h2yz");
608  h2xzn=(TH2F*)f->Get("h2xzn");
609  h2yzn=(TH2F*)f->Get("h2yzn");
610  h2xyn=(TH2F*)f->Get("h2xyn");
611 
612  h1xd->SetStats(0);
613  h1yd->SetStats(0);
614  h1zxd->SetStats(0);
615  h1zyd->SetStats(0);
616  h2xz->SetStats(0);
617  h2yz->SetStats(0);
618  h2xzn->SetStats(0);
619  h2yzn->SetStats(0);
620  h2xyn->SetStats(0);
621  h1xd->SetLineColor(2);
622  h1yd->SetLineColor(4);
623  h1zxd->SetLineColor(2);
624  h1zyd->SetLineColor(4);
625 
626  h1Doca=(TH1F*)f->Get("h1Doca");
627  h1Poca_x=(TH1F*)f->Get("h1Poca_x");
628  h1Poca_y=(TH1F*)f->Get("h1Poca_y");
629  h1Poca_z=(TH1F*)f->Get("h1Poca_z");
630  h2Poca_xz=(TH2F*)f->Get("h2Poca_xz");
631  h2Poca_yz=(TH2F*)f->Get("h2Poca_yz");
632 
633  h1Px=(TH1F*)f->Get("h1Px");
634  h1Py=(TH1F*)f->Get("h1Py");
635  h1Pz=(TH1F*)f->Get("h1Pz");
636 
637  h1Azimutal=(TH1F*)f->Get("h1Azimutal");
638  h1AOpen=(TH1F*)f->Get("h1AOpen");
639 
640  h1Doca->SetStats(0);
641  h1Poca_x->SetStats(0);
642  h1Poca_y->SetStats(0);
643  h1Poca_z->SetStats(0);
644  h2Poca_xz->SetStats(0);
645  h2Poca_yz->SetStats(0);
646  h1Poca_x->SetLineColor(2);
647  h1Poca_y->SetLineColor(4);
648 
649  h1Px->SetStats(0);
650  h1Py->SetStats(0);
651  h1Pz->SetStats(0);
652 
653  h1Azimutal->SetStats(0);
654  h1AOpen->SetStats(0);
655 
656  h1NTrackX=(TH1F*)f->Get("h1NTrackX");
657  h1NTrackY=(TH1F*)f->Get("h1NTrackY");
658  h1NClusterX=(TH1F*)f->Get("h1NClusterX");
659  h1NClusterY=(TH1F*)f->Get("h1NClusterY");
660 
661  h1NClusterNX=(TH1F*)f->Get("h1NClusterNX");
662  h1NClusterNY=(TH1F*)f->Get("h1NClusterNY");
663 
664  h1NTrackX->SetStats(0);
665  h1NTrackY->SetStats(0);
666  h1NClusterX->SetStats(0);
667  h1NClusterY->SetStats(0);
668  h1NClusterNX->SetStats(0);
669  h1NClusterNY->SetStats(0);
670 
671  h1NTrackX->SetLineColor(2);
672  h1NTrackY->SetLineColor(4);
673  h1NClusterX->SetLineColor(2);
674  h1NClusterY->SetLineColor(4);
675 
676  h1NClusterNX->SetLineColor(2);
677  h1NClusterNY->SetLineColor(4);
678 
679  h1_distortion_dt_x->SetStats(0);
680  h1_distortion_dc_x->SetStats(0);
681  h1_distortion_dt_y->SetStats(0);
682  h1_distortion_dc_y->SetStats(0);
683  h2_distortion_dc_t_x->SetStats(0);
684  h2_distortion_dc_c_x->SetStats(0);
685  h2_distortion_dt_t_x->SetStats(0);
686  h2_distortion_dt_c_x->SetStats(0);
687 
688  h2_distortion_dc_t_y->SetStats(0);
689  h2_distortion_dc_c_y->SetStats(0);
690  h2_distortion_dt_t_y->SetStats(0);
691  h2_distortion_dt_c_y->SetStats(0);
692 
693  h1_Qpix_y->SetLineColor(4);
694  h1_Q_time_y->SetLineColor(4);
695  h1_Q_channel_y->SetLineColor(4);
696 
697  h1_QTcluster_y->SetLineColor(4);
698  h1_QCcluster_y->SetLineColor(4);
699  h1_SigTcluster_y->SetLineColor(4);
700  h1_SigCcluster_y->SetLineColor(4);
701  h1_WidthTcluster_y->SetLineColor(4);
702  h1_WidthCcluster_y->SetLineColor(4);
703  h1_IndexTcluster_y->SetLineColor(4);
704  h1_IndexCcluster_y->SetLineColor(4);
705  h1_MeanTcluster_y->SetLineColor(4);
706  h1_MeanCcluster_y->SetLineColor(4);
707 
708  h1_theta_y->SetLineColor(4);
709  h1_rho_y->SetLineColor(4);
710  h1_sigtheta_y->SetLineColor(4);
711  h1_sigrho_y->SetLineColor(4);
712  h1_QcAssoc_y->SetLineColor(4);
713  h1_QcNAssoc_y->SetLineColor(4);
714  h1_QtAssoc_y->SetLineColor(4);
715  h1_QtNAssoc_y->SetLineColor(4);
716  h1_TypeTrack_y->SetLineColor(4);
717  h1_angleTrack_y->SetLineColor(4);
718 
719  h1_QtAssocN_y->SetLineColor(4);
720  h1_QtAssocN_time_y->SetLineColor(4);
721  h1_QtAssocN_channel_y->SetLineColor(4);
722 
723 
724  h1_Qpix_y->SetStats(0);
725  h1_Q_time_y->SetStats(0);
726  h1_Q_channel_y->SetStats(0);
727 
728  h1_QTcluster_y->SetStats(0);
729  h1_QCcluster_y->SetStats(0);
730  h1_SigTcluster_y->SetStats(0);
731  h1_SigCcluster_y->SetStats(0);
732  h1_WidthTcluster_y->SetStats(0);
733  h1_WidthCcluster_y->SetStats(0);
734  h1_IndexTcluster_y->SetStats(0);
735  h1_IndexCcluster_y->SetStats(0);
736  h1_MeanTcluster_y->SetStats(0);
737  h1_MeanCcluster_y->SetStats(0);
738 
739  h1_theta_y->SetStats(0);
740  h1_rho_y->SetStats(0);
741  h1_sigtheta_y->SetStats(0);
742  h1_sigrho_y->SetStats(0);
743  h1_QcAssoc_y->SetStats(0);
744  h1_QcNAssoc_y->SetStats(0);
745  h1_QtAssoc_y->SetStats(0);
746  h1_QtNAssoc_y->SetStats(0);
747  h1_TypeTrack_y->SetStats(0);
748  h1_angleTrack_y->SetStats(0);
749 
750  h1_QtAssocN_y->SetStats(0);
751  h1_QtAssocN_time_y->SetStats(0);
752  h1_QtAssocN_channel_y->SetStats(0);
753 
754 
755  TH1F *h1_vertex_tr1;
756  TH1F *h1_vertex_tr2;
757  TH2F *h2_vertex;
758 
759  h1_vertex_tr1=(TH1F*)f->Get("h1_vertex_tr1");
760  h1_vertex_tr2=(TH1F*)f->Get("h1_vertex_tr2");
761  h2_vertex=(TH2F*)f->Get("h2_vertex");
762  h1_vertex_tr1->SetStats(0);;
763  h1_vertex_tr2->SetStats(0);;
764  h2_vertex->SetStats(0);;
765 
766  h1_vertex_tr1->SetLineColor(2);
767  h1_vertex_tr2->SetLineColor(4);
769 
770  Int_t NEventEmpty = h1_NEvent->GetBinContent(1);
771  Int_t NEventDEPOSIT = h1_NEvent->GetBinContent(2);
772  Int_t NEventTTZ= h1_NEvent->GetBinContent(3);
773  Int_t NEventTT = h1_NEvent->GetBinContent(4);
774  Int_t NEventTCR = h1_NEvent->GetBinContent(5);
775  Int_t NEventTCN = h1_NEvent->GetBinContent(6);
776  Int_t NEventGAMMA = h1_NEvent->GetBinContent(7);
777  Int_t NEventDELTA = h1_NEvent->GetBinContent(8);
778  Int_t NEvent2TOTHER = h1_NEvent->GetBinContent(9);
779  Int_t NEventSHOWER = h1_NEvent->GetBinContent(10);
780  Int_t NEventOTHER = h1_NEvent->GetBinContent(11);
781  Int_t NEvent = h1_NEvent->GetBinContent(0);
782  // ULong_t TimeSt = h1_TimeSt->GetBinContent(1);
783  Double_t TimeSt = h1_TimeSt->GetBinContent(1);
784  Double_t tEvent = NEvent/TimeSt;
785  Double_t tGamma = NEventGAMMA/TimeSt;
786  Double_t tEmpty = NEventEmpty/TimeSt;
787 
788  Int_t QmaxX = h1_QtAssocN_time_x->GetMaximum();
789  TF1 *myFitx = new TF1("myFitx","[3]/4*TMath::Erfc((x-[0])/[4])*TMath::Erfc(([1]-x)/[5])*TMath::Exp(-(x-[1])/[2])",100,450);
790  myFitx->SetParameters(410,102,1000,QmaxX,6,6);
791  myFitx->SetLineColor(kBlack);
792  h1_QtAssocN_time_x->Fit(myFitx);
793 
794  Int_t QmaxY = h1_QtAssocN_time_y->GetMaximum();
795  TF1 *myFity = new TF1("myFity","[3]/4*TMath::Erfc((x-[0])/[4])*TMath::Erfc(([1]-x)/[5])*TMath::Exp(-(x-[1])/[2])",100,450);
796  myFity->SetParameters(410,102,1500,QmaxY,6,6);
797  myFity->SetLineColor(kBlack);
798  h1_QtAssocN_time_y->Fit(myFity);
799 
800 
801  Double_t xbinc= h1xd->GetBinCenter(h1xd->GetMaximumBin());
802  Double_t ybinc= h1yd->GetBinCenter(h1yd->GetMaximumBin());
803 
804  TF1 *xfit = new TF1("xfit","gaus",xbinc-10,xbinc+10);
805  TF1 *yfit = new TF1("yfit","gaus",ybinc-10,ybinc+10);
806  h1xd->Fit(xfit);
807  h1yd->Fit(yfit);
808  xfit->SetLineColor(2);
809  yfit->SetLineColor(4);
810 
811 
812  h1xd->GetXaxis()->SetRangeUser(xbinc-12,xbinc+12);
813  h1yd->GetXaxis()->SetRangeUser(ybinc-12,ybinc+12);
814 
815  // myFitRho->SetParameters(MAX,mrho,sigrho);
816  // myFitRho->SetLineColor(kRed);
817 
818 
819  h2xz->GetYaxis()->SetRangeUser(xfit->GetParameter(2)-10,xfit->GetParameter(2)+10);
820  h2yz->GetYaxis()->SetRangeUser(yfit->GetParameter(2)-10,yfit->GetParameter(2)+10);
821  TProfile* p2xz = h2xz->ProfileX();
822  TProfile* p2yz = h2yz->ProfileX();
823  p2xz->GetYaxis()->SetRangeUser(xbinc-10,xbinc+10);
824  p2yz->GetYaxis()->SetRangeUser(ybinc-10,ybinc+10);
825  // p2xz->Fit("pol1");
826  // p2yz->Fit("pol1");
827 
828  Double_t PxMax= h1Poca_x->GetBinCenter(h1xd->GetMaximumBin());
829  Double_t PyMax= h1Poca_y->GetBinCenter(h1yd->GetMaximumBin());
830 
831  TF1 *xfitPoca = new TF1("xfitPoca","gaus",PxMax-15,PxMax+15);
832  TF1 *yfitPoca = new TF1("yfitPoca","gaus",PyMax-15,PyMax+15);
833  h1Poca_x->Fit(xfitPoca);
834  h1Poca_y->Fit(yfitPoca);
835 
836 
837  TF1 *myFitAlignmentX=new TF1("myFitAlignmentX","[0]+x*[1]",100.0,400.0);
838  TF1 *myFitAlignmentY=new TF1("myFitAlignmentY","[0]+x*[1]",100.0,400.0);
839  myFitAlignmentX->SetParameters(0.0022,xfit->GetParameter(2));
840  myFitAlignmentY->SetParameters(0.0022,yfit->GetParameter(2));
841  myFitAlignmentX->SetLineColor(2);
842  myFitAlignmentY->SetLineColor(4);
843 
844  myFitAlignmentX->SetLineWidth(1);
845 
846  myFitAlignmentY->SetLineWidth(1);
847  h2xz->Fit(myFitAlignmentX);
848  h2yz->Fit(myFitAlignmentY);
849 
850  //h2xzn->GetYaxis()->SetRangeUser(xbinc-153.5.,xbinc-133.5.);
851  //h2yzn->GetYaxis()->SetRangeUser(ybinc-153.5,ybinc-133.5);
852  h2xzn->GetYaxis()->SetRangeUser(xfit->GetParameter(2)-153.5,xfit->GetParameter(2)-133.5);
853  h2yzn->GetYaxis()->SetRangeUser(yfit->GetParameter(2)-153.5,yfit->GetParameter(2)-133.5);
854 
855  // h2xyn->GetXaxis()->SetRangeUser(-13.,13.);
856  // h2xyn->GetYaxis()->SetRangeUser(-12.5,12.5);
857  TProfile* p2xzn = h2xzn->ProfileX();
858  TProfile* p2yzn = h2yzn->ProfileX();
859  p2xzn->GetYaxis()->SetRangeUser(-13.,13.);
860  p2yzn->GetYaxis()->SetRangeUser(12.5,12.5);
861 
862  TF1 *fitnX=new TF1("fitnX","[0]+x*[1]",-150.0,150.0);
863  TF1 *fitnY=new TF1("fitnY","[0]+x*[1]",-150.0,150.0);
864  fitnX->SetParameters(0.0022,xfit->GetParameter(2)-143.5);
865  fitnY->SetParameters(0.0022,yfit->GetParameter(2)-143.5);
866  fitnX->SetLineColor(2);
867  fitnY->SetLineColor(4);
868  fitnX->SetLineWidth(1);
869  fitnY->SetLineWidth(1);
870  h2xzn->Fit(fitnX);
871  h2yzn->Fit(fitnY);
872 
873 
874  // h2Poca_xz->GetYaxis()->SetRangeUser(123.5,163.5);
875  // h2Poca_yz->GetYaxis()->SetRangeUser(123.5,163.5);
876 
877  h2Poca_xz->GetYaxis()->SetRangeUser(xfitPoca->GetParameter(2)-10,xfitPoca->GetParameter(2)+10);
878  h2Poca_yz->GetYaxis()->SetRangeUser(yfitPoca->GetParameter(2)-10,yfitPoca->GetParameter(2)+10);
879 
880 
881  TF1 *fitPX=new TF1("fitPX","[0]+x*[1]",100.0,400.0);
882  TF1 *fitPY=new TF1("fitPY","[0]+x*[1]",100.0,400.0);
883  fitPX->SetParameters(0.0022,xfitPoca->GetParameter(2));
884  fitPY->SetParameters(0.0022,yfitPoca->GetParameter(2));
885  fitPX->SetLineColor(2);
886  fitPY->SetLineColor(4);
887  fitPX->SetLineWidth(1);
888  fitPY->SetLineWidth(1);
889  h2Poca_xz->Fit(fitPX);
890  h2Poca_yz->Fit(fitPY);
891 
892  Double_t anxP=fitPX->GetParameter(1);
893  Double_t poxP=fitPX->GetParameter(0);
894 
895  Double_t anyP=fitPY->GetParameter(1);
896  Double_t poyP=fitPY->GetParameter(0);
897 
898  Double_t anxN=fitnX->GetParameter(1);
899  Double_t poxN=fitnX->GetParameter(0);
900 
901  Double_t anyN=fitnY->GetParameter(1);
902  Double_t poyN=fitnY->GetParameter(0);
903 
904  Double_t anx=myFitAlignmentX->GetParameter(1);
905  Double_t pox=myFitAlignmentX->GetParameter(0);
906 
907  Double_t any=myFitAlignmentY->GetParameter(1);
908  Double_t poy=myFitAlignmentY->GetParameter(0);
910  TChain* tree = new TChain("data");
911  tree->Add(inputfile);
912  TH1F* hdX = new TH1F("hdX","#delta_{X};t[bin];channel;",150,-15,15);
913  tree->Project("hdX",Form("fAlignmentX-fAlignmentZx*%f-%f",anx, pox),"","");
914  TF1 *dX_fit = new TF1("dX_fit","gaus",-10.,10.);
915  dX_fit->SetLineColor(2);
916  hdX->Fit(dX_fit);
917  hdX->SetStats(0);
918  Double_t meanX_fit = dX_fit->GetParameter(1);
919  TH1F* hdXal = new TH1F("hdXal","#delta_{X};t[bin];channel;",150,-15,15);
920  hdXal->SetLineColor(2);
921  tree->Project("hdXal",Form("fAlignmentX-fAlignmentZx*%f-%f",anx, pox),Form("abs(fAlignmentX-fAlignmentZx*%f-%f-%f)<2",anx, pox,meanX_fit),"");
922  Int_t NXal=hdX->GetEntries();
923 
924  TH1F* hdY = new TH1F("hdY","#delta_{Y};t[bin];channel;",150,-15,15);
925  tree->Project("hdY",Form("fAlignmentY-fAlignmentZy*%f-%f",any, poy),"","");
926  TF1 *dY_fit = new TF1("dY_fit","gaus",-10.,10.);
927  dY_fit->SetLineColor(4);
928  hdY->Fit(dY_fit);
929  hdY->SetStats(0);
930  Double_t meanY_fit = dX_fit->GetParameter(1);
931  TH1F* hdYal = new TH1F("hdYal","#delta_{X};t[bin];channel;",150,-15,15);
932  hdYal->SetLineColor(4);
933  tree->Project("hdYal",Form("fAlignmentY-fAlignmentZy*%f-%f",any, poy),Form("abs(fAlignmentY-fAlignmentZy*%f-%f-%f)<2",any, poy,meanY_fit),"");
934  Int_t NYal=hdY->GetEntries();
936 
937  // TF1 *myFitErfx = new TF1("myFitErfx","[3]/4*TMath::Erfc((x-[0])/[4])*TMath::Erfc(([1]-x)/[5])*TMath::Exp(-(x-[1])/[2])",100.,450.);
938  // myFitErfx->SetParameters(400.,102.,2500.,700.,6.,6.);
939  // myFitErfx->SetLineColor(kRed);
940 
941  // TF1 *myFitErfy = new TF1("myFitErfy","[3]/4*TMath::Erfc((x-[0])/[4])*TMath::Erfc(([1]-x)/[5])*TMath::Exp(-(x-[1])/[2])",100.,450.);
942  // myFitErfy->SetParameters(400.,102.,2500.,600.,6.,6.);
943  // myFitErfy->SetLineColor(kRed);
944 
945  // //h2_QtAssocN_time_x->Fit(myFitErfx);
946  // h2_Qprof_x->Fit(myFitErfx);
947  // h2_Qprof_y->Fit(myFitErfy);
948  // //h2_QtAssocN_time_y->Fit(myFitErfy);
949 
950  Double_t x0 = myFitx->GetParameter(0);
951  Double_t x1 = myFitx->GetParameter(1);
952  Double_t y0 = myFity->GetParameter(0);
953  Double_t y1 = myFity->GetParameter(1);
954  Double_t xt= x0-x1;
955  Double_t yt= y0-y1;
956  Double_t sigma0x = myFitx->GetParameter(4);
957  Double_t sigma1x = myFitx->GetParameter(5);
958  Double_t sigma0y = myFity->GetParameter(4);
959  Double_t sigma1y = myFity->GetParameter(5);
960 
961  Double_t GainX= h1_QtAssocN_time_x->Integral();
962  Double_t GainY= h1_QtAssocN_time_y->Integral();
963  Double_t labx = myFitx->GetParameter(2);
964  Double_t laby = myFity->GetParameter(2);
965 
966  Double_t drt = h1_dtime->GetBinCenter(h1_dtime->GetMaximumBin());
967 
968 
969  // HarpoEventHeader *hdr = fEvt->GetHeader();
970  // Int_t Nevt=fEvt->GetRecoEvent()->evNum;
971  TCanvas *tcanvas[24];
972  for(Int_t i = 0; i<25; i++){
973  tcanvas[i] = new TCanvas(Form("tcanvas%d",i),"Event Map",700,500);
974  }
975  // Int_t i;
976 
977  //numerical value
978  tcanvas[0]->cd();
979  //gBenchmark->Start("canvas");
980  TPad *pad1 = new TPad("pad1","This is pad1",0.05,0.05,0.95,0.97);
981  // TPad *pad2 = new TPad("pad2","This is pad2",0.05,0.02,0.95,0.47);
982  pad1->SetFillColor(11);
983  // pad2->SetFillColor(11);
984  pad1->Draw();
985  // pad2->Draw();
986 
987  pad1->cd();
988  TText *t11 = new TText(0.13,0.9,Form("HARPO Monitoring Offline Summary of %s",outputfile));
989  t11->SetTextSize(0.06);
990  t11->Draw();
991 
992  TText *tpage = new TText(0.5,0.015,"page 1");
993  tpage->SetTextSize(0.03);
994  tpage->SetTextColor(7);
995  tpage->Draw();
996 
997  float xp1 = 0.9;
998  float yp1 = 0.85;
999  TPaveText *pave1 = new TPaveText(0.1,0.05,xp1,yp1);
1000  //pave1->AddText("This is a PavesText");
1001  pave1->AddText(" plan X plan Y");
1002  pave1->AddText(Form("#theta_{tr} %.4f [rad] %.4f [rad] ",anxN,anyN));
1003  pave1->AddText(Form(" pos_{center} %.2f [bin] %.2f [bin] ",poxN,poyN));
1004  //pave1->AddText("- Characterization (fit): ");
1005  pave1->AddText(Form("Q_{t} %.3f 10^{6} [ADC] %.3f 10^{6} [ADC] ",GainX/1000000,GainY/1000000));
1006  pave1->AddText(Form("t_{drift} %.1f [bin] %.1f [bin] ",xt,yt));
1007  pave1->AddText(Form(" %.3f[#mus] %.3f[#mus] ",xt*0.03,yt*0.03));
1008  // pave1->AddText("- Characterization (t1-t0): ");
1009  pave1->AddText(Form("v_{drift} %.2f [cm/#mus] %.2f [cm/#mus] ",1000/xt,1000/yt));
1010  pave1->AddText(Form(" #alpha = 1/#lambda_{ab} %.2f [ms^{-1}] %.2f [ms^{-1}] ",1/(labx*0.00003),1/(laby*0.00003)));
1011 
1012  //pave1->AddText(Form("t_{drift} t_{1} - t_{0} = %.1f [bin] = %.3f [#mus] ",drt,drt*0.03));
1013  //pave1->AddText(Form("v_{drift} %.2f [cm/#mus] ",1000/drt));
1014 
1015  pave1->AddText(Form("N_{evt} = %d, N_{#gamma} = %d, T = %.2f[s]",NEvent, NEventGAMMA, TimeSt));
1016  pave1->AddText(Form("#tau_{evt} = %.2f [s^{-1}], #tau_{#gamma} = %.2f [s^{-1}], #tau_{empty} = %.2f [s^{-1}]",tEvent, tGamma, tEmpty));
1017  pave1->SetFillColor(43);
1018  pave1->Draw();
1019 
1020 
1021  TLine *line2 = new TLine(0.1,0.77,0.9,0.77);
1022  line2->SetLineWidth(1);
1023  line2->SetLineColor(5);
1024  line2->Draw();
1025  line2->DrawLine(0.1,0.61,0.9,0.61);
1026 
1027  line2->DrawLine(0.1,0.22,0.9,0.22);
1028  //line2->DrawLine(0.1,0.13,0.9,0.13);
1029  line2->DrawLine(0.3,0.22,0.3,0.85);
1030 
1031 
1032  //MakeNiceHisto(h2yz,tcanvas[0],"");
1033  // MakeNiceHisto(h2_QtAssocN_time_x,tcanvas[0],"colz");//gPad->SetLogz();gPad->SetLogy();
1034  // MakeNiceHisto(h2_Qprof_x,tcanvas[0],"same");//gPad->SetLogy();
1035  // TLatex *latex4 = new TLatex();
1036  // latex4->SetTextFont(132);
1037  // latex4->SetTextAlign(12);
1038  // latex4->SetTextSize(0.07);
1039  // latex4->DrawLatex(100,5500,Form("Gain=%.1f ADC",GainX));
1040  // latex4->DrawLatex(150,3000,Form("t_{1}=%.1f bin",x0));
1041  // latex4->DrawLatex(150,2500,Form("t_{0}=%.1f bin",x1));
1042  // latex4->DrawLatex(150,2000,Form("t_{drift}=%.1f bin",xt));
1043  // latex4->DrawLatex(150,1500,Form("#sigma_{t1}=%.1f bin",sigma0x));
1044  // latex4->DrawLatex(150,1000,Form("#sigma_{t0}=%.1f bin",sigma1x));
1045  // latex4->DrawLatex(150,500,Form("#lambda_{ab}=%.1f bin",labx));
1046 
1047  //MakeNiceHisto(h2,tcanvas[0],"");
1048  // //h2->Draw();
1049  // TLatex *lresume = new TLatex();
1050  // lresume->SetTextFont(132);
1051  // lresume->SetTextAlign(12);
1052  // lresume->SetTextSize(0.05);
1053  // lresume->DrawLatex(50,5500,"1) Alignment(a method of fitting the position of first cluster):");
1054  // lresume->DrawLatex(100,4900,Form("#theta_{xz}=%.3f[rad], Px=%.1f[bin];",anx,pox));
1055  // lresume->DrawLatex(100,4500,Form("#theta_{yz}=%.3f[rad], Py=%.1f[bin].",any,poy));
1056  // lresume->DrawLatex(50,4100,"2) Characterization (fit):");
1057  // lresume->DrawLatex(100,3700,Form("Gain_{x}=%.1f ADC, Gain_{y}=%.1f ADC;",GainX,GainY));
1058  // lresume->DrawLatex(100,3300,Form("t_{drift}(x)=%.1f bin, t_{drift}(y)=%.1f bin.",xt,yt));
1059  // lresume->DrawLatex(50,2900,"3) Characterization (t1-t0):");
1060  // lresume->DrawLatex(100,2500,Form("t_{drift}=%.1f bin.",drt));
1061  // lresume->DrawLatex(50,2100,"4) Angle 3d:");
1062  // lresume->DrawLatex(100,1700,"#theta_{open}= [rad], #theta_{azm}= [rad]");
1063  // lresume->DrawLatex(50,1300,"5) #gamma direction: px = , py = , pz = ");
1064  // lresume->DrawLatex(100,1900,Form("t_{drift}=%.1f bin.",drt));
1065 
1066 
1067 
1068  //alignment: method of the position of signal
1069  tcanvas[1]->Divide(2,2);
1070  tcanvas[1]->cd();
1071  // TPad *pad2 = new TPad("pad2","This is pad2",0.05,0.95,0.95,0.99);
1072  // pad2->SetFillColor(11);
1073  // pad2->Draw();
1074  TText *t21 = new TText(0.06,0.955,Form("Alignment: fit the position of first 3 clusters of gamma (%d evts)", NEventGAMMA));
1075  t21->SetTextSize(0.04);
1076  t21->Draw();
1077 
1078  TText *t211 = new TText(0.9,0.85,"X");
1079  t211->SetTextSize(0.03);
1080  t211->SetTextColor(2);
1081  t211->Draw();
1082 
1083  TText *t212 = new TText(0.9,0.82,"Y");
1084  t212->SetTextSize(0.03);
1085  t212->SetTextColor(4);
1086  t212->Draw();
1087 
1088  TText *t213 = new TText(0.4,0.85,"X");
1089  t213->SetTextSize(0.03);
1090  t213->SetTextColor(2);
1091  t213->Draw();
1092 
1093  TText *t214 = new TText(0.4,0.82,"Y");
1094  t214->SetTextSize(0.03);
1095  t214->SetTextColor(4);
1096  t214->Draw();
1097 
1098  TText *t21page = new TText(0.5,0.03,"page 2");
1099  t21page->SetTextSize(0.03);
1100  t21page->SetTextColor(7);
1101  t21page->Draw();
1102 
1103 
1104  MakeNiceHisto(h1zxd,tcanvas[1]->GetPad(1),"");
1105  MakeNiceHisto(h1zyd,tcanvas[1]->GetPad(1),"same");
1106  MakeNiceHisto(h1xd,tcanvas[1]->GetPad(2),"");
1107  MakeNiceHisto(h1yd,tcanvas[1]->GetPad(2),"same");
1108  MakeNiceHisto(h2xz,tcanvas[1]->GetPad(3),"");
1109  //MakeNiceHisto(h2xz,tcanvas[1]->GetPad(3),"same");
1110  TLatex *lxz = new TLatex();
1111  lxz->SetTextFont(132);
1112  lxz->SetTextAlign(12);
1113  lxz->SetTextSize(0.07);
1114  lxz->SetTextColor(2);
1115  lxz->DrawLatex(100,140,Form("x=%.4ft+%.2f",anx,pox));
1116  MakeNiceHisto(h2yz,tcanvas[1]->GetPad(4),"");
1117  //MakeNiceHisto(h2yz,tcanvas[1]->GetPad(4),"same");
1118  TLatex *lyz = new TLatex();
1119  lyz->SetTextFont(132);
1120  lyz->SetTextAlign(12);
1121  lyz->SetTextSize(0.07);
1122  lyz->SetTextColor(4);
1123  lyz->DrawLatex(100,140,Form("y=%.4ft+%.2f",any,poy));
1124 
1125  //
1126 
1127 
1128  tcanvas[2]->Divide(2,1);
1129  tcanvas[2]->cd();
1130  TText *tcen = new TText(0.10,0.955,Form("Alignment: with first 3 clusters of gamma (%d evts) in center of strips", NEventGAMMA));
1131  tcen->SetTextSize(0.04);
1132  tcen->Draw();
1133 
1134  TText *tcenpage = new TText(0.5,0.03,"page 3");
1135  tcenpage->SetTextSize(0.03);
1136  tcenpage->SetTextColor(7);
1137  tcenpage->Draw();
1138 
1139  MakeNiceHisto(h2xzn,tcanvas[2]->GetPad(1),"");
1140  //MakeNiceHisto(p2xzn,tcanvas[2]->GetPad(1),"same");
1141  TLatex *lxzn = new TLatex();
1142  lxzn->SetTextFont(132);
1143  lxzn->SetTextAlign(12);
1144  lxzn->SetTextSize(0.06);
1145  lxzn->SetTextColor(2);
1146  if(poxN<0) lxzn->DrawLatex(-20,-5,Form("x_{c}=%.4ft_{c}%.2f",anxN,poxN));
1147  else lxzn->DrawLatex(-20,-5,Form("x_{c}=%.4ft_{c}+%.2f",anxN,poxN));
1148  // MakeNiceHisto(p2yz,tcanvas[1]->GetPad(4),"");
1149 
1150  MakeNiceHisto(h2yzn,tcanvas[2]->GetPad(2),"");
1151  //MakeNiceHisto(p2yzn,tcanvas[2]->GetPad(2),"same");
1152  TLatex *lyzn = new TLatex();
1153  lyzn->SetTextFont(132);
1154  lyzn->SetTextAlign(12);
1155  lyzn->SetTextSize(0.06);
1156  lyzn->SetTextColor(4);
1157  if(poyN<0) lyzn->DrawLatex(-20,-5,Form("y_{c}=%.4ft_{c}%.2f",anyN,poyN));
1158  else lyzn->DrawLatex(-20,-5,Form("y_{c}=%.4ft_{c}+%.2f",anyN,poyN));
1159 
1160  //MakeNiceHisto(h2xyn,tcanvas[2]->GetPad(3),"");
1161 
1162  //alignment method POCA and DOCA
1163  tcanvas[3]->Divide(2,2);
1164  tcanvas[3]->cd();
1165  TText *t22 = new TText(0.10,0.955,Form("Alignment: with POCA and DOCA of gamma (%d evts)", NEventGAMMA));
1166  t22->SetTextSize(0.04);
1167  t22->Draw();
1168 
1169  TText *t221 = new TText(0.92,0.85,"X");
1170  t221->SetTextSize(0.03);
1171  t221->SetTextColor(2);
1172  t221->Draw();
1173 
1174  TText *t222 = new TText(0.92,0.82,"Y");
1175  t222->SetTextSize(0.03);
1176  t222->SetTextColor(4);
1177  t222->Draw();
1178 
1179  TText *t22page = new TText(0.5,0.03,"page 4");
1180  t22page->SetTextSize(0.03);
1181  t22page->SetTextColor(7);
1182  t22page->Draw();
1183 
1184  //tcanvas[2]->SetTopMargin(0.1);
1185  MakeNiceHisto(h1Poca_z,tcanvas[3]->GetPad(1),"");
1186  MakeNiceHisto(h1Poca_x,tcanvas[3]->GetPad(2),"");
1187  MakeNiceHisto(h1Poca_y,tcanvas[3]->GetPad(2),"same");
1188  MakeNiceHisto(h2Poca_xz,tcanvas[3]->GetPad(3),"");
1189 
1190  TLatex *lxzp = new TLatex();
1191  lxzp->SetTextFont(132);
1192  lxzp->SetTextAlign(12);
1193  lxzp->SetTextSize(0.07);
1194  lxzp->SetTextColor(2);
1195  lxzp->DrawLatex(100,140,Form("x=%.4ft+%.2f",anxP,poxP));
1196  MakeNiceHisto(h2Poca_yz,tcanvas[3]->GetPad(4),"");
1197  TLatex *lyzp = new TLatex();
1198  lyzp->SetTextFont(132);
1199  lyzp->SetTextAlign(12);
1200  lyzp->SetTextSize(0.07);
1201  lyzp->SetTextColor(4);
1202  lyzp->DrawLatex(100,140,Form("y=%.4ft+%.2f",anyP,poyP));
1203 
1204 
1205  tcanvas[4]->Divide(2,1);
1206  tcanvas[4]->cd();
1207  TText *t23 = new TText(0.10,0.955,Form("Calibration by fitting the time spectrum of charges of TTZ (%d evts)", NEventTTZ));
1208  t23->SetTextSize(0.04);
1209  t23->Draw();
1210 
1211  TText *t1 = new TText(0.4,0.85,"X");
1212  t1->SetTextSize(0.03);
1213  t1->SetTextColor(2);
1214  t1->Draw();
1215 
1216  TText *t2 = new TText(0.9,0.85,"Y");
1217  t2->SetTextSize(0.03);
1218  t2->SetTextColor(4);
1219  t2->Draw();
1220 
1221  TText *t2page = new TText(0.5,0.03,"page 5");
1222  t2page->SetTextSize(0.03);
1223  t2page->SetTextColor(7);
1224  t2page->Draw();
1225 
1226  //MakeNiceHisto(h2_QtAssocN_time_x,tcanvas[3]->GetPad(1),"colz");//gPad->SetLogz();gPad->SetLogy();
1227  // MakeNiceHisto(h2_Qprof_x,tcanvas[3]->GetPad(1),"");//gPad->SetLogy();
1228  MakeNiceHisto(h1_QtAssocN_time_x,tcanvas[4]->GetPad(1),"");//gPad->SetLogy();
1229  // MakeNiceHisto(h1_Q_time_x,tcanvas[4]->GetPad(1),"");//gPad->SetLogy();
1230  TLatex *latex1 = new TLatex();
1231  latex1->SetTextFont(132);
1232  latex1->SetTextAlign(12);
1233  latex1->SetTextSize(0.03);
1234  latex1->DrawLatex(150,0.9*QmaxX,Form("Q_{t}=%.3f 10^{6} [ADC]",GainX/1000000));
1235  latex1->DrawLatex(150,0.7*QmaxX,Form("t_{1}=%.1f [bin]",x0));
1236  latex1->DrawLatex(150,0.8*QmaxX,Form("t_{0}=%.1f [bin]",x1));
1237  latex1->DrawLatex(150,0.6*QmaxX,Form("t_{drift}=%.1f [bin] = %.3f [#mus]",xt,xt*0.03));
1238  latex1->DrawLatex(150,0.5*QmaxX,Form("v_{drift}= %.2f [cm/#mus]",1000/xt));
1239  latex1->DrawLatex(150,0.4*QmaxX,Form("#sigma_{t1}=%.1f [bin] = %.4f [#mus]",sigma0x,sigma0x*0.03));
1240  latex1->DrawLatex(150,0.3*QmaxX,Form("#sigma_{t0}=%.1f [bin] = %.4f [#mus]",sigma1x,sigma1x*0.03));
1241  latex1->DrawLatex(150,0.2*QmaxX,Form("#alpha= %.2f [ms^{-1}]",1/(labx*0.00003)));
1242  // latex1->DrawLatex(242,2.4e4, "plan Y");
1243  //MakeNiceHisto(h2_QtAssocN_time_x,tcanvas[7]->GetPad(1),"profil,same");//gPad->SetLogy();
1244  //MakeNice2dHisto(h2_QtAssocN_time_y,tcanvas[3]->GetPad(2),"colz");//gPad->SetLogz();gPad->SetLogy();
1245  // MakeNiceHisto(h2_Qprof_y,tcanvas[3]->GetPad(2),"");//gPad->SetLogy();
1246  MakeNiceHisto(h1_QtAssocN_time_y,tcanvas[4]->GetPad(2),"");//gPad->SetLogy();
1247  // MakeNiceHisto(h1_Q_time_y,tcanvas[4]->GetPad(2),"");//gPad->SetLogy();
1248  TLatex *latex2 = new TLatex();
1249  latex2->SetTextFont(132);
1250  latex2->SetTextAlign(12);
1251  latex2->SetTextSize(0.03);
1252  latex2->DrawLatex(150,0.9*QmaxY,Form("Q_{t}=%.3f 10^{6} [ADC]",GainY/1000000));
1253  latex2->DrawLatex(150,0.7*QmaxY,Form("t_{1}=%.1f [bin]",y0));
1254  latex2->DrawLatex(150,0.8*QmaxY,Form("t_{0}=%.1f [bin]",y1));
1255  latex2->DrawLatex(150,0.6*QmaxY,Form("t_{drift}=%.1f [bin] = %.3f [#mus]",yt,yt*0.03));
1256  latex2->DrawLatex(150,0.5*QmaxY,Form("v_{drift}= %.2f [cm/#mus]",1000/yt));
1257  latex2->DrawLatex(150,0.4*QmaxY,Form("#sigma_{t1}=%.1f [bin] = %.4f [#mus]",sigma0y,sigma0y*0.03));
1258  latex2->DrawLatex(150,0.3*QmaxY,Form("#sigma_{t0}=%.1f [bin] = %.4f [#mus]",sigma1y,sigma1y*0.03));
1259  latex2->DrawLatex(150,0.2*QmaxY,Form("#alpha=%.2f [ms^{-1}]",1/(laby*0.00003)));
1260 
1261 
1262  //method of tmax and tmin to calculate drift time
1263  tcanvas[5]->Divide(3,1);
1264  tcanvas[5]->cd();
1265  TText *t24 = new TText(0.10,0.955,Form("Calibration by the first cluster and last cluster TTZ (%d evts)", NEventTTZ));
1266  t24->SetTextSize(0.04);
1267  t24->Draw();
1268  TText *t20 = new TText(0.85,0.8,Form("tdrift = %.1f [bin]",drt));
1269  t20->SetTextSize(0.02);
1270  t20->SetTextColor(3);
1271  t20->Draw();
1272  TText *t24page = new TText(0.5,0.03,"page 6");
1273  t24page->SetTextSize(0.03);
1274  t24page->SetTextColor(7);
1275  t24page->Draw();
1276 
1277  MakeNiceHisto(h1_tmin,tcanvas[5]->GetPad(1),"");//h1_tmin->Draw();
1278  // Double_t drt=330.1;
1279  // TLatex *lt = new TLatex();
1280  // lt->SetTextFont(132);
1281  // lt->SetTextAlign(12);
1282  // lt->SetTextSize(0.07);
1283  // lt->DrawLatex(150,2.4e4,Form("t_{drift}=t_{min}-t_{max}=%.1f bin",drt));
1284  MakeNiceHisto(h1_tmax,tcanvas[5]->GetPad(2),"");
1285  MakeNiceHisto(h1_dtime,tcanvas[5]->GetPad(3),"");
1286  //lt->DrawLatex(150,1500,"test test");
1287 
1288 
1290  //pixel signal
1291  tcanvas[6]->Divide(1,1);
1292  tcanvas[6]->cd();
1293  TText *t25 = new TText(0.10,0.955,Form("Q of pixel of %d evts",NEvent));
1294  t25->SetTextSize(0.04);
1295  t25->Draw();
1296 
1297  TText *t251 = new TText(0.9,0.85,"X");
1298  t251->SetTextSize(0.03);
1299  t251->SetTextColor(2);
1300  t251->Draw();
1301 
1302 
1303  TText *t252 = new TText(0.9,0.82,"Y");
1304  t252->SetTextSize(0.03);
1305  t252->SetTextColor(4);
1306  t252->Draw();
1307 
1308  TText *t25page = new TText(0.5,0.03,"page 7");
1309  t25page->SetTextSize(0.03);
1310  t25page->SetTextColor(7);
1311  t25page->Draw();
1312 
1313  MakeNiceHisto(h1_Qpix_x,tcanvas[6]->GetPad(1),"");gPad->SetLogx();gPad->SetLogy(); MakeLogBinning(500, 50., 5000.);
1314  MakeNiceHisto(h1_Qpix_y,tcanvas[6]->GetPad(1),"same");
1315  // leg = new TLegend(0.15,0.81,0.4,0.9);
1316  // leg->AddEntry(h1_Qpix_x,"X","l");
1317  // leg->AddEntry(h1_Qpix_y,"Y","l");
1318  // leg->Draw();
1319 
1320  //pixel signal vs time
1321  tcanvas[7]->Divide(1,1);
1322  tcanvas[7]->cd();
1323  TText *t26 = new TText(0.20,0.955,Form("Time spectrum of pixel charges of %d evts",NEvent));
1324  t26->SetTextSize(0.04);
1325  t26->Draw();
1326 
1327  TText *t261 = new TText(0.9,0.85,"X");
1328  t261->SetTextSize(0.03);
1329  t261->SetTextColor(2);
1330  t261->Draw();
1331 
1332  TText *t262 = new TText(0.9,0.82,"Y");
1333  t262->SetTextSize(0.03);
1334  t262->SetTextColor(4);
1335  t262->Draw();
1336 
1337  TText *t26page = new TText(0.5,0.03,"page 8");
1338  t26page->SetTextSize(0.03);
1339  t26page->SetTextColor(7);
1340  t26page->Draw();
1341 
1342 
1343  MakeNiceHisto(h1_Q_time_x,tcanvas[7]->GetPad(1),"");
1344  MakeNiceHisto(h1_Q_time_y,tcanvas[7]->GetPad(1),"same");
1345 
1346  //pixel signal vs channel
1347  tcanvas[8]->Divide(1,1);
1348  tcanvas[8]->cd();
1349  TText *t27 = new TText(0.20,0.955,Form("Channel spectrum of pixel charges of %d evts",NEvent));
1350  t27->SetTextSize(0.04);
1351  t27->Draw();
1352  TText *t271 = new TText(0.9,0.85,"X");
1353  t271->SetTextSize(0.03);
1354  t271->SetTextColor(2);
1355  t271->Draw();
1356 
1357  TText *t272 = new TText(0.9,0.82,"Y");
1358  t272->SetTextSize(0.03);
1359  t272->SetTextColor(4);
1360  t272->Draw();
1361 
1362  TText *t7page = new TText(0.5,0.03,"page 9");
1363  t7page->SetTextSize(0.03);
1364  t7page->SetTextColor(7);
1365  t7page->Draw();
1366 
1367  MakeNiceHisto(h1_Q_channel_x,tcanvas[8]->GetPad(1),"");
1368  MakeNiceHisto(h1_Q_channel_y,tcanvas[8]->GetPad(1),"same");
1369  // leg = new TLegend(0.15,0.81,0.4,0.9);
1370  // leg->AddEntry(h1_Q_channel_x,"X","l");
1371  // leg->AddEntry(h1_Q_channel_y,"Y","l");
1372  // leg->Draw();
1373 
1374  tcanvas[15]->Divide(1,1);
1375  tcanvas[15]->cd();
1376  // Trigger
1377  hTrigger->Draw();//gPad->SetLogy();
1378  // TText *ttrpage = new TText(0.5,0.03,"page 16");
1379  // ttrpage->SetTextSize(0.03);
1380  // ttrpage->SetTextColor(7);
1381  // ttrpage->Draw();
1382  // TText *tTr = new TText(0.10,1.5,"Types of Trigger: ");
1383  // tTr->SetTextSize(0.04);
1384  // tTr->Draw();
1385  //
1386 
1387  //MakeNiceHisto(hTrigger,tcanvas[15]->GetPad(1),"");
1388  lTrigger->AddEntry(hTriggerEmpty,Form("Empty: %d",NEventEmpty),"F");
1389  lTrigger->AddEntry(hTriggerDepot,Form("Deposit: %d",NEventDEPOSIT),"F");
1390  lTrigger->AddEntry(hTriggerTTZ,Form("TTZ: %d",NEventTTZ),"F");
1391  lTrigger->AddEntry(hTriggerTraversing,Form("Traversing: %d",NEventTT),"F");
1392  lTrigger->AddEntry(hTriggerCreated,Form("Created: %d",NEventTCR),"F");
1393  lTrigger->AddEntry(hTriggerContained,Form("Contained: %d", NEventTCN),"F");
1394  lTrigger->AddEntry(hTriggerTwoTrGamma,Form("Gamma: %d", NEventGAMMA),"F");
1395  lTrigger->AddEntry(hTriggerTwoTrDelta,Form("Delta: %d", NEventDELTA),"F");
1396  lTrigger->AddEntry(hTriggerTwoTrOther,Form("TwoOther: %d",NEvent2TOTHER),"F");
1397  lTrigger->AddEntry(hTriggerShower,Form("Shower: %d", NEventSHOWER),"F");
1398  lTrigger->AddEntry(hTriggerOther,Form("Other: %d",NEventOTHER),"F");
1399  lTrigger->Draw();
1400 
1401 
1402  //fit of Q profil in time to calculate drift time and gain
1403 
1404  // track type and track in 2d
1405  tcanvas[9]->Divide(2,1);
1406  tcanvas[9]->cd();
1407 
1408  TText *tPtpage = new TText(0.5,0.03,"page 10");
1409  tPtpage->SetTextSize(0.03);
1410  tPtpage->SetTextColor(7);
1411  tPtpage->Draw();
1412  TText *tPt = new TText(0.10,0.955,Form("Parameters of track of %d evts",NEvent));
1413  tPt->SetTextSize(0.04);
1414  tPt->Draw();
1415  TText *tPtx = new TText(0.9,0.85,"X");
1416  tPtx->SetTextSize(0.03);
1417  tPtx->SetTextColor(2);
1418  tPtx->Draw();
1419 
1420  TText *tPty = new TText(0.9,0.82,"Y");
1421  tPty->SetTextSize(0.03);
1422  tPty->SetTextColor(4);
1423  tPty->Draw();
1424 
1425  TText *tTT = new TText(0.18,0.6,"TTraversing");
1426  tTT->SetTextSize(0.02);
1427  tTT->SetTextColor(3);
1428  tTT->Draw();
1429 
1430  TText *tTC = new TText(0.3,0.4,"TCreated");
1431  tTC->SetTextSize(0.02);
1432  tTC->SetTextColor(3);
1433  tTC->Draw();
1434 
1435  TText *tTC1 = new TText(0.09,0.2,"TContained");
1436  tTC1->SetTextSize(0.02);
1437  tTC1->SetTextColor(3);
1438  tTC1->Draw();
1439 
1440  MakeNiceHisto(h1_TypeTrack_x,tcanvas[9]->GetPad(1),"");
1441  MakeNiceHisto(h1_TypeTrack_y,tcanvas[9]->GetPad(1),"same");
1442  MakeNiceHisto(h1_angleTrack_x,tcanvas[9]->GetPad(2),"");
1443  MakeNiceHisto(h1_angleTrack_y,tcanvas[9]->GetPad(2),"same");
1444 
1445  //Cluster inside of track and outside of track
1446  tcanvas[10]->Divide(2,2);
1447  tcanvas[10]->cd();// gPad->SetLogx();
1448  TText *tQCT= new TText(0.10,0.96,Form("Charges of cluster associated or non-associated to track of %d evts",NEvent));
1449  tQCT->SetTextSize(0.03);
1450  tQCT->Draw();
1451  TText *tQCTx = new TText(0.9,0.85,"X");
1452  tQCTx->SetTextSize(0.03);
1453  tQCTx->SetTextColor(2);
1454  tQCTx->Draw();
1455 
1456  TText *tQCTy = new TText(0.9,0.82,"Y");
1457  tQCTy->SetTextSize(0.03);
1458  tQCTy->SetTextColor(4);
1459  tQCTy->Draw();
1460 
1461  TText *tQCTpage = new TText(0.5,0.03,"page 11");
1462  tQCTpage->SetTextSize(0.03);
1463  tQCTpage->SetTextColor(7);
1464  tQCTpage->Draw();
1465 
1466  TText *tCA = new TText(0.1,0.9,"CCluster associated to track");
1467  tCA->SetTextSize(0.02);
1468  //tQCTx->SetTextColor(2);
1469  tCA->Draw();
1470 
1471  TText *tCNA = new TText(0.6,0.9,"CCluster non-associated to track");
1472  tCNA->SetTextSize(0.02);
1473  //tQCTx->SetTextColor(2);
1474  tCNA->Draw();
1475 
1476  TText *tTA = new TText(0.1,0.4,"TCluster associated to track");
1477  tTA->SetTextSize(0.02);
1478  //tQCTx->SetTextColor(2);
1479  tTA->Draw();
1480 
1481  TText *tTNA = new TText(0.6,0.4,"TCluster non-associated to track");
1482  tTNA->SetTextSize(0.02);
1483  //tQCTx->SetTextColor(2);
1484  tTNA->Draw();
1485 
1486  MakeNiceHisto(h1_QcAssoc_x,tcanvas[10]->GetPad(1),"");gPad->SetLogx();
1487  MakeNiceHisto(h1_QcAssoc_y,tcanvas[10]->GetPad(1),"same");gPad->SetLogx();
1488  MakeNiceHisto(h1_QcNAssoc_x,tcanvas[10]->GetPad(2),"");gPad->SetLogx();
1489  MakeNiceHisto(h1_QcNAssoc_y,tcanvas[10]->GetPad(2),"same");gPad->SetLogx();
1490  MakeNiceHisto(h1_QtAssoc_x,tcanvas[10]->GetPad(3),"");gPad->SetLogx();
1491  MakeNiceHisto(h1_QtAssoc_y,tcanvas[10]->GetPad(3),"same");gPad->SetLogx();
1492  MakeNiceHisto(h1_QtNAssoc_x,tcanvas[10]->GetPad(4),"");gPad->SetLogx();
1493  MakeNiceHisto(h1_QtNAssoc_y,tcanvas[10]->GetPad(4),"same");gPad->SetLogx();
1494 
1495  // distortion in plan X
1496  tcanvas[11]->Divide(2,3);
1497  tcanvas[11]->cd();
1498  TText *tdX = new TText(0.10,0.97,"Distortions in X of TTZ: ");
1499  tdX->SetTextSize(0.03);
1500  tdX->Draw();
1501 
1502  TText *tdXpage = new TText(0.5,0.03,"page 12");
1503  tdXpage->SetTextSize(0.03);
1504  tdXpage->SetTextColor(7);
1505  tdXpage->Draw();
1506 
1507  MakeNiceHisto(h1_distortion_dt_x,tcanvas[11]->GetPad(1),"");
1508  MakeNiceHisto(h1_distortion_dc_x,tcanvas[11]->GetPad(2),"");
1509  MakeNiceHisto(h2_distortion_dc_t_x,tcanvas[11]->GetPad(3),"colz");
1510  MakeNiceHisto(h2_prof_dc_t_x,tcanvas[11]->GetPad(3),"same");
1511  MakeNiceHisto(h2_distortion_dc_c_x,tcanvas[11]->GetPad(4),"colz");
1512  MakeNiceHisto(h2_prof_dc_c_x,tcanvas[11]->GetPad(4),"same");
1513  MakeNiceHisto(h2_distortion_dt_t_x,tcanvas[11]->GetPad(5),"colz");
1514  MakeNiceHisto(h2_prof_dt_t_x,tcanvas[11]->GetPad(5),"same");
1515  MakeNiceHisto(h2_distortion_dt_c_x,tcanvas[11]->GetPad(6),"colz");
1516  MakeNiceHisto(h2_prof_dt_c_x,tcanvas[11]->GetPad(6),"same");
1517 
1518  //distortion in plan Y
1519  tcanvas[12]->Divide(2,3);
1520  tcanvas[12]->cd();
1521  TText *tdY = new TText(0.10,0.97,"Distortions in Y of TTZ: ");
1522  tdY->SetTextSize(0.03);
1523  tdY->Draw();
1524 
1525  TText *tdYpage = new TText(0.5,0.03,"page 13");
1526  tdYpage->SetTextSize(0.03);
1527  tdYpage->SetTextColor(7);
1528  tdYpage->Draw();
1529 
1530  MakeNiceHisto(h1_distortion_dt_y,tcanvas[12]->GetPad(1),"");
1531  MakeNiceHisto(h1_distortion_dc_y,tcanvas[12]->GetPad(2),"");
1532  MakeNiceHisto(h2_distortion_dc_t_y,tcanvas[12]->GetPad(3),"colz");
1533  MakeNiceHisto(h2_prof_dc_t_y,tcanvas[12]->GetPad(3),"same");
1534  MakeNiceHisto(h2_distortion_dc_c_y,tcanvas[12]->GetPad(4),"colz");
1535  MakeNiceHisto(h2_prof_dc_c_y,tcanvas[12]->GetPad(4),"same");
1536  MakeNiceHisto(h2_distortion_dt_t_y,tcanvas[12]->GetPad(5),"colz");
1537  MakeNiceHisto(h2_prof_dt_t_y,tcanvas[12]->GetPad(5),"same");
1538  MakeNiceHisto(h2_distortion_dt_c_y,tcanvas[12]->GetPad(6),"colz");
1539  MakeNiceHisto(h2_prof_dt_c_y,tcanvas[12]->GetPad(6),"same");
1540 
1541  //Tcluster
1542  tcanvas[13]->Divide(2,2);
1543  tcanvas[13]->cd();
1544  TText *tptc = new TText(0.10,0.955,Form("Parameters of TCluster of %d evts",NEvent));
1545  tptc->SetTextSize(0.04);
1546  tptc->Draw();
1547 
1548  TText *tptcx = new TText(0.9,0.85,"X");
1549  tptcx->SetTextSize(0.03);
1550  tptcx->SetTextColor(2);
1551  tptcx->Draw();
1552 
1553  TText *tptcy = new TText(0.9,0.82,"Y");
1554  tptcy->SetTextSize(0.03);
1555  tptcy->SetTextColor(4);
1556  tptcy->Draw();
1557 
1558  TText *tptcpage = new TText(0.5,0.03,"page 14");
1559  tptcpage->SetTextSize(0.03);
1560  tptcpage->SetTextColor(7);
1561  tptcpage->Draw();
1562 
1563  MakeNiceHisto(h1_IndexTcluster_x,tcanvas[13]->GetPad(1),"");
1564  MakeNiceHisto(h1_IndexTcluster_y,tcanvas[13]->GetPad(1),"same");
1565  MakeNiceHisto(h1_MeanTcluster_x,tcanvas[13]->GetPad(2),"");
1566  MakeNiceHisto(h1_MeanTcluster_y,tcanvas[13]->GetPad(2),"same");
1567  MakeNiceHisto(h1_SigTcluster_x,tcanvas[13]->GetPad(3),"");
1568  MakeNiceHisto(h1_SigTcluster_y,tcanvas[13]->GetPad(3),"same");
1569  MakeNiceHisto(h1_WidthTcluster_x,tcanvas[13]->GetPad(4),"");
1570  MakeNiceHisto(h1_WidthTcluster_y,tcanvas[13]->GetPad(4),"same");
1571  //Ccluster
1572  tcanvas[14]->Divide(2,2);
1573  tcanvas[14]->cd();
1574  TText *tpcc = new TText(0.10,0.955,Form("Parameters of CCluster of %d evts",NEvent));
1575  tpcc->SetTextSize(0.04);
1576  tpcc->Draw();
1577  TText *tpccx = new TText(0.9,0.85,"X");
1578  tpccx->SetTextSize(0.03);
1579  tpccx->SetTextColor(2);
1580  tpccx->Draw();
1581 
1582  TText *tpccy = new TText(0.9,0.82,"Y");
1583  tpccy->SetTextSize(0.03);
1584  tpccy->SetTextColor(4);
1585  tpccy->Draw();
1586 
1587  TText *tpccpage = new TText(0.5,0.03,"page 15");
1588  tpccpage->SetTextSize(0.03);
1589  tpccpage->SetTextColor(7);
1590  tpccpage->Draw();
1591  MakeNiceHisto(h1_IndexCcluster_x,tcanvas[14]->GetPad(1),"");
1592  MakeNiceHisto(h1_IndexCcluster_y,tcanvas[14]->GetPad(1),"same");
1593  MakeNiceHisto(h1_MeanCcluster_x,tcanvas[14]->GetPad(2),"");
1594  MakeNiceHisto(h1_MeanCcluster_y,tcanvas[14]->GetPad(2),"same");
1595  MakeNiceHisto(h1_SigCcluster_x,tcanvas[14]->GetPad(3),"");
1596  MakeNiceHisto(h1_SigCcluster_y,tcanvas[14]->GetPad(3),"same");
1597  MakeNiceHisto(h1_WidthCcluster_x,tcanvas[14]->GetPad(4),"");
1598  MakeNiceHisto(h1_WidthCcluster_y,tcanvas[14]->GetPad(4),"same");
1599 
1600 
1601  //Pmm2
1602  tcanvas[16]->Divide(2,2);
1603  tcanvas[16]->cd();
1604  TText *tPMM2 = new TText(0.10,0.955,"Informations of PMM2: ");
1605  tPMM2->SetTextSize(0.04);
1606  tPMM2->Draw();
1607 
1608  TText *tmissed = new TText(0.30,0.9,"Pmm2 Missed: ");
1609  tmissed->SetTextSize(0.03);
1610  tmissed->Draw();
1611 
1612  TText *ttriggered = new TText(0.8,0.9,"Pmm2 Triggered: ");
1613  ttriggered->SetTextSize(0.03);
1614  ttriggered->Draw();
1615 
1616  TText *tcoincidence = new TText(0.60,0.45,"Pmm2 Coincidence: ");
1617  tcoincidence->SetTextSize(0.03);
1618  tcoincidence->Draw();
1619 
1620  TText *tPmm2d = new TText(0.10,0.45,"Pmm2 Spectrum 2D: ");
1621  tPmm2d->SetTextSize(0.03);
1622  tPmm2d->Draw();
1623 
1624  TText *tPMM2page = new TText(0.5,0.03,"page 17");
1625  tPMM2page->SetTextSize(0.03);
1626  tPMM2page->SetTextColor(7);
1627  tPMM2page->Draw();
1628  MakeNiceHisto(hPmm2Missed,tcanvas[16]->GetPad(1),"");
1629  MakeNiceHisto(hPmm2Triggered,tcanvas[16]->GetPad(2),"");
1630  MakeNiceHisto(hPmm2Spectrum2D,tcanvas[16]->GetPad(3),"colz");
1631  MakeNiceHisto(hPmm2Coincidence,tcanvas[16]->GetPad(4),"colz");
1632  //theta, rho and their RMS in 2d
1633  tcanvas[17]->Divide(2,2);
1634  tcanvas[17]->cd();
1635  TText *though = new TText(0.10,0.955,Form("Parameters of reconstruction (Hough) of %d evts",NEvent));
1636  though->SetTextSize(0.04);
1637  though->Draw();
1638  TText *thoughx = new TText(0.9,0.85,"X");
1639  thoughx->SetTextSize(0.03);
1640  thoughx->SetTextColor(2);
1641  thoughx->Draw();
1642 
1643  TText *thoughy = new TText(0.9,0.82,"Y");
1644  thoughy->SetTextSize(0.03);
1645  thoughy->SetTextColor(4);
1646  thoughy->Draw();
1647 
1648  TText *thoughpage = new TText(0.5,0.03,"page 18");
1649  thoughpage->SetTextSize(0.03);
1650  thoughpage->SetTextColor(7);
1651  thoughpage->Draw();
1652 
1653 
1654  MakeNiceHisto(h1_theta_x,tcanvas[17]->GetPad(1),"");
1655  MakeNiceHisto(h1_theta_y,tcanvas[17]->GetPad(1),"same");
1656  MakeNiceHisto(h1_rho_x,tcanvas[17]->GetPad(2),"");
1657  MakeNiceHisto(h1_rho_y,tcanvas[17]->GetPad(2),"same");
1658  MakeNiceHisto(h1_sigtheta_x,tcanvas[17]->GetPad(3),"");
1659  MakeNiceHisto(h1_sigtheta_y,tcanvas[17]->GetPad(3),"same");
1660  MakeNiceHisto(h1_sigrho_x,tcanvas[17]->GetPad(4),"");
1661  MakeNiceHisto(h1_sigrho_y,tcanvas[17]->GetPad(4),"same");
1662 
1663  //angle 3d
1664  tcanvas[18]->Divide(2,1);
1665  tcanvas[18]->cd();
1666  TText *tad = new TText(0.10,0.955,Form("Angles of tracks 3d of Gamma: %d evts", NEventGAMMA));
1667  tad->SetTextSize(0.04);
1668  tad->Draw();
1669  TText *tadpage = new TText(0.5,0.03,"page 19");
1670  tadpage->SetTextSize(0.03);
1671  tadpage->SetTextColor(7);
1672  tadpage->Draw();
1673  MakeNiceHisto(h1AOpen,tcanvas[18]->GetPad(1),"");
1674  MakeNiceHisto(h1Azimutal,tcanvas[18]->GetPad(2),"");
1675 
1676  //direction of gamma
1677 
1678  tcanvas[19]->Divide(3,1);
1679  tcanvas[19]->cd();
1680  TText *tdg = new TText(0.10,0.955,Form("The direction vector of Gamma: %d evts", NEventGAMMA));
1681  tdg->SetTextSize(0.04);
1682  tdg->Draw();
1683  TText *tdgpage = new TText(0.5,0.03,"page 20");
1684  tdgpage->SetTextSize(0.03);
1685  tdgpage->SetTextColor(7);
1686  tdgpage->Draw();
1687  MakeNiceHisto(h1Px,tcanvas[19]->GetPad(1),"");
1688  MakeNiceHisto(h1Py,tcanvas[19]->GetPad(2),"");
1689  MakeNiceHisto(h1Pz,tcanvas[19]->GetPad(3),"");
1690 
1691  tcanvas[20]->Divide(1,1);
1692  tcanvas[20]->cd();
1693 
1694  TText *tnt = new TText(0.10,0.95,Form("Track Numbers in one event in the run of %d evts", NEvent));
1695  tnt->SetTextSize(0.04);
1696  tnt->Draw();
1697 
1698  TText *tntx = new TText(0.9,0.85,"X");
1699  tntx->SetTextSize(0.03);
1700  tntx->SetTextColor(2);
1701  tntx->Draw();
1702 
1703  TText *tnty = new TText(0.9,0.82,"Y");
1704  tnty->SetTextSize(0.03);
1705  tnty->SetTextColor(4);
1706  tnty->Draw();
1707 
1708  TText *tntpage = new TText(0.5,0.03,"page 21");
1709  tntpage->SetTextSize(0.03);
1710  tntpage->SetTextColor(7);
1711  tntpage->Draw();
1712 
1713  MakeNiceHisto(h1NTrackY,tcanvas[20]->GetPad(1),"");
1714  MakeNiceHisto(h1NTrackX,tcanvas[20]->GetPad(1),"same");
1715 
1716  tcanvas[21]->Divide(2,1);
1717  tcanvas[21]->cd();
1718  TText *tct = new TText(0.10,0.955,Form("Relationship between Clusters and Track of %d evts", NEvent));
1719  tct->SetTextSize(0.04);
1720  tct->Draw();
1721 
1722  TText *tctx = new TText(0.9,0.85,"X");
1723  tctx->SetTextSize(0.03);
1724  tctx->SetTextColor(2);
1725  tctx->Draw();
1726 
1727  TText *tcty = new TText(0.9,0.82,"Y");
1728  tcty->SetTextSize(0.03);
1729  tcty->SetTextColor(4);
1730  tcty->Draw();
1731  TText *tctpage = new TText(0.5,0.03,"page 22");
1732  tctpage->SetTextSize(0.03);
1733  tctpage->SetTextColor(7);
1734  tctpage->Draw();
1735 
1736  TText *tCAT11 = new TText(0.1,0.85,"Cluster associated to track");
1737  tCAT11->SetTextSize(0.02);
1738  //tQCTx->SetTextColor(2);
1739  tCAT11->Draw();
1740 
1741  TText *tCNAT12 = new TText(0.6,0.85,"Cluster non-associated to track");
1742  tCNAT12->SetTextSize(0.02);
1743  //tQCTx->SetTextColor(2);
1744  tCNAT12->Draw();
1745 
1746  MakeNiceHisto(h1NClusterX,tcanvas[21]->GetPad(1),"");gPad->SetLogx();
1747  MakeNiceHisto(h1NClusterY,tcanvas[21]->GetPad(1),"same");gPad->SetLogx();
1748  MakeNiceHisto(h1NClusterNX,tcanvas[21]->GetPad(2),"");//gPad->SetLogx();
1749  MakeNiceHisto(h1NClusterNY,tcanvas[21]->GetPad(2),"same");//gPad->SetLogx();
1750 
1751  //return;
1752 
1753 
1754  tcanvas[22]->Divide(2,1);
1755  tcanvas[22]->cd();
1756  TText *tsgz = new TText(0.10,0.955,"Sigma rho of Gamma and TTZ: ");
1757  tsgz->SetTextSize(0.04);
1758  tsgz->Draw();
1759 
1760  TText *tsgzx = new TText(0.9,0.85,"X");
1761  tsgzx->SetTextSize(0.03);
1762  tsgzx->SetTextColor(2);
1763  tsgzx->Draw();
1764 
1765  TText *tsgzy = new TText(0.9,0.82,"Y");
1766  tsgzy->SetTextSize(0.03);
1767  tsgzy->SetTextColor(4);
1768  tsgzy->Draw();
1769 
1770 
1771  TText *tGamma1 = new TText(0.3,0.75,Form("Gamma: %d evts", NEventGAMMA));
1772  tGamma1->SetTextSize(0.03);
1773  tGamma1->SetTextColor(3);
1774  tGamma1->Draw();
1775 
1776  TText *tTTZ1 = new TText(0.7,0.75,Form("TTZ: %d evts",NEventTTZ));
1777  tTTZ1->SetTextSize(0.03);
1778  tTTZ1->SetTextColor(3);
1779  tTTZ1->Draw();
1780 
1781  TText *tsgzpage = new TText(0.5,0.03,"page 23");
1782  tsgzpage->SetTextSize(0.03);
1783  tsgzpage->SetTextColor(7);
1784  tsgzpage->Draw();
1785  MakeNiceHisto(h1_sigrho_gamma_x,tcanvas[22]->GetPad(1),"");//gPad->SetLogx();
1786  MakeNiceHisto(h1_sigrho_gamma_y,tcanvas[22]->GetPad(1),"same");//gPad->SetLogx();
1787  MakeNiceHisto(h1_sigrho_TTZ_x,tcanvas[22]->GetPad(2),"");//gPad->SetLogx();
1788  MakeNiceHisto(h1_sigrho_TTZ_y,tcanvas[22]->GetPad(2),"same");//gPad->SetLogx();
1789 
1790 
1791  tcanvas[23]->Divide(3,1);
1792  tcanvas[23]->cd();
1793  TText *doca = new TText(0.05,0.955,Form("DOCA and the minimum distance from POCA to each track of gamma (%d evts)",NEventGAMMA));
1794  doca->SetTextSize(0.035);
1795  doca->Draw();
1796  TText *docat1 = new TText(0.6,0.85,"tr1");
1797  docat1->SetTextSize(0.03);
1798  docat1->SetTextColor(2);
1799  docat1->Draw();
1800 
1801  TText *docat2 = new TText(0.6,0.82,"tr2");
1802  docat2->SetTextSize(0.03);
1803  docat2->SetTextColor(4);
1804  docat2->Draw();
1805  MakeNiceHisto(h1Doca,tcanvas[23]->GetPad(1),"");
1806  MakeNiceHisto(h1_vertex_tr1,tcanvas[23]->GetPad(2),"");
1807  MakeNiceHisto(h1_vertex_tr2,tcanvas[23]->GetPad(2),"same");
1808  MakeNiceHisto(h2_vertex,tcanvas[23]->GetPad(3),"");
1809 
1810  tcanvas[24]->Divide(2,1);
1811  tcanvas[24]->cd();
1812  TText *alsel = new TText(0.05,0.955,Form("Selection of aligned events for un run (%d evts)",NEvent));
1813  alsel->SetTextSize(0.035);
1814  alsel->Draw();
1815  TText *alselx = new TText(0.6,0.85,Form("X: Nal=%d", NXal));
1816  alselx->SetTextSize(0.03);
1817  alselx->SetTextColor(2);
1818  alselx->Draw();
1819 
1820  TText *alsely = new TText(0.6,0.80,Form("Y: Nal=%d", NYal));
1821  alsely->SetTextSize(0.03);
1822  alsely->SetTextColor(4);
1823  alsely->Draw();
1824 
1825  MakeNiceHisto(hdX,tcanvas[24]->GetPad(1),"");
1826  MakeNiceHisto(hdXal,tcanvas[24]->GetPad(1),"same");
1827  MakeNiceHisto(hdY,tcanvas[24]->GetPad(2),"");
1828  MakeNiceHisto(hdYal,tcanvas[24]->GetPad(2),"same");
1829 
1830  tcanvas[0]->SaveAs(outputfileopen);
1831  for(Int_t i = 0; i<25; i++)
1832  tcanvas[i]->SaveAs(outputfile);
1833  tcanvas[24]->SaveAs(outputfileclose);
1834 
1835  ofstream fout;
1836  //fout.open("run1156.tex");
1837  fout.open(outputtex);
1838 
1839  fout<<"\\"<<"documentclass{article}"<<endl;
1840  fout<<"\\" <<"usepackage{multirow}" <<endl;
1841  fout<<"\\"<<"begin{document}"<<endl;
1842 
1843  fout<<"\\"<<"begin{table}[tb]"<<"\\"<<"label{sample_tab}"<<endl;
1844  fout<<"\\"<<"caption{HARPO Monitoring off-line Summary}"<<endl;
1845  fout<<"\\"<<"begin{center}"<<endl;
1846  fout<<"\\"<<"begin{tabular}{c|c|c|c}"<<endl;
1847  fout<<"\\"<<"hline "<<"\\"<<"hline"<<endl;
1848  fout<<"\\"<<"multirow{1}{*}{} & "<<"\\"<<"multirow{1}{*}{} & "<<"\\"<<"multirow{1}{*}{X} & "<<"\\"<<"multirow{1}{*}{Y} "<<"\\\\"<<endl;
1849  fout<<"\\"<<"hline"<<endl;
1850  fout<<"\\"<<"multirow{3}{*}{Alignment}"<<endl;
1851  fout<<"& $"<<"\\"<<"theta_{ph}$ & "<<anxN<<"[rad] & "<<anyN<<" [rad] "<<"\\\\"<<endl;
1852  fout<<"& $"<<"\\"<<"Delta_{center}$& "<<poxN<<" [mm]& "<<poyN<<" [mm] "<<"\\\\"<<endl;
1853  fout<<"\\"<<"hline"<<endl;
1854  fout<<"\\"<<"multirow{3}{*}{Calibration} "<<endl;
1855  fout<<"& $Q_{t}$& "<<GainX/1000000<<" $"<<"\\"<<"times 10^{6}$[ADC]& "<<GainY/1000000<<" $"<<"\\"<<"times 10^{6}$[ADC] "<<"\\\\" <<endl;
1856  fout<<"& $t_{drift}$ & "<<xt<<"[bin] & "<<yt<<"[bin]"<<"\\\\" <<endl;
1857  fout<<"& & "<<xt*0.03<<" [$"<<"\\"<<"mu$s]& "<<yt*0.03<<"[$"<<"\\"<<"mu$s] "<<"\\\\"<<endl;
1858  fout<<"& $"<<"\\"<<"nu_{drift}$ & "<<1000/xt<<"[cm/$"<<"\\"<<"mu$s] & "<<1000/yt<<"[cm/$"<<"\\"<<"mu$s] "<<"\\\\"<<endl;
1859  fout<<"& $"<<"\\"<<"alpha_{abs}$ & "<<1/(labx*0.00003)<<"[$ms^{-1}$] & "<<1/(laby*0.00003)<<"[$ms^{-1}$] "<<"\\\\"<<endl;
1860  fout<<"\\"<<"hline "<<"\\"<<"hline "<<"\\"<<"hline "<<endl;
1861  fout<<"\\"<<"multirow{20}{*}{Statistics} &"<<"\\"<<"multirow{20}{*}{T}& "<<"\\\\"<<endl;
1862  fout<<"& & NEventToTal&REventToTal "<<"\\\\"<<endl;
1863  fout<<"& & "<<NEvent<<"&"<<NEvent/TimeSt<<"[Hz] "<<"\\\\"<<endl;
1864  fout<<"& &NEventEmpty& REventEmpty "<<"\\\\"<<endl;
1865  fout<<"& &"<<NEventEmpty<<"&"<<NEventEmpty/TimeSt<<" [Hz] "<<"\\\\"<<endl;
1866  fout<<"& &NEventDeposit&REventDeposit "<<"\\\\"<<endl;
1867  fout<<"& & "<<NEventDEPOSIT<<"&"<<NEventDEPOSIT/TimeSt<<" [Hz] "<<"\\\\"<<endl;
1868  fout<<"& &NEventTTZ&REventTTZ "<<"\\\\"<<endl;
1869  fout<<"& & "<<NEventTTZ<<"&"<<NEventTTZ/TimeSt<<" [Hz]"<<"\\\\"<<endl;
1870  fout<<"& &NEventTT&REventTT "<<"\\\\"<<endl;
1871  fout<<"& &"<<NEventTT <<" & "<<NEventTT/TimeSt<<"[Hz] "<<"\\\\"<<endl;
1872  fout<<"&"<<TimeSt<<" [s] &NEventTCR&REventTCR "<<"\\\\"<<endl;
1873  fout<<"& & "<<NEventTCR<<"&"<<NEventTCR/TimeSt<<" [Hz] "<<"\\\\"<<endl;
1874  fout<<"& &NEventTCN&REventTCN "<<"\\\\"<<endl;
1875  fout<<"& & "<<NEventTCN<<"&"<<NEventTCN/TimeSt<<" [Hz] "<<"\\\\"<<endl;
1876  fout<<"& &NEventGamma&REventGamma "<<"\\\\"<<endl;
1877  fout<<"& & "<< NEventGAMMA<<"&"<<NEventGAMMA/TimeSt<<" [Hz] "<<"\\\\"<<endl;
1878  fout<<"& &NEventDelta&REventDelta "<<"\\\\"<<endl;
1879  fout<<"& & "<<NEventDELTA<<"&"<<NEventDELTA/TimeSt<<" [Hz] "<<"\\\\"<<endl;
1880  fout<<"& &NEventTwoOther&REventTwoOther "<<"\\\\"<<endl;
1881  fout<<"& & "<<NEvent2TOTHER<<"&"<<NEvent2TOTHER/TimeSt<<" [Hz] "<<"\\\\"<<endl;
1882  fout<<"& &NEventShower&REventShower "<<"\\\\"<<endl;
1883  fout<<"& & "<<NEventSHOWER<<"&"<<NEventSHOWER/TimeSt<<" [Hz] "<<"\\\\"<<endl;
1884  fout<<"& &NEventOther&REventOther"<<"\\\\"<<endl;
1885  fout<<"& & "<<NEventOTHER<<"&"<<NEventOTHER/TimeSt<<" [Hz] "<<"\\\\"<<endl;
1886  fout<<"\\"<<"hline "<<"\\"<<"hline "<<endl;
1887  fout<<"\\"<<"end{tabular} "<<endl;
1888  fout<<"\\"<<"end{center} "<<endl;
1889  fout<<"\\"<<"end{table} "<<endl;
1890 
1891  fout<<"\\"<<"end{document}"<<endl;
1892  fout.close();
1893 
1894 }
int main(int argc, char **argv)
Definition: drawAnalyse.cxx:25
void drawAnalyse(const char *input, const char *output="UNDEFINED", const char *outputtex="UNDEFINED")
Definition: drawAnalyse.cxx:96
const Double_t * MakeLogBinning(Int_t nbins, Double_t xmin, Double_t xmax)
TVirtualPad * MakeNiceHisto(TH1 *hist, TVirtualPad *c1, const char *opt, Bool_t copy)