|
ATLAS Offline Software
|
#include <TRT_ElectronPidToolRun2.h>
|
| 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 |
|
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.
◆ StoreGateSvc_t
◆ 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.
79 declareInterface<ITRT_ElectronPidTool>(
this);
80 declareInterface<ITRT_ElectronToTTool>(
this);
◆ ~TRT_ElectronPidToolRun2()
InDet::TRT_ElectronPidToolRun2::~TRT_ElectronPidToolRun2 |
( |
| ) |
|
|
virtualdefault |
◆ CheckGeometry()
bool InDet::TRT_ElectronPidToolRun2::CheckGeometry |
( |
int |
BEC, |
|
|
int |
Layer, |
|
|
int |
Strawlayer |
|
) |
| const |
|
private |
Definition at line 563 of file TRT_ElectronPidToolRun2.cxx.
567 ATH_MSG_ERROR(
"Found a wrong TRT part: "<<
BEC<<
" expected one of (-2,-1,1,2)");
578 static const int nlayers[2]={3,14};
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}};
594 if(not(StrawLayer < strawsPerBEC[
part][
Layer])){
597 <<
" straws. Found index " << StrawLayer);
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ 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.
157 if(HTcalc==
nullptr) {
165 PIDNN = (*readHandlePIDNN);
173 std::vector<float> PIDvalues = Trk::eProbabilityDefault;
177 if (!perigee)
return PIDvalues;
187 ATH_MSG_DEBUG(
" Track has negative theta or is VERY close to beampipe! "
188 "(tan(theta/2) < 0.0001). Returning default Pid values.");
193 ATH_MSG_DEBUG (
" Track momentum infinite! (i.e. q/p = 0). Returning default Pid values.");
197 double pTrk = fabs(1.0 /
qOverP);
205 ATH_MSG_WARNING(
" Occupancy was outside allowed range! Returning default Pid values. Occupancy = "
212 ATH_MSG_DEBUG (
"check---------------------------------------------------------------------------------------");
214 ATH_MSG_DEBUG (
"check---------------------------------------------------------------------------------------");
217 double pHTel_prod = 1.0;
218 double pHTpi_prod = 1.0;
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;
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;
242 if (not recoTrackStates) {
252 for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
255 if (!measurement)
continue;
268 if (!driftcircle)
continue;
274 if (isHTMB) nTRThitsHTMB++;
275 hit_HTMB.push_back(
static_cast<double>(isHTMB));
313 double rTrkWire = 0.;
314 bool hasTrackParameters =
true;
315 if ((*tsosIter)->trackParameters()) {
320 rTrkWire = fabs((*tsosIter)->trackParameters()->parameters()[
Trk::driftRadius]);
321 if (rTrkWire > 2.2) rTrkWire = 2.175;
324 hasTrackParameters =
false;
332 hit_HitZ.push_back(HitZ);
333 hit_HitR.push_back(HitR);
334 hit_rTrkWire.push_back(rTrkWire);
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);
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;
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;
370 if (
stat==2 ||
stat==3 ) { GasType = 0; }
371 else if (
stat==1 ||
stat==4 ) { GasType = 1; }
372 else if (
stat==5 ) { GasType = 1; }
373 else if (
stat==6 ) { GasType = 1; }
374 else if (
stat==7 ) { GasType = 1;
380 <<
", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or "
381 "'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!");
387 << nTRThits <<
" TrtPart: " << TrtPart
388 <<
" GasType: " << GasType <<
" SL: " << StrawLayer
389 <<
" ZRpos: " << ZRpos[TrtPart] <<
" TWdist: " << rTrkWire
394 hit_gasType.push_back(
static_cast<double>(GasType));
397 }
else if (GasType == 1) {
408 hit_isPrec.push_back(
static_cast<double>(isPrec));
433 if (pHTel > 0.999 || pHTpi > 0.999 || pHTel < 0.001 || pHTpi < 0.001) {
435 << pHTel <<
" pHTpi = " << pHTpi
436 <<
" TrtPart: " << TrtPart <<
" SL: " << StrawLayer
437 <<
" ZRpos: " << ZRpos[TrtPart] <<
" TWdist: " << rTrkWire
442 if (pHTel > 0.80 || pHTpi > 0.50 || pHTel < 0.025 || pHTpi < 0.010) {
444 << pHTel <<
" pHTpi = " << pHTpi
445 <<
" TrtPart: " << TrtPart <<
" SL: " << StrawLayer
446 <<
" ZRpos: " << ZRpos[TrtPart] <<
" TWdist: " << rTrkWire
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 );
465 ATH_MSG_DEBUG (
"check nTRThits: " << nTRThits <<
" : " << nTRThitsHTMB
466 <<
" pHTel_prod: " << pHTel_prod
467 <<
" pHTpi_prod: " << pHTpi_prod
494 (limProbHT * limProbToT) /
495 ((limProbHT * limProbToT) + ((1.0 - limProbHT) * (1.0 - limProbToT)));
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();
509 double fAr =
static_cast<double>(nArhits) / nTRThits;
510 double fHTMB =
static_cast<double>(nTRThitsHTMB) / nTRThits;
511 double PHF =
static_cast<double>(nPrecHits) / nTRThits;
513 if (!scalarInputs_NN.empty()) {
514 std::map<std::string, double>& trackVarMap = scalarInputs_NN.begin()->second;
522 storeNNVariable(trackVarMap,
"dEdx",
static_cast<double>(dEdx_noHTHits));
525 if (!vectorInputs_NN.empty()) {
526 std::map<std::string, std::vector<double>>& hitVarMap = vectorInputs_NN.begin()->second;
539 for (
const auto& scalarInputs : scalarInputs_NN) {
541 for (
const auto&
variable : scalarInputs.second) {
545 for (
const auto& vectorInputs : vectorInputs_NN) {
547 for (
const auto&
variable : vectorInputs.second) {
◆ electronProbability() [2/2]
std::vector<float> Trk::ITRT_ElectronPidTool::electronProbability |
( |
const Trk::Track & |
track | ) |
const |
|
inlineinherited |
◆ 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.
136 std::vector<float> PIDvalues = Trk::eProbabilityDefault;
138 if (!perigee) {
return PIDvalues; }
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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 |
◆ initialize()
StatusCode InDet::TRT_ElectronPidToolRun2::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
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 |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ 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 |
◆ 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 |
◆ renounce()
◆ renounceArray()
◆ sqr()
double InDet::TRT_ElectronPidToolRun2::sqr |
( |
double |
a | ) |
|
|
inlineprivate |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_calculateNN
bool InDet::TRT_ElectronPidToolRun2::m_calculateNN |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_HTReadKey
◆ m_LocalOccTool
◆ m_minTRThits
unsigned int InDet::TRT_ElectronPidToolRun2::m_minTRThits |
|
private |
◆ m_ptMinNN
float InDet::TRT_ElectronPidToolRun2::m_ptMinNN |
|
private |
◆ m_TRTdEdxTool
ToolHandle<ITRT_ToT_dEdx> InDet::TRT_ElectronPidToolRun2::m_TRTdEdxTool |
|
private |
◆ m_trtId
◆ m_TRTPIDNNReadKey
◆ m_TRTStrawSummaryTool
Initial value:{
this,
"TRTStrawSummaryTool",
"InDetTRTStrawStatusSummaryTool",
"TRT straw summary tool"
}
Definition at line 150 of file TRT_ElectronPidToolRun2.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Const iterator class for DataVector/DataList.
@ eProbabilityToT
Electron probability from Time-Over-Threshold (ToT) information.
virtual const TRT_DriftCircle * prepRawData() const override final
returns the PrepRawData - is a TRT_DriftCircle in this scope
Scalar phi() const
phi method
@ eProbabilityBrem
Electron probability from Brem fitting (DNA).
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Scalar theta() const
theta method
std::map< std::string, std::map< std::string, double > > getScalarInputs() const
virtual const Trk::Surface & associatedSurface() const override final
returns the surface for the local to global transformation
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
static float Limit(float prob)
virtual bool rioType(RIO_OnTrackType::Type type) const =0
Method checking the Rio On Track type.
std::map< std::string, std::map< std::string, std::vector< double > > > getVectorInputs() const
const Amg::Vector3D & center() const
Returns the center position of the Surface.
@ eProbabilityHT
Electron probability from High Threshold (HT) information.
@ TRTdEdx
dEdx from TRT ToT measurement.
@ eProbabilityNumberOfTRTHitsUsedFordEdx
Number of TRT hits used for dEdx measurement.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
@ eProbabilityComb
Electron probability from combining the below probabilities.
::StatusCode StatusCode
StatusCode definition for legacy code.
@ eProbabilityNN
Electron probability from NN.
#define CHECK(...)
Evaluate an expression and check for errors.
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int straw_layer(const Identifier &id) const
int layer_or_wheel(const Identifier &id) const
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
double timeOverThreshold() const
returns time over threshold in ns for valid digits; zero otherwise
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
static double calculateTrackLengthInStraw(const Trk::TrackStateOnSurface *trackState, const TRT_ID *identifier)
#define ATH_MSG_WARNING(x)
virtual Identifier identify() const final
return the identifier -extends MeasurementBase
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
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
@ TRTTrackOccupancy
TRT track occupancy.
virtual const Amg::Vector3D & globalPosition() const override final
return the global position of this RIO_OnTrack
unsigned int getWord() const
returns the TRT dataword
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
float getProbHT(float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkAnode, float Occupancy, bool hasTrackPars) const