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// particle table
30#include "HepPDT/ParticleDataTable.hh"
31#include "GaudiKernel/IPartPropSvc.h"
32
33// For magneticfield
35
40#include <vector>
41#include <set>
42#include <utility> /* pair */
43
44class TRT_ID;
47class TRTDigCondBase;
48class TRTNoise;
49
50namespace CLHEP{
51 class HepRandomEngine;
52}
53
57//class TRTUncompressedHitCollection;
58namespace InDetDD {
60}
61
62class TRTDigSettings;
63
64class TRTDigitizationTool : virtual public IPileUpTool, public PileUpToolBase {
65public:
66 TRTDigitizationTool( const std::string& type, const std::string& name, const IInterface* parent );
67
70
72 virtual StatusCode initialize() override final;
73
75 virtual StatusCode finalize() override final;
76
78 virtual StatusCode mergeEvent(const EventContext& ctx) override final;
79
81 virtual StatusCode processBunchXing( int bunchXing,
82 SubEventIterator bSubEvents,
83 SubEventIterator eSubEvents ) override final;
86 // virtual bool toProcess(int bunchXing) const;
87
88 virtual StatusCode prepareEvent( const EventContext& ctx, const unsigned int nInputEvents ) override final;
89
97 virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
98
99private:
100 CLHEP::HepRandomEngine* getRandomEngine(const std::string& streamName, const EventContext& ctx) const;
101 CLHEP::HepRandomEngine* getRandomEngine(const std::string& streamName, unsigned long int randomSeedOffset, const EventContext& ctx) const;
102
103 Identifier getIdentifier( int hitID,
104 IdentifierHash& hashId,
105 Identifier& layerID,
106 bool& statusok ) const;
107
108 StatusCode lateInitialize(const EventContext& ctx);
109 StatusCode processStraws(const EventContext& ctx,
111 std::set<int>& sim_hitids,
112 std::set<Identifier>& simhitsIdentifiers,
113 CLHEP::HepRandomEngine *rndmEngine,
114 CLHEP::HepRandomEngine *strawRndmEngine,
115 CLHEP::HepRandomEngine *elecProcRndmEngine,
116 CLHEP::HepRandomEngine *elecNoiseRndmEngine,
117 CLHEP::HepRandomEngine *paiRndmEngine);
118 StatusCode createAndStoreRDOs();
119
120 static double getCosmicEventPhase(CLHEP::HepRandomEngine *rndmEngine);
121
123 ToolHandle<ITRT_PAITool> m_TRTpaiToolXe{this, "PAI_Tool_Xe", "TRT_PAI_Process_Xe", "The PAI model for ionisation in the TRT Xe gas"};
124 ToolHandle<ITRT_PAITool> m_TRTpaiToolAr{this, "PAI_Tool_Ar", "TRT_PAI_Process_Ar", "The PAI model for ionisation in the TRT Ar gas"};
125 ToolHandle<ITRT_PAITool> m_TRTpaiToolKr{this, "PAI_Tool_Kr", "TRT_PAI_Process_Kr", "The PAI model for ionisation in the TRT Kr gas"};
126 ToolHandle<ITRT_SimDriftTimeTool> m_TRTsimdrifttimetool{this, "SimDriftTimeTool", "TRT_SimDriftTimeTool", "Drift time versus distance (r-t-relation) for TRT straws"};
127 ToolHandle<ITRT_StrawStatusSummaryTool> m_sumTool{this, "InDetTRTStrawStatusSummaryTool", "TRT_StrawStatusSummaryTool", ""};
128 ToolHandle<ITRT_CalDbTool> m_calDbTool{this, "InDetTRTCalDbTool", "TRT_CalDbTool", ""};
129 ServiceHandle<PileUpMergeSvc> m_mergeSvc{this, "MergeSvc", "PileUpMergeSvc", "Merge service"};
130 ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
131 ServiceHandle<ITRT_StrawNeighbourSvc> m_TRTStrawNeighbourSvc{this, "TRT_StrawNeighbourSvc", "TRT_StrawNeighbourSvc", ""};
132 // Read handle for conditions object to get the field cache
133 SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj",
134 "Name of the Magnetic Field conditions object key"};
135 SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> m_trtDetElementsInputKey {this, "TRT_DetEltContKey", "TRT_DetElementContainer",
136 "Name of the TRT Detector Element container conditions object key"};
137 Gaudi::Property<bool> m_onlyUseContainerName{this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};
138 SG::ReadHandleKey<TRTUncompressedHitCollection> m_hitsContainerKey{this, "DataObjectName", "TRTUncompressedHits", "Data Object Name"};
139 std::string m_dataObjectName{""};
140 SG::WriteHandleKey<TRT_RDO_Container> m_outputRDOCollName{this,"OutputObjectName","TRT_RDOs","WHK Output Object name"};
141 SG::WriteHandleKey<InDetSimDataCollection> m_outputSDOCollName{this,"OutputSDOName","TRT_SDO_Map","WHK Output SDO container name"};
143
144 Gaudi::Property<bool> m_printOverrideableSettings{this, "PrintOverrideableSettings", false, "Print overrideable settings"};
145 Gaudi::Property<bool> m_printUsedDigSettings{this, "PrintDigSettings", true, "Print ditigization settings"};
146 Gaudi::Property<int> m_HardScatterSplittingMode{this, "HardScatterSplittingMode", 0, ""};
147 Gaudi::Property<int> m_UseGasMix{this, "UseGasMix", 0, ""};
148 Gaudi::Property<unsigned long int> m_randomSeedOffset{this, "RandomSeedOffset", 678910, ""};
149
151
152 std::vector<std::pair<unsigned int, int> > m_seen;
153 std::vector<TRTDigit> m_vDigits;
158 //unsigned int m_timer_eventcount;
160 const TRT_ID* m_trt_id{};
161 std::vector<TRTUncompressedHitCollection*> m_trtHitCollList;
167 // const ComTime* m_ComTime{};
168 double m_cosmicEventPhase{0.0}; // local replacement for the comTime service
169
171 ServiceHandle<IPartPropSvc> m_ppSvc{this, "PartPropSvc", "PartPropSvc"};
172 const HepPDT::ParticleDataTable* m_particleTable{};
173
174 bool m_first_event{true};
175
177
178};
179
180#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
const HepPDT::ParticleDataTable * m_particleTable
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
ServiceHandle< IPartPropSvc > m_ppSvc
Handle on the particle property service.
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:82
Message Stream Member.