ATLAS Offline Software
Loading...
Searching...
No Matches
TRTDigitizationTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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"
23
26#include "TRTDigit.h"
27
28// particle table
29#include "HepPDT/ParticleDataTable.hh"
30#include "GaudiKernel/IPartPropSvc.h"
31
32// For magneticfield
34
39#include <vector>
40#include <set>
41#include <utility> /* pair */
42
43class TRT_ID;
46class TRTDigCondBase;
47class TRTNoise;
48
49namespace CLHEP{
50 class HepRandomEngine;
51}
52
56//class TRTUncompressedHitCollection;
57namespace InDetDD {
59}
60
61class TRTDigSettings;
62
63class TRTDigitizationTool : virtual public IPileUpTool, public PileUpToolBase {
64public:
65 TRTDigitizationTool( const std::string& type, const std::string& name, const IInterface* parent );
66
69
71 virtual StatusCode initialize() override final;
72
74 virtual StatusCode finalize() override final;
75
77 virtual StatusCode mergeEvent(const EventContext& ctx) override final;
78
80 virtual StatusCode processBunchXing( int bunchXing,
81 SubEventIterator bSubEvents,
82 SubEventIterator eSubEvents ) override final;
85 // virtual bool toProcess(int bunchXing) const;
86
87 virtual StatusCode prepareEvent( const EventContext& ctx, const unsigned int nInputEvents ) override final;
88
96 virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
97
98private:
99 CLHEP::HepRandomEngine* getRandomEngine(const std::string& streamName, const EventContext& ctx) const;
100 CLHEP::HepRandomEngine* getRandomEngine(const std::string& streamName, unsigned long int randomSeedOffset, const EventContext& ctx) const;
101
102 Identifier getIdentifier( int hitID,
103 IdentifierHash& hashId,
104 Identifier& layerID,
105 bool& statusok ) const;
106
107 StatusCode lateInitialize(const EventContext& ctx);
108 StatusCode processStraws(const EventContext& ctx,
110 std::set<int>& sim_hitids,
111 std::set<Identifier>& simhitsIdentifiers,
112 CLHEP::HepRandomEngine *rndmEngine,
113 CLHEP::HepRandomEngine *strawRndmEngine,
114 CLHEP::HepRandomEngine *elecProcRndmEngine,
115 CLHEP::HepRandomEngine *elecNoiseRndmEngine,
116 CLHEP::HepRandomEngine *paiRndmEngine);
117 StatusCode createAndStoreRDOs();
118
119 static double getCosmicEventPhase(CLHEP::HepRandomEngine *rndmEngine);
120
122 ToolHandle<ITRT_PAITool> m_TRTpaiToolXe{this, "PAI_Tool_Xe", "TRT_PAI_Process_Xe", "The PAI model for ionisation in the TRT Xe gas"};
123 ToolHandle<ITRT_PAITool> m_TRTpaiToolAr{this, "PAI_Tool_Ar", "TRT_PAI_Process_Ar", "The PAI model for ionisation in the TRT Ar gas"};
124 ToolHandle<ITRT_PAITool> m_TRTpaiToolKr{this, "PAI_Tool_Kr", "TRT_PAI_Process_Kr", "The PAI model for ionisation in the TRT Kr gas"};
125 ToolHandle<ITRT_SimDriftTimeTool> m_TRTsimdrifttimetool{this, "SimDriftTimeTool", "TRT_SimDriftTimeTool", "Drift time versus distance (r-t-relation) for TRT straws"};
126 ToolHandle<ITRT_StrawStatusSummaryTool> m_sumTool{this, "InDetTRTStrawStatusSummaryTool", "TRT_StrawStatusSummaryTool", ""};
127 ToolHandle<ITRT_CalDbTool> m_calDbTool{this, "InDetTRTCalDbTool", "TRT_CalDbTool", ""};
128 ServiceHandle<PileUpMergeSvc> m_mergeSvc{this, "MergeSvc", "PileUpMergeSvc", "Merge service"};
129 ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
130 ServiceHandle<ITRT_StrawNeighbourSvc> m_TRTStrawNeighbourSvc{this, "TRT_StrawNeighbourSvc", "TRT_StrawNeighbourSvc", ""};
131 // Read handle for conditions object to get the field cache
132 SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj",
133 "Name of the Magnetic Field 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
168 ServiceHandle<IPartPropSvc> m_ppSvc{this, "PartPropSvc", "PartPropSvc"};
169 const HepPDT::ParticleDataTable* m_particleTable{};
170
171 bool m_first_event{true};
172
174
175};
176
177#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
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.