LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TrackContainmentAlg.hh
Go to the documentation of this file.
1 
8 #ifndef TRK_TRACKCONTAINMENTALG_H
9 #define TRK_TRACKCONTAINMENTALG_H
10 
11 #include <string>
12 #include <vector>
13 
14 namespace fhicl {
15  class ParameterSet;
16 }
17 
20 
21 class TTree;
22 
23 namespace geo {
24  class GeometryCore;
25 }
26 
27 namespace trk {
28  class TrackContainmentAlg;
29 
30  typedef struct TrackTree {
31 
32  TrackTree() {}
33 
35  : start_x(t.Vertex().X())
36  , start_y(t.Vertex().Y())
37  , start_z(t.Vertex().Z())
38  , start_theta(t.VertexDirection().Theta())
39  , start_phi(t.VertexDirection().Phi())
40  , end_x(t.End().X())
41  , end_y(t.End().Y())
42  , end_z(t.End().Z())
43  , end_theta(t.EndDirection().Theta())
44  , end_phi(t.EndDirection().Phi())
45  , length(t.Length())
46  , length_simple((t.End() - t.Vertex()).R())
47  {}
48 
49  double start_x;
50  double start_y;
51  double start_z;
52  double start_theta;
53  double start_phi;
54  double end_x;
55  double end_y;
56  double end_z;
57  double end_theta;
58  double end_phi;
59  double length;
60  double length_simple;
61 
62  std::string Leaflist()
63  {
64  return "start_x/D:start_y/D:start_z/D:start_theta/D:start_phi/D:end_x/D:end_y/D:end_z/"
65  "D:end_theta/D:end_phi/D:length/D:length_simple/D";
66  }
67 
68  } TrackTree_t;
69 
70 }
71 
73 
74 public:
77 
78  void SetupOutputTree(TTree*);
79 
80  void Configure(fhicl::ParameterSet const&);
81 
82  void SetRunEvent(unsigned int const&, unsigned int const&);
83  void ProcessTracks(std::vector<std::vector<recob::Track>> const&, geo::GeometryCore const&);
84 
85  std::vector<std::vector<int>> const& GetTrackContainmentValues()
86  {
87  return fTrackContainmentLevel;
88  }
89  std::vector<std::vector<double>> const& GetTrackMinDistanceValues() { return fMinDistances; }
90  std::vector<std::vector<anab::CosmicTag>> const& GetTrackCosmicTags();
91 
92  void setMakeCosmicTags(bool flag = true) { fMakeCosmicTags = flag; }
93  void setFillOutputTree(bool flag = true) { fFillOutputTree = flag; }
94 
95 private:
96  double fZBuffer;
97  double fYBuffer;
98  double fXBuffer;
99  double fIsolation;
101  bool fDebug;
103 
104  TTree* fTrackTree;
106  unsigned int fRun;
107  unsigned int fEvent;
108  unsigned int fCollection;
109  unsigned int fTrkID;
110  double fDistance;
112 
113  std::vector<std::vector<int>> fTrackContainmentLevel;
114  std::vector<std::vector<std::pair<int, int>>> fTrackContainmentIndices;
115  std::vector<std::vector<double>> fMinDistances;
116  std::vector<std::vector<anab::CosmicTag>> fCosmicTags;
117 
118  bool IsContained(recob::Track const&, geo::GeometryCore const&);
119  anab::CosmicTagID_t GetCosmicTagID(recob::Track const&, geo::GeometryCore const&);
120 
121  double MinDistanceStartPt(recob::Track const&, recob::Track const&);
122  double MinDistanceEndPt(recob::Track const&, recob::Track const&);
123 };
124 
125 #endif
std::vector< std::vector< double > > const & GetTrackMinDistanceValues()
float Length(const PFPStruct &pfp)
Definition: PFPUtils.cxx:3269
void setMakeCosmicTags(bool flag=true)
std::vector< std::vector< std::pair< int, int > > > fTrackContainmentIndices
enum anab::cosmic_tag_id CosmicTagID_t
void setFillOutputTree(bool flag=true)
Float_t Y
Definition: plot.C:37
std::vector< std::vector< anab::CosmicTag > > fCosmicTags
Float_t Z
Definition: plot.C:37
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
struct trk::TrackTree TrackTree_t
std::vector< std::vector< int > > fTrackContainmentLevel
parameter set interface
std::string Leaflist()
TrackTree(recob::Track const &t)
Provides recob::Track data product.
std::vector< std::vector< int > > const & GetTrackContainmentValues()
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
std::vector< std::vector< double > > fMinDistances
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
Float_t X
Definition: plot.C:37
Namespace collecting geometry-related classes utilities.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49