ProtoDUNETrackUtils.h
Go to the documentation of this file.
1 #ifndef PROTODUNE_TRACK_UTILS_H
2 #define PROTODUNE_TRACK_UTILS_H
3 
4 ///////////////////////////////////////////////////////////////
5 // ProtoDUNETrackUtils
6 // - Class to help analysers access useful track information
7 //
8 // Leigh Whitehead - leigh.howard.whitehead@cern.ch
9 ///////////////////////////////////////////////////////////////
10 
17 
19 #include "TProfile.h"
20 
21 namespace protoana {
22 
23  struct BrokenTrack {
26 
27  double CosTheta;
28  std::vector< float > Combined_ResidualRange;
29  std::vector< float > Combined_dQdx;
30  std::vector< float > Combined_dEdx;
31 
32  bool Valid;
33 
34  };
35 
37 
38  public:
39 
42 
43  /// Get the cosmic tag(s) from a given reco track
44  std::vector<anab::CosmicTag> GetRecoTrackCosmicTag(const recob::Track &track, art::Event const &evt, std::string trackModule) const;
45  /// Get the T0(s) from a given reco track
46  std::vector<anab::T0> GetRecoTrackT0(const recob::Track &track, art::Event const &evt, std::string trackModule) const;
47  /// Get the Calorimetry(s) from a given reco track
48  std::vector<anab::Calorimetry> GetRecoTrackCalorimetry(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule) const;
49  /// Calibrate a Calorimetry object for a given plane from a given track
50  std::vector< float > CalibrateCalorimetry(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule, const fhicl::ParameterSet & ps );
51  float calc_dEdX( double, double, double, double, double, double );
52  /// Get the hits from a given reco track
53  const std::vector<const recob::Hit*> GetRecoTrackHits(const recob::Track &track, art::Event const &evt, const std::string trackModule) const;
54  /// Get the hits from a given reco track from a specific plane
55  const std::vector<const recob::Hit*> GetRecoTrackHitsFromPlane(const recob::Track &track, art::Event const &evt, const std::string trackModule, unsigned int planeID) const;
56  /// Get the number of hits from a given reco track
57  unsigned int GetNumberRecoTrackHits(const recob::Track &track, art::Event const &evt, const std::string trackModule) const;
58  /// Get the PID from a given track
59  std::vector<anab::ParticleID> GetRecoTrackPID(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string pidModule) const;
60  /// Try to determine if it's a broken track
61  BrokenTrack IsBrokenTrack( const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule, const fhicl::ParameterSet & BrokenTrackPars, const fhicl::ParameterSet & CalorimetryPars );
62  /// Until we have fully calibrated calorimetry, use this PID algo
63  std::pair< double, int > Chi2PIDFromTrack_MC( const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule, TProfile * profile );
64  std::pair< double, int > Chi2PID( const std::vector< double > & track_dedx, const std::vector< double > & range, TProfile * profile );
65 
66  // Get the hits from the track, organized by the Track Trajectory points
67  //std::map< size_t, std::vector< const recob::Hit * > > GetRecoHitsFromTrajPoints( const recob::Track & track, art::Event const & evt, std::string trackModule );
68  std::map< size_t, const recob::Hit * > GetRecoHitsFromTrajPoints( const recob::Track & track, art::Event const & evt, std::string trackModule );
69 
70  bool IsBeamlike( const recob::Track & track, art::Event const & evt, const fhicl::ParameterSet & BeamPars, bool flip=false );
71 
72 
73  std::pair<double, int> GetVertexMichelScore(
74  const recob::Track & track, const art::Event & evt,
75  const std::string trackModule, const std::string hitModule,
76  double min_length = 5., double min_x = -200.,
77  double max_x = 0., double min_y = 200., double max_y = 500.,
78  double min_z = 25., bool check_wire = true, double check_x = 0,
79  double check_y = 0., double check_z = 0.);
80  std::pair<double, double> GetVertexMichelScore_weight_by_charge(
81  const recob::Track & track, const art::Event & evt,
82  const std::string trackModule, const std::string hitModule,
83  double min_length = 5., double min_x = -200.,
84  double max_x = 0., double min_y = 200., double max_y = 500.,
85  double min_z = 25., bool check_wire = true, double check_x = 0,
86  double check_y = 0., double check_z = 0.);
87  std::pair<double, int> GetVertexMichelScoreAlt(
88  const recob::Track & track, const art::Event & evt,
89  const std::string trackModule, const std::string hitModule,
90  double min_length = 5., double min_x = -200.,
91  double max_x = 0., double min_y = 200., double max_y = 500.,
92  double min_z = 25., bool check_wire = true, double check_x = 0,
93  double check_y = 0., double check_z = 0.);
94 
95  private:
96 
97 
98  };
99 
100 }
101 
102 #endif
103 
std::vector< float > Combined_ResidualRange
std::string string
Definition: nybbler.cc:12
const recob::Track * secondTrack
static constexpr double ps
Definition: Units.h:99
std::vector< float > Combined_dQdx
std::vector< float > Combined_dEdx
Declaration of signal hit object.
const recob::Track * firstTrack
Provides recob::Track data product.
TCEvent evt
Definition: DataStructs.cxx:7
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