|
ATLAS Offline Software
|
Go to the documentation of this file.
4 #ifndef _InDetAccessor_H_
5 #define _InDetAccessor_H_
22 #define IDTRKSEL_MSG(msg_type,the_msg) if (msgHelper.msgLvl(msg_type)) { msgHelper.msg() << the_msg << endmsg; } do {} while (false)
23 #define IDTRKSEL_MSG_DEBUG(the_msg) IDTRKSEL_MSG(MSG::DEBUG,the_msg)
24 #define IDTRKSEL_MSG_WARNING(the_msg) IDTRKSEL_MSG(MSG::WARNING,the_msg)
25 #define IDTRKSEL_MSG_ERROR(the_msg) IDTRKSEL_MSG(MSG::ERROR,the_msg)
40 class TrackParticleHelper;
41 template <
short index>
46 template <
short index>
60 double theta(
const asg::AsgMessaging &msgHelper)
const {
return getDefiningParameters<InDetAccessor::theta>(*
this,msgHelper); }
62 double d0(
const asg::AsgMessaging &msgHelper)
const {
return getDefiningParameters<InDetAccessor::d0>(*
this,msgHelper);}
63 double z0(
const asg::AsgMessaging &msgHelper)
const {
return getDefiningParameters<InDetAccessor::z0>(*
this,msgHelper);}
86 double theta(
const asg::AsgMessaging &msgHelper)
const {
return getDefiningParameters<InDetAccessor::theta>(*
this,msgHelper);}
90 double d0(
const asg::AsgMessaging &msgHelper)
const {
return getDefiningParameters<InDetAccessor::d0>(*
this,msgHelper);}
91 double z0(
const asg::AsgMessaging &msgHelper)
const {
return getDefiningParameters<InDetAccessor::z0>(*
this,msgHelper);}
117 template <
typename T_TrkHelper>
123 if (!
helper.track().summaryValue(summaryValue, summaryType)) {
124 IDTRKSEL_MSG_DEBUG(
"Failed to get SummaryType " <<
std::to_string(summaryType) <<
" from xAOD::TrackParticle summary. A value of zero will be used instead." );
130 #ifndef XAOD_ANALYSIS
133 Int_t summaryTypeInt =
static_cast<Int_t
>(summaryType);
135 if (checkSummaryValue < 0) {
137 IDTRKSEL_MSG_DEBUG(
"Received " << checkSummaryValue <<
" for SummaryType " <<
std::to_string(summaryType) <<
" from Trk::TrackSummary. A value of zero will be used instead." );
138 checkSummaryValue = 0;
140 return checkSummaryValue;
144 template <std::
size_t n_summary_types,
typename T_TrkHelper>
155 template <
typename Trk_Helper>
160 return helper.track().chiSquared();
163 #ifndef XAOD_ANALYSIS
166 if (!
helper.track().fitQuality()) {
170 return helper.track().fitQuality()->chiSquared();
174 template <
typename TrkHelper>
179 return helper.track().numberDoF();
182 #ifndef XAOD_ANALYSIS
185 if (!
helper.track().fitQuality()) {
189 return helper.track().fitQuality()->doubleNumberDoF();
195 template <
typename Trk_Helper>
202 IDTRKSEL_MSG_DEBUG(
"Failed to get eProbabilityHT from xAOD::TrackParticle summary. A value of zero will be used instead." );
208 #ifndef XAOD_ANALYSIS
211 throw std::runtime_error(
"eProbabilityHT only available in xAOD::TrackParticle not for Trk::Track.");
218 template <
short index>
220 static_assert(
index<5);
221 double param =
helper.track().definingParameters()[
index];
230 #ifndef XAOD_ANALYSIS
231 template <
short index>
235 return helper.hasPerigeeOrError(msgHelper) ?
helper.perigee()->parameters()[
index] : std::nan(
"");
240 template <
typename Trk_Helper>
245 assert( index_i<5 && index_j<5);
246 return helper.track().definingParametersCovMatrix()(index_i, index_j);
249 #ifndef XAOD_ANALYSIS
252 assert( index_i<5 && index_j<5);
253 return helper.hasPerigeeOrError(msgHelper) ? (*
helper.perigee()->covariance())(index_i, index_j) : std::nan(
"");
257 template <
typename Trk_Helper>
262 return helper.track().numberOfUsedHitsdEdx();
265 #ifndef XAOD_ANALYSIS
268 throw std::runtime_error(
"umberOfUsedHitsdEdx only available in xAOD::TrackParticle not for Trk::Track.");
273 template <
typename Trk_Helper>
278 return helper.track().numberOfUsedHitsdEdx();
281 #ifndef XAOD_ANALYSIS
284 throw std::runtime_error(
"NumberOfIBLOverflowsdEdx only available in xAOD::TrackParticle not for Trk::Track.");
289 #ifndef XAOD_ANALYSIS
292 template <
typename Trk_Helper>
301 return std::tuple<uint8_t,uint8_t>{};
#define IDTRKSEL_MSG_WARNING(the_msg)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
#define IDTRKSEL_MSG_ERROR(the_msg)
const Trk::TrackSummary * m_summary
bool hasPerigeeOrError(const asg::AsgMessaging &msgHelper) const
double d0(const asg::AsgMessaging &msgHelper) const
const xAOD::Vertex * m_vtx
const Trk::TrackParameters * m_perigee
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
double z0(const asg::AsgMessaging &msgHelper) const
uint8_t getSummarySum(const T_TrkHelper helper, const asg::AsgMessaging &msgHelper, std::array< xAOD::SummaryType, n_summary_types > sumTypes)
const Trk::TrackParameters * perigee() const
std::tuple< uint8_t, uint8_t > getSiHitsTopBottom(const Trk::Track &track, const asg::AsgMessaging &msgHelper)
double d0(const asg::AsgMessaging &msgHelper) const
double eta(const asg::AsgMessaging &msgHelper) const
TrkTrackHelper(const Trk::Track &a_track, const Trk::TrackSummary &summary, const Trk::TrackParameters *a_perigee)
#define IDTRKSEL_MSG_DEBUG(the_msg)
float getEProbabilityHT(const Trk_Helper &helper, const asg::AsgMessaging &msgHelper)
SummaryType
Enumerates the different types of information stored in Summary.
double getFitChiSquare(const Trk_Helper &helper, const asg::AsgMessaging &msgHelper)
const Trk::TrackSummary & summary() const
double getDefiningParameters(TrackParticleHelper helper, const asg::AsgMessaging &msgHelper)
double qOverP(const asg::AsgMessaging &msgHelper) const
double theta(const asg::AsgMessaging &msgHelper) const
const xAOD::TrackParticle * m_track
Int_t getNumberOfUsedHitsdEdx(Trk_Helper &helper, const asg::AsgMessaging &msgHelper)
float qOverP() const
Returns the parameter.
double getFitNDoF(const TrkHelper &helper, const asg::AsgMessaging &msgHelper)
double theta(const asg::AsgMessaging &msgHelper) const
double z0(const asg::AsgMessaging &msgHelper) const
A summary of the information contained by a track.
Int_t getNumberOfIBLOverflowsdEdx(Trk_Helper &helper, const asg::AsgMessaging &msgHelper)
Class mimicking the AthMessaging class from the offline software.
std::string to_string(const DetectorType &type)
double getDefiningParametersCov(Trk_Helper &helper, [[maybe_unused]] const asg::AsgMessaging &msgHelper, unsigned int index_i, unsigned int index_j)
const xAOD::TrackParticle & track() const
const Amg::Vector3D & momentum() const
Access method for the momentum.
uint8_t getSummary(const T_TrkHelper &helper, const asg::AsgMessaging &msgHelper, xAOD::SummaryType sumType)
Class describing a Vertex.
const Trk::Track & track() const
double pt(const asg::AsgMessaging &) const
double qOverP(const asg::AsgMessaging &) const
@ eProbabilityHT
Electron probability from High Threshold (HT) information [float].
bool hasSummaryOrError(const asg::AsgMessaging &msgHelper) const
double eta(const asg::AsgMessaging &) const
SummaryType
enumerates the different types of information stored in Summary.
Class describing a TrackParticle.
TrackParticleHelper(const xAOD::TrackParticle &a_track, const xAOD::Vertex *a_vtx)
const xAOD::Vertex * vertex() const
const Trk::Track * m_track
double pt(const asg::AsgMessaging &msgHelper) const