MCTruthAndFriendsItr.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file MCTruthAndFriendsItr.cxx
3 /// \brief allow easy iteration over MCTruth and associated GTruth/MCFlux
4 ///
5 /// \version $Id: $
6 /// \author rhatcher@fnal.gov
7 ////////////////////////////////////////////////////////////////////////
8 #ifndef EVGB_MCTRUTHANDFRIENDSITR_H
9 #define EVGB_MCTRUTHANDFRIENDSITR_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 evgb {
31 
33 
34  public:
35  MCTruthAndFriendsItr(art::Event const & evtIn,
36  std::vector<std::string> const & labels);
37 
38  virtual ~MCTruthAndFriendsItr() { ; }
39 
40  bool Next(); // move to next
41  const simb::MCTruth* GetMCTruth() const { return thisMCTruth; }
42  const simb::GTruth* GetGTruth() const { return thisGTruth; }
43  const simb::MCFlux* GetMCFlux() const { return thisMCFlux; }
44  const bsim::Dk2Nu* GetDk2Nu() const { return thisDk2Nu; }
45  const bsim::NuChoice* GetNuChoice() const { return thisNuChoice; }
46 
47  std::string GetLabel() const { return thisLabel; }
48  // return associated label???
49 
50  private:
51 
52  art::Event const & evt;
53  std::vector<std::string> const & fInputModuleLabels;
54 
55  std::vector< art::Handle< std::vector<simb::MCTruth> > > mclists;
56 
57  std::set<std::pair<int,int> > indices;
58  std::set<std::pair<int,int> >::const_iterator indx_itr;
59  std::vector<std::string> outlabels;
60 
61  int nmctruth;
62  int imctruth;
63 
67  const bsim::Dk2Nu* thisDk2Nu;
68  const bsim::NuChoice* thisNuChoice;
70 
71  }; // end-of-class MCTruthAndFriendsItr
72 
73 } // end-of-namespace evgb
74 
75 #endif // EVGB_MCTRUTHANDFRIENDSITR_H
std::vector< art::Handle< std::vector< simb::MCTruth > > > mclists
MCTruthAndFriendsItr(art::Event const &evtIn, std::vector< std::string > const &labels)
std::string string
Definition: nybbler.cc:12
const simb::MCTruth * GetMCTruth() const
std::vector< std::string > outlabels
object containing MC flux information
const simb::GTruth * thisGTruth
const bsim::NuChoice * GetNuChoice() const
const simb::MCFlux * GetMCFlux() const
std::vector< std::string > const & fInputModuleLabels
const bsim::NuChoice * thisNuChoice
std::set< std::pair< int, int > > indices
const simb::MCFlux * thisMCFlux
const simb::GTruth * GetGTruth() const
const simb::MCTruth * thisMCTruth
Physics generators for neutrinos, cosmic rays, and others.
Definition: CRYHelper.cxx:33
std::set< std::pair< int, int > >::const_iterator indx_itr
Event generator information.
Definition: MCTruth.h:32
std::string GetLabel() const
const bsim::Dk2Nu * GetDk2Nu() const