Project

General

Profile

makeEffHist.h

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

 
1
//////////////////////////////////////////////////////////
2
// This class has been automatically generated on
3
// Thu Sep 25 15:06:13 2014 by ROOT version 5.34/03
4
// from TTree anatree/analysis tree
5
// found on file: f_hist.root
6
//////////////////////////////////////////////////////////
7

    
8
#ifndef makeEffHist_h
9
#define makeEffHist_h
10

    
11
#include <TROOT.h>
12
#include <TChain.h>
13
#include <TFile.h>
14

    
15
// Header file for the classes stored in the TTree if any.
16

    
17
// Fixed size dimensions of array or collections stored in the TTree if any.
18

    
19
class makeEffHist {
20
public :
21
   TTree          *fChain;   //!pointer to the analyzed TTree or TChain
22
   Int_t           fCurrent; //!current Tree number in a TChain
23

    
24
   // Declaration of leaf types
25
   Int_t           run;
26
   Int_t           subrun;
27
   Int_t           event;
28
   Double_t        evttime;
29
   Double_t        efield[3];
30
   Int_t           t0;
31
   Int_t           trigtime[16];
32
   Int_t           ntracks_reco;
33
   Double_t        trkstartx[1000];   //[ntracks_reco]
34
   Double_t        trkstarty[1000];   //[ntracks_reco]
35
   Double_t        trkstartz[1000];   //[ntracks_reco]
36
   Double_t        trkendx[1000];   //[ntracks_reco]
37
   Double_t        trkendy[1000];   //[ntracks_reco]
38
   Double_t        trkendz[1000];   //[ntracks_reco]
39
   Double_t        trkstartx_MC[1000];   //[ntracks_reco]
40
   Double_t        trkstarty_MC[1000];   //[ntracks_reco]
41
   Double_t        trkstartz_MC[1000];   //[ntracks_reco]
42
   Double_t        trkendx_MC[1000];   //[ntracks_reco]
43
   Double_t        trkendy_MC[1000];   //[ntracks_reco]
44
   Double_t        trkendz_MC[1000];   //[ntracks_reco]
45
   Double_t        trklen_MC[1000];   //[ntracks_reco]
46
   Double_t        trklen_cut_MC[1000];   //[ntracks_reco]
47
   Double_t        trkmom_MC[1000];   //[ntracks_reco]
48
   Double_t        trkpdg_MC[1000];   //[ntracks_reco]
49
   Double_t        trkd2[1000];   //[ntracks_reco]
50
   Double_t        trkcolin[1000];   //[ntracks_reco]
51
   Double_t        trktheta_xz_MC[1000];   //[ntracks_reco]
52
   Double_t        trktheta_yz_MC[1000];   //[ntracks_reco]
53
   Double_t        trktheta_MC[1000];   //[ntracks_reco]
54
   Double_t        trkphi_MC[1000];   //[ntracks_reco]
55
   Double_t        trkstartdcosx[1000];   //[ntracks_reco]
56
   Double_t        trkstartdcosy[1000];   //[ntracks_reco]
57
   Double_t        trkstartdcosz[1000];   //[ntracks_reco]
58
   Double_t        trklen[1000];   //[ntracks_reco]
59
   Double_t        trkid[1000];   //[ntracks_reco]
60
   Double_t        mcang_x;
61
   Double_t        mcang_y;
62
   Double_t        mcang_z;
63
   Double_t        mcpos_x;
64
   Double_t        mcpos_y;
65
   Double_t        mcpos_z;
66
   Double_t        trkang[1000];   //[ntracks_reco]
67
   Double_t        trkcolinearity[1000];   //[ntracks_reco]
68
   Double_t        trkmatchdisp[1000];   //[ntracks_reco]
69
   Double_t        trkwmatchdisp[1000];   //[ntracks_reco]
70
   Double_t        trklenratio[1000];   //[ntracks_reco]
71
   Double_t        trkenddcosx[1000];   //[ntracks_reco]
72
   Double_t        trkenddcosy[1000];   //[ntracks_reco]
73
   Double_t        trkenddcosz[1000];   //[ntracks_reco]
74
   Int_t           ntrkhits[1000];   //[ntracks_reco]
75
   Double_t        trkx[1000][1000];   //[ntracks_reco]
76
   Double_t        trky[1000][1000];   //[ntracks_reco]
77
   Double_t        trkz[1000][1000];   //[ntracks_reco]
78
   Double_t        trkpitch[1000][3];   //[ntracks_reco]
79
   Int_t           nhits;
80

    
81
   // List of branches
82
   TBranch        *b_run;   //!
83
   TBranch        *b_subrun;   //!
84
   TBranch        *b_event;   //!
85
   TBranch        *b_evttime;   //!
86
   TBranch        *b_efield;   //!
87
   TBranch        *b_t0;   //!
88
   TBranch        *b_trigtime;   //!
89
   TBranch        *b_ntracks_reco;   //!
90
   TBranch        *b_trkstartx;   //!
91
   TBranch        *b_trkstarty;   //!
92
   TBranch        *b_trkstartz;   //!
93
   TBranch        *b_trkendx;   //!
94
   TBranch        *b_trkendy;   //!
95
   TBranch        *b_trkendz;   //!
96
   TBranch        *b_trkstartx_MC;   //!
97
   TBranch        *b_trkstarty_MC;   //!
98
   TBranch        *b_trkstartz_MC;   //!
99
   TBranch        *b_trkendx_MC;   //!
100
   TBranch        *b_trkendy_MC;   //!
101
   TBranch        *b_trkendz_MC;   //!
102
   TBranch        *b_trklen_MC;   //!
103
   TBranch        *b_trklen_cut_MC;   //!
104
   TBranch        *b_trkmom_MC;   //!
105
   TBranch        *b_trkpdg_MC;   //!
106
   TBranch        *b_trkd2;   //!
107
   TBranch        *b_trkcolin;   //!
108
   TBranch        *b_trktheta_xz_MC;   //!
109
   TBranch        *b_trktheta_yz_MC;   //!
110
   TBranch        *b_trktheta_MC;   //!
111
   TBranch        *b_trkphi_MC;   //!
112
   TBranch        *b_trkstartdcosx;   //!
113
   TBranch        *b_trkstartdcosy;   //!
114
   TBranch        *b_trkstartdcosz;   //!
115
   TBranch        *b_trklen;   //!
116
   TBranch        *b_trkid;   //!
117
   TBranch        *b_mcang_x;   //!
118
   TBranch        *b_mcang_y;   //!
119
   TBranch        *b_mcang_z;   //!
120
   TBranch        *b_mcpos_x;   //!
121
   TBranch        *b_mcpos_y;   //!
122
   TBranch        *b_mcpos_z;   //!
123
   TBranch        *b_trkang;   //!
124
   TBranch        *b_trkcolinearity;   //!
125
   TBranch        *b_trkmatchdisp;   //!
126
   TBranch        *b_trkwmatchdisp;   //!
127
   TBranch        *b_trklenratio;   //!
128
   TBranch        *b_trkenddcosx;   //!
129
   TBranch        *b_trkenddcosy;   //!
130
   TBranch        *b_trkenddcosz;   //!
131
   TBranch        *b_ntrkhits;   //!
132
   TBranch        *b_trkx;   //!
133
   TBranch        *b_trky;   //!
134
   TBranch        *b_trkz;   //!
135
   TBranch        *b_trkpitch;   //!
136
   TBranch        *b_nhits;   //!
137

    
138

    
139
   makeEffHist(char * filename="",char * treename="",TChain *tree=0);
140
   virtual ~makeEffHist();
141
   virtual Int_t    Cut(Long64_t entry);
142
   virtual Int_t    GetEntry(Long64_t entry);
143
   virtual Long64_t LoadTree(Long64_t entry);
144
   virtual void     Init(TTree *tree);
145
   virtual double *    Loop();
146
   virtual Bool_t   Notify();
147
   virtual void     Show(Long64_t entry = -1);
148

    
149
 private:
150
   
151

    
152
  double fMinMCKE;           // Minimum MC particle kinetic energy (GeV).
153
  double fMinMCLen;          // Minimum MC particle length in tpc (cm).
154
  double fMatchColinearity;  // Minimum matching colinearity.
155
  double fMatchDisp;         // Maximum matching displacement.
156
  double fWMatchDisp;        // Maximum matching displacement in the w direction.
157

    
158

    
159
  struct RecoHists
160
    {
161
      // Constructors.
162
      RecoHists();
163
      //      ~RecoHists();
164
      RecoHists(const std::string& subdir);
165
      // Pure reco track histograms.
166
      TH1F* fHstartx;      // Starting x position.
167
      TH1F* fHstarty;      // Starting y position.
168
      TH1F* fHstartz;      // Starting z position.
169
      TH1F* fHstartd;      // Starting distance to boundary.
170
      TH1F* fHendx;        // Ending x position.
171
      TH1F* fHendy;        // Ending y position.
172
      TH1F* fHendz;        // Ending z position.
173
      TH1F* fHendd;        // Ending distance to boundary.
174
      TH1F* fHtheta;       // Theta.
175
      TH1F* fHphi;         // Phi.
176
      TH1F* fHtheta_xz;    // Theta_xz.
177
      TH1F* fHtheta_yz;    // Theta_yz.
178
      TH1F* fHmom;         // Momentum.
179
      TH1F* fHlen;         // Length.
180
      // Histograms for the consituent Hits
181
      TH1F* fHHitChg;       // hit charge
182
      TH1F* fHHitWidth;     // hit width
183
      TH1F* fHHitPdg;       // Pdg primarily responsible.
184
      TH1F* fHHitTrkId;     // TrkId
185
      TH1F* fModeFrac;       // mode fraction
186
      TH1F* fNTrkIdTrks;    // # of stitched tracks in which unique TrkId appears
187
      TH2F* fNTrkIdTrks2;   
188
      TH2F* fNTrkIdTrks3;   
189
    };
190

    
191
    // Struct for mc particles and mc-matched tracks.
192
    struct MCHists
193
    {
194
      // Constructors.
195
      MCHists();
196
      MCHists(const std::string& subdir);
197
      // Reco-MC matching.
198
      TH2F* fHduvcosth;    // 2D mc vs. data matching, duv vs. cos(theta).
199
      TH1F* fHcosth;       // 1D direction matching, cos(theta).
200
      TH1F* fHmcu;         // 1D endpoint truth u.
201
      TH1F* fHmcv;         // 1D endpoint truth v.
202
      TH1F* fHmcw;         // 1D endpoint truth w.
203
      TH1F* fHupull;       // 1D endpoint u pull.
204
      TH1F* fHvpull;       // 1D endpoint v pull.
205
      TH1F* fHmcdudw;      // Truth du/dw.
206
      TH1F* fHmcdvdw;      // Truth dv/dw.
207
      TH1F* fHdudwpull;    // du/dw pull.
208
      TH1F* fHdvdwpull;    // dv/dw pull.
209
      // Histograms for matched tracks.
210
      TH1F* fHstartdx;     // Start dx.
211
      TH1F* fHstartdy;     // Start dy.
212
      TH1F* fHstartdz;     // Start dz.
213
      TH1F* fHenddx;       // End dx.
214
      TH1F* fHenddy;       // End dy.
215
      TH1F* fHenddz;       // End dz.
216
      TH2F* fHlvsl;        // MC vs. reco length.
217
      TH1F* fHtrkd2;        // trkd2.
218
      TH3F* fHlvslvstrkang;        // MC vs. reco length.
219
      TH1F* fHdl;          // Delta(length).
220
      TH2F* fHpvsp;        // MC vs. reco momentum.
221
      TH2F* fHpvspc;       // MC vs. reco momentum (contained tracks).
222
      TH1F* fHdp;          // Momentum difference.
223
      TH1F* fHdpc;         // Momentum difference (contained tracks).
224
      TH1F* fHppull;       // Momentum pull.
225
      TH1F* fHppullc;      // Momentum pull (contained tracks).
226
      // Pure MC particle histograms (efficiency denominator).
227
      TH1F* fHmcstartx;    // Starting x position.
228
      TH1F* fHmcstarty;    // Starting y position.
229
      TH1F* fHmcstartz;    // Starting z position.
230
      TH1F* fHmcendx;      // Ending x position.
231
      TH1F* fHmcendy;      // Ending y position.
232
      TH1F* fHmcendz;      // Ending z position.
233
      TH1F* fHmctheta;     // Theta.
234
      TH1F* fHmcphi;       // Phi.
235
      TH1F* fHmctheta_xz;  // Theta_xz.
236
      TH1F* fHmctheta_yz;  // Theta_yz.
237
      TH1F* fHmcmom;       // Momentum.
238
      TH1F* fHmclen;       // Length.
239
      // Histograms for well-reconstructed matched tracks (efficiency numerator).
240
      TH1F* fHgstartx;     // Starting x position.
241
      TH1F* fHgstarty;     // Starting y position.
242
      TH1F* fHgstartz;     // Starting z position.
243
      TH1F* fHgendx;       // Ending x position.
244
      TH1F* fHgendy;       // Ending y position.
245
      TH1F* fHgendz;       // Ending z position.
246
      TH1F* fHgtheta;      // Theta.
247
      TH1F* fHgphi;        // Phi.
248
      TH1F* fHgtheta_xz;   // Theta_xz.
249
      TH1F* fHgtheta_yz;   // Theta_yz.
250
      TH1F* fHgmom;        // Momentum.
251
      TH1F* fHglen;        // Length.
252
      // Efficiency histograms.
253
      TH1F* fHestartx;     // Starting x position.
254
      TH1F* fHestarty;     // Starting y position.
255
      TH1F* fHestartz;     // Starting z position.
256
      TH1F* fHeendx;       // Ending x position.
257
      TH1F* fHeendy;       // Ending y position.
258
      TH1F* fHeendz;       // Ending z position.
259
      TH1F* fHetheta;      // Theta.
260
      TH1F* fHephi;        // Phi.
261
      TH1F* fHetheta_xz;   // Theta_xz.
262
      TH1F* fHetheta_yz;   // Theta_yz.
263
      TH1F* fHemom;        // Momentum.
264
      TH1F* fHelen;        // Length.
265
    };
266

    
267

    
268
    //    std::map<int, MCHists> fMCHistMap;       // Indexed by pdg id.
269
    //    std::map<int, RecoHists> fRecoHistMap;   // Indexed by pdg id.
270

    
271
};
272

    
273
#endif
274

    
275
#ifdef makeEffHist_cxx
276
makeEffHist::makeEffHist(char * filename,char * treeName,TChain *tree) : fChain(0) 
277
{
278
// if parameter tree is not specified (or zero), connect the file
279
// used to generate this class and read the Tree.
280
   if (tree == 0) {
281
     /*      TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
282
      if (!f || !f->IsOpen()) {
283
         f = new TFile(filename);
284
         }*/
285
     TString tmpString="";
286
     tmpString+=treeName;
287
     tmpString+="/anatree";
288
     tree=new TChain(tmpString);
289

    
290
     //     tree->Add("reco_35t_filt_stit__evts_Mom6_*.root);
291
     //     tree->Add("reco_35t_filt_stit30_*.root");
292
     //     tree->Add("testnewSt1.root");
293
     //     tree->Add("reco_35t_filt_50*allfiles.root");//stit30_0.80_cosmics_FILE{1}_hist.root");
294
     //          tree->Add("test_events1.root");
295
     //     tree->Add("reco_tmp.root");
296
     //     tree->Add("reco_35t_hist.root");
297
     //     tree->Add("test_very_big_readoutwindow1.root");
298
     //     tree->Add("reco_35t_20_files.root");
299
     //tree->Add("test_CT2.root");
300
     //               tree->Add("reco_35t_10k.root");
301
     //     tree->Add("reco_35t_withoutSpcpts.root");
302
     //     tree->Add("tmp_T1.root");
303
     tree->Add(filename);
304
     //     tree->Add("test_dbscan1.root");
305
     //          tree->Add("reco_test_T1*.root");
306
     /*      TString tmpname=filename;
307
      tmpname+=":/anatree";
308
      TDirectory * dir = (TDirectory*)f->Get(tmpname);
309
      dir->GetObject("anatree",tree);*/
310

    
311
   }
312
   Init(tree);
313
}
314

    
315
makeEffHist::~makeEffHist()
316
{
317
  //  if (!fChain) return;
318
  //  delete fChain->GetCurrentFile();
319
}
320

    
321
Int_t makeEffHist::GetEntry(Long64_t entry)
322
{
323
// Read contents of entry.
324
   if (!fChain) return 0;
325
   return fChain->GetEntry(entry);
326
}
327
Long64_t makeEffHist::LoadTree(Long64_t entry)
328
{
329
// Set the environment to read one entry
330
   if (!fChain) return -5;
331
   Long64_t centry = fChain->LoadTree(entry);
332
   if (centry < 0) return centry;
333
   if (fChain->GetTreeNumber() != fCurrent) {
334
      fCurrent = fChain->GetTreeNumber();
335
      Notify();
336
   }
337
   return centry;
338
}
339

    
340
void makeEffHist::Init(TTree *tree)
341
{
342
   // The Init() function is called when the selector needs to initialize
343
   // a new tree or chain. Typically here the branch addresses and branch
344
   // pointers of the tree will be set.
345
   // It is normally not necessary to make changes to the generated
346
   // code, but the routine can be extended by the user if needed.
347
   // Init() will be called many times when running on PROOF
348
   // (once per file to be processed).
349

    
350
   // Set branch addresses and branch pointers
351
  //canvas=new TCanvas("c1","c1",600,800);
352
 
353

    
354
   if (!tree) return;
355
   fChain = tree;
356
   fCurrent = -1;
357
   fChain->SetMakeClass(1);
358

    
359
   fChain->SetBranchAddress("run", &run, &b_run);
360
   fChain->SetBranchAddress("subrun", &subrun, &b_subrun);
361
   fChain->SetBranchAddress("event", &event, &b_event);
362
   fChain->SetBranchAddress("evttime", &evttime, &b_evttime);
363
   fChain->SetBranchAddress("efield", efield, &b_efield);
364
   fChain->SetBranchAddress("t0", &t0, &b_t0);
365
   fChain->SetBranchAddress("trigtime", trigtime, &b_trigtime);
366
   fChain->SetBranchAddress("ntracks_reco", &ntracks_reco, &b_ntracks_reco);
367
   fChain->SetBranchAddress("trkstartx", trkstartx, &b_trkstartx);
368
   fChain->SetBranchAddress("trkstarty", trkstarty, &b_trkstarty);
369
   fChain->SetBranchAddress("trkstartz", trkstartz, &b_trkstartz);
370
   fChain->SetBranchAddress("trkendx", trkendx, &b_trkendx);
371
   fChain->SetBranchAddress("trkendy", trkendy, &b_trkendy);
372
   fChain->SetBranchAddress("trkendz", trkendz, &b_trkendz);
373
   fChain->SetBranchAddress("trkstartx_MC", trkstartx_MC, &b_trkstartx_MC);
374
   fChain->SetBranchAddress("trkstarty_MC", trkstarty_MC, &b_trkstarty_MC);
375
   fChain->SetBranchAddress("trkstartz_MC", trkstartz_MC, &b_trkstartz_MC);
376
   fChain->SetBranchAddress("trkendx_MC", trkendx_MC, &b_trkendx_MC);
377
   fChain->SetBranchAddress("trkendy_MC", trkendy_MC, &b_trkendy_MC);
378
   fChain->SetBranchAddress("trkendz_MC", trkendz_MC, &b_trkendz_MC);
379
   fChain->SetBranchAddress("trklen_MC", trklen_MC, &b_trklen_MC);
380
   fChain->SetBranchAddress("trklen_cut_MC", trklen_cut_MC, &b_trklen_cut_MC);
381
   fChain->SetBranchAddress("trkmom_MC", trkmom_MC, &b_trkmom_MC);
382
   fChain->SetBranchAddress("trkpdg_MC", trkpdg_MC, &b_trkpdg_MC);
383
   fChain->SetBranchAddress("trkd2", trkd2, &b_trkd2);
384
   fChain->SetBranchAddress("trkcolin", trkcolin, &b_trkcolin);
385
   fChain->SetBranchAddress("trktheta_xz_MC", trktheta_xz_MC, &b_trktheta_xz_MC);
386
   fChain->SetBranchAddress("trktheta_yz_MC", trktheta_yz_MC, &b_trktheta_yz_MC);
387
   fChain->SetBranchAddress("trktheta_MC", trktheta_MC, &b_trktheta_MC);
388
   fChain->SetBranchAddress("trkphi_MC", trkphi_MC, &b_trkphi_MC);
389
   fChain->SetBranchAddress("trkstartdcosx", trkstartdcosx, &b_trkstartdcosx);
390
   fChain->SetBranchAddress("trkstartdcosy", trkstartdcosy, &b_trkstartdcosy);
391
   fChain->SetBranchAddress("trkstartdcosz", trkstartdcosz, &b_trkstartdcosz);
392
   fChain->SetBranchAddress("trklen", trklen, &b_trklen);
393
   fChain->SetBranchAddress("trkid", trkid, &b_trkid);
394
   fChain->SetBranchAddress("mcang_x", &mcang_x, &b_mcang_x);
395
   fChain->SetBranchAddress("mcang_y", &mcang_y, &b_mcang_y);
396
   fChain->SetBranchAddress("mcang_z", &mcang_z, &b_mcang_z);
397
   fChain->SetBranchAddress("mcpos_x", &mcpos_x, &b_mcpos_x);
398
   fChain->SetBranchAddress("mcpos_y", &mcpos_y, &b_mcpos_y);
399
   fChain->SetBranchAddress("mcpos_z", &mcpos_z, &b_mcpos_z);
400
   fChain->SetBranchAddress("trkang", trkang, &b_trkang);
401
   fChain->SetBranchAddress("trkcolinearity", trkcolinearity, &b_trkcolinearity);
402
   fChain->SetBranchAddress("trkmatchdisp", trkmatchdisp, &b_trkmatchdisp);
403
   fChain->SetBranchAddress("trkwmatchdisp", trkwmatchdisp, &b_trkwmatchdisp);
404
   fChain->SetBranchAddress("trklenratio", trklenratio, &b_trklenratio);
405
   fChain->SetBranchAddress("trkenddcosx", trkenddcosx, &b_trkenddcosx);
406
   fChain->SetBranchAddress("trkenddcosy", trkenddcosy, &b_trkenddcosy);
407
   fChain->SetBranchAddress("trkenddcosz", trkenddcosz, &b_trkenddcosz);
408
   fChain->SetBranchAddress("ntrkhits", ntrkhits, &b_ntrkhits);
409
   fChain->SetBranchAddress("trkx", trkx, &b_trkx);
410
   fChain->SetBranchAddress("trky", trky, &b_trky);
411
   fChain->SetBranchAddress("trkz", trkz, &b_trkz);
412
   fChain->SetBranchAddress("trkpitch", trkpitch, &b_trkpitch);
413
   fChain->SetBranchAddress("nhits", &nhits, &b_nhits);
414
   Notify();
415
}
416

    
417
Bool_t makeEffHist::Notify()
418
{
419
   // The Notify() function is called when a new file is opened. This
420
   // can be either for a new TTree in a TChain or when when a new TTree
421
   // is started when using PROOF. It is normally not necessary to make changes
422
   // to the generated code, but the routine can be extended by the
423
   // user if needed. The return value is currently not used.
424

    
425
   return kTRUE;
426
}
427

    
428
void makeEffHist::Show(Long64_t entry)
429
{
430
// Print contents of entry.
431
// If entry is not specified, print current entry
432
   if (!fChain) return;
433
   fChain->Show(entry);
434
}
435
Int_t makeEffHist::Cut(Long64_t entry)
436
{
437
// This function may be called from Loop.
438
// returns  1 if entry is accepted.
439
// returns -1 otherwise.
440
   return 1;
441
}
442

    
443
makeEffHist::MCHists::MCHists() :
444
    //
445
    // Purpose: Default constructor.
446
    //
447
    fHduvcosth(0),
448
    fHcosth(0),
449
    fHmcu(0),
450
    fHmcv(0),
451
    fHmcw(0),
452
    fHupull(0),
453
    fHvpull(0),
454
    fHmcdudw(0),
455
    fHmcdvdw(0),
456
    fHdudwpull(0),
457
    fHdvdwpull(0),
458
    fHstartdx(0),
459
    fHstartdy(0),
460
    fHstartdz(0),
461
    fHenddx(0),
462
    fHenddy(0),
463
    fHenddz(0),
464
    fHlvsl(0),
465
    fHtrkd2(0),
466
    fHlvslvstrkang(0),
467
    fHdl(0),
468
    fHpvsp(0),
469
    fHpvspc(0),
470
    fHdp(0),
471
    fHdpc(0),
472
    fHppull(0),
473
    fHppullc(0),
474
    fHmcstartx(0),
475
    fHmcstarty(0),
476
    fHmcstartz(0),
477
    fHmcendx(0),
478
    fHmcendy(0),
479
    fHmcendz(0),
480
    fHmctheta(0),
481
    fHmcphi(0),
482
    fHmctheta_xz(0),
483
    fHmctheta_yz(0),
484
    fHmcmom(0),
485
    fHmclen(0),
486
    fHgstartx(0),
487
    fHgstarty(0),
488
    fHgstartz(0),
489
    fHgendx(0),
490
    fHgendy(0),
491
    fHgendz(0),
492
    fHgtheta(0),
493
    fHgphi(0),
494
    fHgtheta_xz(0),
495
    fHgtheta_yz(0),
496
    fHgmom(0),
497
    fHglen(0),
498
    fHestartx(0),
499
    fHestarty(0),
500
    fHestartz(0),
501
    fHeendx(0),
502
    fHeendy(0),
503
    fHeendz(0),
504
    fHetheta(0),
505
    fHephi(0),
506
    fHetheta_xz(0),
507
    fHetheta_yz(0),
508
    fHemom(0),
509
    fHelen(0)
510
  {}
511
makeEffHist::MCHists::MCHists(const std::string& subdir)
512
  //
513
  // Purpose: Initializing constructor.
514
  //
515
  {
516
    // Make sure all histogram pointers are initially zero.
517
     MCHists();
518
    // Get services.
519
    //    art::ServiceHandle<geo::Geometry> geom;
520
    // art::ServiceHandle<art::TFileService> tfs;
521
    // Make histogram directory.
522
    // art::TFileDirectory topdir = tfs->mkdir("trkana", "TrackAnaCT histograms");
523
    // art::TFileDirectory dir = topdir.mkdir(subdir);
524
    // Book histograms.
525
   
526
    fHduvcosth = new TH2F("duvcosth", "Delta(uv) vs. Colinearity", 
527
                                100, 0.95, 1., 100, 0., 1.);
528
    fHcosth = new TH1F("colin", "Colinearity", 100, 0.95, 1.);
529
    fHmcu = new TH1F("mcu", "MC Truth U", 100, -5., 5.);
530
    fHmcv = new TH1F("mcv", "MC Truth V", 100, -5., 5.);
531
    fHmcw = new TH1F("mcw", "MC Truth W", 100, -20., 20.);
532
    fHupull = new TH1F("dupull", "U Pull", 100, -20., 20.);
533
    fHvpull = new TH1F("dvpull", "V Pull", 100, -20., 20.);
534
    fHmcdudw = new TH1F("mcdudw", "MC Truth U Slope", 100, -0.2, 0.2);
535
    fHmcdvdw = new TH1F("mcdvdw", "MV Truth V Slope", 100, -0.2, 0.2);
536
    fHdudwpull = new TH1F("dudwpull", "U Slope Pull", 100, -10., 10.);
537
    fHdvdwpull = new TH1F("dvdwpull", "V Slope Pull", 100, -10., 10.);
538
    fHstartdx = new TH1F("startdx", "Start Delta x", 100, -10., 10.);
539
    fHstartdy = new TH1F("startdy", "Start Delta y", 100, -10., 10.);
540
    fHstartdz = new TH1F("startdz", "Start Delta z", 100, -10., 10.);
541
    fHenddx = new TH1F("enddx", "End Delta x", 100, -10., 10.);
542
    fHenddy = new TH1F("enddy", "End Delta y", 100, -10., 10.);
543
    fHenddz = new TH1F("enddz", "End Delta z", 100, -10., 10.);
544
    fHlvsl = new TH2F("lvsl", "Reco Length vs. MC Truth Length",
545
                      100, 0., 300, 100, 0., 300);
546
    fHtrkd2 = new TH1F("trkd2", "trkd2",
547
                       100, 0., 10);
548
    fHlvslvstrkang = new TH3F("lvslvstrkang", "Reco Length vs. MC Truth Length vs. trkang",
549
                              100, -1.1, 1.1, 100, 0., 300, 100, 0., 300. );
550
    //    fHlvsl = new TH2F("lvsl", "Reco Length vs. MC Truth Length",
551
    //                      100, 0., 1.1 * geom->Cryostat(0).Length(), 100, 0., 1.1 * geom->Cryostat(0).Length());
552
    fHdl = new TH1F("dl", "Track Length Minus MC Particle Length", 100, -200., 50.);
553
    fHpvsp = new TH2F("pvsp", "Reco Momentum vs. MC Truth Momentum",
554
                            100, 0., 5., 100, 0., 5.);
555
    fHpvspc = new TH2F("pvspc", "Reco Momentum vs. MC Truth Momentum (Contained Tracks)",
556
                             100, 0., 5., 100, 0., 5.);
557
    fHdp = new TH1F("dp", "Reco-MC Momentum Difference", 100, -5., 5.);
558
    fHdpc = new TH1F("dpc", "Reco-MC Momentum Difference (Contained Tracks)",
559
                           100, -5., 5.);
560
    fHppull = new TH1F("ppull", "Momentum Pull", 100, -10., 10.);
561
    fHppullc = new TH1F("ppullc", "Momentum Pull (Contained Tracks)", 100, -10., 10.);
562
    /*    fHmcstartx = new TH1F("mcxstart", "MC X Start Position",
563
                                10, -2.*geom->Cryostat(0).HalfWidth(), 4.*geom->Cryostat(0).HalfWidth());
564
    fHmcstarty = new TH1F("mcystart", "MC Y Start Position",
565
                                10, -geom->Cryostat(0).HalfHeight(), geom->Cryostat(0).HalfHeight());
566
    fHmcstartz = new TH1F("mczstart", "MC Z Start Position",
567
                                10, 0., geom->Cryostat(0).Length());
568
    fHmcendx = new TH1F("mcxend", "MC X End Position",
569
                              10, -2.*geom->Cryostat(0).HalfWidth(), 4.*geom->Cryostat(0).HalfWidth());
570
    fHmcendy = new TH1F("mcyend", "MC Y End Position",
571
                              10, -geom->Cryostat(0).HalfHeight(), geom->Cryostat(0).HalfHeight());
572
    fHmcendz = new TH1F("mczend", "MC Z End Position",
573
    10, 0., geom->Cryostat(0).Length());*/
574
    fHmctheta = new TH1F("mctheta", "MC Theta", 40, 0., 3.142);
575
    fHmcphi = new TH1F("mcphi", "MC Phi", 40, -3.142, 3.142);
576
    fHmctheta_xz = new TH1F("mctheta_xz", "MC Theta_xz", 40, -3.142, 3.142);
577
    fHmctheta_yz = new TH1F("mctheta_yz", "MC Theta_yz", 40, -3.142, 3.142);
578
    fHmcmom = new TH1F("mcmom", "MC Momentum", 25, 0., 50.);
579
    fHmclen = new TH1F("mclen", "MC Particle Length", 20, 0., 1.1 * 200.0);
580
    /*fHgstartx = new TH1F("gxstart", "Good X Start Position",
581
                               10, -2.*geom->Cryostat(0).HalfWidth(), 4.*geom->Cryostat(0).HalfWidth());
582
    fHgstarty = new TH1F("gystart", "Good Y Start Position",
583
                               10, -geom->Cryostat(0).HalfHeight(), geom->Cryostat(0).HalfHeight());
584
    fHgstartz = new TH1F("gzstart", "Good Z Start Position",
585
                               10, 0., geom->Cryostat(0).Length());
586
    fHgendx = new TH1F("gxend", "Good X End Position",
587
                             10, -2.*geom->Cryostat(0).HalfWidth(), 4.*geom->Cryostat(0).HalfWidth());
588
    fHgendy = new TH1F("gyend", "Good Y End Position",
589
                             10, -geom->Cryostat(0).HalfHeight(), geom->Cryostat(0).HalfHeight());
590
    fHgendz = new TH1F("gzend", "Good Z End Position",
591
    10, 0., geom->Cryostat(0).Length());*/
592
    fHgtheta = new TH1F("gtheta", "Good Theta", 40, 0., 3.142);
593
    fHgphi = new TH1F("gphi", "Good Phi", 40, -3.142, 3.142);
594
    fHgtheta_xz = new TH1F("gtheta_xz", "Good Theta_xz", 40, -3.142, 3.142);
595
    fHgtheta_yz = new TH1F("gtheta_yz", "Good Theta_yz", 40, -3.142, 3.142);
596
    fHgmom = new TH1F("gmom", "Good Momentum", 25, 0., 50.);
597
    fHglen = new TH1F("glen", "Good Particle Length", 20, 0., 1.1 * 200.0);
598
        /*    fHestartx = new TH1F("exstart", "Efficiency vs. X Start Position",
599
                               10, -2.*geom->Cryostat(0).HalfWidth(), 4.*geom->Cryostat(0).HalfWidth());
600
    fHestarty = new TH1F("eystart", "Efficiency vs. Y Start Position",
601
                               10, -geom->Cryostat(0).HalfHeight(), geom->Cryostat(0).HalfHeight());
602
    fHestartz = new TH1F("ezstart", "Efficiency vs. Z Start Position",
603
                               10, 0., geom->Cryostat(0).Length());
604
    fHeendx = new TH1F("exend", "Efficiency vs. X End Position",
605
                             10, -2.*geom->Cryostat(0).HalfWidth(), 4.*geom->Cryostat(0).HalfWidth());
606
    fHeendy = new TH1F("eyend", "Efficiency vs. Y End Position",
607
                             10, -geom->Cryostat(0).HalfHeight(), geom->Cryostat(0).HalfHeight());
608
    fHeendz = new TH1F("ezend", "Efficiency vs. Z End Position",
609
                             10, 0., geom->Cryostat(0).Length());
610
    */
611
    fHetheta = new TH1F("etheta", "Efficiency vs. Theta", 40, 0., 3.142);
612
    fHephi = new TH1F("ephi", "Efficiency vs. Phi", 40, -3.142, 3.142);
613
    fHetheta_xz = new TH1F("etheta_xz", "Efficiency vs. Theta_xz", 40, -3.142, 3.142);
614
    fHetheta_yz = new TH1F("etheta_yz", "Efficiency vs. Theta_yz", 40, -3.142, 3.142);
615
    fHemom = new TH1F("emom", "Efficiency vs. Momentum", 25, 0., 50.);
616
    fHelen = new TH1F("elen", "Efficiency vs. Particle Length", 20, 0., 1.1 * 200.0);
617
  }
618

    
619

    
620

    
621
#endif // #ifdef makeEffHist_cxx