LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
MCRecoPart.h
Go to the documentation of this file.
1 #ifndef MCRECOPART_H
2 #define MCRECOPART_H
3 
4 // ART includes
16 
17 // LArSoft
22 
23 // STL
24 #include <set>
25 #include <vector>
26 #include <sstream>
27 
28 // ROOT
29 #include <TString.h>
30 #include <TTree.h>
31 
32 namespace sim
33 {
34 
35  class MCMiniPart {
36 
37  public:
38 
40 
41  virtual ~MCMiniPart(){}
42 
43  unsigned int _track_id;
44  std::string _process;
45  unsigned int _mother;
46  unsigned int _ancestor;
47  int _pdgcode;
48  TLorentzVector _start_vtx;
49  TLorentzVector _start_mom;
50  TLorentzVector _end_vtx;
51  TLorentzVector _end_mom;
52  std::vector<std::pair<TLorentzVector,TLorentzVector> > _det_path;
53  std::set<unsigned int> _daughters;
55 
56  void Reset(){
57  _track_id = _mother = _ancestor = kINVALID_UINT;
58  _pdgcode = kINVALID_INT;
59  _process = "";
60  _origin = ::simb::kUnknown;
61 
62  TLorentzVector invalid(kINVALID_DOUBLE,
66  _start_vtx = invalid;
67  _start_mom = invalid;
68  _end_vtx = invalid;
69  _end_mom = invalid;
70  _daughters.clear();
71  _det_path.clear();
72  }
73 
74  };
75 
76  class MCRecoPart : public std::vector<sim::MCMiniPart> {
77 
78  public:
79 
81  MCRecoPart(fhicl::ParameterSet const& pset);
82 
84  virtual ~MCRecoPart(){};
85 
86  void AddParticles(const std::vector<simb::MCParticle>& mcp_v,
87  const std::vector<simb::Origin_t>& orig_v);
88 
89  unsigned int AncestorTrackID(const unsigned int part_index);
90 
91  unsigned int MotherTrackID(const unsigned int part_index) const;
92 
93  /*
94  Take TrackID and returns the corresponding particle unique index number (MCParticle array index)
95  Returns kINVALID_UINT if nothing found.
96  */
97  unsigned int TrackToParticleIndex(const unsigned int track_id) const
98  {
99  auto const iter (_track_index.find(track_id));
100  if(iter==_track_index.end()) return kINVALID_UINT;
101  return (*iter).second;
102  }
103 
104  bool InDetector(const double& x,
105  const double& y,
106  const double& z) const;
107 
108  public:
109 
111  std::map<unsigned int, unsigned int> _track_index;
112  //std::map<size_t,size_t> _track_index;
113 
115  std::set<int> _pdg_list;
116 
117  protected:
118 
119  double _x_max;
120  double _x_min;
121  double _y_max;
122  double _y_min;
123  double _z_max;
124  double _z_min;
125 
126  }; // class MCRecoPart
127 
128 } //namespace cluster
129 #endif
Float_t x
Definition: compare.C:6
std::string _process
Definition: MCRecoPart.h:44
const double kINVALID_DOUBLE
Definition: MCLimits.h:10
const int kINVALID_INT
Definition: MCLimits.h:16
double _z_max
z-max of volume box used to determine whether to save track information
Definition: MCRecoPart.h:123
Unknown view.
Definition: geo_types.h:83
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
enum simb::_ev_origin Origin_t
event origin types
virtual ~MCRecoPart()
Default destructor.
Definition: MCRecoPart.h:84
double _y_max
y-max of volume box used to determine whether to save track information
Definition: MCRecoPart.h:121
double _y_min
y-min of volume box used to determine whether to save track information
Definition: MCRecoPart.h:122
std::map< unsigned int, unsigned int > _track_index
Track ID => Index Map.
Definition: MCRecoPart.h:111
Particle class.
TLorentzVector _start_vtx
Definition: MCRecoPart.h:48
std::vector< std::pair< TLorentzVector, TLorentzVector > > _det_path
Definition: MCRecoPart.h:52
TLorentzVector _start_mom
Definition: MCRecoPart.h:49
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
double _z_min
z-min of volume box used to determine whether to save track information
Definition: MCRecoPart.h:124
TLorentzVector _end_mom
Definition: MCRecoPart.h:51
virtual ~MCMiniPart()
Definition: MCRecoPart.h:41
TLorentzVector _end_vtx
Definition: MCRecoPart.h:50
::simb::Origin_t _origin
Definition: MCRecoPart.h:54
Monte Carlo Simulation.
unsigned int _mother
Definition: MCRecoPart.h:45
double _x_max
x-max of volume box used to determine whether to save track information
Definition: MCRecoPart.h:119
double _x_min
x-min of volume box used to determine whether to save track information
Definition: MCRecoPart.h:120
std::set< int > _pdg_list
PDG code list for which particle&#39;s trajectory within the detector is saved.
Definition: MCRecoPart.h:115
const unsigned int kINVALID_UINT
Definition: MCLimits.h:14
unsigned int _track_id
Definition: MCRecoPart.h:43
unsigned int TrackToParticleIndex(const unsigned int track_id) const
Definition: MCRecoPart.h:97
std::set< unsigned int > _daughters
Definition: MCRecoPart.h:53
art framework interface to geometry description
unsigned int _ancestor
Definition: MCRecoPart.h:46