ATLAS Offline Software
Loading...
Searching...
No Matches
TRTFastDigitizationTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef FASTTRT_DIGITIZATION_FASTTRT_DIGITIZATIONTOOL_H
6#define FASTTRT_DIGITIZATION_FASTTRT_DIGITIZATIONTOOL_H
11
13
14#include "GaudiKernel/ServiceHandle.h"
15#include "GaudiKernel/ToolHandle.h"
17
22
23#include "GaudiKernel/RndmGenerators.h"
24
26
28
29#include "Identifier/Identifier.h"
30#include "CLHEP/Random/RandGauss.h"
31
33
35
41
42#include <utility>
43#include <vector>
44#include <map>
45#include <cmath>
46
47class TRT_ID;
49
50namespace InDetDD {
52}
53
54class TRT_ID;
55class StoreGateSvc;
57
58
60public:
61 TRTFastDigitizationTool( const std::string &type, const std::string &name, const IInterface *parent );
62
65 StatusCode mergeEvent(const EventContext& ctx);
66
69 StatusCode processBunchXing( int bunchXing,
70 SubEventIterator bSubEvents,
71 SubEventIterator eSubEvents );
72
75 // virtual bool toProcess(int bunchXing) const;
76
77 StatusCode prepareEvent(const EventContext& ctx, const unsigned int /*nInputEvents*/ );
78
81 StatusCode processAllSubEvents(const EventContext& ctx);
82
84 virtual StatusCode initialize();
85
87 StatusCode finalize();
88
89private:
90
91 StatusCode initializeNumericalConstants(); // once per run
92 StatusCode setNumericalConstants(); // once per event (pileup-dependent constants)
93
94 StatusCode produceDriftCircles(const EventContext& ctx,
95 CLHEP::HepRandomEngine* rndmEngine,
97
98 Identifier getIdentifier( int hitID, IdentifierHash &hash, Identifier &layer_id, bool &status ) const;
99
100 StatusCode createAndStoreRIOs(const EventContext& ctx, CLHEP::HepRandomEngine* rndmEngine);
101
103 HepGeom::Point3D< double > getGlobalPosition( const TimedHitPtr< TRTUncompressedHit > &hit );
104 bool isArgonStraw( const Identifier &straw_id ) const;
105 int gasType( const Identifier &straw_id ) const;
106 double getProbHT( const EventContext& ctx, int particleEncoding, float kineticEnergy, const Identifier &straw_id, double driftRadiusLoc, double hitGlobalPosition ) const;
107 static double HTProbabilityElectron_high_pt( double eta );
108 static double HTProbabilityElectron_low_pt( double eta );
109 static double HTProbabilityMuon_5_20( double eta );
110 static double HTProbabilityMuon_60( double eta );
111 static double strawEfficiency( double driftRadius, int BEC = 0 );
112 static double correctionHT( double momentum, Trk::ParticleHypothesis hypothesis );
113 double particleMass( int i ) const;
114
115 // Tools and Services
116 PublicToolHandle< ITRT_DriftFunctionTool > m_trtDriftFunctionTool{this, "TRT_DriftFunctionTool", "TRT_DriftFunctionTool/FatrasTrtDriftFunctionTool"};
117 bool m_useTrtElectronPidTool{true}; // false: use Tina's parametrization
118 PublicToolHandle< Trk::ITRT_ElectronPidTool > m_trtElectronPidTool{this, "TRT_ElectronPidTool", "InDet::TRT_ElectronPidToolRun2/InDetTRT_ElectronPidTool"};
119 ToolHandle< ITRT_StrawStatusSummaryTool > m_trtStrawStatusSummaryTool{this, "TRT_StrawStatusSummaryTool", "InDetTRTStrawStatusSummaryTool"}; // Argon / Xenon
120 ServiceHandle< PileUpMergeSvc > m_mergeSvc{this, "MergeSvc", "PileUpMergeSvc"}; // PileUp Merge service
121 ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
122 StringProperty m_randomEngineName{this, "RandomStreamName", "FatrasRnd"}; // Name of the random number stream
123
124 // INPUT
125 StringProperty m_trtHitCollectionKey{this, "trtHitCollectionName", "TRTUncompressedHits"};
126 std::vector< TRTUncompressedHitCollection * > m_trtHitCollList;
127
128 // OUTPUT
130 SG::WriteHandleKey< PRD_MultiTruthCollection > m_trtPrdTruthKey{this, "trtPrdMultiTruthCollection", "PRD_MultiTruthTRT"};
131
133 std::multimap< Identifier, InDet::TRT_DriftCircle * > m_driftCircleMap;
134
135 // Helpers
137 const TRT_ID *m_trt_id{}; // TRT Id Helper
138
139 // Split configuration
140 IntegerProperty m_HardScatterSplittingMode{this, "HardScatterSplittingMode", 0, "Control pileup & signal splitting"}; // Process all TRT_Hits or just those from signal or background events
142
143 BooleanProperty m_useEventInfo{this, "useEventInfo", false}; // get mu from EventInfo ?
145 { this, "EventInfoKey", "EventInfo", "SG key for EventInfo" };
146 FloatProperty m_NCollPerEvent{this, "NCollPerEvent", 30};
147
148 // numerical constants. Might wish to move these to a DB in the future
149 double m_trtTailFraction{0.0}; // fraction in tails
150 double m_trtSigmaDriftRadiusTail{0.0}; // sigma of one TRT straw in R
153 double m_cFit[ 8 ][ 5 ]{}; // efficiency and resolution
154
155};
156
157#endif // FASTTRT_DIGITIZATION_FASTTRT_DIGITIZATIONTOOL_H
Scalar eta() const
pseudorapidity method
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition IPileUpTool.h:22
abstract interface to TRT straw status constants
the preferred mechanism to access information from the different event stores in a pileup job.
helper base class IPileUpTool::toProcess().
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for recording to StoreGate.
Interface to AlgTool TRT_DriftFunctionTool.
This is a "hash" representation of an Identifier.
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Property holding a SG store/key/clid from which a ReadHandle is made.
The Athena Transient Store API.
bool isArgonStraw(const Identifier &straw_id) const
static double HTProbabilityMuon_60(double eta)
static double getDriftRadiusFromXYZ(const TimedHitPtr< TRTUncompressedHit > &hit)
HepGeom::Point3D< double > getGlobalPosition(const TimedHitPtr< TRTUncompressedHit > &hit)
StatusCode produceDriftCircles(const EventContext &ctx, CLHEP::HepRandomEngine *rndmEngine, TimedHitCollection< TRTUncompressedHit > &thpctrt)
static double strawEfficiency(double driftRadius, int BEC=0)
TimedHitCollection< TRTUncompressedHit > * m_thpctrt
StatusCode mergeEvent(const EventContext &ctx)
called at the end of the subevts loop.
StatusCode prepareEvent(const EventContext &ctx, const unsigned int)
return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase...
SG::WriteHandleKey< InDet::TRT_DriftCircleContainer > m_trtDriftCircleContainerKey
std::multimap< Identifier, InDet::TRT_DriftCircle * > m_driftCircleMap
int gasType(const Identifier &straw_id) const
SG::WriteHandleKey< PRD_MultiTruthCollection > m_trtPrdTruthKey
PublicToolHandle< ITRT_DriftFunctionTool > m_trtDriftFunctionTool
static double correctionHT(double momentum, Trk::ParticleHypothesis hypothesis)
ToolHandle< ITRT_StrawStatusSummaryTool > m_trtStrawStatusSummaryTool
std::vector< TRTUncompressedHitCollection * > m_trtHitCollList
virtual StatusCode initialize()
Initialize.
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Identifier getIdentifier(int hitID, IdentifierHash &hash, Identifier &layer_id, bool &status) const
static double HTProbabilityMuon_5_20(double eta)
double particleMass(int i) const
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service.
const InDetDD::TRT_DetectorManager * m_trt_manager
double getProbHT(const EventContext &ctx, int particleEncoding, float kineticEnergy, const Identifier &straw_id, double driftRadiusLoc, double hitGlobalPosition) const
static double HTProbabilityElectron_high_pt(double eta)
StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents)
called for each active bunch-crossing to process current SubEvents bunchXing is in ns
static double HTProbabilityElectron_low_pt(double eta)
StatusCode createAndStoreRIOs(const EventContext &ctx, CLHEP::HepRandomEngine *rndmEngine)
PublicToolHandle< Trk::ITRT_ElectronPidTool > m_trtElectronPidTool
ServiceHandle< PileUpMergeSvc > m_mergeSvc
TRTFastDigitizationTool(const std::string &type, const std::string &name, const IInterface *parent)
StatusCode processAllSubEvents(const EventContext &ctx)
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:84
Message Stream Member.
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.