TrackContainmentAlg.hh
Go to the documentation of this file.
1 /**
2  * \file TrackContainmentAlg.h
3  *
4  *
5  * @author wketchum
6 */
7 
8 #ifndef TRK_TRACKCONTAINMENTALG_H
9 #define TRK_TRACKCONTAINMENTALG_H
10 
11 #include <string>
12 #include <vector>
13 
14 #include "fhiclcpp/fwd.h"
17 
18 class TTree;
19 
20 namespace geo{ class GeometryCore; }
21 
22 namespace trk{
23  class TrackContainmentAlg;
24 
25  typedef struct TrackTree{
26 
28 
30  start_x(t.Vertex().X()),start_y(t.Vertex().Y()),start_z(t.Vertex().Z()),
31  start_theta(t.VertexDirection().Theta()),start_phi(t.VertexDirection().Phi()),
32  end_x(t.End().X()),end_y(t.End().Y()),end_z(t.End().Z()),
33  end_theta(t.EndDirection().Theta()),end_phi(t.EndDirection().Phi()),
34  length(t.Length()),length_simple( (t.End()-t.Vertex()).R() ){}
35 
36  double start_x;
37  double start_y;
38  double start_z;
39  double start_theta;
40  double start_phi;
41  double end_x;
42  double end_y;
43  double end_z;
44  double end_theta;
45  double end_phi;
46  double length;
47  double length_simple;
48 
50  { return "start_x/D:start_y/D:start_z/D:start_theta/D:start_phi/D:end_x/D:end_y/D:end_z/D:end_theta/D:end_phi/D:length/D:length_simple/D"; }
51 
52  } TrackTree_t;
53 
54 }
55 
56 
58 
59 public:
60 
61  /// Default constructor
63 
64  void SetupOutputTree(TTree*);
65 
66  void Configure(fhicl::ParameterSet const&);
67 
68  void SetRunEvent(unsigned int const&, unsigned int const&);
69  void ProcessTracks(std::vector< std::vector<recob::Track> > const&,
70  geo::GeometryCore const& );
71 
72  std::vector< std::vector<int> > const& GetTrackContainmentValues()
73  { return fTrackContainmentLevel; }
74  std::vector< std::vector<double> > const& GetTrackMinDistanceValues()
75  { return fMinDistances; }
76  std::vector< std::vector<anab::CosmicTag> > const& GetTrackCosmicTags();
77 
78  void setMakeCosmicTags(bool flag=true) { fMakeCosmicTags = flag; }
79  void setFillOutputTree(bool flag=true) { fFillOutputTree = flag; }
80 
81 
82  private:
83 
84  double fZBuffer;
85  double fYBuffer;
86  double fXBuffer;
87  double fIsolation;
89  bool fDebug;
91 
92  TTree* fTrackTree;
94  unsigned int fRun;
95  unsigned int fEvent;
96  unsigned int fCollection;
97  unsigned int fTrkID;
98  double fDistance;
100 
101  std::vector< std::vector<int> > fTrackContainmentLevel;
102  std::vector< std::vector< std::pair<int,int> > > fTrackContainmentIndices;
103  std::vector< std::vector<double> > fMinDistances;
104  std::vector< std::vector<anab::CosmicTag> > fCosmicTags;
105 
106 
107  bool IsContained(recob::Track const&, geo::GeometryCore const&);
108  anab::CosmicTagID_t GetCosmicTagID(recob::Track const&, geo::GeometryCore const&);
109 
110  double MinDistanceStartPt(recob::Track const&, recob::Track const&);
111  double MinDistanceEndPt(recob::Track const&, recob::Track const&);
112 
113 };
114 
115 #endif
float Length(const PFPStruct &pfp)
Definition: PFPUtils.cxx:3303
std::vector< std::vector< int > > fTrackContainmentLevel
void setMakeCosmicTags(bool flag=true)
std::string string
Definition: nybbler.cc:12
enum anab::cosmic_tag_id CosmicTagID_t
void setFillOutputTree(bool flag=true)
std::vector< std::vector< double > > fMinDistances
struct vector vector
std::vector< std::vector< int > > const & GetTrackContainmentValues()
std::vector< std::vector< std::pair< int, int > > > fTrackContainmentIndices
struct trk::TrackTree TrackTree_t
std::string Leaflist()
TrackTree(recob::Track const &t)
Description of geometry of one entire detector.
std::vector< std::vector< anab::CosmicTag > > fCosmicTags
void End(void)
Definition: gXSecComp.cxx:210
void Configure(string mesg)
Definition: gEvServ.cxx:196
std::vector< std::vector< double > > const & GetTrackMinDistanceValues()
Provides recob::Track data product.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
LArSoft geometry interface.
Definition: ChannelGeo.h:16
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