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 {nullptr}
 
UnsignedIntegerProperty m_minTRThits
 
FloatProperty m_ptMinNN
 
BooleanProperty 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 67 of file TRT_ElectronPidToolRun2.cxx.

68  :
69  AthAlgTool(t,n,p)
70 {
71  declareInterface<ITRT_ElectronPidTool>(this);
72  declareInterface<ITRT_ElectronToTTool>(this);
73 }

◆ ~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 552 of file TRT_ElectronPidToolRun2.cxx.

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

◆ 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 137 of file TRT_ElectronPidToolRun2.cxx.

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

◆ 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 122 of file TRT_ElectronPidToolRun2.cxx.

123 {
124  // Simply return values without calculation
125  std::vector<float> PIDvalues = Trk::eProbabilityDefault;
126  const Trk::TrackParameters* perigee = track.perigeeParameters();
127  if (!perigee) { return PIDvalues; }
128  return PIDvalues;
129 }

◆ 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 115 of file TRT_ElectronPidToolRun2.cxx.

116 {
117  return AthAlgTool::finalize();
118 }

◆ initialize()

StatusCode InDet::TRT_ElectronPidToolRun2::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 87 of file TRT_ElectronPidToolRun2.cxx.

88 {
90  if (sc.isFailure()) return sc;
91 
92  // Get the TRT Identifier-helper:
93  CHECK (detStore()->retrieve(m_trtId, "TRT_ID"));
94 
95  /* Get the TRT_ToT_dEdx tool */
96  CHECK( m_TRTdEdxTool.retrieve() );
97 
98  CHECK( m_LocalOccTool.retrieve() );
99 
101 
103 
104  CHECK( m_TRTStrawSummaryTool.retrieve() );
105 
106  return StatusCode::SUCCESS;
107 }

◆ 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 599 of file TRT_ElectronPidToolRun2.cxx.

605 {
606  if (not CheckGeometry(HitPart,Layer,StrawLayer) ){
607  ATH_MSG_ERROR("TRT geometry fail. Returning default value.");
608  return 0.5;
609  }
610 
611  return 1.0;
612 }

◆ 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 615 of file TRT_ElectronPidToolRun2.cxx.

624 {
626  bool hasTrackPar = true;
627  return (*readHandle)
628  ->getProbHT(pTrk,
629  hypothesis,
630  TrtPart,
631  GasType,
632  StrawLayer,
633  ZR,
634  rTrkWire,
635  Occupancy,
636  hasTrackPar);
637 }

◆ 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

BooleanProperty InDet::TRT_ElectronPidToolRun2::m_calculateNN
private
Initial value:
{this, "CalculateNNPid", true,
"Decide whether to use NN PID"}

Definition at line 140 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 160 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 147 of file TRT_ElectronPidToolRun2.h.

◆ m_minTRThits

UnsignedIntegerProperty InDet::TRT_ElectronPidToolRun2::m_minTRThits
private
Initial value:
{this, "MinimumTRThitsForIDpid", 5,
"Minimum number of TRT hits to give PID"}

Definition at line 136 of file TRT_ElectronPidToolRun2.h.

◆ m_ptMinNN

FloatProperty InDet::TRT_ElectronPidToolRun2::m_ptMinNN
private
Initial value:
{this, "MinimumTrackPtForNNPid", 2000.,
"Minimum track pt to calculate NN response for PID"}

Definition at line 138 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 143 of file TRT_ElectronPidToolRun2.h.

◆ m_trtId

const TRT_ID* InDet::TRT_ElectronPidToolRun2::m_trtId {nullptr}
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 165 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 153 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:160
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
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
LArNewCalib_Delay_OFC_Cali.BEC
BEC
Definition: LArNewCalib_Delay_OFC_Cali.py:119
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
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:143
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AthCommonDataStore::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:75
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
InDet::TRT_ElectronPidToolRun2::m_minTRThits
UnsignedIntegerProperty m_minTRThits
Definition: TRT_ElectronPidToolRun2.h:136
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
const 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
InDet::TRT_ElectronPidToolRun2::m_calculateNN
BooleanProperty m_calculateNN
Definition: TRT_ElectronPidToolRun2.h:140
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
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
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:66
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:165
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:53
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
InDet::TRTPIDNN::getScalarInputs
const std::map< std::string, std::map< std::string, double > > & getScalarInputs() const
Definition: TRTPIDNN.h:42
calibdata.exception
exception
Definition: calibdata.py:496
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:153
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:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDet::TRT_ElectronPidToolRun2::m_LocalOccTool
ToolHandle< InDet::ITRT_LocalOccupancy > m_LocalOccTool
Definition: TRT_ElectronPidToolRun2.h:147
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:1185
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::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
InDet::TRT_ElectronPidToolRun2::CheckGeometry
bool CheckGeometry(int BEC, int Layer, int Strawlayer) const
Definition: TRT_ElectronPidToolRun2.cxx:552
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
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:75
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
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:52
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
fitman.k
k
Definition: fitman.py:528
Identifier
Definition: IdentifierFieldParser.cxx:14
InDet::TRT_ElectronPidToolRun2::m_ptMinNN
FloatProperty m_ptMinNN
Definition: TRT_ElectronPidToolRun2.h:138