Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
gar::gar_pandora::TrackCreator Class Reference

#include <TrackCreator.h>

Classes

class  Settings
 

Public Member Functions

 TrackCreator (const Settings &settings, const pandora::Pandora *const pPandora, const RotationTransformation *const pRotation)
 
virtual ~TrackCreator ()
 
pandora::StatusCode CreateTracks (const art::Event &pEvent)
 
pandora::StatusCode CreateTrackAssociations (const art::Event &pEvent)
 
const TrackVectorGetTrackVector () const
 
void Reset ()
 

Private Member Functions

pandora::StatusCode CreateTracks ()
 
void GetTrackStates (const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const
 
bool PassesQualityCuts (const gar::rec::Track *const pTrack, const PandoraApi::Track::Parameters &trackParameters) const
 
void TrackReachesECAL (const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const
 
void DefineTrackPfoUsage (const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const
 
void CalculateTrackStateAtCalo (const gar::rec::Track *const pTrack, pandora::CartesianVector &posAtCalo) const
 
void CalculateTimeAtCalo (const gar::rec::Track *const pTrack, float &timeAtCalo) const
 
pandora::StatusCode CollectTracks (const art::Event &pEvent, const std::string &label, TrackVector &trkVector)
 
pandora::StatusCode ExtractKinks (const art::Event &pEvent)
 
pandora::StatusCode ExtractProngsAndSplits (const art::Event &pEvent)
 
pandora::StatusCode ExtractV0s (const art::Event &pEvent)
 
bool IsV0 (const gar::rec::Track *const pTrack) const
 
bool IsParent (const gar::rec::Track *const pTrack) const
 
bool IsDaughter (const gar::rec::Track *const pTrack) const
 

Private Attributes

const Settings m_settings
 
const pandora::Pandora & m_pandora
 
const RotationTransformationm_rotation
 
TrackVector artTrkVector
 
TrackVector m_trackVector
 
TrackList m_v0TrackList
 The list of v0 tracks. More...
 
TrackList m_parentTrackList
 The list of parent tracks. More...
 
TrackList m_daughterTrackList
 The list of daughter tracks. More...
 

Detailed Description

Definition at line 16 of file TrackCreator.h.

Constructor & Destructor Documentation

gar::gar_pandora::TrackCreator::TrackCreator ( const Settings settings,
const pandora::Pandora *const  pPandora,
const RotationTransformation *const  pRotation 
)

Definition at line 17 of file TrackCreator.cxx.

18  : m_settings(settings),
19  m_pandora(*pPandora),
20  m_rotation(*pRotation),
21  m_trackVector(0),
25  {
26  }
TrackList m_v0TrackList
The list of v0 tracks.
Definition: TrackCreator.h:86
const RotationTransformation & m_rotation
Definition: TrackCreator.h:82
std::set< const gar::rec::Track * > TrackList
Definition: TrackCreator.h:14
TrackList m_parentTrackList
The list of parent tracks.
Definition: TrackCreator.h:87
const pandora::Pandora & m_pandora
Definition: TrackCreator.h:81
TrackList m_daughterTrackList
The list of daughter tracks.
Definition: TrackCreator.h:88
gar::gar_pandora::TrackCreator::~TrackCreator ( )
virtual

Definition at line 30 of file TrackCreator.cxx.

31  {
32  }

Member Function Documentation

void gar::gar_pandora::TrackCreator::CalculateTimeAtCalo ( const gar::rec::Track *const  pTrack,
float &  timeAtCalo 
) const
private

Definition at line 308 of file TrackCreator.cxx.

309  {
310  const float *trackParams = pTrack->TrackParEnd(); //y, z, omega, phi, lambda
311  const float omega = trackParams[2] / CLHEP::cm;
312  const float tanl = std::tan(trackParams[4]);
313  const float d0(std::sqrt(trackParams[0]*trackParams[0] + trackParams[1]+trackParams[1]) * CLHEP::cm);
314  const float z0(std::fabs(pTrack->Vertex()[0]) * CLHEP::cm);
315 
316  const gar_content::Helix helix(trackParams[3], d0, z0, omega, tanl, m_settings.m_bField);
317  const pandora::CartesianVector &referencePoint(helix.GetReferencePoint());
318 
319  // First project to endcap
320  float minGenericTime(std::numeric_limits<float>::max());
321 
322  pandora::CartesianVector bestECalProjection(0.f, 0.f, 0.f);
323  const int signPx((helix.GetMomentum().GetX() > 0.f) ? 1 : -1);
324  (void) helix.GetPointInX(static_cast<float>(signPx) * m_settings.m_eCalEndCapInnerZ, referencePoint, bestECalProjection, minGenericTime);
325 
326  // Then project to barrel surface(s)
327  pandora::CartesianVector barrelProjection(0.f, 0.f, 0.f);
329  {
330  // Polygon
331  float twopi_n = 2. * M_PI / (static_cast<float>(m_settings.m_eCalBarrelInnerSymmetry));
332 
333  for (int i = 0; i < m_settings.m_eCalBarrelInnerSymmetry; ++i)
334  {
335  float genericTime(std::numeric_limits<float>::max());
336  const float phi(twopi_n * static_cast<float>(i) + m_settings.m_eCalBarrelInnerPhi0);
337 
338  const pandora::StatusCode statusCode(helix.GetPointInZY(m_settings.m_eCalBarrelInnerR * std::cos(phi), m_settings.m_eCalBarrelInnerR * std::sin(phi), std::cos(phi + 0.5 * M_PI), std::sin(phi + 0.5 * M_PI), referencePoint, barrelProjection, genericTime));
339 
340  if ((pandora::STATUS_CODE_SUCCESS == statusCode) && (genericTime < minGenericTime))
341  {
342  minGenericTime = genericTime;
343  bestECalProjection = barrelProjection;
344  }
345  }
346  }
347  else
348  {
349  // Cylinder
350  float genericTime(std::numeric_limits<float>::max());
351  const pandora::StatusCode statusCode(helix.GetPointOnCircle(m_settings.m_eCalBarrelInnerR, referencePoint, barrelProjection, genericTime));
352 
353  if ((pandora::STATUS_CODE_SUCCESS == statusCode) && (genericTime < minGenericTime))
354  {
355  minGenericTime = genericTime;
356  bestECalProjection = barrelProjection;
357  }
358  }
359 
360  if (bestECalProjection.GetMagnitudeSquared() < std::numeric_limits<float>::epsilon())
361  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
362 
363  timeAtCalo = minGenericTime;
364 
365  return;
366  }
static constexpr double cm
Definition: Units.h:68
float m_eCalBarrelInnerR
ECal barrel inner radius.
Definition: TrackCreator.h:43
int m_eCalBarrelInnerSymmetry
ECal barrel inner symmetry order.
Definition: TrackCreator.h:41
float m_eCalEndCapInnerZ
ECal endcap inner z.
Definition: TrackCreator.h:44
const float * Vertex() const
Definition: Track.h:139
const float * TrackParEnd() const
Definition: Track.h:152
static int max(int a, int b)
float m_eCalBarrelInnerPhi0
ECal barrel inner phi 0.
Definition: TrackCreator.h:42
#define M_PI
Definition: includeROOT.h:54
Helix class.
Definition: Helix.h:14
void gar::gar_pandora::TrackCreator::CalculateTrackStateAtCalo ( const gar::rec::Track *const  pTrack,
pandora::CartesianVector &  posAtCalo 
) const
private

Definition at line 280 of file TrackCreator.cxx.

281  {
282  pandora::CartesianVector bestECalProjection(0., 0., 0);
283  float fbestECalProjection[3] = {0., 0., 0.}; float otherECALProjection[3];
284  //Use our TrackPropagator
285  //First propagate to the barrel; 2nd extrapolation isn't used here. Guess it could be.
287  bestECalProjection.SetValues(fbestECalProjection[0] * CLHEP::cm, fbestECalProjection[1] * CLHEP::cm, fbestECalProjection[2] * CLHEP::cm);
288 
289  if( result != 0 ) {
290  //Propagate to the Endcap
291  float endcapProjection[3] = {0., 0., 0.};
292  int result_local = util::TrackPropagator::PropagateToX( pTrack->TrackParEnd(), pTrack->End(), (pTrack->End()[0] > 0) ? m_settings.m_eCalEndCapInnerZ / CLHEP::cm : -m_settings.m_eCalEndCapInnerZ / CLHEP::cm, endcapProjection, m_settings.m_eCalBarrelInnerR / CLHEP::cm );
293 
294  if(result_local == 0) {
295  bestECalProjection.SetValues(endcapProjection[0] * CLHEP::cm, endcapProjection[1] * CLHEP::cm, endcapProjection[2] * CLHEP::cm);
296  }
297  }
298 
299  if (bestECalProjection.GetMagnitudeSquared() < std::numeric_limits<float>::epsilon())
300  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
301 
302  posAtCalo = bestECalProjection;
303 
304  return;
305  }
static constexpr double cm
Definition: Units.h:68
float m_eCalBarrelInnerR
ECal barrel inner radius.
Definition: TrackCreator.h:43
float m_eCalEndCapInnerZ
ECal endcap inner z.
Definition: TrackCreator.h:44
static QCString result
static int PropagateToX(const float *trackpar, const float *Xpoint, const float x, float *retXYZ, const float Rmax=0.0)
const float * TrackParEnd() const
Definition: Track.h:152
static int PropagateToCylinder(const float *trackpar, const float *Xpoint, const float rCyl, const float yCyl, const float zCyl, float *retXYZ1, float *retXYZ2, const float Xmax=0.0, const float epsilon=2.0e-5)
const float * End() const
Definition: Track.h:140
pandora::StatusCode gar::gar_pandora::TrackCreator::CollectTracks ( const art::Event pEvent,
const std::string label,
TrackVector trkVector 
)
private

Definition at line 370 of file TrackCreator.cxx.

371  {
372  auto theTrk = pEvent.getHandle< RawTrackVector >(label);
373  if (!theTrk)
374  {
375  MF_LOG_DEBUG("TrackCreator::CreateTracks") << " Failed to find tracks... " << std::endl;
376  return pandora::STATUS_CODE_NOT_FOUND;
377  }
378 
379  MF_LOG_DEBUG("TrackCreator::CreateTracks") << " Found: " << theTrk->size() << " tracks " << std::endl;
380 
381  for (unsigned int i = 0; i < theTrk->size(); ++i)
382  {
383  const art::Ptr<gar::rec::Track> trk(theTrk, i);
384  trkVector.push_back(trk);
385  }
386 
387  return pandora::STATUS_CODE_SUCCESS;
388  }
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
#define MF_LOG_DEBUG(id)
std::vector< gar::rec::Track > RawTrackVector
Definition: TrackCreator.h:13
QTextStream & endl(QTextStream &s)
pandora::StatusCode gar::gar_pandora::TrackCreator::CreateTrackAssociations ( const art::Event pEvent)

Definition at line 46 of file TrackCreator.cxx.

47  {
48  PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, this->ExtractKinks(pEvent));
49  PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, this->ExtractProngsAndSplits(pEvent));
50  PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, this->ExtractV0s(pEvent));
51 
52  return pandora::STATUS_CODE_SUCCESS;
53  }
pandora::StatusCode ExtractProngsAndSplits(const art::Event &pEvent)
pandora::StatusCode ExtractKinks(const art::Event &pEvent)
pandora::StatusCode ExtractV0s(const art::Event &pEvent)
pandora::StatusCode gar::gar_pandora::TrackCreator::CreateTracks ( const art::Event pEvent)

Definition at line 36 of file TrackCreator.cxx.

37  {
38  PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, this->CollectTracks(pEvent, m_settings.m_trackCollection, artTrkVector));
39  PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, this->CreateTracks());
40 
41  return pandora::STATUS_CODE_SUCCESS;
42  }
pandora::StatusCode CollectTracks(const art::Event &pEvent, const std::string &label, TrackVector &trkVector)
pandora::StatusCode CreateTracks()
std::string m_trackCollection
The reconstructed track collection.
Definition: TrackCreator.h:25
pandora::StatusCode gar::gar_pandora::TrackCreator::CreateTracks ( )
private

Definition at line 78 of file TrackCreator.cxx.

79  {
80  for (TrackVector::const_iterator iter = artTrkVector.begin(), iterEnd = artTrkVector.end(); iter != iterEnd; ++iter)
81  {
82  art::Ptr<gar::rec::Track> artPtrTrack = *iter;
83  const gar::rec::Track *pTrack = artPtrTrack.get();
84 
85  const unsigned int nTrackHits(static_cast<int>(pTrack->NHits()));
86  if ((nTrackHits < m_settings.m_minTrackHits) || (nTrackHits > m_settings.m_maxTrackHits))
87  continue;
88 
89  PandoraApi::Track::Parameters trackParameters;
90 
91  const float *trackParams = pTrack->TrackParBeg(); //y, z, omega, phi, lambda
92  const float omega = trackParams[2] / CLHEP::cm;
93  const float d0 = std::sqrt(trackParams[0]*trackParams[0] + trackParams[1]*trackParams[1]) * CLHEP::cm;
94  const float z0 = pTrack->Vertex()[0] * CLHEP::cm;
95 
96  trackParameters.m_pParentAddress = (void*)pTrack;
97  trackParameters.m_d0 = d0;
98  trackParameters.m_z0 = z0;
99 
100  trackParameters.m_particleId = (omega > 0) ? pandora::MU_PLUS : pandora::MU_MINUS;
101  trackParameters.m_mass = pandora::PdgTable::GetParticleMass(pandora::MU_PLUS);
102 
103  if (std::numeric_limits<float>::epsilon() < std::fabs(omega))
104  trackParameters.m_charge = static_cast<int>(omega / std::fabs(omega));
105 
106  try
107  {
108  this->GetTrackStates(pTrack, trackParameters);
109  this->TrackReachesECAL(pTrack, trackParameters);
110  this->DefineTrackPfoUsage(pTrack, trackParameters);
111 
112  MF_LOG_DEBUG("TrackCreator::CreateTracks()")
113  << "Creating Track " << pTrack << "\n"
114  << " starting at " << trackParameters.m_trackStateAtStart.Get() << "\n"
115  << " ending at " << trackParameters.m_trackStateAtEnd.Get() << "\n"
116  << " state at calo " << trackParameters.m_trackStateAtCalorimeter.Get() << "\n"
117  << " with momentum " << trackParameters.m_momentumAtDca.Get() << "\n"
118  << " magnitude " << trackParameters.m_momentumAtDca.Get().GetMagnitude() << " GeV\n"
119  << " can form PFO " << trackParameters.m_canFormPfo.Get() << "\n"
120  << " can form clusterless PFO " << trackParameters.m_canFormClusterlessPfo.Get() << "\n"
121  << " time at calo " << trackParameters.m_timeAtCalorimeter.Get() << " ns";
122 
123  PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Track::Create(m_pandora, trackParameters));
124  m_trackVector.push_back(artPtrTrack);
125  }
126  catch (pandora::StatusCodeException &statusCodeException)
127  {
128  MF_LOG_DEBUG("TrackCreator::CreateTracks")
129  << "Failed to extract a track: " << statusCodeException.ToString();
130  }
131 
132  }
133 
134  return pandora::STATUS_CODE_SUCCESS;
135  }
static constexpr double cm
Definition: Units.h:68
const float * TrackParBeg() const
Definition: Track.h:151
unsigned int m_maxTrackHits
Track quality cut: the maximum number of track hits.
Definition: TrackCreator.h:29
intermediate_table::const_iterator const_iterator
const float * Vertex() const
Definition: Track.h:139
const pandora::Pandora & m_pandora
Definition: TrackCreator.h:81
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
void TrackReachesECAL(const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const
#define MF_LOG_DEBUG(id)
size_t const & NHits() const
Definition: Track.h:150
T const * get() const
Definition: Ptr.h:149
void DefineTrackPfoUsage(const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const
void gar::gar_pandora::TrackCreator::DefineTrackPfoUsage ( const gar::rec::Track *const  pTrack,
PandoraApi::Track::Parameters &  trackParameters 
) const
private

Definition at line 216 of file TrackCreator.cxx.

217  {
218  bool canFormPfo(false);
219  bool canFormClusterlessPfo(false);
220 
221  if (trackParameters.m_reachesCalorimeter.Get() && !this->IsParent(pTrack))
222  {
223  const float *trackParams = pTrack->TrackParEnd(); //y, z, omega, phi, lambda
224  const float d0(std::sqrt(trackParams[0]*trackParams[0] + trackParams[1]+trackParams[1]) * CLHEP::cm);
225  const float z0(std::fabs(pTrack->Vertex()[0]) * CLHEP::cm);
226 
227  if (this->PassesQualityCuts(pTrack, trackParameters))
228  {
229  const pandora::CartesianVector &momentumAtDca(trackParameters.m_momentumAtDca.Get());
230  const bool isV0(this->IsV0(pTrack));
231  const bool isDaughter(this->IsDaughter(pTrack));
232 
233  // Decide whether track can be associated with a pandora cluster and used to form a charged PFO
234  if ((d0 < m_settings.m_d0TrackCut) && (z0 < m_settings.m_z0TrackCut))
235  {
236  canFormPfo = true;
237  }
238  else if (isV0 || isDaughter)
239  {
240  canFormPfo = true;
241  }
242 
243  // Decide whether track can be used to form a charged PFO, even if track fails to be associated with a pandora cluster
244  const float particleMass(trackParameters.m_mass.Get());
245  const float trackEnergy(std::sqrt(momentumAtDca.GetMagnitudeSquared() + particleMass * particleMass));
246 
248  {
250  {
251  canFormClusterlessPfo = true;
252  }
253  else if (isV0 || isDaughter)
254  {
255  canFormClusterlessPfo = true;
256  }
257  }
258  }
259  else if (this->IsDaughter(pTrack) || this->IsV0(pTrack))
260  {
261  MF_LOG_DEBUG("TrackCreator::DefineTrackPfoUsage")
262  << "Recovering daughter or v0 track "
263  << trackParameters.m_momentumAtDca.Get().GetMagnitude();
264  canFormPfo = true;
265  }
266 
267  MF_LOG_DEBUG("TrackCreator::DefineTrackPfoUsage")
268  << " -- track canFormPfo = " << canFormPfo
269  << " - canFormClusterlessPfo = " << canFormClusterlessPfo;
270 
271  }
272 
273  trackParameters.m_canFormPfo = canFormPfo;
274  trackParameters.m_canFormClusterlessPfo = canFormClusterlessPfo;
275 
276  return;
277  }
static constexpr double cm
Definition: Units.h:68
float m_d0TrackCut
Track d0 cut used to determine whether track can be used to form pfo.
Definition: TrackCreator.h:31
float m_z0TrackCut
Track z0 cut used to determine whether track can be used to form pfo.
Definition: TrackCreator.h:32
bool IsV0(const gar::rec::Track *const pTrack) const
Definition: TrackCreator.h:111
const float * Vertex() const
Definition: Track.h:139
const float * TrackParEnd() const
Definition: Track.h:152
bool IsParent(const gar::rec::Track *const pTrack) const
Definition: TrackCreator.h:118
bool PassesQualityCuts(const gar::rec::Track *const pTrack, const PandoraApi::Track::Parameters &trackParameters) const
#define MF_LOG_DEBUG(id)
bool IsDaughter(const gar::rec::Track *const pTrack) const
Definition: TrackCreator.h:125
pandora::StatusCode gar::gar_pandora::TrackCreator::ExtractKinks ( const art::Event pEvent)
private

Definition at line 57 of file TrackCreator.cxx.

58  {
59  return pandora::STATUS_CODE_SUCCESS;
60  }
pandora::StatusCode gar::gar_pandora::TrackCreator::ExtractProngsAndSplits ( const art::Event pEvent)
private

Definition at line 64 of file TrackCreator.cxx.

65  {
66  return pandora::STATUS_CODE_SUCCESS;
67  }
pandora::StatusCode gar::gar_pandora::TrackCreator::ExtractV0s ( const art::Event pEvent)
private

Definition at line 71 of file TrackCreator.cxx.

72  {
73  return pandora::STATUS_CODE_SUCCESS;
74  }
void gar::gar_pandora::TrackCreator::GetTrackStates ( const gar::rec::Track *const  pTrack,
PandoraApi::Track::Parameters &  trackParameters 
) const
private

Definition at line 139 of file TrackCreator.cxx.

140  {
141  const float *trackParams = pTrack->TrackParEnd(); //y, z, omega, phi, lambda
142  const float omega = trackParams[2] / CLHEP::cm;
143 
144  //Track momentum
145  const double pt(m_settings.m_bField * 2.99792e-4 / std::fabs(omega));
146  const pandora::CartesianVector momentum = pandora::CartesianVector(std::cos(trackParams[3]), std::sin(trackParams[3]), std::tan(trackParams[4])) * pt;
147  const pandora::CartesianVector newmomentum = m_rotation.MakeRotation(momentum);
148  trackParameters.m_momentumAtDca = newmomentum;
149 
150  //Track state at begin and end
151  const pandora::CartesianVector startPosition(pTrack->Vertex()[0] * CLHEP::cm, pTrack->Vertex()[1] * CLHEP::cm, pTrack->Vertex()[2] * CLHEP::cm);
152  const pandora::CartesianVector endPosition(pTrack->End()[0] * CLHEP::cm, pTrack->End()[1] * CLHEP::cm, pTrack->End()[2] * CLHEP::cm);
153  const pandora::CartesianVector newstartPosition = m_rotation.MakeRotation(startPosition);
154  const pandora::CartesianVector newendPosition = m_rotation.MakeRotation(endPosition);
155 
156  trackParameters.m_trackStateAtStart = pandora::TrackState(newstartPosition, momentum);
157  trackParameters.m_trackStateAtEnd = pandora::TrackState(newendPosition, momentum);
158 
159  pandora::CartesianVector calorimeterPosition(0., 0., 0.);
160  float minGenericTime(0.);
161  this->CalculateTrackStateAtCalo(pTrack, calorimeterPosition);
162  this->CalculateTimeAtCalo(pTrack, minGenericTime);
163 
164  const pandora::CartesianVector newcalorimeterPosition = m_rotation.MakeRotation(calorimeterPosition);
165  trackParameters.m_trackStateAtCalorimeter = pandora::TrackState(newcalorimeterPosition, momentum);
166  trackParameters.m_isProjectedToEndCap = ((std::fabs(trackParameters.m_trackStateAtCalorimeter.Get().GetPosition().GetX()) < m_settings.m_eCalEndCapInnerZ) ? false : true);
167 
168  // Convert generic time (length from reference point to intersection, divided by momentum) into nanoseconds
169  const float particleMass(trackParameters.m_mass.Get());
170  const float particleEnergy(std::sqrt(particleMass * particleMass + trackParameters.m_momentumAtDca.Get().GetMagnitudeSquared()));
171  trackParameters.m_timeAtCalorimeter = minGenericTime * particleEnergy / 299.792f;
172  }
static constexpr double cm
Definition: Units.h:68
float m_eCalEndCapInnerZ
ECal endcap inner z.
Definition: TrackCreator.h:44
const RotationTransformation & m_rotation
Definition: TrackCreator.h:82
const float * Vertex() const
Definition: Track.h:139
const float * TrackParEnd() const
Definition: Track.h:152
const float * End() const
Definition: Track.h:140
const pandora::CartesianVector MakeRotation(const pandora::CartesianVector &initialVec) const
void CalculateTrackStateAtCalo(const gar::rec::Track *const pTrack, pandora::CartesianVector &posAtCalo) const
def momentum(x1, x2, x3, scale=1.)
void CalculateTimeAtCalo(const gar::rec::Track *const pTrack, float &timeAtCalo) const
const TrackVector & gar::gar_pandora::TrackCreator::GetTrackVector ( ) const
inline

Definition at line 93 of file TrackCreator.h.

94  {
95  return m_trackVector;
96  }
bool gar::gar_pandora::TrackCreator::IsDaughter ( const gar::rec::Track *const  pTrack) const
inlineprivate

Definition at line 125 of file TrackCreator.h.

126  {
127  return (m_daughterTrackList.end() != m_daughterTrackList.find(pTrack));
128  }
TrackList m_daughterTrackList
The list of daughter tracks.
Definition: TrackCreator.h:88
bool gar::gar_pandora::TrackCreator::IsParent ( const gar::rec::Track *const  pTrack) const
inlineprivate

Definition at line 118 of file TrackCreator.h.

119  {
120  return (m_parentTrackList.end() != m_parentTrackList.find(pTrack));
121  }
TrackList m_parentTrackList
The list of parent tracks.
Definition: TrackCreator.h:87
bool gar::gar_pandora::TrackCreator::IsV0 ( const gar::rec::Track *const  pTrack) const
inlineprivate

Definition at line 111 of file TrackCreator.h.

112  {
113  return (m_v0TrackList.end() != m_v0TrackList.find(pTrack));
114  }
TrackList m_v0TrackList
The list of v0 tracks.
Definition: TrackCreator.h:86
bool gar::gar_pandora::TrackCreator::PassesQualityCuts ( const gar::rec::Track *const  pTrack,
const PandoraApi::Track::Parameters &  trackParameters 
) const
private

Definition at line 176 of file TrackCreator.cxx.

177  {
178  if (trackParameters.m_trackStateAtCalorimeter.Get().GetPosition().GetMagnitude() < m_settings.m_minTrackECalDistanceFromIp)
179  return false;
180 
181  if (std::fabs(pTrack->TrackParEnd()[2] / CLHEP::cm) < std::numeric_limits<float>::epsilon())
182  {
183  MF_LOG_ERROR("TrackCreator::PassesQualityCuts")
184  << "Track has Omega = 0 ";
185  return false;
186  }
187 
188  // Check momentum uncertainty is reasonable to use track
189  const pandora::CartesianVector &momentumAtDca(trackParameters.m_momentumAtDca.Get());
190  const float sigmaPOverP(std::sqrt(pTrack->CovMatEndPacked()[5]) / std::fabs( pTrack->TrackParEnd()[2] / CLHEP::cm ));
191 
192  if (sigmaPOverP > m_settings.m_maxTrackSigmaPOverP)
193  {
194  MF_LOG_WARNING("TrackCreator::PassesQualityCuts")
195  << " Dropping track : " << momentumAtDca.GetMagnitude()
196  << " +- " << sigmaPOverP * (momentumAtDca.GetMagnitude())
197  << " chi2 = " << pTrack->ChisqForward();
198  return false;
199  }
200 
201  return true;
202  }
static constexpr double cm
Definition: Units.h:68
float m_minTrackECalDistanceFromIp
Sanity check on separation between ip and track projected ecal position.
Definition: TrackCreator.h:37
#define MF_LOG_ERROR(category)
const float * TrackParEnd() const
Definition: Track.h:152
float const & ChisqForward() const
Definition: Track.h:148
float m_maxTrackSigmaPOverP
Track fraction momentum error cut.
Definition: TrackCreator.h:38
#define MF_LOG_WARNING(category)
const float * CovMatEndPacked() const
Definition: Track.h:154
void gar::gar_pandora::TrackCreator::Reset ( )
inline

Definition at line 100 of file TrackCreator.h.

101  {
102  artTrkVector.clear();
103  m_trackVector.clear();
104  m_v0TrackList.clear();
105  m_parentTrackList.clear();
106  m_daughterTrackList.clear();
107  }
TrackList m_v0TrackList
The list of v0 tracks.
Definition: TrackCreator.h:86
TrackList m_parentTrackList
The list of parent tracks.
Definition: TrackCreator.h:87
TrackList m_daughterTrackList
The list of daughter tracks.
Definition: TrackCreator.h:88
void gar::gar_pandora::TrackCreator::TrackReachesECAL ( const gar::rec::Track *const  pTrack,
PandoraApi::Track::Parameters &  trackParameters 
) const
private

Definition at line 206 of file TrackCreator.cxx.

207  {
208  trackParameters.m_reachesCalorimeter = true;
209  return;
210 
211  //Do a check later on with the track state at the calo!
212  }

Member Data Documentation

TrackVector gar::gar_pandora::TrackCreator::artTrkVector
private

Definition at line 84 of file TrackCreator.h.

TrackList gar::gar_pandora::TrackCreator::m_daughterTrackList
private

The list of daughter tracks.

Definition at line 88 of file TrackCreator.h.

const pandora::Pandora& gar::gar_pandora::TrackCreator::m_pandora
private

Definition at line 81 of file TrackCreator.h.

TrackList gar::gar_pandora::TrackCreator::m_parentTrackList
private

The list of parent tracks.

Definition at line 87 of file TrackCreator.h.

const RotationTransformation& gar::gar_pandora::TrackCreator::m_rotation
private

Definition at line 82 of file TrackCreator.h.

const Settings gar::gar_pandora::TrackCreator::m_settings
private

Definition at line 80 of file TrackCreator.h.

TrackVector gar::gar_pandora::TrackCreator::m_trackVector
private

Definition at line 85 of file TrackCreator.h.

TrackList gar::gar_pandora::TrackCreator::m_v0TrackList
private

The list of v0 tracks.

Definition at line 86 of file TrackCreator.h.


The documentation for this class was generated from the following files: