ATLAS Offline Software
Loading...
Searching...
No Matches
TRTDigitizationTool.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 TRT_DIGITIZATION_TRTDIGITIZATIONTOOL_H
6#define TRT_DIGITIZATION_TRTDIGITIZATIONTOOL_H
12
16#include "GaudiKernel/ServiceHandle.h"
17#include "GaudiKernel/ToolHandle.h"
24
27#include "TRTDigit.h"
28
29// For magneticfield
31
36#include <memory>
37#include <vector>
38#include <set>
39#include <utility> /* pair */
40
41class TRT_ID;
44class TRTDigCondBase;
45class TRTNoise;
46
47namespace CLHEP{
48 class HepRandomEngine;
49}
50
54//class TRTUncompressedHitCollection;
55namespace InDetDD {
57}
58
59class TRTDigSettings;
60
61class TRTDigitizationTool : virtual public IPileUpTool, public PileUpToolBase {
62public:
63 TRTDigitizationTool( const std::string& type, const std::string& name, const IInterface* parent );
64
67
69 virtual StatusCode initialize() override final;
70
72 virtual StatusCode finalize() override final;
73
75 virtual StatusCode mergeEvent(const EventContext& ctx) override final;
76
78 virtual StatusCode processBunchXing( int bunchXing,
79 SubEventIterator bSubEvents,
80 SubEventIterator eSubEvents ) override final;
83 // virtual bool toProcess(int bunchXing) const;
84
85 virtual StatusCode prepareEvent( const EventContext& ctx, const unsigned int nInputEvents ) override final;
86
94 virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
95
96private:
97 CLHEP::HepRandomEngine* getRandomEngine(const std::string& streamName, const EventContext& ctx) const;
98 CLHEP::HepRandomEngine* getRandomEngine(const std::string& streamName, unsigned long int randomSeedOffset, const EventContext& ctx) const;
99
100 Identifier getIdentifier( int hitID,
101 IdentifierHash& hashId,
102 Identifier& layerID,
103 bool& statusok ) const;
104
105 StatusCode lateInitialize(const EventContext& ctx);
106 StatusCode processStraws(const EventContext& ctx,
108 std::set<int>& sim_hitids,
109 std::set<Identifier>& simhitsIdentifiers,
110 CLHEP::HepRandomEngine *rndmEngine,
111 CLHEP::HepRandomEngine *strawRndmEngine,
112 CLHEP::HepRandomEngine *elecProcRndmEngine,
113 CLHEP::HepRandomEngine *elecNoiseRndmEngine,
114 CLHEP::HepRandomEngine *paiRndmEngine);
115 StatusCode createAndStoreRDOs();
116
117 static double getCosmicEventPhase(CLHEP::HepRandomEngine *rndmEngine);
118
120 ToolHandle<ITRT_PAITool> m_TRTpaiToolXe{this, "PAI_Tool_Xe", "TRT_PAI_Process_Xe", "The PAI model for ionisation in the TRT Xe gas"};
121 ToolHandle<ITRT_PAITool> m_TRTpaiToolAr{this, "PAI_Tool_Ar", "TRT_PAI_Process_Ar", "The PAI model for ionisation in the TRT Ar gas"};
122 ToolHandle<ITRT_PAITool> m_TRTpaiToolKr{this, "PAI_Tool_Kr", "TRT_PAI_Process_Kr", "The PAI model for ionisation in the TRT Kr gas"};
123 ToolHandle<ITRT_SimDriftTimeTool> m_TRTsimdrifttimetool{this, "SimDriftTimeTool", "TRT_SimDriftTimeTool", "Drift time versus distance (r-t-relation) for TRT straws"};
124 ToolHandle<ITRT_StrawStatusSummaryTool> m_sumTool{this, "InDetTRTStrawStatusSummaryTool", "TRT_StrawStatusSummaryTool", ""};
125 ToolHandle<ITRT_CalDbTool> m_calDbTool{this, "InDetTRTCalDbTool", "TRT_CalDbTool", ""};
126 ServiceHandle<PileUpMergeSvc> m_mergeSvc{this, "MergeSvc", "PileUpMergeSvc", "Merge service"};
127 ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
128 ServiceHandle<ITRT_StrawNeighbourSvc> m_TRTStrawNeighbourSvc{this, "TRT_StrawNeighbourSvc", "TRT_StrawNeighbourSvc", ""};
129 // Read handle for conditions object to get the field cache
130 SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj",
131 "Name of the Magnetic Field conditions object key"};
132 SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> m_trtDetElementsInputKey {this, "TRT_DetEltContKey", "TRT_DetElementContainer",
133 "Name of the TRT Detector Element container conditions object key"};
134 Gaudi::Property<bool> m_onlyUseContainerName{this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};
135 SG::ReadHandleKey<TRTUncompressedHitCollection> m_hitsContainerKey{this, "DataObjectName", "TRTUncompressedHits", "Data Object Name"};
136 std::string m_dataObjectName{""};
137 SG::WriteHandleKey<TRT_RDO_Container> m_outputRDOCollName{this,"OutputObjectName","TRT_RDOs","WHK Output Object name"};
138 SG::WriteHandleKey<InDetSimDataCollection> m_outputSDOCollName{this,"OutputSDOName","TRT_SDO_Map","WHK Output SDO container name"};
140
141 Gaudi::Property<bool> m_printOverrideableSettings{this, "PrintOverrideableSettings", false, "Print overrideable settings"};
142 Gaudi::Property<bool> m_printUsedDigSettings{this, "PrintDigSettings", true, "Print ditigization settings"};
143 Gaudi::Property<int> m_HardScatterSplittingMode{this, "HardScatterSplittingMode", 0, ""};
144 Gaudi::Property<int> m_UseGasMix{this, "UseGasMix", 0, ""};
145 Gaudi::Property<unsigned long int> m_randomSeedOffset{this, "RandomSeedOffset", 678910, ""};
146
148
149 std::vector<std::pair<unsigned int, int> > m_seen;
150 std::vector<TRTDigit> m_vDigits;
155 //unsigned int m_timer_eventcount;
157 const TRT_ID* m_trt_id{};
158 std::vector<TRTUncompressedHitCollection*> m_trtHitCollList;
164 // const ComTime* m_ComTime{};
165 double m_cosmicEventPhase{0.0}; // local replacement for the comTime service
166
167 bool m_first_event{true};
168
170
171};
172
173#endif
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition IPileUpTool.h:22
abstract interface to TRT calibration constants
Abstract interface to information on straws electronic grouping.
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.
Property holding a SG store/key/clid from which a WriteHandle is made.
Handle class for recording to StoreGate.
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.
Property holding a SG store/key/clid from which a WriteHandle is made.
Communication with CondDB.
Class containing parameters and settings used by TRT digitization.
TRTProcessingOfStraw * m_pProcessingOfStraw
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service.
virtual StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
called for each active bunch-crossing to process current SubEvents bunchXing is in ns
virtual StatusCode prepareEvent(const EventContext &ctx, const unsigned int nInputEvents) override final
return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase...
Gaudi::Property< bool > m_printUsedDigSettings
static double getCosmicEventPhase(CLHEP::HepRandomEngine *rndmEngine)
ToolHandle< ITRT_CalDbTool > m_calDbTool
SG::ReadCondHandleKey< InDetDD::TRT_DetElementContainer > m_trtDetElementsInputKey
std::vector< std::pair< unsigned int, int > > m_seen
ToolHandle< ITRT_PAITool > m_TRTpaiToolXe
Configurable properties.
ToolHandle< ITRT_SimDriftTimeTool > m_TRTsimdrifttimetool
TRTDigSettings * m_settings
SG::ReadHandleKey< TRTUncompressedHitCollection > m_hitsContainerKey
StatusCode processStraws(const EventContext &ctx, TimedHitCollection< TRTUncompressedHit > &thpctrt, std::set< int > &sim_hitids, std::set< Identifier > &simhitsIdentifiers, CLHEP::HepRandomEngine *rndmEngine, CLHEP::HepRandomEngine *strawRndmEngine, CLHEP::HepRandomEngine *elecProcRndmEngine, CLHEP::HepRandomEngine *elecNoiseRndmEngine, CLHEP::HepRandomEngine *paiRndmEngine)
ServiceHandle< ITRT_StrawNeighbourSvc > m_TRTStrawNeighbourSvc
Gaudi::Property< bool > m_onlyUseContainerName
std::vector< TRTDigit > m_vDigits
Vector of all digits.
Gaudi::Property< bool > m_printOverrideableSettings
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
TRTDigCondBase * m_pDigConditions
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
Perform digitization:
const InDetDD::TRT_DetectorManager * m_manager
Gaudi::Property< unsigned long int > m_randomSeedOffset
TimedHitCollection< TRTUncompressedHit > * m_thpctrt
virtual StatusCode initialize() override final
Initialize.
virtual StatusCode finalize() override final
Finalize.
Gaudi::Property< int > m_UseGasMix
StatusCode lateInitialize(const EventContext &ctx)
ToolHandle< ITRT_PAITool > m_TRTpaiToolKr
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
TRTElectronicsProcessing * m_pElectronicsProcessing
SG::WriteHandleKey< InDetSimDataCollection > m_outputSDOCollName
name of the output SDOs.
TRTDigitizationTool(const std::string &type, const std::string &name, const IInterface *parent)
SG::WriteHandle< TRT_RDO_Container > m_trtrdo_container
std::vector< TRTUncompressedHitCollection * > m_trtHitCollList
Identifier getIdentifier(int hitID, IdentifierHash &hashId, Identifier &layerID, bool &statusok) const
ServiceHandle< PileUpMergeSvc > m_mergeSvc
const TRT_ID * m_trt_id
TRT Id Helper.
SG::WriteHandleKey< TRT_RDO_Container > m_outputRDOCollName
name of the output RDOs.
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the subevts loop. Not (necessarily) able to access SubEvents
Gaudi::Property< int > m_HardScatterSplittingMode
ToolHandle< ITRT_PAITool > m_TRTpaiToolAr
Simulation of noise hits in the TRT.
Definition TRTNoise.h:39
TRT Digitization: Processing of a TRT Straws.
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:84
Message Stream Member.