LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 
16 
17 #include "TTree.h"
18 #include "fhiclcpp/ParameterSet.h"
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 
49  std::string Leaflist()
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 
63 
65  virtual ~TrackContainmentAlg(){};
66 
67  void SetupOutputTree(TTree*);
68 
69  void Configure(fhicl::ParameterSet const&);
70 
71  void SetRunEvent(unsigned int const&, unsigned int const&);
72  void ProcessTracks(std::vector< std::vector<recob::Track> > const&,
73  geo::GeometryCore const& );
74 
75  std::vector< std::vector<int> > const& GetTrackContainmentValues()
76  { return fTrackContainmentLevel; }
77  std::vector< std::vector<double> > const& GetTrackMinDistanceValues()
78  { return fMinDistances; }
79  std::vector< std::vector<anab::CosmicTag> > const& GetTrackCosmicTags();
80 
81  void setMakeCosmicTags(bool flag=true) { fMakeCosmicTags = flag; }
82  void setFillOutputTree(bool flag=true) { fFillOutputTree = flag; }
83 
84 
85  private:
86 
87  double fZBuffer;
88  double fYBuffer;
89  double fXBuffer;
90  double fIsolation;
92  bool fDebug;
94 
95  TTree* fTrackTree;
97  unsigned int fRun;
98  unsigned int fEvent;
99  unsigned int fCollection;
100  unsigned int fTrkID;
101  double fDistance;
103 
104  std::vector< std::vector<int> > fTrackContainmentLevel;
105  std::vector< std::vector< std::pair<int,int> > > fTrackContainmentIndices;
106  std::vector< std::vector<double> > fMinDistances;
107  std::vector< std::vector<anab::CosmicTag> > fCosmicTags;
108 
109 
110  bool IsContained(recob::Track const&, geo::GeometryCore const&);
111  anab::CosmicTagID_t GetCosmicTagID(recob::Track const&, geo::GeometryCore const&);
112 
113  double MinDistanceStartPt(recob::Track const&, recob::Track const&);
114  double MinDistanceEndPt(recob::Track const&, recob::Track const&);
115 
116 };
117 
118 #endif
std::vector< std::vector< int > > fTrackContainmentLevel
void setMakeCosmicTags(bool flag=true)
enum anab::cosmic_tag_id CosmicTagID_t
void setFillOutputTree(bool flag=true)
Float_t Y
Definition: plot.C:39
std::vector< std::vector< double > > fMinDistances
std::vector< std::vector< int > > const & GetTrackContainmentValues()
typename BeginEndPackage< L >::End End
Float_t Z
Definition: plot.C:39
std::vector< std::vector< std::pair< int, int > > > fTrackContainmentIndices
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
virtual ~TrackContainmentAlg()
Default destructor.
Provides recob::Track data product.
struct trk::TrackTree TrackTree_t
std::string Leaflist()
Double_t R
TrackTree(recob::Track const &t)
Description of geometry of one entire detector.
std::vector< std::vector< anab::CosmicTag > > fCosmicTags
std::vector< std::vector< double > > const & GetTrackMinDistanceValues()
Float_t X
Definition: plot.C:39
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:52