MCTruthToDk2NuHackItr.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file MCTruthToDk2NuHackItr.cxx
3 /// \brief allow easy iteration over MCTruth and associated GTruth/MCFlux
4 ///
5 /// \version $Id: $
6 /// \author rhatcher@fnal.gov
7 ////////////////////////////////////////////////////////////////////////
8 #ifndef EVG_MCTRUTHTODK2NUHACKITR_H
9 #define EVG_MCTRUTHTODK2NUHACKITR_H
10 
11 #include <vector>
12 #include <utility> // for pair<>
13 #include <set>
14 
19 
20 #include "fhiclcpp/ParameterSet.h"
22 
26 
27 #include "dk2nu/tree/dk2nu.h"
28 #include "dk2nu/tree/NuChoice.h"
29 
30 namespace evg {
31 
33 
34  public:
35  MCTruthToDk2NuHackItr(art::Event const & evtIn,
36  std::vector<std::string> const & labels,
37  int verbose=0);
38 
39  virtual ~MCTruthToDk2NuHackItr() { ; }
40 
41  bool Next(); // move to next
42  const simb::MCTruth* GetMCTruth() const { return thisMCTruth; }
43  const simb::GTruth* GetGTruth() const { return thisGTruth; }
44  const simb::MCFlux* GetMCFlux() const { return thisMCFlux; }
45  const bsim::Dk2Nu* GetDk2Nu() const { return thisDk2Nu; }
46  const bsim::NuChoice* GetNuChoice() const { return thisNuChoice; }
47 
48  std::string GetLabel() const { return thisLabel; }
49  // return associated label???
50 
52 
53  private:
54 
55  bool pretty_darn_close(double a, double b, double eps_precision=10.0);
56 
57  bool match_mctruth_nuchoice(const simb::MCTruth* pmctruth,
58  const bsim::NuChoice* pnchoice);
59 
60  art::Event const & evt;
61  std::vector<std::string> const & fInputModuleLabels;
62 
63  std::vector< art::Handle< std::vector<simb::MCTruth> > > mclists;
64 
65  std::set<std::pair<int,int> > indices;
66  std::set<std::pair<int,int> >::const_iterator indx_itr;
67  std::vector<std::string> outlabels;
68 
69  int nmctruth;
70  int imctruth;
71 
78 
80 
81  int verbose;
82 
83  }; // end-of-class MCTruthToDk2NuHackItr
84 
85 } // end-of-namespace evg
86 
87 #endif // EVG_MCTRUTHTODK2NUHACKITR_H
std::vector< std::string > const & fInputModuleLabels
std::set< std::pair< int, int > >::const_iterator indx_itr
const simb::MCTruth * thisMCTruth
std::vector< art::Handle< std::vector< simb::MCTruth > > > mclists
std::vector< std::string > outlabels
object containing MC flux information
const simb::GTruth * GetGTruth() const
const simb::MCTruth * GetMCTruth() const
const bsim::NuChoice * thisNuChoice
art::Ptr< simb::MCTruth > GetMCTruthPtr() const
const double a
const bsim::NuChoice * GetNuChoice() const
const bsim::Dk2Nu * GetDk2Nu() const
bool match_mctruth_nuchoice(const simb::MCTruth *pmctruth, const bsim::NuChoice *pnchoice)
bool pretty_darn_close(double a, double b, double eps_precision=10.0)
const simb::MCFlux * GetMCFlux() const
art::Ptr< simb::MCTruth > thisMCTruthPtr
std::set< std::pair< int, int > > indices
const hit & b
Definition: hits.cxx:21
const simb::MCFlux * thisMCFlux
Event generator information.
Definition: MCTruth.h:32
const simb::GTruth * thisGTruth
MCTruthToDk2NuHackItr(art::Event const &evtIn, std::vector< std::string > const &labels, int verbose=0)
enum BeamMode string