MINT2
ReadNTuple.h
Go to the documentation of this file.
1 #ifndef READNTUPLE_HH
2 #define READNTUPLE_HH
3 
4 #include "TFile.h"
5 #include "TTree.h"
6 #include "TLorentzVector.h"
7 #include "TString.h"
8 #include "TTree.h"
9 #include "TBranch.h"
10 #include "TEntryList.h"
11 #include "TRandom.h"
12 
13 #include <vector>
14 #include <iostream>
15 #include <fstream>
16 #include <string>
17 
18 #include "Mint/counted_ptr.h"
19 #include "Mint/DalitzEvent.h"
20 #include "Mint/IDalitzEvent.h"
21 #include "Mint/MinimalEventList.h"
23 #include "Mint/DalitzEventList.h"
25 #include "Mint/ReadNTupleBase.h"
26 
27 using namespace std;
28 using namespace MINT;
29 
30 template <typename T, typename N>
32 {
33 private:
34  TFile* _file0;
35  TTree* _oldTree;
36  TTree* _tree;
37  std::string _fname;
38  std::string _ntpName;
39  long int _maxEvents;
40 
41 
42 
43  TRandom Rand;
44  TTree* friendTree;
45  // Variables to read in
46  std::vector<std::vector<N> > m_input_var;
47  std::vector<T> m_pdg; // pattern from events
48  std::vector<int> set_pat; // pattern fed in
49  std::vector<N> m_mother_var;
50  T m_mother_pdg; // change for DTF
51 
53  std::string m_weightName;
54 
55  std::vector<N> m_slowPion_var;
57  bool slowPion;
58 
60  const char* _cuts;
61 
62  Long64_t _entries;
63  Long64_t _firstentry;
64 
65  TLorentzVector _pMother;
66 
68 
70 
71 public:
72 
73  std::string newFilename() const;
74 
76  , std::string fname
77  , std::string ntpName = "DalitzEventList"
78  , const char* cuts = ""
79  , long int maxEvents = -1
80  )
81  : _file0(0)
82  , _oldTree(0)
83  , _tree(0)
84  , _fname(fname)
85  , _ntpName(ntpName)
86  , _maxEvents(maxEvents)
87  , m_useWeights(false)
88  , m_particle(0)
89  , _firstentry(0)
90  , _entries(1000000000)
91  {
92  m_weightName = "";
93 
94  for (int i = 0; i < 5; i++) {
95  vector<N> row; // Create an empty row
96  for (int j = 0; j < 5; j++) {
97  row.push_back(i * j); // Add an element (column) to the row
98  }
99  m_input_var.push_back(row); // Add the row to the main vector
100  }
101 
102  for (int i = 0; i < 4; i++) {
103  m_pdg.push_back(0);
104  m_mother_var.push_back(0);
105  m_slowPion_var.push_back(0);
106 
107  }
108 
109  // SetEventPattern(pat);
110 
111  slowPion = false;
112  _cuts = cuts;
113  _applyFiducalCuts = false;
114 
115  SetEventPattern(pat);
116  getTree();
117  }
118 
120  {
121 
122  }
123 
124  bool getTree(){
125  TFile* f = TFile::Open(_fname.c_str(), "READ");
126  if(0 == f) return false;
127  _oldTree = dynamic_cast<TTree*>(f->Get(_ntpName.c_str()));
128  return (0 != _oldTree);
129  }
130 
131 
132  bool SetDaughterBranchAddress(const char* Px, const char* Py, const char* Pz, const char* E, const char* pdg );
133  bool SetMotherBranchAddress(const char* Px, const char* Py, const char* Pz, const char* E, const char* pdg );
134  void AddSlowPion(const char* Px = "SlowPion_PX", const char* Py= "SlowPion_PY",
135  const char* Pz= "SlowPion_PZ", const char* E= "SlowPion_E",
136  const char* pdg = "SlowPion_ID" );
137 
139  {
140  m_pat = pat;
141  set_pat = pat->getVectorOfInts();
142  }
143 
144  void ApplyFiducalCuts();
145  bool passFiducalCuts(unsigned int entry);
146  bool passedFidCuts(float dx, float dy, float dz);
147 
148  bool AddFriend(std::string fname
149  , std::string ntpName);
150 
151  bool getUpdatedTree();
152 
153  void useWeights(bool Weights);
154 
155  void weightVarName(std::string weightName);
156 
157  MINT::counted_ptr<DalitzEvent> readEntry(unsigned int entry);
158  bool readit(MinimalEventList<DalitzEvent>* listPtr, int nEvents=-1, double scale = 1.0);
159  //
160  bool testEventPattern();
161  bool passETAcut(unsigned int entry);
162  float Random()
163  {
164  return Rand.Rndm();
165  }
166 
167  void SetEntries(int entries){ _entries = entries;}
168  void SetFirstEntry(int firstEntry){ _firstentry = firstEntry;}
169 
170 };
171 
172 
173 template <typename T, typename N>
174 std::string ReadNTuple<T,N>::newFilename() const{
175  bool exists = true;
176  ofstream checkFile;
177  int i=0;
178  string newFilename(_fname);
179  newFilename.insert(newFilename.find_last_of('.'), "_reweighted");
180  do{
181  newFilename.insert(newFilename.find_last_of('.'), anythingToString(i++));
182  checkFile.open( newFilename.c_str(), ios::in );
183  exists = ! checkFile.fail();
184  checkFile.close();
185  }while(exists);
186 
187  return newFilename;
188 }
189 
190 template <typename T, typename N>
191 bool ReadNTuple<T,N>::AddFriend(std::string fname
192  , std::string ntpName)
193  {
194  if (fname == "" || ntpName == "")
195  {
196  std::cout << "No friend Specified" << std::endl;
197  return true;
198  }
199  TFile* f = TFile::Open(fname.c_str(), "READ");
200  if(0 == f) return false;
201  friendTree = dynamic_cast<TTree*>(f->Get(ntpName.c_str()));
202  _oldTree->AddFriend(friendTree);
203  return (0 != _oldTree);
204 
205  }
206 //template<>
207 //bool ReadNTuple<float>::getTree(){
208 // TFile* f = TFile::Open(_fname.c_str(), "READ");
209 // if(0 == f) return false;
210 // _oldTree = dynamic_cast<TTree*>(f->Get(_ntpName.c_str()));
211 // return (0 != _oldTree);
212 //
213 //}
214 
215 template <typename T, typename N>
217 {
218 
219  TEntryList* elist=0;
220 
221  _oldTree->SetBranchStatus("*",1);
222  if (_cuts&&strcmp(_cuts,"")!=0) {
223  _oldTree->Draw(">>elist",_cuts,"entryList");
224  elist = (TEntryList*)gDirectory->Get("elist");
225  if (!elist)
226  {
227  std::stringstream msg;
228  msg << "Failed to retrieve TEntryList for cuts " << _cuts;
229 
230  }
231  _oldTree->SetEntryList(elist);
232  }
233  Long64_t nentries = !elist?_oldTree->GetEntries():elist->GetN();
234  if (nentries==0) {
235  std::cout << "No entries after cuts " << _cuts << std::endl;
236  }
237 
238  // attachit();
239  // cout << "ReadNTuple::getTree(): Reading from " << _fname
240  // << ", writing to: " << newFilename() << endl;
241  _file0 = TFile::Open(newFilename().c_str(), "RECREATE");
242  cout << "opened new file " << _file0 << endl;
243  if(0 == _file0) return false;
244  _file0->cd();
245  cout << "cd'ed to new file " << endl;
246  // _tree = _oldTree->CloneTree(1000);
247  std::cout << "Cuts: " << _cuts << std::endl;
248 
249  _tree = _oldTree->CopyTree(_cuts, "",_entries,_firstentry);
250 
251  _tree->Write();
252 
253 
254  return (0 != _tree);
255 }
256 
257 //template <>
258 //void ReadNTuple<float>::SetEventPattern(DalitzEventPattern* pat)
259 //{
260 // m_pat = pat;
261 // set_pat = pat->getVectorOfInts();
262 //}
263 
264 template <typename T, typename N>
266 {
267  _applyFiducalCuts = true;
268 }
269 
270 template <typename T, typename N>
271 bool ReadNTuple<T,N>::passedFidCuts(float dx, float dy, float dz)
272 {
273  bool passCuts = true;
274  if (fabs(dx) > 0.317*(dz - 2400))
275  {
276  passCuts = false;
277  }
278  if (fabs(dy/dz) < 0.02){
279  double p1 = 398;//418
280  double p2 = 517;//497
281  double beta1 = 0.01397;
282  double beta2 = 0.01605;
283  if( ( (p1 - beta1*dz) < fabs(dx) ) || ( fabs(dx) < ( p2+ beta2*dz ) ))
284  //|| (fabs(dx) > 600 && fabs(dx) < 700)) //add this back in if needed
285  {
286  passCuts = false;
287  }
288  }
289  // if ( (fabs(dx) > 600 && fabs(dx) < 700)) passCuts = false;
290 
291  // if (sqrt(dx*dx+dy*dy+dz*dz) > 100000) passCuts = false;
292 
293  return passCuts;
294 }
295 // Fiducal Cuts
296 template <typename T, typename N>
297 bool ReadNTuple<T,N>::passFiducalCuts(unsigned int entry)
298 {
299  _tree->GetEntry(entry);
300  bool passCuts = true;
301 
302 
303  for (int i = 0; i<4; i++)
304  {
305  float dx = m_input_var[0][i];
306  float dy = m_input_var[1][i];
307  float dz = m_input_var[2][i];
308  if (!passedFidCuts(dx,dy,dz)) passCuts = false;
309  }
310 
311  if (slowPion)
312  {
313  if (!passedFidCuts(m_slowPion_var[0],m_slowPion_var[1],m_slowPion_var[2])) passCuts = false;
314  }
315  return passCuts;
316 }
317 
318 template <typename T, typename N>
319 bool ReadNTuple<T,N>::SetDaughterBranchAddress(const char* Px, const char* Py, const char* Pz, const char* E, const char* pdg )
320 {
321 
322  _oldTree->SetBranchAddress(Px,&m_input_var[0][m_particle]);
323  _oldTree->SetBranchAddress(Py,&m_input_var[1][m_particle]);
324  _oldTree->SetBranchAddress(Pz,&m_input_var[2][m_particle]);
325  _oldTree->SetBranchAddress(E,&m_input_var[3][m_particle]);
326  _oldTree->SetBranchAddress(pdg,&m_pdg[m_particle]);
327  m_particle++;
328 
329  return true;
330 }
331 
332 template <typename T, typename N>
333 bool ReadNTuple<T,N>::SetMotherBranchAddress(const char* Px, const char* Py, const char* Pz, const char* E, const char* pdg )
334 {
335 
336  _oldTree->SetBranchAddress(Px,&m_mother_var[0]);
337  _oldTree->SetBranchAddress(Py,&m_mother_var[1]);
338  _oldTree->SetBranchAddress(Pz,&m_mother_var[2]);
339  _oldTree->SetBranchAddress(E,&m_mother_var[3]);
340  _oldTree->SetBranchAddress(pdg,&m_mother_pdg);
341 
342  return true;
343 }
344 
345 template <typename T, typename N>
347 
348  // we read the MC-truth 4-momenta as we want to re-weight
349  // according to the trugh.
350  // Things to cut on are read from reconstructed data.
351 
352  bool dbThis = false;
353 
354  _tree->GetEntry(entry);
355 
356  if (set_pat.size() == 0)
357  {
358  std::cout << "Could not find EventPattern Did you set it?" << std::endl;
359  counted_ptr<DalitzEvent> zeroPtr(0);
360  return zeroPtr;
361  }
362  // if (set_pat.size() != m_pdg.size())
363  // {
364  // std::cout << "Event Patterns not the same" << std::endl;
365  // counted_ptr<DalitzEvent> zeroPtr(0);
366  // return zeroPtr;
367  // }
368  // for (int i = 0; i < 5; i++)
369  // {
370  // if (m_pdg[i] != set_pat[i])
371  // {
372  // std::cout << "ReadNTuple: Warning input Pattern does not match selected Events: Setting pattern to match Events " << m_pdg << std::endl;
373  // set_pat = m_pdg;
374  // break;
375  // }
376  //
377  // }
378 
379  // OrderParticles();
380  // we'll fill it according to the event pattern
381  // 421 -> -321 +211 -211 +211
382  // DalitzEventPattern pat(421, -211, +211, +211, -211);
383 
384  TLorentzVector mother(m_mother_var[0],m_mother_var[1],m_mother_var[2],m_mother_var[3]);
385 
386  // Get daughter LorentzVectors
387  TLorentzVector daughter1(m_input_var[0][0],m_input_var[1][0],m_input_var[2][0],m_input_var[3][0]);
388  TLorentzVector daughter2(m_input_var[0][1],m_input_var[1][1],m_input_var[2][1],m_input_var[3][1]);
389  TLorentzVector daughter3(m_input_var[0][2],m_input_var[1][2],m_input_var[2][2],m_input_var[3][2]);
390  TLorentzVector daughter4(m_input_var[0][3],m_input_var[1][3],m_input_var[2][3],m_input_var[3][3]);
391 
392  std::vector<TLorentzVector> daughter;
393  daughter.push_back(daughter1);
394  daughter.push_back(daughter2);
395  daughter.push_back(daughter3);
396  daughter.push_back(daughter4);
397 
398  if (dbThis)
399  {
400  if (!(entry%10000))
401  {
402  cout << "PDG: " << (int)m_pdg[0] << " Px: " << m_input_var[0][0] << std::endl;
403  cout << "PDG: " << (int)m_pdg[1] << " Px: " << m_input_var[0][1] << std::endl;
404  cout << "PDG: " << (int)m_pdg[2] << " Px: " << m_input_var[0][2] << std::endl;
405  cout << "PDG: " << (int)m_pdg[3] << " Px: " << m_input_var[0][3] << std::endl;
406  cout << "Mother PDG: " << m_mother_pdg << " Px: " << m_mother_var[0] << std::endl;
407 
408  }
409  }
410  // vector of Lorentz Vectors to great Dalitz Event
411  vector<TLorentzVector> PArray(5);
412 
413  TLorentzVector* pMother = &(PArray[0]);
414  *pMother = mother;
415 
416  int pdgArray[5];
417  pdgArray[0] = (int)m_mother_pdg;
418  // std::cout << m_mother_pdg <<
419 
420  if (dbThis)
421  {
422  if (!(entry%10000))
423  {
424  std::cout << "PArray Px: " << PArray[0].Px() << std::endl;
425  std::cout << "Mother Px: " << mother.Px() << std::endl;
426  }
427  }
428  std::vector<int> passed_pat = set_pat;
429  std::vector<T> this_pat = m_pdg; //change this for DTF
430  if (dbThis)
431  {
432  if (!(entry%1000))
433  {
434  for (int i = 0; i < 4; i++) // loop over particles read in
435  {
436  cout << "this_pat: " << (int)this_pat[i] << " passed pat:" << passed_pat[i];
437  cout << std::endl;
438  }
439  }
440  }
441 
442  // Order daughter particles accordinging to passed_pat
443  for (int j =1; j<5; j++) // loop over particles in pattern given
444  {
445  for (int i = 0; i < 4; i++) // loop over particles read in
446  {
447  if (dbThis)
448  {
449  if (!(entry%1000))
450  {
451  cout << "Pdg: " << passed_pat[j] << " " << (int)this_pat[i];
452  cout << std::endl;
453  }
454  }
455  if (passed_pat[j] == (int)this_pat[i]) // if particle equal to the one in pattern
456  {
457  pdgArray[j] = (int)this_pat[i];
458  PArray[j] = daughter[i];
459  this_pat[i] = 999; // dont use this particle again
460  if (dbThis)
461  {
462  if (!(entry%1000))
463  {
464  cout << "Pdg: " << passed_pat[j];
465  cout << " Px: " << PArray[j].Px() << std::endl;
466  }
467  }
468  break;
469  }
470  }
471  }
472 
473  // Randomize indentical final state particles
474  for (int i = 1; i < 4; i++)
475  {
476  for (int j = i+1; j < 5; j++)
477  {
478  if( pdgArray[i] == pdgArray[j])
479  {
480  // if(gRandom->Rndm() >0.5)
481  if (Random() > 0.5)
482  {
483  swap(PArray[i],PArray[j] );//swap 4-momenta
484  swap(pdgArray[i],pdgArray[j] );//shouldn't need this
485  }
486  }
487  }
488  }
489 
490 
491  if (dbThis)
492  {
493  if(entry < 5){
494  for(unsigned int i = 0; i < 5; i++){
495  cout << " mass " << i << ") " << PArray[i].M()
496  << " Px " << i << ") " << PArray[i].Px()
497  << " Py " << i << ") " << PArray[i].Py()
498  << " Pz " << i << ") " << PArray[i].Pz()
499  << " E " << i << ") " << PArray[i].E()
500  << ", pdg " << pdgArray[i] << endl;
501  }
502  }
503 
504  if (!(entry%10000))
505  {
506  for(unsigned int i = 0; i < 5; i++){
507  cout << " mass " << i << ") " << PArray[i].M()
508  << " Px " << i << ") " << PArray[i].Px()
509  << ", pdg " << pdgArray[i] << endl;
510  }
511  }
512  }
513  _pMother.SetPxPyPzE(m_mother_var[0], m_mother_var[1], m_mother_var[2], m_mother_var[3]);
514 
515  // DalitzEvent* devt = new DalitzEvent(*m_pat, PArray);
516  MINT::counted_ptr<DalitzEvent> evtPtr(new DalitzEvent(*m_pat, PArray));
517  return evtPtr;
518 }
519 
520 template <typename T, typename N>
522 {
523  m_useWeights = Weights;
524 }
525 
526 template <typename T, typename N>
527 void ReadNTuple<T,N>::weightVarName(std::string weightName)
528 {
529  m_weightName = weightName;
530 }
531 
532 template <typename T, typename N>
533 bool ReadNTuple<T,N>::readit(DiskResidentEventList* listPtr, int maxEvents, double scale){
534  getUpdatedTree();
535  if(0 == listPtr) return false;
536  int numEvents = 0;
537  TRandom Rand(1987);
538 
539  if (!testEventPattern()) return false;
540 
541  double weight(0);
542  if (m_useWeights)
543  {
544  _tree->SetBranchAddress(m_weightName.c_str(),&weight);
545  }
546  std::cout << "Entries " << _oldTree->GetEntries() << " " << _tree->GetEntries() << std::endl;
547  for(unsigned int i=0; i < _tree->GetEntries(); i++){
548 
549  if (Rand.Rndm() < scale)
550  {
551  if (_applyFiducalCuts)
552  {
553  if (passFiducalCuts(i))
554  {
555  if (passETAcut(i))
556  {
557  counted_ptr<DalitzEvent> evtPtr = readEntry(i);
558  if (m_useWeights)
559  {
560  evtPtr->setWeight(weight);
561  }
562 
563  numEvents++;
564  listPtr->Add(*(evtPtr.get()));
565  }
566  }
567  }
568  if (!_applyFiducalCuts)
569  {
570  counted_ptr<DalitzEvent> evtPtr = readEntry(i);
571  if (m_useWeights)
572  {
573  evtPtr->setWeight(weight);
574  }
575 
576  if (evtPtr->kinematicallyAllowed(5.e-2))
577  {
578  numEvents++;
579  listPtr->Add(*(evtPtr.get()));
580  }
581  else if (!evtPtr->kinematicallyAllowed(5.e-2))
582  {
583  std::cout << "Not allowed " << std::endl;
584  evtPtr->print();
585  }
586  }
587  if(maxEvents > 0 && numEvents > maxEvents) break;
588  }
589  }
590  return true;
591 }
592 
593 template <typename T, typename N>
595 {
596  _tree->GetEntry(0);
597  if ((int)set_pat[0] != (int)m_mother_pdg)
598  {
599  cout << "Mother Pattern not the same try CC" << endl;
600  cout << " set_pat " << set_pat[0] << " " << set_pat[1];
601  cout << " " << set_pat[2] << " " << set_pat[3] << std::endl;
602 
603  cout << " m_mother_pdg " << m_mother_pdg << " " << endl;
604 
605  DalitzEventPattern pat = (m_pat->makeCPConjugate());
606  m_pat = new DalitzEventPattern(pat);
607  set_pat = m_pat->getVectorOfInts();
608  }
609  if ((int)set_pat[0] != (int)m_mother_pdg)
610  {
611  cerr << " set_pat " << set_pat[0] << std::endl;
612  cerr << "Mother Pattern STILL not the same" << endl;
613  cerr << "Will try other entry" << endl;
614  _tree->GetEntry(10);
615  if (set_pat[0] != m_mother_pdg)
616  {
617  cout << "Mother Pattern not the same try CC" << endl;
618  cout << " set_pat " << set_pat[0] << " " << set_pat[1];
619  cout << " " << set_pat[2] << " " << set_pat[3] << std::endl;
620 
621  cout << " m_mother_pdg " << m_mother_pdg << " " << endl;
622 
623  DalitzEventPattern pat = (m_pat->makeCPConjugate());
624  m_pat = new DalitzEventPattern(pat);
625  set_pat = m_pat->getVectorOfInts();
626  }
627  if (set_pat[0] != m_mother_pdg)
628  {
629  cerr << " set_pat " << set_pat[0] << std::endl;
630  cerr << "Mother Pattern STILL not the same" << endl;
631  return false;
632  }
633  }
634 
635  return true;
636 }
637 
638 
639 template <typename T, typename N>
640 void ReadNTuple<T,N>::AddSlowPion(const char* Px, const char* Py, const char* Pz, const char* E, const char* pdg )
641 {
642 
643  _oldTree->SetBranchAddress(Px,(float*)&m_slowPion_var[0]);
644  _oldTree->SetBranchAddress(Py,(float*)&m_slowPion_var[1]);
645  _oldTree->SetBranchAddress(Pz,(float*)&m_slowPion_var[2]);
646  _oldTree->SetBranchAddress(E,(float*)&m_slowPion_var[3]);
647  _oldTree->SetBranchAddress(pdg,(int*)&m_slowPion_pdg);
648  slowPion = true;
649 
650 }
651 
652 template <typename T, typename N>
653 bool ReadNTuple<T,N>::passETAcut(unsigned int entry)
654 {
655  bool passETAcut = false;
656  _tree->GetEntry(entry);
657 
658  float dx = m_mother_var[0];
659  float dy = m_mother_var[1];
660  float dz = m_mother_var[2];
661  float P = sqrt(dx*dx+dy*dy+dz*dz);
662  float ETA = 0.5*log( (P + dz)/(P - dz) );
663  if (ETA < 5.0 && ETA > 2.0 ) passETAcut = true;
664  if (P < 300000 ) passETAcut = true;
665  return passETAcut;
666 }
667 
668 #endif
bool _applyFiducalCuts
Definition: ReadNTuple.h:69
std::string _ntpName
Definition: ReadNTuple.h:38
virtual void setWeight(double w)
bool passFiducalCuts(unsigned int entry)
Definition: ReadNTuple.h:297
void weightVarName(std::string weightName)
Definition: ReadNTuple.h:527
bool SetDaughterBranchAddress(const char *Px, const char *Py, const char *Pz, const char *E, const char *pdg)
Definition: ReadNTuple.h:319
TTree * _tree
Definition: ReadNTuple.h:36
void useWeights(bool Weights)
Definition: ReadNTuple.h:521
long int _maxEvents
Definition: ReadNTuple.h:39
bool exists(const string &fname)
bool slowPion
Definition: ReadNTuple.h:57
std::vector< std::vector< N > > m_input_var
Definition: ReadNTuple.h:46
TFile * _file0
Definition: ReadNTuple.h:34
bool passETAcut(unsigned int entry)
Definition: ReadNTuple.h:653
TTree * _oldTree
Definition: ReadNTuple.h:35
bool testEventPattern()
Definition: ReadNTuple.h:594
bool getTree()
Definition: ReadNTuple.h:124
virtual bool Add(const DalitzEvent &evt)
void AddSlowPion(const char *Px="SlowPion_PX", const char *Py="SlowPion_PY", const char *Pz="SlowPion_PZ", const char *E="SlowPion_E", const char *pdg="SlowPion_ID")
Definition: ReadNTuple.h:640
std::string newFilename() const
Definition: ReadNTuple.h:174
bool SetMotherBranchAddress(const char *Px, const char *Py, const char *Pz, const char *E, const char *pdg)
Definition: ReadNTuple.h:333
int m_slowPion_pdg
Definition: ReadNTuple.h:56
TTree * friendTree
Definition: ReadNTuple.h:44
std::vector< N > m_slowPion_var
Definition: ReadNTuple.h:55
std::vector< int > getVectorOfInts() const
void SetFirstEntry(int firstEntry)
Definition: ReadNTuple.h:168
TRandom Rand
Definition: ReadNTuple.h:43
MINT::counted_ptr< DalitzEvent > readEntry(unsigned int entry)
Definition: ReadNTuple.h:346
bool getUpdatedTree()
Definition: ReadNTuple.h:216
bool readit(MinimalEventList< DalitzEvent > *listPtr, int nEvents=-1, double scale=1.0)
Definition: ReadNTuple.h:533
DalitzEventPattern * m_pat
Definition: ReadNTuple.h:67
bool m_useWeights
Definition: ReadNTuple.h:52
bool passedFidCuts(float dx, float dy, float dz)
Definition: ReadNTuple.h:271
int m_particle
Definition: ReadNTuple.h:59
T m_mother_pdg
Definition: ReadNTuple.h:50
std::string anythingToString(const T &anything)
Definition: Utils.h:62
void print(std::ostream &os=std::cout) const
void SetEntries(int entries)
Definition: ReadNTuple.h:167
Long64_t _firstentry
Definition: ReadNTuple.h:63
float Random()
Definition: ReadNTuple.h:162
void SetEventPattern(DalitzEventPattern *pat)
Definition: ReadNTuple.h:138
std::string m_weightName
Definition: ReadNTuple.h:53
ReadNTuple(DalitzEventPattern *pat, std::string fname, std::string ntpName="DalitzEventList", const char *cuts="", long int maxEvents=-1)
Definition: ReadNTuple.h:75
std::string _fname
Definition: ReadNTuple.h:37
std::vector< T > m_pdg
Definition: ReadNTuple.h:47
const char * _cuts
Definition: ReadNTuple.h:60
Long64_t _entries
Definition: ReadNTuple.h:62
std::vector< N > m_mother_var
Definition: ReadNTuple.h:49
TLorentzVector _pMother
Definition: ReadNTuple.h:65
std::vector< int > set_pat
Definition: ReadNTuple.h:48
void ApplyFiducalCuts()
Definition: ReadNTuple.h:265
bool kinematicallyAllowed(double epsilon=1.e-9) const
X * get() const
Definition: counted_ptr.h:123
bool AddFriend(std::string fname, std::string ntpName)
Definition: ReadNTuple.h:191