ATLAS Offline Software
HGTD_DigitizationTool.h
Go to the documentation of this file.
1 
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"
34 
35 #include <memory>
36 #include <string>
37 
38 class HGTD_ID;
41 class IFrontEnd;
43 
44 namespace CLHEP {
45 class HepRandomEngine;
46 }
47 
48 class HGTD_DigitizationTool : virtual public IPileUpTool,
49  public PileUpToolBase {
50 public:
51  static const InterfaceID& interfaceID();
52 
53  HGTD_DigitizationTool(const std::string& type, const std::string& name,
54  const IInterface* parent);
55 
57  /*** Methods completing the IPileUpTool interfaces ***/
58 
59  virtual StatusCode initialize() override final;
60 
61  virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
62 
63  virtual StatusCode prepareEvent(const EventContext& ctx, unsigned int) override final;
64 
65  virtual StatusCode processBunchXing(int bunch_xing,
66  SubEventIterator sub_event_itr,
67  SubEventIterator sub_event_itr_end) override final;
68 
69  virtual StatusCode mergeEvent(const EventContext& ctx) override final;
71 
72 private:
75 
78  StatusCode retrieveHitCollection(const EventContext& ctx);
79 
80  StatusCode digitizeHitsPerDetectorElement(const EventContext& ctx, CLHEP::HepRandomEngine* rndmEngine);
81 
85  // StatusCode simulateNoisePerDetectorElement();
86 
93  void applyProcessorTools(SiChargedDiodeCollection*, CLHEP::HepRandomEngine* rndmEngine) const;
94 
95  std::unique_ptr<HGTD_RDO_Collection> createRDOCollection(SiChargedDiodeCollection*) const;
96 
97  StatusCode storeRDOCollection(std::unique_ptr<HGTD_RDO_Collection>);
98 
99  // inserts the created SDO elements into the m_sdo_collection_map object.
101 
103 
104  FloatProperty m_charge_threshold{this, "ChargeThreshold", 625., "Minimum charge threshold in ASIC"};
105 
106  BooleanProperty m_onlyUseContainerName{this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};
107  SG::ReadHandleKey<SiHitCollection> m_hitsContainerKey{this, "InputObjectName", "HGTD_Hits", "Input HITS collection name"};
108  std::string m_inputObjectName{""};
109 
111  SG::WriteHandleKey<HGTD_RDO_Container> m_output_rdo_cont_key{this, "OutputObjectName", "HGTD_RDOs", "Output Object name"};
113  SG::WriteHandleKey<InDetSimDataCollection> m_output_sdo_coll_key{this, "OutputSDOName", "HGTD_SDO_Map", "Output SDO container name"};
114  SG::ReadCondHandleKey<InDetDD::HGTD_DetectorElementCollection> m_HGTDDetEleCollKey{this, "HGTDDetEleCollKey", "HGTD_DetectorElementCollection", "Key of HGTD_DetectorElementCollection for HGTD"};
115 
116  ServiceHandle<PileUpMergeSvc> m_merge_svc{this, "MergeSvc", "PileUpMergeSvc", "Merge service used in Pixel & HGTD digitization"};
117  ServiceHandle<IAthRNGSvc> m_rndm_svc{this, "RndmSvc", "AthRNGSvc", "Random Number Service used in HGTD & Pixel digitization"};
118  std::list<ISiChargedDiodesProcessorTool*> m_diode_processor_tools;
119  ToolHandle<IFrontEnd> m_hgtd_front_end_tool{this, "FrontEnd", "HGTD_FrontEndTool", "Tool for pulse shape simulation"};
120  ToolHandle<IHGTD_SurfaceChargesGenerator> m_hgtd_surf_charge_gen{this, "SurfaceChargesGenerator", "HGTD_SurfaceChargesGenerator", "Choice of using a more detailed charge drift model"};
121 
122  const HGTD_ID* m_id_helper{nullptr};
123  // NB: even though it is a flat collection, it acts more like a container,
124  // since the actual collections can be retrieved one by one with the
125  // nextDetectorElement method.
126  std::unique_ptr<TimedHitCollection<SiHit>> m_timed_hit_coll{nullptr};
131  std::vector<bool> m_processed_elements;
132  // FIXME is this meant as a "keapalive" vector?
133  std::vector<std::unique_ptr<SiHitCollection>> m_hit_coll_ptrs{};
134 };
135 
136 static const InterfaceID IID_IHGTD_DigitizationTool("HGTD_DigitizationTool", 1, 0);
137 inline const InterfaceID& HGTD_DigitizationTool::interfaceID() {
138  return IID_IHGTD_DigitizationTool;
139 }
140 
141 #endif // HGTD_DIGITZATION_HGTD_DIGITZATIONTOOL_H
HGTD_DigitizationTool::m_output_sdo_coll_key
SG::WriteHandleKey< InDetSimDataCollection > m_output_sdo_coll_key
Definition: HGTD_DigitizationTool.h:113
HGTD_DigitizationTool::m_id_helper
const HGTD_ID * m_id_helper
Handle to the ID helper.
Definition: HGTD_DigitizationTool.h:122
HGTD_DigitizationTool::processBunchXing
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)
Definition: HGTD_DigitizationTool.cxx:90
HGTD_DigitizationTool::mergeEvent
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the bunchXing loop
Definition: HGTD_DigitizationTool.cxx:129
HGTD_DigitizationTool::initialize
virtual StatusCode initialize() override final
Definition: HGTD_DigitizationTool.cxx:28
HGTD_DigitizationTool::m_hitsContainerKey
SG::ReadHandleKey< SiHitCollection > m_hitsContainerKey
Definition: HGTD_DigitizationTool.h:107
HGTD_DigitizationTool::m_hgtd_surf_charge_gen
ToolHandle< IHGTD_SurfaceChargesGenerator > m_hgtd_surf_charge_gen
Definition: HGTD_DigitizationTool.h:120
IFrontEnd
Definition: IFrontEnd.h:27
HGTD_RDO_Container.h
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration.
HGTD_DigitizationTool::processAllSubEvents
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
Definition: HGTD_DigitizationTool.cxx:62
IHGTD_SurfaceChargesGenerator.h
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration.
HGTD_DigitizationTool::createRDOCollection
std::unique_ptr< HGTD_RDO_Collection > createRDOCollection(SiChargedDiodeCollection *) const
Definition: HGTD_DigitizationTool.cxx:337
InDetSimDataCollection
Definition: InDetSimDataCollection.h:25
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
HGTD_DigitizationTool::m_sdo_collection_map
SG::WriteHandle< InDetSimDataCollection > m_sdo_collection_map
SDO Map handle.
Definition: HGTD_DigitizationTool.h:112
HGTD_DigitizationTool::interfaceID
static const InterfaceID & interfaceID()
Definition: HGTD_DigitizationTool.h:137
ISiChargedDiodesProcessorTool
Definition: ISiChargedDiodesProcessorTool.h:26
HGTD_DigitizationTool::m_inputObjectName
std::string m_inputObjectName
Definition: HGTD_DigitizationTool.h:108
HGTD_DigitizationTool::m_rndm_svc
ServiceHandle< IAthRNGSvc > m_rndm_svc
Random number service.
Definition: HGTD_DigitizationTool.h:117
HGTD_DigitizationTool::storeRDOCollection
StatusCode storeRDOCollection(std::unique_ptr< HGTD_RDO_Collection >)
Definition: HGTD_DigitizationTool.cxx:325
SG::WriteHandleKey< HGTD_RDO_Container >
SiChargedDiodeCollection
Definition: SiChargedDiodeCollection.h:109
HGTD_DigitizationTool::retrieveHitCollection
StatusCode retrieveHitCollection(const EventContext &ctx)
Retrieve the SiHit collection and place it in a TimedHitCollection.
Definition: HGTD_DigitizationTool.cxx:172
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
HGTD_DigitizationTool::m_hgtd_front_end_tool
ToolHandle< IFrontEnd > m_hgtd_front_end_tool
Definition: HGTD_DigitizationTool.h:119
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TimedHitCollection.h
HGTD_DigitizationTool::m_merge_svc
ServiceHandle< PileUpMergeSvc > m_merge_svc
Definition: HGTD_DigitizationTool.h:116
HGTD_ID
Definition: HGTD_ID.h:47
IPileUpTool
Definition: IPileUpTool.h:24
HGTD_DigitizationTool::m_timed_hit_coll
std::unique_ptr< TimedHitCollection< SiHit > > m_timed_hit_coll
Definition: HGTD_DigitizationTool.h:126
HGTD_DigitizationTool::applyProcessorTools
void applyProcessorTools(SiChargedDiodeCollection *, CLHEP::HepRandomEngine *rndmEngine) const
FIXME: will be implemented once we know how much noise we expect.
Definition: HGTD_DigitizationTool.cxx:302
PileUpToolBase
Definition: PileUpToolBase.h:18
HGTD_DigitizationTool::digitizeHitsPerDetectorElement
StatusCode digitizeHitsPerDetectorElement(const EventContext &ctx, CLHEP::HepRandomEngine *rndmEngine)
Definition: HGTD_DigitizationTool.cxx:231
HGTD_DigitizationTool::m_HGTDDetEleCollKey
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection > m_HGTDDetEleCollKey
Definition: HGTD_DigitizationTool.h:114
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
HGTD_DetectorElementCollection.h
HGTD_DigitizationTool::m_hit_coll_ptrs
std::vector< std::unique_ptr< SiHitCollection > > m_hit_coll_ptrs
Definition: HGTD_DigitizationTool.h:133
HGTD_DigitizationTool::m_output_rdo_cont_key
SG::WriteHandleKey< HGTD_RDO_Container > m_output_rdo_cont_key
Definition: HGTD_DigitizationTool.h:111
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection >
SG::WriteHandle< HGTD_RDO_Container >
HGTD_RDO_Collection.h
HGTD_DigitizationTool::createAndStoreSDO
void createAndStoreSDO(SiChargedDiodeCollection *collection)
Definition: HGTD_DigitizationTool.cxx:399
PileUpMergeSvc.h
the preferred mechanism to access information from the different event stores in a pileup job.
InDetSimDataCollection.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HGTD_DigitizationTool
Definition: HGTD_DigitizationTool.h:49
HGTD_DigitizationTool::m_diode_processor_tools
std::list< ISiChargedDiodesProcessorTool * > m_diode_processor_tools
Definition: HGTD_DigitizationTool.h:118
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22
HGTD_DigitizationTool::prepareEvent
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int) override final
called before the bunchXing loop
Definition: HGTD_DigitizationTool.cxx:153
PileUpToolBase.h
helper base class IPileUpTool::toProcess().
HGTD_DigitizationTool::HGTD_DigitizationTool
HGTD_DigitizationTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: HGTD_DigitizationTool.cxx:22
HGTD_DigitizationTool::m_charge_threshold
FloatProperty m_charge_threshold
Definition: HGTD_DigitizationTool.h:104
HGTD_DigitizationTool::m_hgtd_rdo_container
SG::WriteHandle< HGTD_RDO_Container > m_hgtd_rdo_container
RDO container handle.
Definition: HGTD_DigitizationTool.h:110
HGTD_DigitizationTool::m_onlyUseContainerName
BooleanProperty m_onlyUseContainerName
Definition: HGTD_DigitizationTool.h:106
HGTD_DigitizationTool::m_processed_elements
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 ...
Definition: HGTD_DigitizationTool.h:131
IAthRNGSvc.h
ServiceHandle< PileUpMergeSvc >
SiHitCollection.h