85 const unsigned int nTrackHits(static_cast<int>(pTrack->
NHits()));
89 PandoraApi::Track::Parameters trackParameters;
92 const float omega = trackParams[2] /
CLHEP::cm;
93 const float d0 = std::sqrt(trackParams[0]*trackParams[0] + trackParams[1]*trackParams[1]) *
CLHEP::cm;
96 trackParameters.m_pParentAddress = (
void*)pTrack;
97 trackParameters.m_d0 = d0;
98 trackParameters.m_z0 = z0;
100 trackParameters.m_particleId = (omega > 0) ? pandora::MU_PLUS : pandora::MU_MINUS;
101 trackParameters.m_mass = pandora::PdgTable::GetParticleMass(pandora::MU_PLUS);
103 if (std::numeric_limits<float>::epsilon() < std::fabs(omega))
104 trackParameters.m_charge =
static_cast<int>(omega / std::fabs(omega));
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";
123 PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Track::Create(
m_pandora, trackParameters));
126 catch (pandora::StatusCodeException &statusCodeException)
129 <<
"Failed to extract a track: " << statusCodeException.ToString();
134 return pandora::STATUS_CODE_SUCCESS;
static constexpr double cm
const float * TrackParBeg() const
unsigned int m_maxTrackHits
Track quality cut: the maximum number of track hits.
const Settings m_settings
const float * Vertex() const
const pandora::Pandora & m_pandora
unsigned int m_minTrackHits
Track quality cut: the minimum number of track hits.
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
size_t const & NHits() const
TrackVector m_trackVector
void DefineTrackPfoUsage(const gar::rec::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const