LArSoft  v10_04_05
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 
14 
15 #include "fhiclcpp/fwd.h"
16 
17 class TTree;
18 
19 #include <string>
20 #include <vector>
21 
22 namespace trk {
23  class TrackContainmentAlg;
24 
25  typedef struct TrackTree {
26 
27  TrackTree() {}
28 
30  : start_x(t.Vertex().X())
31  , start_y(t.Vertex().Y())
32  , start_z(t.Vertex().Z())
33  , start_theta(t.VertexDirection().Theta())
34  , start_phi(t.VertexDirection().Phi())
35  , end_x(t.End().X())
36  , end_y(t.End().Y())
37  , end_z(t.End().Z())
38  , end_theta(t.EndDirection().Theta())
39  , end_phi(t.EndDirection().Phi())
40  , length(t.Length())
41  , length_simple((t.End() - t.Vertex()).R())
42  {}
43 
44  double start_x;
45  double start_y;
46  double start_z;
47  double start_theta;
48  double start_phi;
49  double end_x;
50  double end_y;
51  double end_z;
52  double end_theta;
53  double end_phi;
54  double length;
55  double length_simple;
56 
57  std::string Leaflist()
58  {
59  return "start_x/D:start_y/D:start_z/D:start_theta/D:start_phi/D:end_x/D:end_y/D:end_z/"
60  "D:end_theta/D:end_phi/D:length/D:length_simple/D";
61  }
62 
63  } TrackTree_t;
64 
65 }
66 
68 
69 public:
72 
73  void SetupOutputTree(TTree*);
74 
75  void Configure(fhicl::ParameterSet const&);
76 
77  void SetRunEvent(unsigned int const&, unsigned int const&);
78  void ProcessTracks(std::vector<std::vector<recob::Track>> const&,
79  geo::GeometryCore const&,
80  geo::WireReadoutGeom const&);
81 
82  std::vector<std::vector<int>> const& GetTrackContainmentValues()
83  {
84  return fTrackContainmentLevel;
85  }
86  std::vector<std::vector<double>> const& GetTrackMinDistanceValues() { return fMinDistances; }
87  std::vector<std::vector<anab::CosmicTag>> const& GetTrackCosmicTags();
88 
89  void setMakeCosmicTags(bool flag = true) { fMakeCosmicTags = flag; }
90  void setFillOutputTree(bool flag = true) { fFillOutputTree = flag; }
91 
92 private:
93  double fZBuffer;
94  double fYBuffer;
95  double fXBuffer;
96  double fIsolation;
98  bool fDebug;
100 
101  TTree* fTrackTree;
103  unsigned int fRun;
104  unsigned int fEvent;
105  unsigned int fCollection;
106  unsigned int fTrkID;
107  double fDistance;
109 
110  std::vector<std::vector<int>> fTrackContainmentLevel;
111  std::vector<std::vector<std::pair<int, int>>> fTrackContainmentIndices;
112  std::vector<std::vector<double>> fMinDistances;
113  std::vector<std::vector<anab::CosmicTag>> fCosmicTags;
114 
115  bool IsContained(recob::Track const&, geo::GeometryCore const&);
116  anab::CosmicTagID_t GetCosmicTagID(recob::Track const&, geo::GeometryCore const&);
117 
118  double MinDistanceStartPt(recob::Track const&, recob::Track const&);
119  double MinDistanceEndPt(recob::Track const&, recob::Track const&);
120 };
121 
122 #endif
std::vector< std::vector< double > > const & GetTrackMinDistanceValues()
float Length(const PFPStruct &pfp)
Definition: PFPUtils.cxx:3267
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
Interface for a class providing readout channel mapping to geometry.
std::string Leaflist()
TrackTree(recob::Track const &t)
std::vector< std::vector< int > > const & GetTrackContainmentValues()
Description of the physical geometry of one entire detector.
Definition: GeometryCore.h:91
std::vector< std::vector< double > > fMinDistances
Provides recob::Track data product.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
Float_t X
Definition: plot.C:37
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