TrackCreator.h
Go to the documentation of this file.
1 #ifndef TRACK_CREATOR_H
2 #define TRACK_CREATOR_H 1
3 
5 #include "Api/PandoraApi.h"
8 
9 namespace gar {
10  namespace gar_pandora {
11 
12  typedef std::vector<art::Ptr<gar::rec::Track>> TrackVector;
13  typedef std::vector<gar::rec::Track> RawTrackVector;
14  typedef std::set<const gar::rec::Track *> TrackList;
15 
17  {
18  public:
19 
20  class Settings
21  {
22  public:
23  Settings();
24 
25  std::string m_trackCollection; ///< The reconstructed track collection
26  std::string m_V0Collection; ///< The vees collection
27 
28  unsigned int m_minTrackHits; ///< Track quality cut: the minimum number of track hits
29  unsigned int m_maxTrackHits; ///< Track quality cut: the maximum number of track hits
30 
31  float m_d0TrackCut; ///< Track d0 cut used to determine whether track can be used to form pfo
32  float m_z0TrackCut; ///< Track z0 cut used to determine whether track can be used to form pfo
36 
37  float m_minTrackECalDistanceFromIp; ///< Sanity check on separation between ip and track projected ecal position
38  float m_maxTrackSigmaPOverP; ///< Track fraction momentum error cut
39 
40  float m_bField; ///< The bfield
41  int m_eCalBarrelInnerSymmetry; ///< ECal barrel inner symmetry order
42  float m_eCalBarrelInnerPhi0; ///< ECal barrel inner phi 0
43  float m_eCalBarrelInnerR; ///< ECal barrel inner radius
44  float m_eCalEndCapInnerZ; ///< ECal endcap inner z
45  float m_GArCenterY;
46  float m_GArCenterZ;
47  };
48 
49  TrackCreator(const Settings &settings, const pandora::Pandora *const pPandora, const RotationTransformation *const pRotation);
50 
51  virtual ~TrackCreator();
52 
53  pandora::StatusCode CreateTracks(const art::Event &pEvent);
54  pandora::StatusCode CreateTrackAssociations(const art::Event &pEvent);
55 
56  const TrackVector &GetTrackVector() const;
57 
58  void Reset();
59 
60  private:
61 
62  pandora::StatusCode CreateTracks();
63  void GetTrackStates(const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const;
64  bool PassesQualityCuts(const gar::rec::Track *const pTrack, const PandoraApi::Track::Parameters &trackParameters) const;
65  void TrackReachesECAL(const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const;
66  void DefineTrackPfoUsage(const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const;
67  void CalculateTrackStateAtCalo(const gar::rec::Track *const pTrack, pandora::CartesianVector &posAtCalo) const;
68  void CalculateTimeAtCalo(const gar::rec::Track *const pTrack, float &timeAtCalo) const;
69 
70  pandora::StatusCode CollectTracks(const art::Event &pEvent, const std::string &label, TrackVector &trkVector);
71 
72  pandora::StatusCode ExtractKinks(const art::Event &pEvent);
73  pandora::StatusCode ExtractProngsAndSplits(const art::Event &pEvent);
74  pandora::StatusCode ExtractV0s(const art::Event &pEvent);
75 
76  bool IsV0(const gar::rec::Track *const pTrack) const;
77  bool IsParent(const gar::rec::Track *const pTrack) const;
78  bool IsDaughter(const gar::rec::Track *const pTrack) const;
79 
81  const pandora::Pandora &m_pandora;
83 
84  TrackVector artTrkVector;
85  TrackVector m_trackVector;
86  TrackList m_v0TrackList; ///< The list of v0 tracks
87  TrackList m_parentTrackList; ///< The list of parent tracks
88  TrackList m_daughterTrackList; ///< The list of daughter tracks
89  };
90 
91  //------------------------------------------------------------------------------------------------------------------------------------------
92 
93  inline const TrackVector &TrackCreator::GetTrackVector() const
94  {
95  return m_trackVector;
96  }
97 
98  //------------------------------------------------------------------------------------------------------------------------------------------
99 
100  inline void TrackCreator::Reset()
101  {
102  artTrkVector.clear();
103  m_trackVector.clear();
104  m_v0TrackList.clear();
105  m_parentTrackList.clear();
106  m_daughterTrackList.clear();
107  }
108 
109  //------------------------------------------------------------------------------------------------------------------------------------------
110 
111  inline bool TrackCreator::IsV0(const gar::rec::Track *const pTrack) const
112  {
113  return (m_v0TrackList.end() != m_v0TrackList.find(pTrack));
114  }
115 
116  //------------------------------------------------------------------------------------------------------------------------------------------
117 
118  inline bool TrackCreator::IsParent(const gar::rec::Track *const pTrack) const
119  {
120  return (m_parentTrackList.end() != m_parentTrackList.find(pTrack));
121  }
122 
123  //------------------------------------------------------------------------------------------------------------------------------------------
124 
125  inline bool TrackCreator::IsDaughter(const gar::rec::Track *const pTrack) const
126  {
127  return (m_daughterTrackList.end() != m_daughterTrackList.find(pTrack));
128  }
129  }
130 }
131 
132 #endif // #ifndef TRACK_CREATOR_H
float m_eCalBarrelInnerR
ECal barrel inner radius.
Definition: TrackCreator.h:43
const TrackVector & GetTrackVector() const
Definition: TrackCreator.h:93
pandora::StatusCode CollectTracks(const art::Event &pEvent, const std::string &label, TrackVector &trkVector)
TrackList m_v0TrackList
The list of v0 tracks.
Definition: TrackCreator.h:86
int m_eCalBarrelInnerSymmetry
ECal barrel inner symmetry order.
Definition: TrackCreator.h:41
float m_eCalEndCapInnerZ
ECal endcap inner z.
Definition: TrackCreator.h:44
std::string m_V0Collection
The vees collection.
Definition: TrackCreator.h:26
const RotationTransformation & m_rotation
Definition: TrackCreator.h:82
pandora::StatusCode CreateTracks()
unsigned int m_maxTrackHits
Track quality cut: the maximum number of track hits.
Definition: TrackCreator.h:29
std::string string
Definition: nybbler.cc:12
float m_d0TrackCut
Track d0 cut used to determine whether track can be used to form pfo.
Definition: TrackCreator.h:31
float m_minTrackECalDistanceFromIp
Sanity check on separation between ip and track projected ecal position.
Definition: TrackCreator.h:37
std::set< const gar::rec::Track * > TrackList
Definition: TrackCreator.h:14
TrackCreator(const Settings &settings, const pandora::Pandora *const pPandora, const RotationTransformation *const pRotation)
float m_z0TrackCut
Track z0 cut used to determine whether track can be used to form pfo.
Definition: TrackCreator.h:32
TrackList m_parentTrackList
The list of parent tracks.
Definition: TrackCreator.h:87
bool IsV0(const gar::rec::Track *const pTrack) const
Definition: TrackCreator.h:111
pandora::StatusCode ExtractProngsAndSplits(const art::Event &pEvent)
pandora::StatusCode CreateTrackAssociations(const art::Event &pEvent)
pandora::StatusCode ExtractKinks(const art::Event &pEvent)
const pandora::Pandora & m_pandora
Definition: TrackCreator.h:81
bool IsParent(const gar::rec::Track *const pTrack) const
Definition: TrackCreator.h:118
float m_eCalBarrelInnerPhi0
ECal barrel inner phi 0.
Definition: TrackCreator.h:42
bool PassesQualityCuts(const gar::rec::Track *const pTrack, const PandoraApi::Track::Parameters &trackParameters) const
General GArSoft Utilities.
unsigned int m_minTrackHits
Track quality cut: the minimum number of track hits.
Definition: TrackCreator.h:28
void GetTrackStates(const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const
std::string m_trackCollection
The reconstructed track collection.
Definition: TrackCreator.h:25
pandora::StatusCode ExtractV0s(const art::Event &pEvent)
void CalculateTrackStateAtCalo(const gar::rec::Track *const pTrack, pandora::CartesianVector &posAtCalo) const
void TrackReachesECAL(const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const
std::vector< art::Ptr< gar::rec::Track > > TrackVector
Definition: TrackCreator.h:12
float m_maxTrackSigmaPOverP
Track fraction momentum error cut.
Definition: TrackCreator.h:38
bool IsDaughter(const gar::rec::Track *const pTrack) const
Definition: TrackCreator.h:125
std::vector< gar::rec::Track > RawTrackVector
Definition: TrackCreator.h:13
TrackList m_daughterTrackList
The list of daughter tracks.
Definition: TrackCreator.h:88
void CalculateTimeAtCalo(const gar::rec::Track *const pTrack, float &timeAtCalo) const
void DefineTrackPfoUsage(const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const