LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ParticleAncestryMap.h
Go to the documentation of this file.
1 
12 #ifndef PARTICLEANCESTRYMAP_H
13 #define PARTICLEANCESTRYMAP_H
14 
15 #include <map>
16 #include <set>
17 
18 namespace sim {
19 
21 
22  std::map<int, std::set<int>> fParticleMap;
23 
24  public:
25  // Default constructor
27 
28  // Construction from a pre filled map
29  ParticleAncestryMap(const std::map<int, std::set<int>>& particleMap) : fParticleMap(particleMap)
30  {}
31 
32  // Set the map contents
33  void SetMap(const std::map<int, std::set<int>>& map);
34 
35  // Return the whole ancestry map
36  std::map<int, std::set<int>> const& GetMap() const;
37 
38  // Whether there are any dropped descendants for a given track id
39  bool HasDroppedDescendants(const int trackid) const;
40 
41  // Return the set of dropped descendants from a given ancestor's track id
42  std::set<int> const& GetAllDroppedDescendants(const int trackid) const;
43 
44  // Get the stored ancestor from a given dropped track id
45  int GetAncestor(const int trackid) const;
46 
47  // Whether or not the returned track id from GetAncestor is valid or set to the default value
48  bool Exists(const int trackid) const;
49  };
50 }
51 #endif
std::set< int > const & GetAllDroppedDescendants(const int trackid) const
ParticleAncestryMap(const std::map< int, std::set< int >> &particleMap)
bool HasDroppedDescendants(const int trackid) const
std::map< int, std::set< int > > fParticleMap
Monte Carlo Simulation.
int GetAncestor(const int trackid) const
void SetMap(const std::map< int, std::set< int >> &map)
bool Exists(const int trackid) const
std::map< int, std::set< int > > const & GetMap() const