Project

General

Profile

makeEffHist_v2.h

Version 2 - Muhammad Elnimr, 02/04/2015 12:31 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           hit_trkid[10000];
80
   Int_t           nhits;
81
   Int_t           nclust;
82

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

    
142

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

    
153
 private:
154
   
155

    
156
  double fMinMCKE;           // Minimum MC particle kinetic energy (GeV).
157
  double fMinMCLen;          // Minimum MC particle length in tpc (cm).
158
  double fMatchColinearity;  // Minimum matching colinearity.
159
  double fMatchDisp;         // Maximum matching displacement.
160
  double fWMatchDisp;        // Maximum matching displacement in the w direction.
161

    
162

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

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

    
274

    
275
    //    std::map<int, MCHists> fMCHistMap;       // Indexed by pdg id.
276
    //    std::map<int, RecoHists> fRecoHistMap;   // Indexed by pdg id.
277

    
278
};
279

    
280
#endif
281

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

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

    
318
   }
319
   Init(tree);
320
}
321

    
322
makeEffHist::~makeEffHist()
323
{
324
  //  if (!fChain) return;
325
  //  delete fChain->GetCurrentFile();
326
}
327

    
328
Int_t makeEffHist::GetEntry(Long64_t entry)
329
{
330
// Read contents of entry.
331
   if (!fChain) return 0;
332
   return fChain->GetEntry(entry);
333
}
334
Long64_t makeEffHist::LoadTree(Long64_t entry)
335
{
336
// Set the environment to read one entry
337
   if (!fChain) return -5;
338
   Long64_t centry = fChain->LoadTree(entry);
339
   if (centry < 0) return centry;
340
   if (fChain->GetTreeNumber() != fCurrent) {
341
      fCurrent = fChain->GetTreeNumber();
342
      Notify();
343
   }
344
   return centry;
345
}
346

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

    
357
   // Set branch addresses and branch pointers
358
  //canvas=new TCanvas("c1","c1",600,800);
359
 
360

    
361
   if (!tree) return;
362
   fChain = tree;
363
   fCurrent = -1;
364
   fChain->SetMakeClass(1);
365

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

    
426
Bool_t makeEffHist::Notify()
427
{
428
   // The Notify() function is called when a new file is opened. This
429
   // can be either for a new TTree in a TChain or when when a new TTree
430
   // is started when using PROOF. It is normally not necessary to make changes
431
   // to the generated code, but the routine can be extended by the
432
   // user if needed. The return value is currently not used.
433

    
434
   return kTRUE;
435
}
436

    
437
void makeEffHist::Show(Long64_t entry)
438
{
439
// Print contents of entry.
440
// If entry is not specified, print current entry
441
   if (!fChain) return;
442
   fChain->Show(entry);
443
}
444
Int_t makeEffHist::Cut(Long64_t entry)
445
{
446
// This function may be called from Loop.
447
// returns  1 if entry is accepted.
448
// returns -1 otherwise.
449
   return 1;
450
}
451

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

    
634

    
635

    
636
#endif // #ifdef makeEffHist_cxx