![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "Identifier/Identifier.h"
17 #include "CoralBase/AttributeListSpecification.h"
18 #include "CoralBase/Blob.h"
53 auto it = theMap.find(
name);
54 if (
it != theMap.end()) {
75 declareInterface<ITRT_ElectronPidTool>(
this);
76 declareInterface<ITRT_ElectronToTTool>(
this);
97 if (
sc.isFailure())
return sc;
113 return StatusCode::SUCCESS;
132 std::vector<float> PIDvalues = Trk::eProbabilityDefault;
134 if (!perigee) {
return PIDvalues; }
145 const EventContext& ctx,
153 if(HTcalc==
nullptr) {
161 PIDNN = (*readHandlePIDNN);
169 std::vector<float> PIDvalues = Trk::eProbabilityDefault;
173 if (!perigee)
return PIDvalues;
183 ATH_MSG_DEBUG(
" Track has negative theta or is VERY close to beampipe! "
184 "(tan(theta/2) < 0.0001). Returning default Pid values.");
189 ATH_MSG_DEBUG (
" Track momentum infinite! (i.e. q/p = 0). Returning default Pid values.");
193 double pTrk = fabs(1.0 /
qOverP);
201 ATH_MSG_WARNING(
" Occupancy was outside allowed range! Returning default Pid values. Occupancy = "
208 ATH_MSG_DEBUG (
"check---------------------------------------------------------------------------------------");
210 ATH_MSG_DEBUG (
"check---------------------------------------------------------------------------------------");
213 double pHTel_prod = 1.0;
214 double pHTpi_prod = 1.0;
220 std::vector<double> hit_HTMB;
221 std::vector<double> hit_gasType;
222 std::vector<double> hit_tot;
223 std::vector<double> hit_L;
224 std::vector<double> hit_rTrkWire;
225 std::vector<double> hit_HitZ;
226 std::vector<double> hit_HitR;
227 std::vector<double> hit_isPrec;
229 unsigned int nTRThits = 0;
230 unsigned int nTRThitsHTMB = 0;
231 unsigned int nXehits = 0;
232 unsigned int nArhits = 0;
233 unsigned int nPrecHits = 0;
238 if (not recoTrackStates) {
248 for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
251 if (!measurement)
continue;
264 if (!driftcircle)
continue;
270 if (isHTMB) nTRThitsHTMB++;
271 hit_HTMB.push_back(
static_cast<double>(isHTMB));
309 double rTrkWire = 0.;
310 bool hasTrackParameters =
true;
311 if ((*tsosIter)->trackParameters()) {
316 rTrkWire = fabs((*tsosIter)->trackParameters()->parameters()[
Trk::driftRadius]);
317 if (rTrkWire > 2.2) rTrkWire = 2.175;
320 hasTrackParameters =
false;
328 hit_HitZ.push_back(HitZ);
329 hit_HitR.push_back(HitR);
330 hit_rTrkWire.push_back(rTrkWire);
339 int SL_max[3] = {73, 96, 64};
340 if (StrawLayer > SL_max[TrtPart] || StrawLayer < 0) {
341 ATH_MSG_WARNING(
" StrawLayer was outside allowed range! TrtPart = " << TrtPart <<
" SL = " << StrawLayer);
345 double ZRpos[3] = {fabs(HitZ), HitR, HitR};
346 double ZRpos_min[3] = { 0.0, 630.0, 630.0};
347 double ZRpos_max[3] = {720.0, 1030.0, 1030.0};
348 if (ZRpos[TrtPart] > ZRpos_max[TrtPart]) {
349 ATH_MSG_WARNING(
" ZRpos was above allowed range - adjusted! TrtPart = " << TrtPart <<
" ZRpos = " << ZRpos[TrtPart]);
350 ZRpos[TrtPart] = ZRpos_max[TrtPart] - 0.001;
352 if (ZRpos[TrtPart] < ZRpos_min[TrtPart]) {
353 ATH_MSG_WARNING(
" ZRpos was below allowed range - adjusted! TrtPart = " << TrtPart <<
" ZRpos = " << ZRpos[TrtPart]);
354 ZRpos[TrtPart] = ZRpos_min[TrtPart] + 0.001;
366 if (
stat==2 ||
stat==3 ) { GasType = 0; }
367 else if (
stat==1 ||
stat==4 ) { GasType = 1; }
368 else if (
stat==5 ) { GasType = 1; }
369 else if (
stat==6 ) { GasType = 1; }
370 else if (
stat==7 ) { GasType = 1;
376 <<
", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or "
377 "'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!");
383 << nTRThits <<
" TrtPart: " << TrtPart
384 <<
" GasType: " << GasType <<
" SL: " << StrawLayer
385 <<
" ZRpos: " << ZRpos[TrtPart] <<
" TWdist: " << rTrkWire
390 hit_gasType.push_back(
static_cast<double>(GasType));
393 }
else if (GasType == 1) {
404 hit_isPrec.push_back(
static_cast<double>(isPrec));
429 if (pHTel > 0.999 || pHTpi > 0.999 || pHTel < 0.001 || pHTpi < 0.001) {
431 << pHTel <<
" pHTpi = " << pHTpi
432 <<
" TrtPart: " << TrtPart <<
" SL: " << StrawLayer
433 <<
" ZRpos: " << ZRpos[TrtPart] <<
" TWdist: " << rTrkWire
438 if (pHTel > 0.80 || pHTpi > 0.50 || pHTel < 0.025 || pHTpi < 0.010) {
440 << pHTel <<
" pHTpi = " << pHTpi
441 <<
" TrtPart: " << TrtPart <<
" SL: " << StrawLayer
442 <<
" ZRpos: " << ZRpos[TrtPart] <<
" TWdist: " << rTrkWire
448 if (isHTMB) {pHTel_prod *= pHTel; pHTpi_prod *= pHTpi;}
449 else {pHTel_prod *= 1.0-pHTel; pHTpi_prod *= 1.0-pHTpi;}
450 ATH_MSG_DEBUG (
"check pHT(el): " << pHTel <<
" pHT(pi): " << pHTpi );
461 ATH_MSG_DEBUG (
"check nTRThits: " << nTRThits <<
" : " << nTRThitsHTMB
462 <<
" pHTel_prod: " << pHTel_prod
463 <<
" pHTpi_prod: " << pHTpi_prod
490 (limProbHT * limProbToT) /
491 ((limProbHT * limProbToT) + ((1.0 - limProbHT) * (1.0 - limProbToT)));
501 std::map<std::string, std::map<std::string, double>> scalarInputs_NN = PIDNN->
getScalarInputs();
502 std::map<std::string, std::map<std::string, std::vector<double>>> vectorInputs_NN = PIDNN->
getVectorInputs();
505 double fAr =
static_cast<double>(nArhits) / nTRThits;
506 double fHTMB =
static_cast<double>(nTRThitsHTMB) / nTRThits;
507 double PHF =
static_cast<double>(nPrecHits) / nTRThits;
509 if (!scalarInputs_NN.empty()) {
510 std::map<std::string, double>& trackVarMap = scalarInputs_NN.begin()->second;
518 storeNNVariable(trackVarMap,
"dEdx",
static_cast<double>(dEdx_noHTHits));
521 if (!vectorInputs_NN.empty()) {
522 std::map<std::string, std::vector<double>>& hitVarMap = vectorInputs_NN.begin()->second;
535 for (
const auto& scalarInputs : scalarInputs_NN) {
537 for (
const auto&
variable : scalarInputs.second) {
541 for (
const auto& vectorInputs : vectorInputs_NN) {
543 for (
const auto&
variable : vectorInputs.second) {
563 ATH_MSG_ERROR(
"Found a wrong TRT part: "<<
BEC<<
" expected one of (-2,-1,1,2)");
574 static const int nlayers[2]={3,14};
587 static const int strawsPerBEC[2][14]={{19,24,30, 0, 0, 0,0,0,0,0,0,0,0,0},
588 {16,16,16,16,16,16,8,8,8,8,8,8,8,8}};
590 if(not(StrawLayer < strawsPerBEC[
part][
Layer])){
593 <<
" straws. Found index " << StrawLayer);
611 const int StrawLayer)
const
614 ATH_MSG_ERROR(
"TRT geometry fail. Returning default value.");
630 float Occupancy)
const
633 bool hasTrackPar =
true;
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).
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Scalar theta() const
theta method
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
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
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.
A CondAttrListVec is an Athena DataObject holding a vector of CORAL AttributeLists,...
@ 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.
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.
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
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
float getProbHT(float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkAnode, float Occupancy, bool hasTrackPars) const