ATLAS Offline Software
Loading...
Searching...
No Matches
TRTFastDigitizationTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef FASTTRT_DIGITIZATION_FASTTRT_DIGITIZATIONTOOL_H
6#define FASTTRT_DIGITIZATION_FASTTRT_DIGITIZATIONTOOL_H
12
14
15#include "GaudiKernel/ServiceHandle.h"
16#include "GaudiKernel/ToolHandle.h"
18
23
24#include "GaudiKernel/RndmGenerators.h"
25
27
29
30#include "Identifier/Identifier.h"
31#include "CLHEP/Random/RandGauss.h"
32
34
36
42
43#include <utility>
44#include <vector>
45#include <map>
46#include <cmath>
47
48class TRT_ID;
50
51namespace InDetDD {
53}
54
55class TRT_ID;
56class StoreGateSvc;
58
59
61public:
62 TRTFastDigitizationTool( const std::string &type, const std::string &name, const IInterface *parent );
63
66 StatusCode mergeEvent(const EventContext& ctx);
67
70 StatusCode processBunchXing( int bunchXing,
71 SubEventIterator bSubEvents,
72 SubEventIterator eSubEvents );
73
76 // virtual bool toProcess(int bunchXing) const;
77
78 StatusCode prepareEvent(const EventContext& ctx, const unsigned int /*nInputEvents*/ );
79
82 StatusCode processAllSubEvents(const EventContext& ctx);
83
85 virtual StatusCode initialize();
86
88 StatusCode finalize();
89
90private:
91
92 StatusCode initializeNumericalConstants(); // once per run
93 StatusCode setNumericalConstants(); // once per event (pileup-dependent constants)
94
95 StatusCode produceDriftCircles(const EventContext& ctx,
96 CLHEP::HepRandomEngine* rndmEngine,
98
99 Identifier getIdentifier( int hitID, IdentifierHash &hash, Identifier &layer_id, bool &status ) const;
100
101 StatusCode createAndStoreRIOs(const EventContext& ctx, CLHEP::HepRandomEngine* rndmEngine);
102
104 HepGeom::Point3D< double > getGlobalPosition( const TimedHitPtr< TRTUncompressedHit > &hit );
105 bool isArgonStraw( const Identifier &straw_id ) const;
106 int gasType( const Identifier &straw_id ) const;
107 double getProbHT( int particleEncoding, float kineticEnergy, const Identifier &straw_id, double driftRadiusLoc, double hitGlobalPosition ) const;
108 static double HTProbabilityElectron_high_pt( double eta );
109 static double HTProbabilityElectron_low_pt( double eta );
110 static double HTProbabilityMuon_5_20( double eta );
111 static double HTProbabilityMuon_60( double eta );
112 static double strawEfficiency( double driftRadius, int BEC = 0 );
113 static double correctionHT( double momentum, Trk::ParticleHypothesis hypothesis );
114 double particleMass( int i ) const;
115
116 // Tools and Services
117 PublicToolHandle< ITRT_DriftFunctionTool > m_trtDriftFunctionTool{this, "TRT_DriftFunctionTool", "TRT_DriftFunctionTool/FatrasTrtDriftFunctionTool"};
118 bool m_useTrtElectronPidTool{true}; // false: use Tina's parametrization
119 PublicToolHandle< Trk::ITRT_ElectronPidTool > m_trtElectronPidTool{this, "TRT_ElectronPidTool", "InDet::TRT_ElectronPidToolRun2/InDetTRT_ElectronPidTool"};
120 ToolHandle< ITRT_StrawStatusSummaryTool > m_trtStrawStatusSummaryTool{this, "TRT_StrawStatusSummaryTool", "InDetTRTStrawStatusSummaryTool"}; // Argon / Xenon
121 ServiceHandle< PileUpMergeSvc > m_mergeSvc{this, "MergeSvc", "PileUpMergeSvc"}; // PileUp Merge service
122 ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
123 StringProperty m_randomEngineName{this, "RandomStreamName", "FatrasRnd"}; // Name of the random number stream
124
125 // INPUT
126 StringProperty m_trtHitCollectionKey{this, "trtHitCollectionName", "TRTUncompressedHits"};
127 std::vector< TRTUncompressedHitCollection * > m_trtHitCollList;
128
129 // OUTPUT
131 SG::WriteHandleKey< PRD_MultiTruthCollection > m_trtPrdTruthKey{this, "trtPrdMultiTruthCollection", "PRD_MultiTruthTRT"};
132
134 std::multimap< Identifier, InDet::TRT_DriftCircle * > m_driftCircleMap;
135
136 // Helpers
138 const TRT_ID *m_trt_id{}; // TRT Id Helper
139
140 // Split configuration
141 IntegerProperty m_HardScatterSplittingMode{this, "HardScatterSplittingMode", 0, "Control pileup & signal splitting"}; // Process all TRT_Hits or just those from signal or background events
143
144 BooleanProperty m_useEventInfo{this, "useEventInfo", false}; // get mu from EventInfo ?
146 { this, "EventInfoKey", "EventInfo", "SG key for EventInfo" };
147 FloatProperty m_NCollPerEvent{this, "NCollPerEvent", 30};
148
149 // numerical constants. Might wish to move these to a DB in the future
150 double m_trtTailFraction{0.0}; // fraction in tails
151 double m_trtSigmaDriftRadiusTail{0.0}; // sigma of one TRT straw in R
154 double m_cFit[ 8 ][ 5 ]{}; // efficiency and resolution
155
156};
157
158#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
double getProbHT(int particleEncoding, float kineticEnergy, const Identifier &straw_id, double driftRadiusLoc, double hitGlobalPosition) 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
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:82
Message Stream Member.
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.