ATLAS Offline Software
Classes | Enumerations | Functions
InDetAccessor Namespace Reference

Classes

class  TrackParticleHelper
 
class  TrkTrackHelper
 

Enumerations

enum  ETrackParameters {
  d0 = 0, z0 = 1, phi0 = 2, theta = 3,
  qOverP = 4
}
 

Functions

std::tuple< uint8_t, uint8_t > getSiHitsTopBottom (const Trk::Track &track, const asg::AsgMessaging &msgHelper)
 
template<short index>
double getDefiningParameters (TrackParticleHelper helper, const asg::AsgMessaging &msgHelper)
 
template<short index>
double getDefiningParameters (TrkTrackHelper helper, const asg::AsgMessaging &msgHelper)
 
template<typename T_TrkHelper >
uint8_t getSummary (const T_TrkHelper &helper, const asg::AsgMessaging &msgHelper, xAOD::SummaryType sumType)
 
template<>
uint8_t getSummary (const TrackParticleHelper &helper, const asg::AsgMessaging &msgHelper, xAOD::SummaryType summaryType)
 
template<>
uint8_t getSummary (const TrkTrackHelper &helper, const asg::AsgMessaging &msgHelper, xAOD::SummaryType summaryType)
 
template<std::size_t n_summary_types, typename T_TrkHelper >
uint8_t getSummarySum (const T_TrkHelper helper, const asg::AsgMessaging &msgHelper, std::array< xAOD::SummaryType, n_summary_types > sumTypes)
 
template<typename Trk_Helper >
double getFitChiSquare (const Trk_Helper &helper, const asg::AsgMessaging &msgHelper)
 
template<>
double getFitChiSquare (const TrackParticleHelper &helper, const asg::AsgMessaging &)
 
template<>
double getFitChiSquare (const TrkTrackHelper &helper, const asg::AsgMessaging &msgHelper)
 
template<typename TrkHelper >
double getFitNDoF (const TrkHelper &helper, const asg::AsgMessaging &msgHelper)
 
template<>
double getFitNDoF (const TrackParticleHelper &helper, const asg::AsgMessaging &)
 
template<>
double getFitNDoF (const TrkTrackHelper &helper, const asg::AsgMessaging &msgHelper)
 
template<typename Trk_Helper >
float getEProbabilityHT (const Trk_Helper &helper, const asg::AsgMessaging &msgHelper)
 
template<>
float getEProbabilityHT (const TrackParticleHelper &helper, const asg::AsgMessaging &msgHelper)
 
template<>
float getEProbabilityHT (const TrkTrackHelper &, const asg::AsgMessaging &)
 
template<typename Trk_Helper >
double getDefiningParametersCov (Trk_Helper &helper, [[maybe_unused]] const asg::AsgMessaging &msgHelper, unsigned int index_i, unsigned int index_j)
 
template<>
double getDefiningParametersCov (TrackParticleHelper &helper, [[maybe_unused]] const asg::AsgMessaging &msgHelper, unsigned int index_i, unsigned int index_j)
 
template<>
double getDefiningParametersCov (TrkTrackHelper &helper, const asg::AsgMessaging &msgHelper, unsigned int index_i, unsigned int index_j)
 
template<typename Trk_Helper >
Int_t getNumberOfUsedHitsdEdx (Trk_Helper &helper, const asg::AsgMessaging &msgHelper)
 
template<>
Int_t getNumberOfUsedHitsdEdx (TrackParticleHelper &helper, [[maybe_unused]] const asg::AsgMessaging &msgHelper)
 
template<>
Int_t getNumberOfUsedHitsdEdx (TrkTrackHelper &, const asg::AsgMessaging &)
 
template<typename Trk_Helper >
Int_t getNumberOfIBLOverflowsdEdx (Trk_Helper &helper, const asg::AsgMessaging &msgHelper)
 
template<>
Int_t getNumberOfIBLOverflowsdEdx (TrackParticleHelper &helper, [[maybe_unused]] const asg::AsgMessaging &msgHelper)
 
template<>
Int_t getNumberOfIBLOverflowsdEdx (TrkTrackHelper &, const asg::AsgMessaging &)
 
template<typename Trk_Helper >
std::tuple< uint8_t, uint8_t > getSiHitsTopBottom (Trk_Helper &helper, const asg::AsgMessaging &msgHelper)
 
template<>
std::tuple< uint8_t, uint8_t > getSiHitsTopBottom (TrackParticleHelper &helper, const asg::AsgMessaging &msgHelper)
 
template<>
std::tuple< uint8_t, uint8_t > getSiHitsTopBottom (TrkTrackHelper &helper, const asg::AsgMessaging &msgHelper)
 

Enumeration Type Documentation

◆ ETrackParameters

Enumerator
d0 
z0 
phi0 
theta 
qOverP 

perigee

Definition at line 30 of file InDetAccessor.h.

30  {
31  d0 = 0,
32  z0 = 1,
33  phi0 = 2,
34  theta = 3,
35  qOverP = 4,
36  };

Function Documentation

◆ getDefiningParameters() [1/2]

template<short index>
double InDetAccessor::getDefiningParameters ( TrackParticleHelper  helper,
const asg::AsgMessaging msgHelper 
)
inline

Definition at line 219 of file InDetAccessor.h.

219  {
220  static_assert(index<5);
221  double param = helper.track().definingParameters()[index];
222  if (index==1) {
223  if (helper.vertex()) {
224  param += helper.track().vz() - helper.vertex()->z();
225  }
226  }
227  return param;
228  }

◆ getDefiningParameters() [2/2]

template<short index>
double InDetAccessor::getDefiningParameters ( TrkTrackHelper  helper,
const asg::AsgMessaging msgHelper 
)
inline

Definition at line 233 of file InDetAccessor.h.

233  {
234  assert(index<5);
235  return helper.hasPerigeeOrError(msgHelper) ? helper.perigee()->parameters()[index] : std::nan("");
236  }

◆ getDefiningParametersCov() [1/3]

template<>
double InDetAccessor::getDefiningParametersCov ( TrackParticleHelper helper,
[[maybe_unused] ] const asg::AsgMessaging msgHelper,
unsigned int  index_i,
unsigned int  index_j 
)
inline

Definition at line 244 of file InDetAccessor.h.

244  {
245  assert( index_i<5 && index_j<5);
246  return helper.track().definingParametersCovMatrix()(index_i, index_j);
247  }

◆ getDefiningParametersCov() [2/3]

template<typename Trk_Helper >
double InDetAccessor::getDefiningParametersCov ( Trk_Helper &  helper,
[[maybe_unused] ] const asg::AsgMessaging msgHelper,
unsigned int  index_i,
unsigned int  index_j 
)
inline

◆ getDefiningParametersCov() [3/3]

template<>
double InDetAccessor::getDefiningParametersCov ( TrkTrackHelper helper,
const asg::AsgMessaging msgHelper,
unsigned int  index_i,
unsigned int  index_j 
)
inline

Definition at line 251 of file InDetAccessor.h.

251  {
252  assert( index_i<5 && index_j<5);
253  return helper.hasPerigeeOrError(msgHelper) ? (*helper.perigee()->covariance())(index_i, index_j) : std::nan("");
254  }

◆ getEProbabilityHT() [1/3]

template<>
float InDetAccessor::getEProbabilityHT ( const TrackParticleHelper helper,
const asg::AsgMessaging msgHelper 
)
inline

Definition at line 199 of file InDetAccessor.h.

199  {
200  float eProbHT =0.f;
201  if (!helper.track().summaryValue(eProbHT, xAOD::SummaryType::eProbabilityHT)) {
202  IDTRKSEL_MSG_DEBUG( "Failed to get eProbabilityHT from xAOD::TrackParticle summary. A value of zero will be used instead." );
203  eProbHT =0.f;
204  }
205  return eProbHT;
206  }

◆ getEProbabilityHT() [2/3]

template<typename Trk_Helper >
float InDetAccessor::getEProbabilityHT ( const Trk_Helper &  helper,
const asg::AsgMessaging msgHelper 
)

◆ getEProbabilityHT() [3/3]

template<>
float InDetAccessor::getEProbabilityHT ( const TrkTrackHelper ,
const asg::AsgMessaging  
)
inline

Definition at line 210 of file InDetAccessor.h.

210  {
211  throw std::runtime_error("eProbabilityHT only available in xAOD::TrackParticle not for Trk::Track.");
212  return 0.f;
213  }

◆ getFitChiSquare() [1/3]

template<>
double InDetAccessor::getFitChiSquare ( const TrackParticleHelper helper,
const asg::AsgMessaging  
)
inline

Definition at line 159 of file InDetAccessor.h.

159  {
160  return helper.track().chiSquared();
161  }

◆ getFitChiSquare() [2/3]

template<typename Trk_Helper >
double InDetAccessor::getFitChiSquare ( const Trk_Helper &  helper,
const asg::AsgMessaging msgHelper 
)

◆ getFitChiSquare() [3/3]

template<>
double InDetAccessor::getFitChiSquare ( const TrkTrackHelper helper,
const asg::AsgMessaging msgHelper 
)
inline

Definition at line 165 of file InDetAccessor.h.

165  {
166  if (!helper.track().fitQuality()) {
167  IDTRKSEL_MSG_WARNING( "Zero pointer to fit quality received." );
168  return std::nan("");
169  }
170  return helper.track().fitQuality()->chiSquared();
171  }

◆ getFitNDoF() [1/3]

template<>
double InDetAccessor::getFitNDoF ( const TrackParticleHelper helper,
const asg::AsgMessaging  
)
inline

Definition at line 178 of file InDetAccessor.h.

178  {
179  return helper.track().numberDoF();
180  }

◆ getFitNDoF() [2/3]

template<typename TrkHelper >
double InDetAccessor::getFitNDoF ( const TrkHelper &  helper,
const asg::AsgMessaging msgHelper 
)

◆ getFitNDoF() [3/3]

template<>
double InDetAccessor::getFitNDoF ( const TrkTrackHelper helper,
const asg::AsgMessaging msgHelper 
)
inline

Definition at line 184 of file InDetAccessor.h.

184  {
185  if (!helper.track().fitQuality()) {
186  IDTRKSEL_MSG_WARNING( "Zero pointer to fit quality received." );
187  return std::nan("");
188  }
189  return helper.track().fitQuality()->doubleNumberDoF();
190  }

◆ getNumberOfIBLOverflowsdEdx() [1/3]

template<>
Int_t InDetAccessor::getNumberOfIBLOverflowsdEdx ( TrackParticleHelper helper,
[[maybe_unused] ] const asg::AsgMessaging msgHelper 
)
inline

Definition at line 277 of file InDetAccessor.h.

277  {
278  return helper.track().numberOfUsedHitsdEdx();
279  }

◆ getNumberOfIBLOverflowsdEdx() [2/3]

template<typename Trk_Helper >
Int_t InDetAccessor::getNumberOfIBLOverflowsdEdx ( Trk_Helper &  helper,
const asg::AsgMessaging msgHelper 
)
inline

◆ getNumberOfIBLOverflowsdEdx() [3/3]

template<>
Int_t InDetAccessor::getNumberOfIBLOverflowsdEdx ( TrkTrackHelper ,
const asg::AsgMessaging  
)
inline

Definition at line 283 of file InDetAccessor.h.

283  {
284  throw std::runtime_error("NumberOfIBLOverflowsdEdx only available in xAOD::TrackParticle not for Trk::Track.");
285  return 0;
286  }

◆ getNumberOfUsedHitsdEdx() [1/3]

template<>
Int_t InDetAccessor::getNumberOfUsedHitsdEdx ( TrackParticleHelper helper,
[[maybe_unused] ] const asg::AsgMessaging msgHelper 
)
inline

Definition at line 261 of file InDetAccessor.h.

261  {
262  return helper.track().numberOfUsedHitsdEdx();
263  }

◆ getNumberOfUsedHitsdEdx() [2/3]

template<typename Trk_Helper >
Int_t InDetAccessor::getNumberOfUsedHitsdEdx ( Trk_Helper &  helper,
const asg::AsgMessaging msgHelper 
)
inline

◆ getNumberOfUsedHitsdEdx() [3/3]

template<>
Int_t InDetAccessor::getNumberOfUsedHitsdEdx ( TrkTrackHelper ,
const asg::AsgMessaging  
)
inline

Definition at line 267 of file InDetAccessor.h.

267  {
268  throw std::runtime_error("umberOfUsedHitsdEdx only available in xAOD::TrackParticle not for Trk::Track.");
269  return 0;
270  }

◆ getSiHitsTopBottom() [1/4]

std::tuple< uint8_t, uint8_t > InDetAccessor::getSiHitsTopBottom ( const Trk::Track track,
const asg::AsgMessaging msgHelper 
)

Definition at line 11 of file InDetAccessor.cxx.

11  {
12  std::tuple<uint8_t, uint8_t> top_bottom {0,0};
13 
14  const DataVector<const Trk::MeasurementBase>* trkMeasurements = track.measurementsOnTrack();
15  if (!trkMeasurements) {
16  IDTRKSEL_MSG_WARNING( "Null pointer to Trk::MeasurementBase vector." );
17  }
18  else {
19  // code in here is mostly adapted from InDetCosmicTrackSelectorTool
20  for (const Trk::MeasurementBase* measurement : *trkMeasurements) {
21  const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(measurement);
22  if (!rot) {
23  continue;
24  }
25  const InDet::SiClusterOnTrack* siclus
26  = dynamic_cast<const InDet::SiClusterOnTrack*>(rot);
27  if (!siclus) {
28  continue;
29  }
30  float ypos = siclus->globalPosition().y();
31  if (ypos == 0) {
32  continue; // neither top nor bottom
33  }
34 
35  const InDet::SCT_ClusterOnTrack* sctclus
36  = dynamic_cast<const InDet::SCT_ClusterOnTrack*>(siclus);
37  if (!sctclus) {
38  // Pixel hit
39  if (ypos > 0) {
40  std::get<0>(top_bottom) +=2;
41  }
42  else {
43  std::get<1>(top_bottom)+=2;
44  }
45  } else {
46  // SCT hit
47  if (ypos > 0) {
48  std::get<0>(top_bottom)++;
49  }
50  else {
51  std::get<1>(top_bottom)++;
52  }
53  }
54  }
55  }
56  return top_bottom;
57  }

◆ getSiHitsTopBottom() [2/4]

template<>
std::tuple<uint8_t,uint8_t> InDetAccessor::getSiHitsTopBottom ( TrackParticleHelper helper,
const asg::AsgMessaging msgHelper 
)
inline

Definition at line 296 of file InDetAccessor.h.

296  {
297  const Trk::Track* trkTrack = helper.track().track();
298  if (!trkTrack) {
299  IDTRKSEL_MSG_WARNING( "xAOD::TrackParticle has a null pointer to a Trk::Track." );
300  IDTRKSEL_MSG_WARNING( "Unable to access top/bottom Si hits." );
301  return std::tuple<uint8_t,uint8_t>{};
302  }
303  else {
304  return getSiHitsTopBottom(*trkTrack,msgHelper);
305  }
306  }

◆ getSiHitsTopBottom() [3/4]

template<typename Trk_Helper >
std::tuple<uint8_t,uint8_t> InDetAccessor::getSiHitsTopBottom ( Trk_Helper &  helper,
const asg::AsgMessaging msgHelper 
)
inline

◆ getSiHitsTopBottom() [4/4]

template<>
std::tuple<uint8_t,uint8_t> InDetAccessor::getSiHitsTopBottom ( TrkTrackHelper helper,
const asg::AsgMessaging msgHelper 
)
inline

Definition at line 309 of file InDetAccessor.h.

309  {
310  return getSiHitsTopBottom(helper.track(),msgHelper);
311  }

◆ getSummary() [1/3]

template<typename T_TrkHelper >
uint8_t InDetAccessor::getSummary ( const T_TrkHelper &  helper,
const asg::AsgMessaging msgHelper,
xAOD::SummaryType  sumType 
)

◆ getSummary() [2/3]

template<>
uint8_t InDetAccessor::getSummary ( const TrackParticleHelper helper,
const asg::AsgMessaging msgHelper,
xAOD::SummaryType  summaryType 
)
inline

Definition at line 121 of file InDetAccessor.h.

121  {
122  uint8_t summaryValue = 0;
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." );
125  summaryValue = 0;
126  }
127  return summaryValue;
128  }

◆ getSummary() [3/3]

template<>
uint8_t InDetAccessor::getSummary ( const TrkTrackHelper helper,
const asg::AsgMessaging msgHelper,
xAOD::SummaryType  summaryType 
)
inline

Definition at line 132 of file InDetAccessor.h.

132  {
133  Int_t summaryTypeInt = static_cast<Int_t>(summaryType);
134  Int_t checkSummaryValue = helper.summary().get( static_cast<Trk::SummaryType>(summaryTypeInt) );
135  if (checkSummaryValue < 0) {
136  // Trk::TrackSummary::get() will return -1 if the data cannot be retrieved
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;
139  }
140  return checkSummaryValue;
141  }

◆ getSummarySum()

template<std::size_t n_summary_types, typename T_TrkHelper >
uint8_t InDetAccessor::getSummarySum ( const T_TrkHelper  helper,
const asg::AsgMessaging msgHelper,
std::array< xAOD::SummaryType, n_summary_types >  sumTypes 
)
inline

Definition at line 145 of file InDetAccessor.h.

145  {
146  uint8_t sum=0;
147  for (xAOD::SummaryType sum_type: sumTypes) {
148  sum += getSummary(helper, msgHelper, sum_type);
149  }
150  return sum;
151  }
IDTRKSEL_MSG_WARNING
#define IDTRKSEL_MSG_WARNING(the_msg)
Definition: InDetAccessor.h:24
InDetAccessor::z0
@ z0
Definition: InDetAccessor.h:32
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
index
Definition: index.py:1
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
InDetAccessor::d0
@ d0
Definition: InDetAccessor.h:31
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
IDTRKSEL_MSG_DEBUG
#define IDTRKSEL_MSG_DEBUG(the_msg)
Definition: InDetAccessor.h:23
xAOD::SummaryType
SummaryType
Enumerates the different types of information stored in Summary.
Definition: TrackingPrimitives.h:228
InDet::SiClusterOnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override
returns global position (gathered through Surface constraint)
Definition: SiClusterOnTrack.h:115
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
InDetAccessor::getSummary
uint8_t getSummary(const TrkTrackHelper &helper, const asg::AsgMessaging &msgHelper, xAOD::SummaryType summaryType)
Definition: InDetAccessor.h:132
DataVector< const Trk::MeasurementBase >
Trk::MeasurementBase
Definition: MeasurementBase.h:58
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
DeMoScan.index
string index
Definition: DeMoScan.py:364
xAOD::eProbabilityHT
@ eProbabilityHT
Electron probability from High Threshold (HT) information [float].
Definition: TrackingPrimitives.h:301
Trk::SummaryType
SummaryType
enumerates the different types of information stored in Summary.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:45
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
InDetAccessor::getSiHitsTopBottom
std::tuple< uint8_t, uint8_t > getSiHitsTopBottom(TrkTrackHelper &helper, const asg::AsgMessaging &msgHelper)
Definition: InDetAccessor.h:309
InDet::SiClusterOnTrack
Definition: SiClusterOnTrack.h:39
InDet::SCT_ClusterOnTrack
Definition: SCT_ClusterOnTrack.h:44