ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
InDet::TRT_ElectronPidToolRun2 Class Reference

#include <TRT_ElectronPidToolRun2.h>

Inheritance diagram for InDet::TRT_ElectronPidToolRun2:
Collaboration diagram for InDet::TRT_ElectronPidToolRun2:

Public Member Functions

 TRT_ElectronPidToolRun2 (const std::string &, const std::string &, const IInterface *)
 
virtual ~TRT_ElectronPidToolRun2 ()
 default destructor More...
 
virtual StatusCode initialize () override
 standard Athena-Algorithm method More...
 
virtual StatusCode finalize () override
 standard Athena-Algorithm method More...
 
virtual std::vector< float > electronProbability (const EventContext &ctx, const Trk::Track &track) const override final
 Electron probabilities to be returned. More...
 
virtual double probHT (const double pTrk, const Trk::ParticleHypothesis hypothesis, const int HitPart, const int Layer, const int Strawlayer) const override final
 return high threshold probability More...
 
virtual double probHTRun2 (const EventContext &ctx, float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkWire, float Occupancy) const override final
 
std::vector< float > electronProbability (const Trk::Track &track) const
 
double probHTRun2 (float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkWire, float Occupancy) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static std::vector< float > electronProbability_old (const Trk::Track &track)
 Electron probabilities to be returned. More...
 
static const InterfaceID & interfaceID ()
 
static const InterfaceID & interfaceID ()
 AlgTool interface methods. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

bool CheckGeometry (int BEC, int Layer, int Strawlayer) const
 
double sqr (double a)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

const TRT_IDm_trtId
 
unsigned int m_minTRThits
 
float m_ptMinNN
 
bool m_calculateNN
 
ToolHandle< ITRT_ToT_dEdxm_TRTdEdxTool
 
ToolHandle< InDet::ITRT_LocalOccupancym_LocalOccTool
 
ToolHandle< ITRT_StrawStatusSummaryToolm_TRTStrawSummaryTool
 
SG::ReadCondHandleKey< HTcalculatorm_HTReadKey
 
SG::ReadCondHandleKey< InDet::TRTPIDNNm_TRTPIDNNReadKey
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

TRT_ElectronPidToolRun2 is a tool for identification of electrons based on information mainly from the TRT and partially from the whole ID. Given a track, multiple quantities are calculated (see also TrkTrackSummary/TrackSummary.h):

1: eProbabilityComb - combined probability from High Threshold (HT) and Time-over- Threshold (ToT) information (see below).

2: eProbabilityHT - likelihood calculated using High Threshold (HT) information. Sensitive to Transition Radiation (TR) photons emitted by electrons, when traversing the TRT radiator material between the straws. Electrons start to emit TR at 500 MeV, but only fully at 5 GeV.

3: eProbabilityToT - likelihood calculated using Time-over-Threshold (ToT) information. Sensitive to (increased) ionization by electrons compared to heavier particles (eg. pions, protons, etc.). ToT is computed only for straws without a HT hit (to avoid correlations). The separation is largest at low momentum, and deminishes with increased energy.

4: eProbabilityBrem - Electron probability from Brem fitting (DNA).

5: eProbabilityNN - neural network that combines HT, ToT and other hit- and track-level properties into a combined classifier.

6: TRTTrackOccupancy - fraction of TRT straws that fired in the modules that are traversed by the track.

7: TRTdEdx - calibrated dE/dx measurement from all TRT hits along the track (see TRT_ToT_dEdx.h).

8: eProbabilityNumberOfTRTHitsUsedFordEdx - number of good TRT hits that entered the dE/dx calculation.

Definition at line 88 of file TRT_ElectronPidToolRun2.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TRT_ElectronPidToolRun2()

InDet::TRT_ElectronPidToolRun2::TRT_ElectronPidToolRun2 ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 71 of file TRT_ElectronPidToolRun2.cxx.

72  :
73  AthAlgTool(t,n,p),
74  m_trtId(nullptr),
75  m_minTRThits(5),
76  m_ptMinNN(2000.),
77  m_calculateNN(true)
78 {
79  declareInterface<ITRT_ElectronPidTool>(this);
80  declareInterface<ITRT_ElectronToTTool>(this);
81  declareProperty("MinimumTRThitsForIDpid", m_minTRThits);
82  declareProperty("MinimumTrackPtForNNPid", m_ptMinNN);
83  declareProperty("CalculateNNPid", m_calculateNN);
84 }

◆ ~TRT_ElectronPidToolRun2()

InDet::TRT_ElectronPidToolRun2::~TRT_ElectronPidToolRun2 ( )
virtualdefault

default destructor

Member Function Documentation

◆ CheckGeometry()

bool InDet::TRT_ElectronPidToolRun2::CheckGeometry ( int  BEC,
int  Layer,
int  Strawlayer 
) const
private

Definition at line 563 of file TRT_ElectronPidToolRun2.cxx.

563  {
564 
565  //first check that the BEC is valid:
566  if( BEC!=-2 && BEC !=-1 && BEC!=1 && BEC!=2){
567  ATH_MSG_ERROR("Found a wrong TRT part: "<<BEC<<" expected one of (-2,-1,1,2)");
568  return false;
569  }
570  const int part = abs(BEC)-1;
571 
572  //next check that the layer is valid
573  if( Layer < 0){
574  ATH_MSG_ERROR("Found a negative TRT Layer");
575  return false; //must be positive
576  }
577 
578  static const int nlayers[2]={3,14};
579 
580  if( not ( Layer < nlayers[part] ) ){
581  ATH_MSG_ERROR("Found TRT Layer index "<<Layer<<" in part "<<BEC<<" but part only has "<<nlayers[part]<<" layers.");
582  return false;
583  }
584 
585  //and finally check that the StrawLayer is valid:
586  if( StrawLayer < 0){
587  ATH_MSG_ERROR("Found a negative TRT StrawLayer");
588  return false; //must be positive
589  }
590 
591  static const int strawsPerBEC[2][14]={{19,24,30, 0, 0, 0,0,0,0,0,0,0,0,0},
592  {16,16,16,16,16,16,8,8,8,8,8,8,8,8}};
593 
594  if(not(StrawLayer < strawsPerBEC[part][Layer])){
595  ATH_MSG_ERROR("TRT part " << BEC << " Layer " << Layer << " only has "
596  << strawsPerBEC[part][Layer]
597  << " straws. Found index " << StrawLayer);
598  return false;
599  }
600 
601  return true;
602 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ electronProbability() [1/2]

std::vector< float > InDet::TRT_ElectronPidToolRun2::electronProbability ( const EventContext &  ctx,
const Trk::Track track 
) const
finaloverridevirtual

Electron probabilities to be returned.

Implements Trk::ITRT_ElectronPidTool.

Definition at line 148 of file TRT_ElectronPidToolRun2.cxx.

151 {
152 
153  // Get the probability calculator
155  const HTcalculator* HTcalc = (*readHandle);
156  // make sure some calibration is available
157  if(HTcalc==nullptr) {
158  ATH_MSG_WARNING (" No Pid calibration from the DB.");
159  }
160 
161  // Get the PID NN
162  const InDet::TRTPIDNN* PIDNN = nullptr;
163  if (m_calculateNN) {
165  PIDNN = (*readHandlePIDNN);
166  // make sure some calibration is available
167  if(PIDNN==nullptr) {
168  ATH_MSG_WARNING (" No PID NN available from the DB.");
169  }
170  }
171 
172  // Initialize the vector with default PID values
173  std::vector<float> PIDvalues = Trk::eProbabilityDefault;
174 
175  // Check for perigee:
176  const Trk::TrackParameters* perigee = track.perigeeParameters();
177  if (!perigee) return PIDvalues;
178 
179  // Get parameters at perigee and check that they are reasonable:
180  const AmgVector(Trk::TrackParameters::dim)& parameterVector = perigee->parameters();
181  double qOverP = parameterVector[Trk::qOverP];
182  double theta = parameterVector[Trk::theta];
183  double phi = parameterVector[Trk::phi];
184 
185  // Check the parameters are reasonable:
186  if (tan(theta/2.0) < 0.0001) {
187  ATH_MSG_DEBUG(" Track has negative theta or is VERY close to beampipe! "
188  "(tan(theta/2) < 0.0001). Returning default Pid values.");
189  return PIDvalues;
190  }
191 
192  if (qOverP == 0.0) {
193  ATH_MSG_DEBUG (" Track momentum infinite! (i.e. q/p = 0). Returning default Pid values.");
194  return PIDvalues;
195  }
196 
197  double pTrk = fabs(1.0 / qOverP);
198  double pT = pTrk * sin(theta);
199  double eta = -log(tan(theta/2.0));
200 
201  // Check the tool to get the local occupancy (i.e. for the track in question):
202  PIDvalues[Trk::TRTTrackOccupancy] = m_LocalOccTool->LocalOccupancy(ctx,track);
203 
204  if (PIDvalues[Trk::TRTTrackOccupancy] > 1.0 || PIDvalues[Trk::TRTTrackOccupancy] < 0.0) {
205  ATH_MSG_WARNING(" Occupancy was outside allowed range! Returning default Pid values. Occupancy = "
206  << PIDvalues[Trk::TRTTrackOccupancy] );
207  return PIDvalues;
208  }
209 
210  ATH_MSG_DEBUG ("");
211  ATH_MSG_DEBUG ("");
212  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
213  ATH_MSG_DEBUG ("check Got track: pT: " << pT << " eta: " << eta << " phi: " << phi);
214  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
215 
216  // For calculation of HT probability:
217  double pHTel_prod = 1.0;
218  double pHTpi_prod = 1.0;
219 
220  // ------------------------------------------------------------------------------------
221  // Loop over TRT hits on track, and calculate HT and R-ToT probability:
222  // ------------------------------------------------------------------------------------
223 
224  std::vector<double> hit_HTMB;
225  std::vector<double> hit_gasType;
226  std::vector<double> hit_tot;
227  std::vector<double> hit_L;
228  std::vector<double> hit_rTrkWire;
229  std::vector<double> hit_HitZ;
230  std::vector<double> hit_HitR;
231  std::vector<double> hit_isPrec;
232 
233  unsigned int nTRThits = 0;
234  unsigned int nTRThitsHTMB = 0;
235  unsigned int nXehits = 0;
236  unsigned int nArhits = 0;
237  unsigned int nPrecHits = 0;
238 
239 
240  // Check for track states:
241  const Trk::TrackStates* recoTrackStates = track.trackStateOnSurfaces();
242  if (not recoTrackStates) {
243  ATH_MSG_DEBUG("track.trackStateOnSurfaces() was zero");
244  //m_timingProfile->chronoStop("Tool::electronProb");
245  return PIDvalues;
246  }
247 
248  Trk::TrackStates::const_iterator tsosIter = recoTrackStates->begin();
249  Trk::TrackStates::const_iterator tsosIterEnd = recoTrackStates->end();
250 
251  // Loop over track states on surfaces (i.e. generalized hits):
252  for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
253 
254  const Trk::MeasurementBase *measurement = (*tsosIter)->measurementOnTrack();
255  if (!measurement) continue;
256 
257  // Get drift circle (ensures that hit is from TRT):
258  // use the type methods to avoid dynamic_cast in a loop
259  const InDet::TRT_DriftCircleOnTrack* driftcircle = nullptr;
260  if (measurement->type(Trk::MeasurementBaseType::RIO_OnTrack)) {
261  const Trk::RIO_OnTrack* tmpRio =
262  static_cast<const Trk::RIO_OnTrack*>(measurement);
264  driftcircle = static_cast<const InDet::TRT_DriftCircleOnTrack*>(tmpRio);
265  }
266  }
267 
268  if (!driftcircle) continue;
269 
270  // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT:
271  bool isHTMB = (driftcircle->prepRawData()->getWord() & 0x00020000) > 0;
272 
273  nTRThits++;
274  if (isHTMB) nTRThitsHTMB++;
275  hit_HTMB.push_back(static_cast<double>(isHTMB));
276 
277 
278  // ------------------------------------------------------------------------------------
279  // Get the necessary input for the probability calculations:
280  // ------------------------------------------------------------------------------------
281  Identifier DCid = driftcircle->identify();
282 
283  // Part of TRT hit belongs to (TrtPart = 0: Barrel, 1: EndcapA, 2: EndcapB).
284  int TrtPart = 0; // 0: Barrel, 1: EndcapA, 2: EndcapB
285  if (abs(m_trtId->barrel_ec(DCid)) == 2)
286  TrtPart = (m_trtId->layer_or_wheel(DCid) < 6) ? 1 : 2;
287 
288  // Get Straw Layer (Barrel: 0-72, EndcapA: 0-95 (16 layers in 6 modules), EndcapB: 0-63 (8 layers in 8 modules)):
289  int StrawLayer = 0;
290  if (TrtPart == 0) {
291  // Barrel:
292  if (m_trtId->layer_or_wheel(DCid) == 0) {
293  StrawLayer = m_trtId->straw_layer(DCid);
294  } else if (m_trtId->layer_or_wheel(DCid) == 1) {
295  StrawLayer = 19 + m_trtId->straw_layer(DCid);
296  } else {
297  StrawLayer = 19 + 24 + m_trtId->straw_layer(DCid);
298  }
299  } else {
300  // Endcap:
301  if (m_trtId->layer_or_wheel(DCid) < 6) {
302  StrawLayer =
303  16 * m_trtId->layer_or_wheel(DCid) + m_trtId->straw_layer(DCid);
304  } else {
305  StrawLayer =
306  8 * (m_trtId->layer_or_wheel(DCid) - 6) + m_trtId->straw_layer(DCid);
307  }
308  }
309 
310  // Get Z (Barrel) or R (Endcap) location of the hit, and distance from track to wire (i.e. anode) in straw:
311  double HitZ = 0.;
312  double HitR = 0.;
313  double rTrkWire = 0.;
314  bool hasTrackParameters = true; // Keep track of this for HT prob calculation
315  if ((*tsosIter)->trackParameters()) {
316  // If we have precise information (from hit), get that:
317  const Amg::Vector3D& gp = driftcircle->globalPosition();
318  HitR = gp.perp();
319  HitZ = gp.z();
320  rTrkWire = fabs((*tsosIter)->trackParameters()->parameters()[Trk::driftRadius]);
321  if (rTrkWire > 2.2) rTrkWire = 2.175; // cut off track-to-wire distance for outliers
322  } else {
323  // Otherwise just use the straw coordinates:
324  hasTrackParameters = false; // Jared - pass this to HT calculation
325  HitZ = driftcircle->associatedSurface().center().z();
326  HitR = driftcircle->associatedSurface().center().perp();
327  rTrkWire = 0;
328  }
329 
330  // fill vectors for NN PID
331  if (m_calculateNN and pT >= m_ptMinNN) {
332  hit_HitZ.push_back(HitZ);
333  hit_HitR.push_back(HitR);
334  hit_rTrkWire.push_back(rTrkWire);
335  hit_L.push_back(TRT_ToT_dEdx::calculateTrackLengthInStraw((*tsosIter), m_trtId));
336  hit_tot.push_back(driftcircle->timeOverThreshold());
337  }
338 
339  // ------------------------------------------------------------------------------------
340  // Collection and checks of input variables for HT probability calculation:
341  // ------------------------------------------------------------------------------------
342 
343  int SL_max[3] = {73, 96, 64};
344  if (StrawLayer > SL_max[TrtPart] || StrawLayer < 0) {
345  ATH_MSG_WARNING(" StrawLayer was outside allowed range! TrtPart = " << TrtPart << " SL = " << StrawLayer);
346  continue;
347  }
348 
349  double ZRpos[3] = {fabs(HitZ), HitR, HitR};
350  double ZRpos_min[3] = { 0.0, 630.0, 630.0};
351  double ZRpos_max[3] = {720.0, 1030.0, 1030.0};
352  if (ZRpos[TrtPart] > ZRpos_max[TrtPart]) {
353  ATH_MSG_WARNING(" ZRpos was above allowed range - adjusted! TrtPart = " << TrtPart << " ZRpos = " << ZRpos[TrtPart]);
354  ZRpos[TrtPart] = ZRpos_max[TrtPart] - 0.001;
355  }
356  if (ZRpos[TrtPart] < ZRpos_min[TrtPart]) {
357  ATH_MSG_WARNING(" ZRpos was below allowed range - adjusted! TrtPart = " << TrtPart << " ZRpos = " << ZRpos[TrtPart]);
358  ZRpos[TrtPart] = ZRpos_min[TrtPart] + 0.001;
359  }
360 
361  // ------------------------------------------------------------------------------------
362  // Calculate the HT probability:
363  // ------------------------------------------------------------------------------------
364 
365  // getStatusHT returns enum {Undefined, Dead, Good, Xenon, Argon, Krypton, EmulatedArgon, EmulatedKrypton}.
366  // Our representation of 'GasType' is 0:Xenon, 1:Argon, 2:Krypton
367  int GasType=0; // Xenon is default
368  if (!m_TRTStrawSummaryTool.empty()) {
369  int stat = m_TRTStrawSummaryTool->getStatusHT(DCid,ctx);
370  if ( stat==2 || stat==3 ) { GasType = 0; } // Xe
371  else if ( stat==1 || stat==4 ) { GasType = 1; } // Ar
372  else if ( stat==5 ) { GasType = 1; } // Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR
373  else if ( stat==6 ) { GasType = 1; } // Emulated Ar
374  else if ( stat==7 ) { GasType = 1;
375  } // Emulated Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR
376  else {
378  "getStatusHT = "
379  << stat
380  << ", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or "
381  "'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!");
382  throw std::exception();
383  }
384  }
385 
386  ATH_MSG_DEBUG("check Hit: "
387  << nTRThits << " TrtPart: " << TrtPart
388  << " GasType: " << GasType << " SL: " << StrawLayer
389  << " ZRpos: " << ZRpos[TrtPart] << " TWdist: " << rTrkWire
390  << " Occ_Local: " << PIDvalues[Trk::TRTTrackOccupancy] << " HTMB: " << isHTMB);
391 
392  if (m_calculateNN and pT >= m_ptMinNN) {
393  // RNN gas type observables
394  hit_gasType.push_back(static_cast<double>(GasType));
395  if (GasType == 0) {
396  nXehits++;
397  } else if (GasType == 1) {
398  nArhits++;
399  }
400 
401  // RNN hit preciion observables
402  float errDc = sqrt(driftcircle->localCovariance()(Trk::driftRadius, Trk::driftRadius));
403  bool isPrec = false;
404  if (errDc < 1.0) {
405  isPrec = true;
406  nPrecHits++;
407  }
408  hit_isPrec.push_back(static_cast<double>(isPrec));
409  }
410 
411  // Then call pHT functions with these values:
412  // ------------------------------------------
413 
414  double pHTel = HTcalc->getProbHT(pTrk,
416  TrtPart,
417  GasType,
418  StrawLayer,
419  ZRpos[TrtPart],
420  rTrkWire,
421  PIDvalues[Trk::TRTTrackOccupancy] ,
422  hasTrackParameters);
423  double pHTpi = HTcalc->getProbHT(pTrk,
424  Trk::pion,
425  TrtPart,
426  GasType,
427  StrawLayer,
428  ZRpos[TrtPart],
429  rTrkWire,
430  PIDvalues[Trk::TRTTrackOccupancy] ,
431  hasTrackParameters);
432 
433  if (pHTel > 0.999 || pHTpi > 0.999 || pHTel < 0.001 || pHTpi < 0.001) {
434  ATH_MSG_DEBUG(" pHT outside allowed range! pHTel = "
435  << pHTel << " pHTpi = " << pHTpi
436  << " TrtPart: " << TrtPart << " SL: " << StrawLayer
437  << " ZRpos: " << ZRpos[TrtPart] << " TWdist: " << rTrkWire
438  << " Occ_Local: " << PIDvalues[Trk::TRTTrackOccupancy] );
439  continue;
440  }
441 
442  if (pHTel > 0.80 || pHTpi > 0.50 || pHTel < 0.025 || pHTpi < 0.010) {
443  ATH_MSG_DEBUG(" pHT has abnormal value! pHTel = "
444  << pHTel << " pHTpi = " << pHTpi
445  << " TrtPart: " << TrtPart << " SL: " << StrawLayer
446  << " ZRpos: " << ZRpos[TrtPart] << " TWdist: " << rTrkWire
447  << " Occ_Local: " << PIDvalues[Trk::TRTTrackOccupancy] );
448  continue;
449  }
450 
451  // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT:
452  if (isHTMB) {pHTel_prod *= pHTel; pHTpi_prod *= pHTpi;}
453  else {pHTel_prod *= 1.0-pHTel; pHTpi_prod *= 1.0-pHTpi;}
454  ATH_MSG_DEBUG ("check pHT(el): " << pHTel << " pHT(pi): " << pHTpi );
455 
456  } // end of loop over hits
457 
458 
459  // If number of hits is adequate (default is 5 hits), calculate HT and ToT probability.
460  if (not (nTRThits >= m_minTRThits)) return PIDvalues;
461 
462  // Calculate electron probability (HT)
463  PIDvalues[Trk::eProbabilityHT] = pHTel_prod / (pHTel_prod + pHTpi_prod);
464 
465  ATH_MSG_DEBUG ("check nTRThits: " << nTRThits << " : " << nTRThitsHTMB
466  << " pHTel_prod: " << pHTel_prod
467  << " pHTpi_prod: " << pHTpi_prod
468  << " probEl: " << PIDvalues[Trk::eProbabilityHT]);
469 
470  PIDvalues[Trk::TRTdEdx] = m_TRTdEdxTool->dEdx(
471  ctx,
472  &track,
473  true, //be expicit as optional below can be converted to bool
474  PIDvalues[Trk::TRTTrackOccupancy]); // default dEdx using all hits
475 
477  m_TRTdEdxTool->usedHits(ctx, &track);
478  double dEdx_noHTHits = m_TRTdEdxTool->dEdx(
479  ctx,
480  &track,
481  false,//be expicit as optional below can be converted to bool
482  PIDvalues[Trk::TRTTrackOccupancy]); // Divide by L, exclude HT hits
483 
484  double dEdx_usedHits_noHTHits = m_TRTdEdxTool->usedHits(ctx, &track, false);
485  PIDvalues[Trk::eProbabilityToT] = m_TRTdEdxTool->getTest(
486  ctx, dEdx_noHTHits, pTrk, Trk::electron, Trk::pion, dEdx_usedHits_noHTHits);
487 
488  // Limit the probability values the upper and lower limits that are given/trusted for each part:
489  double limProbHT = HTcalculator::Limit(PIDvalues[Trk::eProbabilityHT]);
490  double limProbToT = HTcalculator::Limit(PIDvalues[Trk::eProbabilityToT]);
491 
492  // Calculate the combined probability, assuming no correlations (none are expected).
493  PIDvalues[Trk::eProbabilityComb] =
494  (limProbHT * limProbToT) /
495  ((limProbHT * limProbToT) + ((1.0 - limProbHT) * (1.0 - limProbToT)));
496 
497  // Troels: VERY NASTY NAMING, BUT AGREED UPON FOR NOW (for debugging, 27. NOV. 2014):
498  PIDvalues[Trk::eProbabilityBrem] = pHTel_prod; // decorates electron LH to el brem for now... (still used?)
499 
500  if (!m_calculateNN or pT < m_ptMinNN) {
501  return PIDvalues;
502  }
503 
504  // Calculate RNN PID score
505  std::map<std::string, std::map<std::string, double>> scalarInputs_NN = PIDNN->getScalarInputs();
506  std::map<std::string, std::map<std::string, std::vector<double>>> vectorInputs_NN = PIDNN->getVectorInputs();
507 
508  // Calculate the hit fraction
509  double fAr = static_cast<double>(nArhits) / nTRThits;
510  double fHTMB = static_cast<double>(nTRThitsHTMB) / nTRThits;
511  double PHF = static_cast<double>(nPrecHits) / nTRThits;
512 
513  if (!scalarInputs_NN.empty()) {
514  std::map<std::string, double>& trackVarMap = scalarInputs_NN.begin()->second;
515  storeNNVariable(trackVarMap, "trkOcc", static_cast<double>(PIDvalues[Trk::TRTTrackOccupancy]));
516  storeNNVariable(trackVarMap, "p", pTrk);
517  storeNNVariable(trackVarMap, "pT", pT);
518  storeNNVariable(trackVarMap, "nXehits", static_cast<double>(nXehits));
519  storeNNVariable(trackVarMap, "fAr", fAr);
520  storeNNVariable(trackVarMap, "fHTMB", fHTMB);
521  storeNNVariable(trackVarMap, "PHF", PHF);
522  storeNNVariable(trackVarMap, "dEdx", static_cast<double>(dEdx_noHTHits));
523  }
524 
525  if (!vectorInputs_NN.empty()) {
526  std::map<std::string, std::vector<double>>& hitVarMap = vectorInputs_NN.begin()->second;
527  storeNNVariable(hitVarMap, "hit_HTMB", hit_HTMB);
528  storeNNVariable(hitVarMap, "hit_gasType", hit_gasType);
529  storeNNVariable(hitVarMap, "hit_tot", hit_tot);
530  storeNNVariable(hitVarMap, "hit_L", hit_L);
531  storeNNVariable(hitVarMap, "hit_rTrkWire", hit_rTrkWire);
532  storeNNVariable(hitVarMap, "hit_HitZ", hit_HitZ);
533  storeNNVariable(hitVarMap, "hit_HitR", hit_HitR);
534  storeNNVariable(hitVarMap, "hit_isPrec", hit_isPrec);
535  }
536  PIDvalues[Trk::eProbabilityNN] = PIDNN->evaluate(scalarInputs_NN, vectorInputs_NN);
537 
538  ATH_MSG_DEBUG ("check NN PID calculation: ");
539  for (const auto& scalarInputs : scalarInputs_NN) {
540  ATH_MSG_DEBUG (" scalar inputs: " << scalarInputs.first);
541  for (const auto& variable : scalarInputs.second) {
542  ATH_MSG_DEBUG (" " << variable.first << " = " << variable.second);
543  }
544  }
545  for (const auto& vectorInputs : vectorInputs_NN) {
546  ATH_MSG_DEBUG (" vector inputs: " << vectorInputs.first);
547  for (const auto& variable : vectorInputs.second) {
548  ATH_MSG_DEBUG (" " << variable.first << " = " << variable.second);
549  }
550  }
551  ATH_MSG_DEBUG (" eProbilityNN: " << PIDvalues[Trk::eProbabilityNN]);
552 
553  return PIDvalues;
554 }

◆ electronProbability() [2/2]

std::vector<float> Trk::ITRT_ElectronPidTool::electronProbability ( const Trk::Track track) const
inlineinherited

Definition at line 46 of file ITRT_ElectronPidTool.h.

47  {
48  return electronProbability(Gaudi::Hive::currentContext(),track);
49  }

◆ electronProbability_old()

std::vector< float > InDet::TRT_ElectronPidToolRun2::electronProbability_old ( const Trk::Track track)
static

Electron probabilities to be returned.

Definition at line 133 of file TRT_ElectronPidToolRun2.cxx.

134 {
135  // Simply return values without calculation
136  std::vector<float> PIDvalues = Trk::eProbabilityDefault;
137  const Trk::TrackParameters* perigee = track.perigeeParameters();
138  if (!perigee) { return PIDvalues; }
139  return PIDvalues;
140 }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode InDet::TRT_ElectronPidToolRun2::finalize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 126 of file TRT_ElectronPidToolRun2.cxx.

127 {
128  return AthAlgTool::finalize();
129 }

◆ initialize()

StatusCode InDet::TRT_ElectronPidToolRun2::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 98 of file TRT_ElectronPidToolRun2.cxx.

99 {
101  if (sc.isFailure()) return sc;
102 
103  // Get the TRT Identifier-helper:
104  CHECK (detStore()->retrieve(m_trtId, "TRT_ID"));
105 
106  /* Get the TRT_ToT_dEdx tool */
107  CHECK( m_TRTdEdxTool.retrieve() );
108 
109  CHECK( m_LocalOccTool.retrieve() );
110 
112 
114 
115  CHECK( m_TRTStrawSummaryTool.retrieve() );
116 
117  return StatusCode::SUCCESS;
118 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID() [1/2]

static const InterfaceID& ITRT_ElectronToTTool::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 25 of file ITRT_ElectronToTTool.h.

25 { return IID_ITRT_ElectronToTTool; };

◆ interfaceID() [2/2]

const InterfaceID & Trk::ITRT_ElectronPidTool::interfaceID ( )
inlinestaticinherited

Definition at line 92 of file ITRT_ElectronPidTool.h.

93  {
94  return IID_ITRT_ElectronPidTool;
95  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ probHT()

double InDet::TRT_ElectronPidToolRun2::probHT ( const double  p,
const Trk::ParticleHypothesis  hypothesis,
const int  HitPart,
const int  Layer,
const int  Strawlayer 
) const
finaloverridevirtual

return high threshold probability

Returns
double of probability

Implements Trk::ITRT_ElectronPidTool.

Definition at line 610 of file TRT_ElectronPidToolRun2.cxx.

616 {
617  if (not CheckGeometry(HitPart,Layer,StrawLayer) ){
618  ATH_MSG_ERROR("TRT geometry fail. Returning default value.");
619  return 0.5;
620  }
621 
622  return 1.0;
623 }

◆ probHTRun2() [1/2]

double InDet::TRT_ElectronPidToolRun2::probHTRun2 ( const EventContext &  ctx,
float  pTrk,
Trk::ParticleHypothesis  hypothesis,
int  TrtPart,
int  GasType,
int  StrawLayer,
float  ZR,
float  rTrkWire,
float  Occupancy 
) const
finaloverridevirtual

Implements Trk::ITRT_ElectronPidTool.

Definition at line 626 of file TRT_ElectronPidToolRun2.cxx.

635 {
637  bool hasTrackPar = true;
638  return (*readHandle)
639  ->getProbHT(pTrk,
640  hypothesis,
641  TrtPart,
642  GasType,
643  StrawLayer,
644  ZR,
645  rTrkWire,
646  Occupancy,
647  hasTrackPar);
648 }

◆ probHTRun2() [2/2]

double Trk::ITRT_ElectronPidTool::probHTRun2 ( float  pTrk,
Trk::ParticleHypothesis  hypothesis,
int  TrtPart,
int  GasType,
int  StrawLayer,
float  ZR,
float  rTrkWire,
float  Occupancy 
) const
inlineinherited

Definition at line 71 of file ITRT_ElectronPidTool.h.

79  {
80  return probHTRun2(Gaudi::Hive::currentContext(),
81  pTrk,
82  hypothesis,
83  TrtPart,
84  GasType,
85  StrawLayer,
86  ZR,
87  rTrkWire,
88  Occupancy);
89  }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sqr()

double InDet::TRT_ElectronPidToolRun2::sqr ( double  a)
inlineprivate

Definition at line 133 of file TRT_ElectronPidToolRun2.h.

133 {return a*a;}

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_calculateNN

bool InDet::TRT_ElectronPidToolRun2::m_calculateNN
private

Definition at line 138 of file TRT_ElectronPidToolRun2.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_HTReadKey

SG::ReadCondHandleKey<HTcalculator> InDet::TRT_ElectronPidToolRun2::m_HTReadKey
private
Initial value:
{ this,
"HTcalculator",
"HTcalculator",
"HTcalculator in-key" }

Definition at line 157 of file TRT_ElectronPidToolRun2.h.

◆ m_LocalOccTool

ToolHandle<InDet::ITRT_LocalOccupancy> InDet::TRT_ElectronPidToolRun2::m_LocalOccTool
private
Initial value:
{
this,
"TRT_LocalOccupancyTool",
{},
"TRT Local occupancy tool"
}

Definition at line 144 of file TRT_ElectronPidToolRun2.h.

◆ m_minTRThits

unsigned int InDet::TRT_ElectronPidToolRun2::m_minTRThits
private

Definition at line 136 of file TRT_ElectronPidToolRun2.h.

◆ m_ptMinNN

float InDet::TRT_ElectronPidToolRun2::m_ptMinNN
private

Definition at line 137 of file TRT_ElectronPidToolRun2.h.

◆ m_TRTdEdxTool

ToolHandle<ITRT_ToT_dEdx> InDet::TRT_ElectronPidToolRun2::m_TRTdEdxTool
private
Initial value:
{ this,
"TRT_ToT_dEdx_Tool",
{},
"TRT ToT dEdx Tool"}

Definition at line 140 of file TRT_ElectronPidToolRun2.h.

◆ m_trtId

const TRT_ID* InDet::TRT_ElectronPidToolRun2::m_trtId
private

Definition at line 135 of file TRT_ElectronPidToolRun2.h.

◆ m_TRTPIDNNReadKey

SG::ReadCondHandleKey<InDet::TRTPIDNN> InDet::TRT_ElectronPidToolRun2::m_TRTPIDNNReadKey
private
Initial value:
{ this,
"TRTPIDNN",
"TRTPIDNN",
"TRTPIDNN in-key" }

Definition at line 162 of file TRT_ElectronPidToolRun2.h.

◆ m_TRTStrawSummaryTool

ToolHandle<ITRT_StrawStatusSummaryTool> InDet::TRT_ElectronPidToolRun2::m_TRTStrawSummaryTool
private
Initial value:
{
this,
"TRTStrawSummaryTool",
"InDetTRTStrawStatusSummaryTool",
"TRT straw summary tool"
}

Definition at line 150 of file TRT_ElectronPidToolRun2.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
InDet::TRT_ElectronPidToolRun2::m_HTReadKey
SG::ReadCondHandleKey< HTcalculator > m_HTReadKey
Definition: TRT_ElectronPidToolRun2.h:157
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
InDet::TRTPIDNN
Definition: TRTPIDNN.h:28
Trk::eProbabilityToT
@ eProbabilityToT
Electron probability from Time-Over-Threshold (ToT) information.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:214
InDet::TRT_DriftCircleOnTrack::prepRawData
virtual const TRT_DriftCircle * prepRawData() const override final
returns the PrepRawData - is a TRT_DriftCircle in this scope
Definition: TRT_DriftCircleOnTrack.h:202
beamspotPlotBcids.k
k
Definition: beamspotPlotBcids.py:524
LArNewCalib_Delay_OFC_Cali.BEC
BEC
Definition: LArNewCalib_Delay_OFC_Cali.py:115
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
Trk::eProbabilityBrem
@ eProbabilityBrem
Electron probability from Brem fitting (DNA).
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:216
InDet::TRT_ElectronPidToolRun2::m_TRTdEdxTool
ToolHandle< ITRT_ToT_dEdx > m_TRTdEdxTool
Definition: TRT_ElectronPidToolRun2.h:140
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
initialize
void initialize()
Definition: run_EoverP.cxx:894
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
InDet::TRTPIDNN::getScalarInputs
std::map< std::string, std::map< std::string, double > > getScalarInputs() const
Definition: TRTPIDNN.h:42
InDet::TRT_DriftCircleOnTrack::associatedSurface
virtual const Trk::Surface & associatedSurface() const override final
returns the surface for the local to global transformation
Definition: TRT_DriftCircleOnTrack.cxx:154
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
HTcalculator::Limit
static float Limit(float prob)
Definition: HTcalculator.cxx:12
Trk::RIO_OnTrack::rioType
virtual bool rioType(RIO_OnTrackType::Type type) const =0
Method checking the Rio On Track type.
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
InDet::TRTPIDNN::getVectorInputs
std::map< std::string, std::map< std::string, std::vector< double > > > getVectorInputs() const
Definition: TRTPIDNN.h:47
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
InDet::TRT_ElectronPidToolRun2::m_ptMinNN
float m_ptMinNN
Definition: TRT_ElectronPidToolRun2.h:137
InDet::TRT_ElectronPidToolRun2::m_trtId
const TRT_ID * m_trtId
Definition: TRT_ElectronPidToolRun2.h:135
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
Trk::eProbabilityHT
@ eProbabilityHT
Electron probability from High Threshold (HT) information.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:212
Trk::TRTdEdx
@ TRTdEdx
dEdx from TRT ToT measurement.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:219
Trk::ParametersCommon::dim
static constexpr int dim
Definition: ParametersCommon.h:50
python.RingerConstants.Layer
Layer
Definition: RingerConstants.py:42
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Trk::eProbabilityNumberOfTRTHitsUsedFordEdx
@ eProbabilityNumberOfTRTHitsUsedFordEdx
Number of TRT hits used for dEdx measurement.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:220
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
HTcalculator
Definition: HTcalculator.h:27
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::eProbabilityComb
@ eProbabilityComb
Electron probability from combining the below probabilities.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:210
Trk::ITRT_ElectronPidTool::probHTRun2
virtual double probHTRun2(const EventContext &ctx, float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkWire, float Occupancy) const =0
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:72
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::electron
@ electron
Definition: ParticleHypothesis.h:27
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::TRT_ElectronPidToolRun2::m_TRTPIDNNReadKey
SG::ReadCondHandleKey< InDet::TRTPIDNN > m_TRTPIDNNReadKey
Definition: TRT_ElectronPidToolRun2.h:162
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
Trk::eProbabilityNN
@ eProbabilityNN
Electron probability from NN.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:217
Trk::ITRT_ElectronPidTool::electronProbability
virtual std::vector< float > electronProbability(const EventContext &ctx, const Trk::Track &track) const =0
particle identification function returning a vector of probabilities.
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:59
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
calibdata.exception
exception
Definition: calibdata.py:496
InDet::TRT_ElectronPidToolRun2::m_minTRThits
unsigned int m_minTRThits
Definition: TRT_ElectronPidToolRun2.h:136
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
python.selection.variable
variable
Definition: selection.py:33
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
Trk::MeasurementBase::type
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::ParametersBase
Definition: ParametersBase.h:55
InDet::TRT_ElectronPidToolRun2::m_TRTStrawSummaryTool
ToolHandle< ITRT_StrawStatusSummaryTool > m_TRTStrawSummaryTool
Definition: TRT_ElectronPidToolRun2.h:150
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:866
TRT_ID::straw_layer
int straw_layer(const Identifier &id) const
Definition: TRT_ID.h:893
DataVector< const Trk::TrackStateOnSurface >
TRT_ID::layer_or_wheel
int layer_or_wheel(const Identifier &id) const
Definition: TRT_ID.h:884
beamspotman.stat
stat
Definition: beamspotman.py:266
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::RIO_OnTrackType::TRT_DriftCircle
@ TRT_DriftCircle
Definition: RIO_OnTrack.h:59
Trk::MeasurementBase
Definition: MeasurementBase.h:58
InDet::TRT_DriftCircleOnTrack::timeOverThreshold
double timeOverThreshold() const
returns time over threshold in ns for valid digits; zero otherwise
Definition: TRT_DriftCircleOnTrack.h:239
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDet::TRT_ElectronPidToolRun2::m_LocalOccTool
ToolHandle< InDet::ITRT_LocalOccupancy > m_LocalOccTool
Definition: TRT_ElectronPidToolRun2.h:144
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TRT_ToT_dEdx::calculateTrackLengthInStraw
static double calculateTrackLengthInStraw(const Trk::TrackStateOnSurface *trackState, const TRT_ID *identifier)
Definition: TRT_ToT_dEdx.cxx:1208
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::RIO_OnTrack::identify
virtual Identifier identify() const final
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:155
InDet::TRT_ElectronPidToolRun2::CheckGeometry
bool CheckGeometry(int BEC, int Layer, int Strawlayer) const
Definition: TRT_ElectronPidToolRun2.cxx:563
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
InDet::TRTPIDNN::evaluate
double evaluate(std::map< std::string, std::map< std::string, double >> &scalarInputs, std::map< std::string, std::map< std::string, std::vector< double >>> &vectorInputs) const
Definition: TRTPIDNN.h:52
Trk::phi
@ phi
Definition: ParamDefs.h:81
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Trk::TRTTrackOccupancy
@ TRTTrackOccupancy
TRT track occupancy.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:218
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
InDet::TRT_DriftCircleOnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
return the global position of this RIO_OnTrack
Definition: TRT_DriftCircleOnTrack.cxx:160
storeNNVariable
void storeNNVariable(std::map< std::string, T > &theMap, const std::string &name, const T &value)
Definition: TRT_ElectronPidToolRun2.cxx:56
InDet::TRT_DriftCircle::getWord
unsigned int getWord() const
returns the TRT dataword
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
HTcalculator::getProbHT
float getProbHT(float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkAnode, float Occupancy, bool hasTrackPars) const
Definition: HTcalculator.cxx:27
InDet::TRT_ElectronPidToolRun2::m_calculateNN
bool m_calculateNN
Definition: TRT_ElectronPidToolRun2.h:138