LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
MCShowerRecoPart.h
Go to the documentation of this file.
1 #ifndef MCSHOWERRECOPART_H
2 #define MCSHOWERRECOPART_H
3 
4 // ART includes
16 
17 // LArSoft
23 #include "MCRecoPart.h"
24 
25 // STL
26 #include <set>
27 #include <vector>
28 #include <sstream>
29 
30 // ROOT
31 #include <TString.h>
32 #include <TTree.h>
33 
34 namespace sim
35 {
36 
38 
39  public:
40  static const unsigned int kINVALID_UINT;
41  static const int kINVALID_INT;
42 
43  public:
44 
46  explicit MCShowerRecoPart(fhicl::ParameterSet const& pset);
47  //ClusterMergeAlg(fhicl::ParameterSet const& pset, art::ActivityRegistry& reg);
48 
50  void ConstructShower(const MCRecoPart& part_v);
51 
56  const std::vector<unsigned int>& ShowerDaughters(const unsigned int shower_id) const
57  {
58  if(shower_id >= _shower_daughters.size()) throw cet::exception(__FUNCTION__) << "Invalid shower index!";
59  return _shower_daughters.at(shower_id);
60  }
61 
65  const std::vector<unsigned int> ShowerMothers() const
66  {
67  std::vector<unsigned int> mothers(_shower_index.size(),0);
68  for(auto mother_iter = _shower_index.begin(); mother_iter!=_shower_index.end(); ++mother_iter)
69  mothers.at((*mother_iter).second) = (*mother_iter).first;
70  return mothers;
71  }
72 
73  //--------------- Particle Information Getters -----------------//
74 
79  int ShowerIndex(const unsigned int part_index) const
80  {
81  if(_shower_id.size() <= part_index) return kINVALID_INT;
82  return _shower_id.at(part_index);
83  }
84 
85  protected:
86 
89 
91  std::vector<int> _shower_id;
92 
93  //
94  // shower-indexed-variables
95  //
97  std::map<unsigned int, unsigned int> _shower_index;
98 
100  std::vector<std::vector<unsigned int> > _shower_daughters;
101 
102  }; // class MCShowerRecoPart
103 
104 } //namespace cluster
105 #endif
std::vector< int > _shower_id
Track index to shower index map.
const std::vector< unsigned int > ShowerMothers() const
Particle class.
std::vector< std::vector< unsigned int > > _shower_daughters
Shower time-ordered daughters.
MCShowerRecoPart(fhicl::ParameterSet const &pset)
Default constructor with fhicl parameters.
static const int kINVALID_INT
int ShowerIndex(const unsigned int part_index) const
bool _debug_mode
lots of stdout stream
Monte Carlo Simulation.
const std::vector< unsigned int > & ShowerDaughters(const unsigned int shower_id) const
std::map< unsigned int, unsigned int > _shower_index
Shower Primary Index ID => Shower Index Map.
static const unsigned int kINVALID_UINT
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void ConstructShower(const MCRecoPart &part_v)
Main function to read-in data and fill variables in this algorithm to reconstruct MC shower...