LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
MCShowerRecoPart.h
Go to the documentation of this file.
1 #ifndef MCSHOWERRECOPART_H
2 #define MCSHOWERRECOPART_H
3 
4 // ART includes
5 namespace fhicl {
6  class ParameterSet;
7 }
8 #include "cetlib_except/exception.h"
9 
10 // LArSoft
11 namespace sim {
12  class MCRecoPart;
13 }
14 
15 // STL
16 #include <map>
17 #include <vector>
18 
19 namespace sim {
20 
22 
23  public:
24  static const unsigned int kINVALID_UINT;
25  static const int kINVALID_INT;
26 
27  public:
29  explicit MCShowerRecoPart(fhicl::ParameterSet const& pset);
30  //ClusterMergeAlg(fhicl::ParameterSet const& pset, art::ActivityRegistry& reg);
31 
33  void ConstructShower(const MCRecoPart& part_v);
34 
39  const std::vector<unsigned int>& ShowerDaughters(const unsigned int shower_id) const
40  {
41  if (shower_id >= _shower_daughters.size())
42  throw cet::exception(__FUNCTION__) << "Invalid shower index!";
43  return _shower_daughters.at(shower_id);
44  }
45 
49  const std::vector<unsigned int> ShowerMothers() const
50  {
51  std::vector<unsigned int> mothers(_shower_index.size(), 0);
52  for (auto mother_iter = _shower_index.begin(); mother_iter != _shower_index.end();
53  ++mother_iter)
54  mothers.at((*mother_iter).second) = (*mother_iter).first;
55  return mothers;
56  }
57 
58  //--------------- Particle Information Getters -----------------//
59 
64  int ShowerIndex(const unsigned int part_index) const
65  {
66  if (_shower_id.size() <= part_index) return kINVALID_INT;
67  return _shower_id.at(part_index);
68  }
69 
70  protected:
73 
75  std::vector<int> _shower_id;
76 
77  //
78  // shower-indexed-variables
79  //
81  std::map<unsigned int, unsigned int> _shower_index;
82 
84  std::vector<std::vector<unsigned int>> _shower_daughters;
85 
86  }; // class MCShowerRecoPart
87 
88 } //namespace cluster
89 #endif
std::vector< int > _shower_id
Track index to shower index map.
const std::vector< unsigned int > ShowerMothers() const
std::vector< std::vector< unsigned int > > _shower_daughters
Shower time-ordered daughters.
parameter set interface
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
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33