CalibAnaPlot.h
Go to the documentation of this file.
1 #include "TFile.h"
2 #include "TTree.h"
3 #include "TStyle.h"
4 #include "TVector3.h"
5 
6 #include <map>
7 #include <iostream>
8 #include <iomanip>
9 #include <fstream>
10 
11 #include "DrawUtils.h" // most of the usual ROOT includes
12 #include "Detector.h"
13 
14 class CalibAnaPlot {
15 
16  public:
17  CalibAnaPlot( std::string outpath );
18  virtual void SchedulePlots(){};
19  virtual void ScheduleSamples(){};
20  virtual void ScheduleEventVars(){};
21  virtual void ScheduleTrackVars(){};
22  virtual void ScheduleHitVars(){};
23  virtual void FillEventPlots(){};
24  virtual void FillTrackPlots(){};
25  virtual void FillHitPlots(){};
26  //virtual void Draw();
27 
28  std::map<std::string, std::string> GetSamples(){return fSamples;}
29 
30  void Initialize();
31  void SetTreeLoopLimit (unsigned int limit) {fLimit=limit;}
32  void SetTreeLoopStride(unsigned int stride){fStride=stride;}
33 
34  void Draw( std::string pdfdir,
35  std::vector< Plot > plots,
36  Plot denom_plot,
37  std::string ratio_title="" );
38 
39  void DrawPeriodLines(float ymin, float ymax, bool withEpochs=false);
40 
41  void PrintUnderOverFlow( TH1 * h,
42  std::string plotname,
43  std::string samp );
44 
45  void ProcessTrees(std::string sample);
46 
47  void MakeDir(std::string path);
48 
50 
51  void HaddAllDataFile();
52  bool ProcessedAllData();
53  void PrintEpochLengths();
54 
55  protected:
56 
57  std::map< std::string, TH1* > fPlots; // cleared every sample
58  std::map< std::string, TH2* > f2dPlots; // cleared every sample
59  std::map<std::string, std::string> fSamples;
61  std::vector< std::string > fProcessedSamples;
63  unsigned int fLimit;
64  unsigned int fStride;
69 
70 
71  void SetEventBranches(TTree * t);
72  void SetTrackBranches(TTree * t);
73  void SetHitBranches(TTree * t);
74  bool UseEVar(std::string var);
75  bool UseTVar(std::string var);
76  bool UseHVar(std::string var);
77 
78  // Track Event Branches
79  int run, subrun, event;
80  uint32_t evt_time;
85 
86  // Track Tree Branches
90  int trk_pdg;
96  TVector3 trk_startpos;
97  TVector3 trk_endpos;
98 
99  // Hit Tree Branches
100  bool istricell;
101  bool istraj;
102  bool isavg;
103  bool isz;
104  int diblock;
105  int dcm;
106  int apd;
107  int pixel;
108  int plane;
109  int cell;
110  int view;
111  float w;
112  float readdist;
114  float pe;
115  float pecorr;
116  float pecorrtomev;
117  float recoMeV;
118  float path;
119  float flightLen;
120  float cmFromEnd;
121  float tns;
122  float truepath;
123  float truepe;
124  float truew;
125  float trueMeV;
128  int tdc;
129  int adc;
130 
131  private:
133  void progbar(int current, float max_inv);
134 
135 };
136 
137 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
139 {
140  // initialize things that shouldn't be reset in ProcessTrees
141  ScheduleHitVars();
144  ScheduleSamples();
145  for(auto& samp : fSamples) MakeDir(fOutPath+"/"+samp.first);
146 }
147 
148 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
150 : fOutPath(outpath),
151  fStride(1),
152  fLimit(0),
153  fCurrentPercProg(-1)
154 {
155  MakeDir(outpath);
156  if (outpath.find("nd_")!=std::string::npos){ fDet = new Detector("nd"); }
157  else if(outpath.find("fd_")!=std::string::npos){ fDet = new Detector("fd"); }
158  else if(outpath.find("tb_")!=std::string::npos){ fDet = new Detector("tb"); }
159  else{
160  std::cout << "Outpath \"" <<outpath<< "\" does not denote detector." << std::endl;
161  std::abort(); }
162 
163  std::cout << "\nSet detector to " << fDet->FullName() << std::endl << std::endl;
164 }
165 
166 
167 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
169  std::vector< Plot > plots,
170  Plot denom_plot,
171  std::string ratio_title )
172 {
173  // Protect sample directories
174  if( fSamples.count(pdfdir) ){
175  std::cout << "Sample names reserved for their own directory, change output dir: "
176  << pdfdir << std::endl; return; }
177  MakeDir(fOutPath+"/"+pdfdir);
178 
179 
180  DrawUtils dutil;
181  // Manage our own canvases
182  TCanvas* c = new TCanvas("c","c");
183  TCanvas* cleg = new TCanvas( "cleg","cleg", 1800, 600);
184  dutil.DrawPlotStack( c, cleg, plots, denom_plot, ratio_title );
185  if(cleg){
186  cleg->Print(Form("%s/%s/legend.pdf",
187  fOutPath.c_str(),
188  pdfdir.c_str()));
189  }
190 
191  // plots vs time should denote period divisions
192  c->cd();
193  if(denom_plot.name.find("_time_")!=std::string::npos)
194  DrawPeriodLines( dutil.GetLastYMin(),
195  dutil.GetLastYMax(), true);
196 
197  c->Print(Form("%s/%s/%s.pdf",
198  fOutPath.c_str(),
199  pdfdir.c_str(),
200  denom_plot.name.c_str())); // does this need to be more specific?
201  delete c;
202  delete cleg;
203 
204  /*
205 
206  // 2d plots: Make colz plot for each sample
207  gStyle->SetPalette(kBird);
208  for( auto& pname : f2dPlots ){
209  std::string plotname = pname.first;
210  for( auto& samp : samples ){
211 
212  TH2* h2;
213  histfiles[samp]->GetObject( plotname.c_str(), h2);
214  if(!h2){ std::cout << "did not find " << plotname
215  << " in " << samp << std::endl; continue; }
216 
217  // Keep these separate from the pdfdir group of samples
218  // since we can only draw one sample at a time.
219  std::string pdf = Form("%s/%s/%s.pdf",
220  fOutPath.c_str(),
221  samp.c_str(),
222  plotname.c_str());
223 
224 
225  //if(FileMade(pdf)) continue; // dont redo this sample
226 
227  dutil.Draw2DPlot( c, h2 );
228  c->Print(pdf.c_str());
229  c->Clear();
230  //gROOT->SetStyle("novaStyle");
231  }
232  } // 2d plot loop
233 
234  */
235 
236 } // Draw
237 
238 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
240 {
241  if( key=="nd_data_ep4b.1" ) return "Data: Epoch 4b.1";
242  if( key=="nd_data_ep4b.2" ) return "Data: Epoch 4b.2";
243 
244  if( key=="fd_mc_p2" ) return "MC P.2 Low Gain";
245  if( key=="fd_mc_p3" ) return "MC P.3 High Gain";
246  if( key=="fd_mc_p5" ) return "MC P.5 High Gain";
247  if( key=="fd_mc_p2_2016" ) return "MC P.2 Low Gain (2016)";
248  if( key=="fd_mc_p3_2016" ) return "MC P.3 High Gain (2016)";
249 
250  std::string label = key.find("mc")!=std::string::npos ? "MC" : "Data";
251 
252  if (key== "nd_data_ep10a") return "Data: Epoch 10a";
253  if (key== "nd_data_ep10b") return "Data: Epoch 10b";
254  if (key== "nd_data_ep10cd") return "Data: Epoch 10cd";
255 
256  if(key.find("ep")!=std::string::npos) {
257  label += ": Epoch " + key.substr(key.length()-3, 3);
258  }
259  return label;
260 }
261 
262 
263 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
265  std::string plotname,
266  std::string samp )
267 {
268  float underflow = 100.*h->GetBinContent(0)/h->Integral(0,h->GetNbinsX()+1);
269  float overflow = 100.*h->GetBinContent(h->GetNbinsX()+1)/h->Integral(0,h->GetNbinsX()+1);
270  if(underflow>1e-2)
271  std::cout << plotname << " " << samp << " underflow %: " << underflow << std::endl;
272  if(overflow>1e-2)
273  std::cout << plotname << " " << samp << " overflow %: " << overflow << std::endl;
274  return;
275 }
276 
277 
278 
279 
280 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
282 {
283  if(UseEVar("evt_nhits_tricell")) t->SetBranchAddress( "evt_nhits_tricell", &evt_nhits_tricell );
284 }
285 
286 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
288 {
289  if(UseTVar("trk_nhits_tricell")) t->SetBranchAddress( "trk_nhits_tricell", &trk_nhits_tricell );
290 }
291 
292 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
294 {
295  // Set branches for all variables we want to use
296  // Speed things up by not filling variables not intended to use
297  if(UseHVar("run")) t->SetBranchAddress( "run", &run );
298  if(UseHVar("subrun")) t->SetBranchAddress( "run", &subrun );
299  if(UseHVar("event")) t->SetBranchAddress( "event", &run );
300  if(UseHVar("view")) t->SetBranchAddress( "view", &view );
301  if(UseHVar("diblock")) t->SetBranchAddress( "diblock", &diblock );
302  if(UseHVar("pe")) t->SetBranchAddress( "pe", &pe );
303  if(UseHVar("pecorr")) t->SetBranchAddress( "pecorr", &pecorr );
304  if(UseHVar("path")) t->SetBranchAddress( "path", &path );
305  if(UseHVar("w")) t->SetBranchAddress( "w", &w );
306  if(UseHVar("cmFromEnd")) t->SetBranchAddress( "cmFromEnd", &cmFromEnd );
307  if(UseHVar("plane")) t->SetBranchAddress( "plane", &plane );
308  if(UseHVar("cell")) t->SetBranchAddress( "cell", &cell );
309  if(UseHVar("recoMeV")) t->SetBranchAddress( "recoMeV", &trueMeV );
310  if(UseHVar("trueMeV")) t->SetBranchAddress( "trueMeV", &trueMeV );
311  if(UseHVar("truepath")) t->SetBranchAddress( "truepath", &truepath );
312  if(UseHVar("brightbin")) t->SetBranchAddress( "brightbin", &brightbin );
313  if(UseHVar("evt_time")) t->SetBranchAddress( "evt_time", &evt_time ); // drift studies
314 }
315 
316 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
318 {
319  return ( fEventVars.find(var+",")!=std::string::npos );
320 }
321 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
323 {
324  return ( fTrackVars.find(var+",")!=std::string::npos );
325 }
326 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
328 {
329  return ( fHitVars.find(var+",")!=std::string::npos );
330 }
331 
332 
333 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
335 {
336  fCurrentSample = samp;
337 
338  if(fSamples.count(samp)==0){
339  std::cout << "\nNo sample scheduled with name \"" << samp
340  << "\". Possible samples:" << std::endl;
341  for(auto& s : fSamples) std::cout << s.first << ": " << s.second << std::endl;
342  std::abort();
343  } else {
344  std::cout << "\nProcessing " << samp << " from " << fSamples[samp] << std::endl;
345  }
346 
347  bool isMC = samp.find("mc")!=std::string::npos;
348 
349  TFile* f = new TFile(fSamples[samp].c_str());
350  if(!f){ std::cout << "did not find " << fSamples[samp] << std::endl; return; }
351 
352  SchedulePlots();
353 
354  /*
355  // Get information about the calibration
356  TTree* t_meta;
357  f->GetObject("calibana/file_tree",t_meta);
358  std::string csvpath_atten;
359  t_meta->SetBranchAddress( "csvpath_atten", &csvpath_atten );
360  t_meta->GetEntry(0);
361  std::cout << t_meta->GetEntries() << " files calibrated with: \n"
362  << " Atten: " << csvpath_atten << std::endl;
363  */
364 
365 
366  if(fEventVars!=""){
367  TTree* eventTree;
368  f->GetObject("calibana/event_tree",eventTree);
369  if(!eventTree) std::cout << "Did not find calibana/event_tree" << std::endl;
370  SetEventBranches(eventTree);
371  std::cout << " ... Event Tree" << std::endl;
372  size_t n = eventTree->GetEntries();
373  if(fLimit && n>fLimit) n = fLimit;
374  size_t e=0;
375  while(e<n){
376  eventTree->GetEntry(e);
377  if(e%1000000==0) std::cout << e << "/" << n << std::endl;
378  FillEventPlots();
379  e += 1; // e += fStride; shouldn't need stride for event loop
380  }
381  }
382 
383 
384  if(fTrackVars!=""){
385  TTree* trackTree;
386  f->GetObject("calibana/track_tree",trackTree);
387  if(!trackTree) std::cout << "Did not find calibana/track_tree" << std::endl;
388  SetTrackBranches(trackTree);
389  std::cout << " ... Track Tree" << std::endl;
390  size_t n = trackTree->GetEntries();
391  if(fLimit && n>fLimit) n = fLimit;
392  size_t e=0;
393  while(e<n){
394  trackTree->GetEntry(e);
395  if(e%1000000==0) std::cout << e << "/" << n << std::endl;
396  FillTrackPlots();
397  e += 1; // e += fStride; shouldn't need stride for track loop
398  }
399  }
400 
401  if(fHitVars!=""){
402  TTree* tricellTree;
403  f->GetObject("calibana/tricell_tree",tricellTree);
404  if(!tricellTree) std::cout << "Did not find calibana/tricell_tree" << std::endl;
405  SetHitBranches(tricellTree);
406  size_t n = tricellTree->GetEntries();
407  std::cout << " ... Tricell Hits Tree: " << n << " entries" << std::endl;
408  if(fStride>1){
409  std::cout << " Using stride " << fStride
410  << ", for about " << (int)n/fStride << " hits processed." << std::endl;
411  } else if(fLimit && n>fLimit){
412  n = fLimit;
413  std::cout << " Limiting to " << fLimit
414  << " hits.\nWarning: Prefer stride over limit for getting a better sweep of runs."
415  << std::endl;
416  }
417  size_t e=0;
418  float nverse=1./n;
419  while(e<n){
420  tricellTree->GetEntry(e);
421  progbar(e,nverse);
422  FillHitPlots();
423  e += fStride;
424  }
425  progbar(n+1,nverse); // ensure last print, floor((n+1)/n)=1.
426 
427  }
428 
429 
430  // Dump everything to an output file to be read in by Draw
431  TFile* outf = new TFile(Form("%s/%s.root",
432  fOutPath.c_str(), samp.c_str()),"recreate");
433  for( auto it=fPlots.begin(); it!=fPlots.end(); it++ ) it->second->Write();
434  for( auto it=f2dPlots.begin(); it!=f2dPlots.end(); it++ ) it->second->Write();
435  outf->Close();
436 
437  // Log sample as processed and hadd into total sample if done
438  fProcessedSamples.push_back(samp);
440 
441  // Need to empty and remake these every sample
442  fPlots.clear();
443  f2dPlots.clear();
444 
445 } // Process Trees
446 
447 
448 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
449 void CalibAnaPlot::progbar(int current, float max_inv) {
450  float prog = current * max_inv; // fractional progress
451  unsigned short prog_perc_floor = (unsigned short)std::floor(100*prog);
452  if( prog_perc_floor == fCurrentPercProg ) return; // dont waste time printing every entry
453 
454  fCurrentPercProg = prog_perc_floor;
455  std::cout << std::fixed << std::setprecision(2)
456  << "\r [" << std::string(prog_perc_floor, '.')
457  << std::string(100 - prog_perc_floor, ' ') << "] " << prog_perc_floor << "%";
458  if (prog_perc_floor == 100){ std::cout << std::endl; fCurrentPercProg=-1; }
459  else{ std::cout.flush(); }
460 }
461 
462 
463 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
465 {
466  std::string all_data_merge = fOutPath+"/"+fDet->name()+"_all_data.root";
467  std::string all_data_files = fOutPath+"/"+fDet->name()+"_data_ep*.root";
468  std::system(( "rm " + all_data_merge ).c_str() );
469  std::system(( "hadd " + all_data_merge + " " + all_data_files ).c_str() );
470 }
471 
472 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
474 {
475  // for every data sample, check if it has been processed
476  for(auto& samp : fSamples){
477  if(samp.first.find("data")!=std::string::npos) continue;
478  bool processed = false;
479  for(auto& done : fProcessedSamples)
480  if(samp.first==done) processed = true;
481  if(!processed) return false;
482  }
483  return true;
484 }
485 
486 
487 
488 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
490  if( -1 == std::system(( "mkdir -p " + path ).c_str() ) ){
491  std::cout << "Error creating directory: " << path << std::endl; exit(1); }
492 }
493 
494 
495 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
496 void CalibAnaPlot::DrawPeriodLines(float ymin, float ymax, bool withEpochs)
497 {
498 
499  for( auto& p : fDet->EndOfPeriodMap() ){
500  TLine* l = new TLine(p.second, ymin, p.second,
501  ymin + 0.2*(ymax-ymin));
502  //l->SetLineColorAlpha(16,0.8);
503  l->SetLineColor(14);
504  l->SetLineWidth(3);
505  //l->SetLineStyle(9);
506  l->Draw();
507  }
508 
509  if( withEpochs ){
510  for( auto& e : fDet->EndOfEpochMap() ){
511  TLine* l = new TLine( e.second, ymin ,e.second,
512  ymin + 0.15*(ymax-ymin) );
513  l->SetLineColor(kCyan+3);
514  l->SetLineWidth(2);
515  l->Draw();
516  }
517  }
518 
519 }
520 
521 //^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
523 {
524  std::string prev_epoch="2a";
525  std::map< std::string, uint32_t > epoch_end_map = fDet->EndOfEpochMap();
526  for( auto& e : epoch_end_map ){
527  if(e.first=="2a") continue;
528  std::cout << prev_epoch << " end -- " << e.first << " end: "
529  << 1.*(e.second-epoch_end_map[prev_epoch])/86400
530  << " days" << std::endl;
531  prev_epoch=e.first;
532  }
533 }
534 
void DrawPeriodLines(float ymin, float ymax, bool withEpochs=false)
Definition: CalibAnaPlot.h:496
std::map< std::string, TH1 * > fPlots
Definition: CalibAnaPlot.h:57
std::map< std::string, std::string > GetSamples()
Definition: CalibAnaPlot.h:28
TVector3 trk_endpos
Definition: CalibAnaPlot.h:97
system("rm -rf microbeam.root")
bool UseHVar(std::string var)
Definition: CalibAnaPlot.h:327
float GetLastYMax()
Definition: DrawUtils.h:108
std::vector< std::string > fProcessedSamples
Definition: CalibAnaPlot.h:61
set< int >::iterator it
void PrintUnderOverFlow(TH1 *h, std::string plotname, std::string samp)
Definition: CalibAnaPlot.h:264
bool ProcessedAllData()
Definition: CalibAnaPlot.h:473
std::map< std::string, TH2 * > f2dPlots
Definition: CalibAnaPlot.h:58
void PrintEpochLengths()
Definition: CalibAnaPlot.h:522
std::map< std::string, uint32_t > EndOfPeriodMap()
Definition: Detector.h:23
std::string fOutPath
Definition: CalibAnaPlot.h:62
const char * p
Definition: xmltok.h:285
void SetTrackBranches(TTree *t)
Definition: CalibAnaPlot.h:287
int trk_nhits_traj
Definition: CalibAnaPlot.h:95
Detector
helper plotting scripts
Definition: PlotSpectra.h:39
int fCurrentPercProg
Definition: CalibAnaPlot.h:132
var_value< double > var
Definition: StanTypedefs.h:14
float trk_totlength
Definition: CalibAnaPlot.h:88
std::map< std::string, uint32_t > EndOfEpochMap()
Definition: Detector.h:24
CalibAnaPlot(std::string outpath)
Definition: CalibAnaPlot.h:149
void SetHitBranches(TTree *t)
Definition: CalibAnaPlot.h:293
float trk_dcosy
Definition: CalibAnaPlot.h:87
void MakeDir(std::string path)
Definition: CalibAnaPlot.h:489
uint32_t evt_time
Definition: CalibAnaPlot.h:80
std::string LegendLabel(std::string key)
Definition: CalibAnaPlot.h:239
void Initialize()
Definition: CalibAnaPlot.h:138
void SetEventBranches(TTree *t)
Definition: CalibAnaPlot.h:281
void SetTreeLoopLimit(unsigned int limit)
Definition: CalibAnaPlot.h:31
const char * label
virtual void SchedulePlots()
Definition: CalibAnaPlot.h:18
Double_t ymax
Definition: plot.C:25
const XML_Char * s
Definition: expat.h:262
std::string fHitVars
Definition: CalibAnaPlot.h:67
virtual void FillEventPlots()
Definition: CalibAnaPlot.h:23
virtual void ScheduleTrackVars()
Definition: CalibAnaPlot.h:21
====================================================================== ///
Definition: CutFlow_Data.C:28
void DrawPlotStack(TCanvas *&canv, TCanvas *&canvleg, const std::vector< Plot > &plot_vec, const Plot &plot_denom, std::string ratio_title="")
Definition: DrawUtils.h:145
unsigned int fStride
Definition: CalibAnaPlot.h:64
virtual void ScheduleEventVars()
Definition: CalibAnaPlot.h:20
float poissonlambda
Definition: CalibAnaPlot.h:126
unsigned int fLimit
Definition: CalibAnaPlot.h:63
std::void_t< T > n
const std::vector< Plot > plots
float trk_dcosz
Definition: CalibAnaPlot.h:87
int evt_nhits_tricell
Definition: CalibAnaPlot.h:83
std::string fEventVars
Definition: CalibAnaPlot.h:65
TFile * outf
Definition: testXsec.C:51
void ProcessTrees(std::string sample)
Definition: CalibAnaPlot.h:334
TVector3 trk_startpos
Definition: CalibAnaPlot.h:96
float pecorrtomev
Definition: CalibAnaPlot.h:116
int evt_nhits_traj
Definition: CalibAnaPlot.h:84
float trk_dcosx
Definition: CalibAnaPlot.h:87
virtual void ScheduleHitVars()
Definition: CalibAnaPlot.h:22
std::string name()
Definition: Detector.h:9
bool UseEVar(std::string var)
Definition: CalibAnaPlot.h:317
virtual void FillTrackPlots()
Definition: CalibAnaPlot.h:24
bool UseTVar(std::string var)
Definition: CalibAnaPlot.h:322
float GetLastYMin()
Definition: DrawUtils.h:107
Definition: run.py:1
void SetTreeLoopStride(unsigned int stride)
Definition: CalibAnaPlot.h:32
OStream cout
Definition: OStream.cxx:6
std::string fTrackVars
Definition: CalibAnaPlot.h:66
void HaddAllDataFile()
Definition: CalibAnaPlot.h:464
void Draw(std::string pdfdir, std::vector< Plot > plots, Plot denom_plot, std::string ratio_title="")
Definition: CalibAnaPlot.h:168
exit(0)
float trk_totdisplace
Definition: CalibAnaPlot.h:89
Double_t ymin
Definition: plot.C:24
int trk_nhits_tricell
Definition: CalibAnaPlot.h:92
Float_t e
Definition: plot.C:35
std::map< std::string, std::string > fSamples
Definition: CalibAnaPlot.h:59
std::string FullName()
Definition: Detector.h:11
void progbar(int current, float max_inv)
Definition: CalibAnaPlot.h:449
std::string fCurrentSample
Definition: CalibAnaPlot.h:60
std::string name
Definition: DrawUtils.h:18
virtual void ScheduleSamples()
Definition: CalibAnaPlot.h:19
virtual void FillHitPlots()
Definition: CalibAnaPlot.h:25
Detector * fDet
Definition: CalibAnaPlot.h:68
enum BeamMode string