8#include "GaudiKernel/AlgTool.h"
9#include "GaudiKernel/ToolHandle.h"
11#include "GaudiKernel/IToolSvc.h"
62 ,
"averageInteractionsPerCrossingKey"
63 ,
"EventInfo.averageInteractionsPerCrossing"
64 ,
"Decoration for Average Interaction Per Crossing"};
68 {
this,
"TRTStrawSummaryTool",
"TRT_StrawStatusSummaryTool"};
70 ToolHandle< Trk::IPRD_AssociationTool >
m_assoTool{
this,
"AssociationTool",
"InDet::InDetPRD_AssociationToolGangedPixels",
"PRD_AssociationTool"};
71 ToolHandle< InDet::ITRT_LocalOccupancy >
m_localOccTool{
this,
"TRT_LocalOccupancyTool",
"",
"Local occupancy tool"};
76 "If true - make correction using rs-distributions"};
78 "If true - divide ToT to the L of track in straw"};
81 {
this,
"TRT_dEdx_useTrackPartWithGasType",
kUnset,
82 "If kUnset - use any gas for dEdX calculation"};
85 "Algorithm type for dEdX estimator calculation"};
87 {
this,
"TRT_dEdx_correctionType",
kTrackBased,
"Type of dEdx correction"};
99 BooleanProperty
m_isData{
this,
"TRT_dEdx_isData",
true};
103 {
this,
"TRT_dEdx_trackConfig_maxRtrack", 1.85,
"maximum track radius"};
105 {
this,
"TRT_dEdx_trackConfig_minRtrack", 0.15,
"maximum track radius"};
108 "skip tracks with where RHit=0"};
115 TRT_ToT_dEdx(
const std::string&,
const std::string&,
const IInterface*);
131 virtual double dEdx(
const EventContext& ctx,
134 std::optional<float> localOccupancy = std::nullopt)
const override final;
142 virtual double usedHits(
const EventContext& ctx,
144 bool useHThits =
true)
const override final;
155 const double dEdx_obs,
157 Trk::ParticleHypothesis hypothesis,
158 Trk::ParticleHypothesis antihypothesis,
159 int nUsedHits)
const override final;
171 const Trk::TrackStateOnSurface* trackState,
191 const Trk::TrackStateOnSurface* itr,
192 const double dEdx_obs,
194 Trk::ParticleHypothesis hypothesis,
195 int nUsedHits)
const;
198 const double dEdx_obs,
200 Trk::ParticleHypothesis hypothesis,
201 int nUsedHits)
const;
210 const Trk::TrackStateOnSurface* itr,
212 Trk::ParticleHypothesis hypothesis)
const;
217 Trk::ParticleHypothesis hypothesis)
const;
226 const Trk::TrackStateOnSurface* itr,
240 const Trk::TrackStateOnSurface* itr,
251 const EventContext& ctx,
287 int StrawLayer)
const;
297 int StrawLayer)
const;
306 int StrawLayer)
const;
332 double radialPosition,
351 int StrawLayer)
const;
359 std::optional<float> localOccupancy)
const;
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual double dEdx(const EventContext &ctx, const Trk::Track *track, bool useHitsHT, std::optional< float > localOccupancy=std::nullopt) const =0
function to calculate sum ToT normalised to number of used hits
virtual double getTest(const EventContext &ctx, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const =0
function to calculate likelihood ratio test
virtual double usedHits(const EventContext &ctx, const Trk::Track *track, bool useHitsHT=true) const =0
function to calculate number of used hits
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
This is an Identifier helper class for the TRT subdetector.
double fitFuncEndcap_corrRZL(const EventContext &ctx, EGasType gasType, double driftRadius, double radialPosition, int Layer, int sign) const
function to compute correction factor in endcap region
virtual StatusCode initialize() override
AlgTool initailize method.
double fitFuncBarrel_corrRZ(const EventContext &ctx, EGasType gas, double driftRadius, double zPosition, int Layer, int StrawLayer) const
function to compute correction factor in barrel region
BooleanProperty m_corrected
virtual double dEdx(const EventContext &ctx, const Trk::Track *track, bool useHThits, std::optional< float > localOccupancy=std::nullopt) const override final
function to calculate sum ToT normalised to number of used hits
void setGasTypeFordEdXCalculation(EGasType gasType)
EGasType gasTypeInStraw(const EventContext &ctx, const Trk::TrackStateOnSurface *itr) const
return gas type for that hit
IntegerProperty m_correctionType
TRT_ToT_dEdx(const std::string &, const std::string &, const IInterface *)
AlgTool like constructor.
IntegerProperty m_useTrackPartWithGasType
SG::ReadCondHandleKey< TRTDedxcorrection > m_ReadKey
BooleanProperty m_useZeroRHitCut
double trackOccupancyCorrection(const EventContext &ctx, const Trk::Track *track, bool useHThits, std::optional< float > localOccupancy) const
double fitFuncBarrelShort_corrRZ(const EventContext &ctx, EGasType gasType, double driftRadius, double zPosition, int StrawLayer) const
function called by fitFuncBarrel_corrRZ for short straws
void setAlgorithm(EstCalc alg)
virtual ~TRT_ToT_dEdx()
Virtual destructor.
void setStatusCorrection(bool value)
void setStatusUseZeroRHitCut(bool value)
double mass(const EventContext &ctx, const Trk::TrackStateOnSurface *itr, const double pTrk, double dEdx) const
function to extract most likely mass in bg [0,3]
virtual double getTest(const EventContext &ctx, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const override final
function to calculate likelihood ratio test
bool isGoodHit(const EventContext &ctx, const Trk::TrackStateOnSurface *trackState, bool useHitsHT, double &length) const
function to define what is a good hit to be used for dEdx calculation cuts on track level can be made...
void setMaxRtrack(float maxRtrack)
virtual double usedHits(const EventContext &ctx, const Trk::Track *track, bool useHThits=true) const override final
function to calculate number of used hits
float getMaxRtrack() const
double fitFuncPol_corrRZ(const EventContext &ctx, EGasType gasType, int parameter, double driftRadius, int Layer, int Strawlayer, int sign, int set) const
function called by fitFuncBarrel_corrRZ and fitFuncEndcap_corrRZ
unsigned int m_nTrunkateHits
double predictdEdx(const EventContext &ctx, const Trk::TrackStateOnSurface *itr, const double pTrk, Trk::ParticleHypothesis hypothesis) const
function to calculate expectation value for dEdx using BB fit
bool getCorrectionType() const
ToolHandle< Trk::IPRD_AssociationTool > m_assoTool
double fitFuncBarrel_corrRZL(const EventContext &ctx, EGasType gasType, double driftRadius, double zPosition, int Layer, int StrawLayer) const
function to compute correction factor in barrel region
void setMinRtrack(float minRtrack)
bool getStatusCorrection() const
bool getStatusUseZeroRHitCut() const
void setCorrectionType(EOccupancyCorrection value)
FloatProperty m_trackConfig_maxRtrack
float getMinRtrack() const
double fitFuncEndcap_corrRZ(const EventContext &ctx, EGasType gas, double driftRadius, double rPosition, int Layer, int sign) const
function to compute correction factor in endcap region
int getGasTypeFordEdXCalculation() const
double correctToT_corrRZ(const EventContext &ctx, const Trk::TrackStateOnSurface *itr, double length) const
main function to correct ToT values on hit level as a function of track radius and z-position
ToolHandle< ITRT_StrawStatusSummaryTool > m_TRTStrawSummaryTool
SG::ReadDecorHandleKey< xAOD::EventInfo > m_rdhkEvtInfo
FloatProperty m_trackConfig_minRtrack
double hitOccupancyCorrection(const EventContext &ctx, const Trk::TrackStateOnSurface *itr) const
static double calculateTrackLengthInStraw(const Trk::TrackStateOnSurface *trackState, const TRT_ID *identifier)
double getProb(const EventContext &ctx, const Trk::TrackStateOnSurface *itr, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, int nUsedHits) const
function to calculate likelihood from prediction and resolution
double fitFuncBarrelLong_corrRZ(const EventContext &ctx, EGasType gasType, double driftRadius, double zPosition, int Layer, int StrawLayer) const
function called by fitFuncBarrel_corrRZ for long straws
BooleanProperty m_divideByL
IntegerProperty m_toolScenario
double correctNormalization(const EventContext &ctx, double nVtx=-1) const
correct overall dEdx normalization on track level
ToolHandle< InDet::ITRT_LocalOccupancy > m_localOccTool
represents the track state (measurement, material, fit parameters and quality) at a surface.
Ensure that the ATLAS eigen extensions are properly loaded.