ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD_DigitizationTool.h
Go to the documentation of this file.
1
17
18#ifndef HGTD_DIGITZATION_HGTD_DIGITZATIONTOOL_H
19#define HGTD_DIGITZATION_HGTD_DIGITZATIONTOOL_H
20
23
25#include "GaudiKernel/ServiceHandle.h"
26#include "GaudiKernel/ToolHandle.h"
37
38#include <memory>
39#include <string>
40
41class HGTD_ID;
44class IFrontEnd;
46
47namespace CLHEP {
48class HepRandomEngine;
49}
50
51class HGTD_DigitizationTool : virtual public IPileUpTool,
52 public PileUpToolBase {
53public:
54 static const InterfaceID& interfaceID();
55
56 HGTD_DigitizationTool(const std::string& type, const std::string& name,
57 const IInterface* parent);
58
60 /*** Methods completing the IPileUpTool interfaces ***/
61
62 virtual StatusCode initialize() override final;
63
64 virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
65
66 virtual StatusCode prepareEvent(const EventContext& ctx, unsigned int) override final;
67
68 virtual StatusCode processBunchXing(int bunch_xing,
69 SubEventIterator sub_event_itr,
70 SubEventIterator sub_event_itr_end) override final;
71
72 virtual StatusCode mergeEvent(const EventContext& ctx) override final;
74
75private:
78
81 StatusCode retrieveHitCollection(const EventContext& ctx);
82
83 StatusCode digitizeHitsPerDetectorElement(const EventContext& ctx, CLHEP::HepRandomEngine* rndmEngine);
84
88 // StatusCode simulateNoisePerDetectorElement();
89
96 void applyProcessorTools(SiChargedDiodeCollection*, CLHEP::HepRandomEngine* rndmEngine) const;
97
99
100 // inserts the created SDO elements into the m_sdo_collection_map object.
102
104
105 FloatProperty m_charge_threshold{this, "ChargeThreshold", 625., "Minimum charge threshold in ASIC"};
106
107 BooleanProperty m_onlyUseContainerName{this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};
108 SG::ReadHandleKey<SiHitCollection> m_hitsContainerKey{this, "InputObjectName", "HGTD_Hits", "Input HITS collection name"};
109 std::string m_inputObjectName{""};
110
112 SG::WriteHandleKey<HGTD_RDO_Container> m_output_rdo_cont_key{this, "OutputObjectName", "HGTD_RDOs", "Output Object name"};
113
115 SG::WriteHandleKey<HGTD_ALTIROC_RDO_Container> m_output_altiroc_rdo_cont_key{this, "AltirocOutputObject", "", "Key of HGTD_ALTIROC_RDO container"};
116
118 SG::WriteHandleKey<InDetSimDataCollection> m_output_sdo_coll_key{this, "OutputSDOName", "HGTD_SDO_Map", "Output SDO container name"};
119 SG::ReadCondHandleKey<InDetDD::HGTD_DetectorElementCollection> m_HGTDDetEleCollKey{this, "HGTDDetEleCollKey", "HGTD_DetectorElementCollection", "Key of HGTD_DetectorElementCollection for HGTD"};
120
121 ServiceHandle<PileUpMergeSvc> m_merge_svc{this, "MergeSvc", "PileUpMergeSvc", "Merge service used in Pixel & HGTD digitization"};
122 ServiceHandle<IAthRNGSvc> m_rndm_svc{this, "RndmSvc", "AthRNGSvc", "Random Number Service used in HGTD & Pixel digitization"};
123 std::list<ISiChargedDiodesProcessorTool*> m_diode_processor_tools;
124 ToolHandle<IFrontEnd> m_hgtd_front_end_tool{this, "FrontEnd", "HGTD_FrontEndTool", "Tool for pulse shape simulation"};
125 ToolHandle<IHGTD_SurfaceChargesGenerator> m_hgtd_surf_charge_gen{this, "SurfaceChargesGenerator", "HGTD_SurfaceChargesGenerator", "Choice of using a more detailed charge drift model"};
126 ToolHandle<HGTD_TdcCalibrationTool> m_hgtd_tdc_calib_tool{this, "HGTD_TdcCalibrationTool","HGTD_TdcCalibrationTool", "Tool that handles the Time to Digital Converter (TDC)"};
127
128 const HGTD_ID* m_id_helper{nullptr};
129 // NB: even though it is a flat collection, it acts more like a container,
130 // since the actual collections can be retrieved one by one with the
131 // nextDetectorElement method.
132 std::unique_ptr<TimedHitCollection<SiHit>> m_timed_hit_coll{nullptr};
137 std::vector<bool> m_processed_elements;
138 // FIXME is this meant as a "keapalive" vector?
139 std::vector<std::unique_ptr<SiHitCollection>> m_hit_coll_ptrs{};
140};
141
142static const InterfaceID IID_IHGTD_DigitizationTool("HGTD_DigitizationTool", 1, 0);
143inline const InterfaceID& HGTD_DigitizationTool::interfaceID() {
145}
146
147#endif // HGTD_DIGITZATION_HGTD_DIGITZATIONTOOL_H
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
static const InterfaceID IID_IHGTD_DigitizationTool("HGTD_DigitizationTool", 1, 0)
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration.
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration.
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition IPileUpTool.h:22
the preferred mechanism to access information from the different event stores in a pileup job.
helper base class IPileUpTool::toProcess().
StatusCode createAndStoreRDO(SiChargedDiodeCollection *, const InDetDD::SolidStateDetectorElementBase *)
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection > m_HGTDDetEleCollKey
ServiceHandle< PileUpMergeSvc > m_merge_svc
SG::WriteHandleKey< HGTD_ALTIROC_RDO_Container > m_output_altiroc_rdo_cont_key
SG::WriteHandle< HGTD_RDO_Container > m_hgtd_rdo_container
RDO container handle.
std::vector< std::unique_ptr< SiHitCollection > > m_hit_coll_ptrs
StatusCode retrieveHitCollection(const EventContext &ctx)
Retrieve the SiHit collection and place it in a TimedHitCollection.
const HGTD_ID * m_id_helper
Handle to the ID helper.
static const InterfaceID & interfaceID()
SG::WriteHandle< HGTD_ALTIROC_RDO_Container > m_hgtd_altiroc_rdo_container
ALTIROC RDO container handle.
ToolHandle< IHGTD_SurfaceChargesGenerator > m_hgtd_surf_charge_gen
HGTD_DigitizationTool(const std::string &type, const std::string &name, const IInterface *parent)
ToolHandle< IFrontEnd > m_hgtd_front_end_tool
std::unique_ptr< TimedHitCollection< SiHit > > m_timed_hit_coll
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int) override final
called before the bunchXing loop
void createAndStoreSDO(SiChargedDiodeCollection *collection)
SG::WriteHandle< InDetSimDataCollection > m_sdo_collection_map
SDO Map handle.
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
virtual StatusCode initialize() override final
StatusCode digitizeHitsPerDetectorElement(const EventContext &ctx, CLHEP::HepRandomEngine *rndmEngine)
ToolHandle< HGTD_TdcCalibrationTool > m_hgtd_tdc_calib_tool
void applyProcessorTools(SiChargedDiodeCollection *, CLHEP::HepRandomEngine *rndmEngine) const
FIXME: will be implemented once we know how much noise we expect.
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the bunchXing loop
virtual StatusCode processBunchXing(int bunch_xing, SubEventIterator sub_event_itr, SubEventIterator sub_event_itr_end) override final
called for each active bunch-crossing (time in ns)
SG::WriteHandleKey< InDetSimDataCollection > m_output_sdo_coll_key
SG::ReadHandleKey< SiHitCollection > m_hitsContainerKey
ServiceHandle< IAthRNGSvc > m_rndm_svc
Random number service.
std::list< ISiChargedDiodesProcessorTool * > m_diode_processor_tools
BooleanProperty m_onlyUseContainerName
SG::WriteHandleKey< HGTD_RDO_Container > m_output_rdo_cont_key
std::vector< bool > m_processed_elements
In order to process all element rather than just those with hits we create a vector to keep track of ...
This is an Identifier helper class for the HGTD subdetector.
Definition HGTD_ID.h:47
Class to hold geometrical description of a solid state detector element.
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.