Project

General

Profile

makeEffHist.C

Muhammad Elnimr, 01/28/2015 12:48 PM

 
1
#define makeEffHist_cxx
2
#include "makeEffHist.h"
3
#include <TH2.h>
4
#include <TStyle.h>
5
#include <TCanvas.h>
6

    
7
void makeEffHist::Loop(int nEvents=0,char * filePrefex="")
8
{
9
//   In a ROOT session, you can do:
10
//      Root > .L makeEffHist.C
11
//      Root > makeEffHist t
12
//      Root > t.GetEntry(12); // Fill t data members with entry number 12
13
//      Root > t.Show();       // Show values of entry 12
14
//      Root > t.Show(16);     // Read and show values of entry 16
15
//      Root > t.Loop();       // Loop on all entries
16
//
17
  prettyPlots();
18
//     This is the loop skeleton where:
19
//    jentry is the global entry number in the chain
20
//    ientry is the entry number in the current Tree
21
//  Note that the argument to GetEntry must be:
22
//    jentry for TChain::GetEntry
23
//    ientry for TTree::GetEntry and TBranch::GetEntry
24
//
25
//       To read only selected branches, Insert statements like:
26
// METHOD1:
27
//    fChain->SetBranchStatus("*",0);  // disable all branches
28
//    fChain->SetBranchStatus("branchname",1);  // activate branchname
29
// METHOD2: replace line
30
//    fChain->GetEntry(jentry);       //read all branches
31
//by  b_branchname->GetEntry(ientry); //read only this branch
32
   if (fChain == 0) return;
33

    
34
  double fMinMCKE=0.05;           // Minimum MC particle kinetic energy (GeV).
35
  double fMinMCLen=20.;          // Minimum MC particle length in tpc (cm).
36
  double fMatchColinearity=0.97;  // Minimum matching colinearity.
37
  double fMatchDisp=2.0;         // Maximum matching displacement.
38
  double fWMatchDisp=15;        // Maximum matching displacement in the w direction.
39
  double pdg=-13;
40

    
41
   Long64_t nentries = fChain->GetEntriesFast();
42
   TH1F * ntracks=new TH1F("ntracks","No. of Tracks",100,0,10);
43
   TH2F * trkytrkz=new TH2F("trkytrkz","Track Spts. y vs. z",1000,-10,300,1000,-150,150);
44
   TH2F * trkytrkx=new TH2F("trkytrkx","Track Spts. y vs. x",1000,-50,250,1000,-150,150);
45
   TH2F * trkztrkx=new TH2F("trkztrkx","Track Spts. z vs. x",1000,-50,250,1000,-100,200);
46
   TH3F * trkztrkxtrky=new TH3F("xyz","xyz",10,-10,300,10,-100,200,10,-10,300);
47

    
48

    
49
   TH2F * hgoodlen=new TH2F("hgoodlen","hgoodlen",300,0,300,300,0,300);
50

    
51
   TH1F * htrkx=new TH1F("htrkx","Track Spacepoints x (cm)",100,-100,200);
52
   TH1F * htrky=new TH1F("htrky","Track Spacepoints y (cm)",100,-100,200);
53
   TH1F * htrkz=new TH1F("htrkz","Track Spacepoints z (cm)",100,-100,200);
54
   TH1F * htrkstartx=new TH1F("htrkstartx","Track Start x (cm)",100,-100,200);
55
   TH1F * htrkstarty=new TH1F("htrkstarty","Track Start y (cm)",100,-100,200);
56
   TH1F * htrkstartz=new TH1F("htrkstartz","Track Start z (cm)",100,-100,200);
57
   TH1F * htrkstartx_diff=new TH1F("htrkstartx_diff","htrkstartx_diff",100,-50,50);
58
   TH1F * htrkstarty_diff=new TH1F("htrkstarty_diff","htrkstarty_diff",100,-50,50);
59
   TH1F * htrkstartz_diff=new TH1F("htrkstartz_diff","htrkstartz_diff",100,-50,50);
60
   TH1F * htrkendx=new TH1F("htrkendx","Track End x (cm)",100,-100,200);
61
   TH1F * htrkendy=new TH1F("htrkendy","Track End y (cm)",100,-100,200);
62
   TH1F * htrkendz=new TH1F("htrkendz","Track End z (cm)",100,-100,200);
63
   TH1F * hntracks_reco=new TH1F("hntracks_reco","No. reco tracks",10,-1,4);
64

    
65
   TH1F * htrkspacepoints=new TH1F("htrkspacepoints","htrkspacepoints",50,0,100);
66
   TH1F * hgtrkspacepoints=new TH1F("hgtrkspacepoints","hgtrkspacepoints",50,0,100);
67
   TH1F * hetrkspacepoints=new TH1F("hetrkspacepoints","hetrkspacepoints",50,0,100);
68

    
69

    
70
   Long64_t nbytes = 0, nb = 0;
71
   MCHists mchists("somename");
72
   if(nEvents==0);
73
   else
74
     nentries=nEvents;
75
   int COUNTER=0;
76
   for (Long64_t jentry=0; jentry<nentries;jentry++) {
77
      Long64_t ientry = LoadTree(jentry);
78
      if (ientry < 0) break;
79
      nb = fChain->GetEntry(jentry);   nbytes += nb;
80
      // if (Cut(ientry) < 0) continue;
81
      Long64_t i=0;
82
      double pdg=-13;
83
      int  nTracks=0;
84
      int nspacepoints=0;
85
      int skipEvent=0;
86
      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
87
      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
88
      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
89
      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
90
      //
91
      //
92
      //  Reco track loop
93
      //
94
      //
95
      int totalSpacepoints=0;
96
      for(int j=0;j<ntracks_reco;j++)
97
        {
98
          /*          if(trkpdg[j]!=-13 )
99
            {
100
              cout << "----" << trkpdg[j] << endl;
101
              cout << " track stuff " << trkd2[j] << endl;
102
              }*/
103
          //          if(trklen_cut_MC[0]<5  && trklen[j]>60 ) std::cout << " Event No." <<  event << std::endl;
104
          if(!(1/*trkang[j]<0 &&trkd2[j]<0.01 &&trkmatchdisp[j]>0  && abs(trklen[j]-10-trklen_cut_MC[0]+10)<30 */))
105
            {
106
            skipEvent=1;
107
            break;
108
            }
109
          totalSpacepoints+=ntrkhits[j];
110
        }
111
      /*      if(trklen_cut_MC[0]<10)
112
              continue;*/
113
      if(skipEvent) 
114
        continue;
115
      /*      if(ntracks_reco==0)
116
              continue;  */
117
      if(trkpdg_MC[0]!=-13)
118
        continue;
119
      
120
      //      if(trklen[j]-10-trklen_cut_MC[0]+10<30)
121
      //      if(trklen_cut_MC[0]>180 &&trklen[i]< 100 )
122
      //        cout << "Event number is :" << event << endl;
123

    
124
      /*      mchists.fHmcstartx->Fill(trkstartx_MC[i]);
125
      mchists.fHmcstarty->Fill(trkstarty_MC[i]);
126
      mchists.fHmcstartz->Fill(trkstartz_MC[i]);
127
      mchists.fHmcendx->Fill(trkendx_MC[i]);
128
      mchists.fHmcendy->Fill(trkendy_MC[i]);
129
      mchists.fHmcendz->Fill(trkendz_MC[i]);*/
130
      mchists.fHmctheta->Fill(trktheta_MC[i]);
131
      mchists.fHmcphi->Fill(trkphi_MC[i]);
132
      mchists.fHmctheta_xz->Fill(trktheta_xz_MC[i]);
133
      mchists.fHmctheta_yz->Fill(trktheta_yz_MC[i]);
134
      mchists.fHmcmom->Fill(trkmom_MC[i]);
135
      mchists.fHmclen->Fill(trklen[i]);
136
      hntracks_reco->Fill(ntracks_reco);
137
      htrkspacepoints->Fill(totalSpacepoints);
138

    
139
      COUNTER++;
140
      for(int j=0;j<ntracks_reco;j++)
141
        {
142
          /*          if( 0 
143
             //trkd2[j]>0.2
144
               || trklen_cut_MC[i]<fMinMCLen
145
               || trkcolinearity[j]<fMatchColinearity 
146
              // ||trklen[j]/trklen_cut_MC[i] < 0.5
147
               || abs(trkwmatchdisp[j]) <= fWMatchDisp &&  trkmatchdisp[j] <= fMatchDisp 
148
               ||ntrkhits[j]==0
149
               )
150
               continue;*/
151
          //          if(abs(trklen[j]-trklen_cut_MC[j]+100)>10 ) continue;
152
          //if(abs(trklen[j]-trklen_cut_MC[j])>10 ) continue;
153
          //          if(ntrkhits[j]==0) continue;
154
          //          cout << "Event no. is : " << event << endl;
155
          /*          htrkstartx->Fill(trkstartx[j]);
156
          htrkstarty->Fill(trkstarty[j]);
157
          htrkstartz->Fill(trkstartz[j]);*/
158
          htrkendx->Fill(trkendx[j]);
159
          htrkendy->Fill(trkendy[j]);
160
          htrkendz->Fill(trkendz[j]);
161

    
162
          mchists.fHglen->Fill(trklen[j]);
163

    
164
          htrkstartx->Fill(trkstartx[j]);
165
          htrkstarty->Fill(trkstarty[j]);
166
          htrkstartz->Fill(trkstartz[j]);
167

    
168
          htrkstartx_diff->Fill(trkendx[j]-trkstartx[j]);
169
          htrkstarty_diff->Fill(trkendy[j]-trkstarty[j]);
170
          htrkstartz_diff->Fill(trkendz[j]-trkstartz[j]);
171

    
172
          mchists.fHstartdx->Fill(trkstartx_MC[i]-trkstartx[j]);
173
          mchists.fHstartdy->Fill(trkstarty_MC[i]-trkstarty[j]);
174
          mchists.fHstartdz->Fill(trkstartz_MC[i]-trkstartz[j]);
175
          for(int tt=0;tt<ntrkhits[j];tt++)
176
            {
177
              
178
              trkytrkz->Fill(trkz[j][tt],trky[j][tt]);
179
              trkytrkx->Fill(trkx[j][tt],trky[j][tt]);
180
              trkztrkx->Fill(trkx[j][tt],trkz[j][tt]);
181
              trkztrkxtrky->Fill(trkz[j][tt],trky[j][tt],trkx[j][tt]);
182
              
183
              htrkx->Fill(trkx[j][tt]);
184
              htrky->Fill(trky[j][tt]);
185
              htrkz->Fill(trkz[j][tt]);
186
              
187
            }
188
          
189
          nspacepoints+=ntrkhits[j];
190
          nTracks++;
191
          mchists.fHtrkd2->Fill(trkd2[j]);
192
          //          if( trkmatchdisp[j] <= fMatchDisp  && trklen_cut_MC[i]> -999)
193
          //          if(  trklen_cut_MC[i]> -999)
194
          {
195
            mchists.fHlvsl->Fill(trklen_cut_MC[i],trklen[j]);
196
            mchists.fHlvslvstrkang->Fill(trkang[j],trklen_cut_MC[i],trklen[j]);
197
            mchists.fHdl->Fill(trklen[j]-trklen_cut_MC[i]);
198
          }
199

    
200
          bool good = (/*trkang[j]>0 &&ntracks_reco==1&& trklen_cut_MC[i]>10 &&abs(trkwmatchdisp[j]) <= fWMatchDisp &&  trkmatchdisp[j] <= fMatchDisp &&*/
201
                       // trklenratio[j] > 0.5 &&
202
                                trklen[j]/trklen_cut_MC[i] > 0.5
203
                       //                                && pdg==-13 
204
                        //                        && trklen_cut_MC[i]>fMinMCLen
205
                        //&& trkcolinearity[j]>fMatchColinearity
206
                        ) ;
207
          //          bool good=1;
208
          //trklen[j]/trklen_cut_MC[i] > 0.5 && pdg==13 && trklen_cut_MC[i]>fMinMCLen  && trkcolinearity[j]>fMatchColinearity);
209
          if(good) {
210
            /* mchists.fHgstartx->Fill(mcstart.X());
211
               mchists.fHgstarty->Fill(mcstart.Y());
212
            mchists.fHgstartz->Fill(mcstart.Z());
213
            mchists.fHgendx->Fill(mcend.X());
214
            mchists.fHgendy->Fill(mcend.Y());
215
            mchists.fHgendz->Fill(mcend.Z());*/
216
            mchists.fHgtheta->Fill(trktheta_MC[j]);
217
            mchists.fHgphi->Fill(trkphi_MC[j]);
218
            mchists.fHgtheta_xz->Fill(trktheta_xz_MC[j]);
219
            mchists.fHgtheta_yz->Fill(trktheta_yz_MC[j]);
220
            mchists.fHgmom->Fill(trkmom_MC[j]);
221
            hgoodlen->Fill(trklen_cut_MC[i],trklen[j]);
222
            hgtrkspacepoints->Fill(totalSpacepoints);
223
          }
224
        }
225

    
226
      //
227
      //
228
      // End of  Reco track loop
229
      //
230
      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
231
      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
232
      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
233
      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
234
      //
235
      ntracks->Fill(nTracks);
236
      //      cout << " event no " << jentry<< " no of spacepoints " << nspacepoints << endl;
237
   }
238

    
239
   cout <<"+++++++++++ "<< endl;
240
   cout << "::effcalc" << endl;
241
   cout <<"+++++++++++ "<< endl;
242
   effcalc(mchists.fHgtheta, mchists.fHmctheta, mchists.fHetheta);
243
   cout <<"+++++++++++ "<< endl;
244
   effcalc(mchists.fHgphi, mchists.fHmcphi, mchists.fHephi);
245
   cout <<"+++++++++++ "<< endl;
246
   effcalc(mchists.fHgtheta_xz, mchists.fHmctheta_xz, mchists.fHetheta_xz);
247
   cout <<"+++++++++++ "<< endl;
248
   effcalc(mchists.fHgtheta_yz, mchists.fHmctheta_yz, mchists.fHetheta_yz);
249
   cout <<"+++++++++++ "<< endl;
250
   effcalc(mchists.fHgmom, mchists.fHmcmom, mchists.fHemom);
251
   cout <<"+++++++++++ "<< endl;
252
   effcalc(mchists.fHglen, mchists.fHmclen, mchists.fHelen);
253
   cout <<"+++++++++++ "<< endl;
254
   effcalc( hgtrkspacepoints,  htrkspacepoints, hetrkspacepoints);
255

    
256
   cout << COUNTER << endl;
257
   //
258
   //
259
   // theta
260
   //
261
     
262
   /*   new TCanvas;
263
   mchists.fHmctheta->Draw();
264
   new TCanvas;
265
   mchists.fHgtheta->Draw();*/
266
  
267
   cout<< "+++++++++++" << endl;
268
   cout << " Phi " << endl;
269
   cout<< "+++++++++++" << endl;
270
    new TCanvas;
271
   mchists.fHmcphi->Draw();
272
   mchists.fHmcphi->SetFillColor(kPink);
273
   //   new TCanvas;
274
   mchists.fHgphi->Draw("same");
275
   mchists.fHgphi->SetFillColor(kBlue);
276
   cout<< "+++++++++++" << endl;
277
   cout << " theta " << endl;
278
   cout<< "+++++++++++" << endl;
279
   new TCanvas;
280
   mchists.fHmctheta->Draw();
281
   mchists.fHmctheta->SetFillColor(kPink);
282
   //   new TCanvas;
283
   mchists.fHgtheta->Draw("same");
284
   mchists.fHgtheta->SetFillColor(kBlue);
285
   cout<< "+++++++++++" << endl;
286
   cout << " Momentum " << endl;
287
   cout<< "+++++++++++" << endl;
288
   new TCanvas;
289
   mchists.fHmcmom->Draw();
290
   mchists.fHmcmom->SetFillColor(kPink);
291
   //  new TCanvas;
292
   mchists.fHgmom->Draw("same");
293
   mchists.fHgmom->SetFillColor(kBlue);
294
   cout<< "+++++++++++" << endl;
295
   cout << " Length " << endl;
296
   cout<< "+++++++++++" << endl;
297
   new TCanvas;
298
   mchists.fHmclen->Draw();
299
   mchists.fHmclen->SetMaximum(700);
300
   mchists.fHmclen->SetMinimum(0);
301
   mchists.fHmclen->SetFillColor(kPink);
302
   //  new TCanvas;
303
   mchists.fHglen->Draw("same");
304
   mchists.fHglen->SetFillColor(kBlue);
305
   //   mchists.fHglen->SetFillStyle(3445);
306
   /////////
307
   /////////
308
   /////////
309
   /////////
310
   /////////
311
   new TCanvas;
312
   mchists.fHephi->Draw("p");
313
   new TCanvas;
314
   mchists.fHetheta->Draw("p");
315
   new TCanvas;
316
   mchists.fHetheta_xz->Draw("p");
317
   new TCanvas;
318
   mchists.fHetheta_yz->Draw("p");
319
   new TCanvas;
320
   mchists.fHelen->Draw("p");
321
   new TCanvas;
322
   mchists.fHlvsl->Draw();
323
   //c1->SaveAs("lvsl.png");
324
   new TCanvas;
325
   mchists.fHdl->Draw();
326
   //c1_n2->SaveAs("dl.png");
327
   new TCanvas;
328
   mchists.fHlvslvstrkang->Draw();
329
   new TCanvas;
330
   mchists.fHemom->Draw();
331
   
332
   new TCanvas;
333
   mchists.fHmctheta_xz->Draw();
334
   mchists.fHgtheta_xz->Draw("same");
335
   mchists.fHgtheta_xz->SetFillColor(kGray);
336
   mchists.fHgtheta_xz->SetMinimum(0);
337
   new TCanvas;
338
   mchists.fHmctheta_yz->Draw();
339
   mchists.fHgtheta_yz->Draw("same");
340
   mchists.fHgtheta_yz->SetFillColor(kGray);
341
   
342
   new TCanvas;
343
   hgoodlen->Draw("zcol");
344
   
345
   new TCanvas;
346
  htrkstartx_diff->Draw();
347
  htrkstartx_diff->SetFillColor(kGray);
348
  
349
  new TCanvas;
350
  htrkstarty_diff->Draw();
351
  htrkstarty_diff->SetFillColor(kGray);
352
  
353
  new TCanvas;
354
  htrkstartz_diff->Draw();
355
  htrkstartz_diff->SetFillColor(kGray);
356
  
357
  new TCanvas;
358
  hetrkspacepoints->Draw("p");
359
  //  hgtrkspacepoints->Draw("same");
360
  //htrkspacepoints->Draw();
361
  
362
  //  new TCanvas;
363
  //  mchists.htrkd2->Draw();
364
  //  new TCanvas
365
  //   saveHist(mchists.fHtrkd2);
366
  // new TCanvas;
367
  //   mchists.fHstartdz->Draw();
368
  // saveHist( mchists.fHdl, mchists.fHlvsl);
369
  saveHist(filePrefex,trkytrkz,trkytrkx,trkztrkx,htrkstartx,htrkstarty,htrkstartz,mchists.fHdl,mchists.fHlvsl,htrkendx,htrkendy,htrkendz,hntracks_reco);
370
  /*            mchists.fHmcmom->Draw();*/
371

    
372
}
373

    
374
void effcalc(const TH1* hnum, const TH1* hden, TH1* heff)
375
{
376
  int nbins = hnum->GetNbinsX();
377
  if (nbins != hden->GetNbinsX())
378
    cout << "something is wrong" << endl;
379
  if (nbins != heff->GetNbinsX())
380
    cout << "something is wrong" << endl;
381
  // Loop over bins, including underflow and overflow.
382
  for(int ibin = 0; ibin <= nbins+1; ++ibin) {
383
    double num = hnum->GetBinContent(ibin);
384
    double den = hden->GetBinContent(ibin);
385
    if(den == 0.) {
386
      heff->SetBinContent(ibin, 0.);
387
      heff->SetBinError(ibin, 0.);
388
    }
389
    else {
390
      double eff = num / den;
391
      if(eff < 0.)
392
        eff = 0.;
393
      /*      if(eff > 1.)
394
              eff = 1.;*/
395
      double err = std::sqrt(eff * (1.-eff) / den);
396
      heff->SetBinContent(ibin, eff);
397
      heff->SetBinError(ibin, err);
398
    }
399
  }
400
  heff->SetMinimum(0.);
401
  heff->SetMaximum(1.05);
402
  heff->SetMarkerStyle(20);
403
}
404

    
405
void saveHist(char * filePrefex,TH2F * h1,TH2F *h2,TH2F* h3,TH1F * h4, TH1F * h5, TH1F * h6,TH1F * h7, TH2F *h8,TH1F * h9, TH1F * h10, TH1F * h11, TH1F * h12)
406
{
407
 
408

    
409
  TString tmpName="display"; 
410
  tmpName+="_hist.root";
411
  TFile * file=new TFile(tmpName,"UPDATE");
412
  TCanvas * tmpCan=new TCanvas("tmpCan","tmpCan",1200,800);
413
  TString tmpSt="";
414
  tmpCan->Divide(4,3);
415
  tmpCan->cd(1);
416
  h1->Draw();
417
  tmpSt=h1->GetName();
418
  tmpSt+=filePrefex;
419
  h1->SetName(tmpSt);
420
  h1->Write();
421
  h1->SetFillColor(kGray);
422
  tmpCan->cd(2);
423
  h2->Draw();
424
  tmpSt=h2->GetName();
425
  tmpSt+=filePrefex;
426
  h2->SetName(tmpSt);
427
  h2->SetFillColor(kGray);
428
  h2->Write();
429
  tmpCan->cd(3);
430
  h3->Draw();
431
 tmpSt=h3->GetName();
432
  tmpSt+=filePrefex;
433
  h3->SetName(tmpSt);
434
  h3->SetFillColor(kGray);
435
  h3->Write();
436
  tmpCan->cd(4);
437
  h4->Draw();
438
 tmpSt=h4->GetName();
439
  tmpSt+=filePrefex;
440
  h4->SetName(tmpSt);
441
  h4->SetFillColor(kGray);
442
  h4->Write();
443
  tmpCan->cd(5);
444
  h5->Draw();
445
  h5->SetFillColor(kGray);
446
  h5->Write();
447
  tmpCan->cd(6);
448
  h6->Draw();
449
 tmpSt=h6->GetName();
450
  tmpSt+=filePrefex;
451
  h6->SetName(tmpSt);
452
  h6->SetFillColor(kGray);
453
  h6->Write();
454
  tmpCan->cd(7);
455
  h7->Draw();
456
 tmpSt=h7->GetName();
457
  tmpSt+=filePrefex;
458
  h7->SetName(tmpSt);
459
  h7->SetFillColor(kGray);
460
  h7->Write();
461
  tmpCan->cd(8);
462
  h8->Draw("zcol");
463
 tmpSt=h8->GetName();
464
  tmpSt+=filePrefex;
465
  h8->SetName(tmpSt);
466
  h8->SetFillColor(kGray);
467
  h8->Write();
468
  tmpCan->cd(9);
469
  h9->Draw();
470
 tmpSt=h9->GetName();
471
  tmpSt+=filePrefex;
472
  h9->SetName(tmpSt);
473
  h9->SetFillColor(kGray);
474
  h9->Write();
475
  tmpCan->cd(10);
476
  h10->Draw();
477
   tmpSt=h10->GetName();
478
  tmpSt+=filePrefex;
479
  h10->SetName(tmpSt);
480
  h10->SetFillColor(kGray);
481
  h10->Write();
482
  tmpCan->cd(11);
483
  h11->Draw();
484
   tmpSt=h11->GetName();
485
  tmpSt+=filePrefex;
486
  h11->SetName(tmpSt);
487
  h11->SetFillColor(kGray);
488
  h11->Write();
489
  tmpCan->cd(12);
490
  h12->Draw();
491
 tmpSt=h12->GetName();
492
  tmpSt+=filePrefex;
493
  h12->SetName(tmpSt);
494
  h12->SetFillColor(kGray);
495
  h12->Write();
496
  tmpCan->Draw();
497

    
498
  file->Close();
499
  //  tmpCan->SaveAs(histName);
500
  //  delete tmpCan;
501
  //  tmpCan->SaveAs(histName);
502
  //  cout << histName << endl;
503
}
504
void saveHist(TH1F * h1, TH2F * h2)
505
{
506
  TCanvas * tmpCan=new TCanvas("tmpCan","tmpCan",600,800);
507
  tmpCan->Divide(1,2);
508
  tmpCan->cd(1);
509
  h1->Draw();
510
  tmpCan->cd(2);
511
  h2->Draw();
512
  tmpCan->Draw();
513
  //  tmpCan->SaveAs(histName);
514
  //  delete tmpCan;
515
  //  tmpCan->SaveAs(histName);
516
  //  cout << histName << endl;
517
}
518

    
519

    
520
void prettyPlots()
521
{
522
  //    gROOT  -> SetStyle("Default");
523
  //    gROOT  -> SetStyle("Plain");
524
  gStyle->SetNdivisions(110,"xyz");
525
  gStyle -> SetStatFont(42);
526
  //  gStyle -> SetOptStat(111);
527
  gStyle -> SetOptStat(111);
528
  gStyle -> SetOptFit(1111);
529
  gROOT  ->ForceStyle();
530
  gStyle -> SetPalette(1);
531
  gStyle->SetStatX(0.8201149);
532
  gStyle->SetStatY(0.8444915);
533
  //  gStyle->SetStatW(0.8807471);
534
  //  gStyle->SetStatH(0.8644068);
535

    
536
  gStyle -> SetLabelFont(42,"XYZ");
537
  gStyle -> SetTitleFont(42, "XYZ");
538
  gStyle -> SetLabelSize(0.04, "XYZ");
539
  gStyle -> SetTitleSize(0.05, "XYZ");
540
  gStyle -> SetTitleOffset(1.0, "X");
541
  gStyle -> SetTitleOffset(1.0, "Y");
542
  gStyle -> SetTitleOffset(1.0, "Z");
543
}