ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_DigitizationTool.h
Go to the documentation of this file.
1/* -*- C++ -*- */
2
3/*
4 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef SCT_DIGITZATION_SCT_DIGITZATIONTOOL_H
8#define SCT_DIGITZATION_SCT_DIGITZATIONTOOL_H
14
15//Base class header
17
18// Athena headers
33
34// Gaudi headers
35#include "GaudiKernel/ServiceHandle.h"
36#include "GaudiKernel/ToolHandle.h"
37
38// STL headers
39#include <limits>
40#include <memory>
41#include <string>
42
43// Forward declarations
45class SCT_ID;
47
48namespace CLHEP
49{
50 class HepRandomEngine;
51}
52
53class SCT_DigitizationTool : public extends<PileUpToolBase, IPileUpTool>
54{
55public:
56 static const InterfaceID& interfaceID();
57 SCT_DigitizationTool(const std::string& type,
58 const std::string& name,
59 const IInterface* parent);
64 virtual StatusCode prepareEvent(const EventContext& ctx, unsigned int) override final;
65 virtual StatusCode processBunchXing(int bunchXing,
66 SubEventIterator bSubEvents,
67 SubEventIterator eSubEvents) override final;
68 virtual StatusCode mergeEvent(const EventContext& ctx) override final;
69
70 virtual StatusCode initialize() override final;
71 virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
72
74
75 bool digitizeElement(const EventContext& ctx, SiChargedDiodeCollection* chargedDiodes, TimedHitCollection<SiHit>*& thpcsi, CLHEP::HepRandomEngine * rndmEngine);
76 void applyProcessorTools(SiChargedDiodeCollection* chargedDiodes, CLHEP::HepRandomEngine * rndmEngine) const;
77 void addSDO(SiChargedDiodeCollection* collection, SG::WriteHandle<InDetSimDataCollection>* simDataCollMap) const;
78
79 void storeTool(ISiChargedDiodesProcessorTool* p_processor) {m_diodeCollectionTools.push_back(p_processor);}
80
81private:
82
86 StatusCode initServices();
90 StatusCode initFrontEndTool();
94 StatusCode initDisabledCells();
99
105 StatusCode createAndStoreRDO(SiChargedDiodeCollection* chDiodeCollection, SG::WriteHandle<SCT_RDO_Container>* rdoContainer) const;
110 std::unique_ptr<SCT_RDO_Collection> createRDO(SiChargedDiodeCollection* collection) const;
111
112 StatusCode getNextEvent(const EventContext& ctx);
113 void digitizeAllHits(const EventContext& ctx, SG::WriteHandle<SCT_RDO_Container>* rdoContainer, SG::WriteHandle<InDetSimDataCollection>* simDataCollMap, std::vector<bool>* processedElements, TimedHitCollection<SiHit>* thpcsi, CLHEP::HepRandomEngine * rndmEngine);
114 void digitizeNonHits(const EventContext& ctx, SG::WriteHandle<SCT_RDO_Container>* rdoContainer, SG::WriteHandle<InDetSimDataCollection>* simDataCollMap, const std::vector<bool>* processedElements, CLHEP::HepRandomEngine * rndmEngine) const;
115
119 void SetupRdoOutputType(Gaudi::Details::PropertyBase&);
120
121 FloatProperty m_tfix{this, "FixedTime", -999., "Fixed time for Cosmics run selection"};
122 BooleanProperty m_enableHits{this, "EnableHits", true, "Enable hits"};
123 BooleanProperty m_onlyHitElements{this, "OnlyHitElements", false, "Process only elements with hits"};
124 BooleanProperty m_cosmicsRun{this, "CosmicsRun", false, "Cosmics run selection"};
125 BooleanProperty m_barrelonly{this, "BarrelOnly", false, "Only Barrel layers"};
126 BooleanProperty m_randomDisabledCells{this, "RandomDisabledCells", false, "Use Random disabled cells, default no"};
127 BooleanProperty m_createNoiseSDO{this, "CreateNoiseSDO", false, "Create SDOs for strips with only noise hits (huge increase in SDO collection size"};
128 IntegerProperty m_HardScatterSplittingMode{this, "HardScatterSplittingMode", 0, "Control pileup & signal splitting. Process all SiHit or just those from signal or background events"};
129 BooleanProperty m_WriteSCT1_RawData{this, "WriteSCT1_RawData", false, "Write out SCT1_RawData rather than SCT3_RawData"};
130
131 BooleanProperty m_onlyUseContainerName{this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};
132 SG::ReadHandleKey<SiHitCollection> m_hitsContainerKey{this, "InputObjectName", "SCT_Hits", "Input HITS collection name"};
133 std::string m_inputObjectName{""};
134
135 SG::WriteHandleKey<SCT_RDO_Container> m_rdoContainerKey{this, "OutputObjectName", "SCT_RDOs", "Output Object name"};
137 SG::WriteHandleKey<InDetSimDataCollection> m_simDataCollMapKey{this, "OutputSDOName", "SCT_SDO_Map", "Output SDO container name"};
139 SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
140
141 ToolHandle<IFrontEnd> m_sct_FrontEnd{this, "FrontEnd", "SCT_FrontEnd", "Handle the Front End Electronic tool"};
142 ToolHandle<ISurfaceChargesGenerator> m_sct_SurfaceChargesGenerator{this, "SurfaceChargesGenerator", "SCT_SurfaceChargesGenerator", "Choice of using a more detailed charge drift model"};
143 ToolHandle<IRandomDisabledCellGenerator> m_sct_RandomDisabledCellGenerator{this, "RandomDisabledCellGenerator", "SCT_RandomDisabledCellGenerator", ""};
144 ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
145 ServiceHandle <PileUpMergeSvc> m_mergeSvc{this, "MergeSvc", "PileUpMergeSvc", "Merge service used in Pixel & SCT digitization"};
146
147 const SCT_ID* m_detID{nullptr};
148 std::unique_ptr<TimedHitCollection<SiHit>> m_thpcsi{nullptr};
149 std::vector<ISiChargedDiodesProcessorTool*> m_diodeCollectionTools;
150 std::vector<bool> m_processedElements;
151 std::vector<std::unique_ptr<SiHitCollection>> m_hitCollPtrs;
153};
154
155static const InterfaceID IID_ISCT_DigitizationTool("SCT_DigitizationTool", 1, 0);
156inline const InterfaceID& SCT_DigitizationTool::interfaceID() {
158}
159
160#endif // SCT_DIGITZATION_SCT_DIGITZATIONTOOL_H
#define protected
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().
static const InterfaceID IID_ISCT_DigitizationTool("SCT_DigitizationTool", 1, 0)
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.
void digitizeNonHits(const EventContext &ctx, SG::WriteHandle< SCT_RDO_Container > *rdoContainer, SG::WriteHandle< InDetSimDataCollection > *simDataCollMap, const std::vector< bool > *processedElements, CLHEP::HepRandomEngine *rndmEngine) const
digitize SCT without hits
ToolHandle< IFrontEnd > m_sct_FrontEnd
StatusCode createAndStoreRDO(SiChargedDiodeCollection *chDiodeCollection, SG::WriteHandle< SCT_RDO_Container > *rdoContainer) const
RDO and SDO methods.
BooleanProperty m_WriteSCT1_RawData
std::vector< std::unique_ptr< SiHitCollection > > m_hitCollPtrs
void digitizeAllHits(const EventContext &ctx, SG::WriteHandle< SCT_RDO_Container > *rdoContainer, SG::WriteHandle< InDetSimDataCollection > *simDataCollMap, std::vector< bool > *processedElements, TimedHitCollection< SiHit > *thpcsi, CLHEP::HepRandomEngine *rndmEngine)
digitize all hits
StatusCode initServices()
initialize the required services
ToolHandle< IRandomDisabledCellGenerator > m_sct_RandomDisabledCellGenerator
virtual ~SCT_DigitizationTool()
ToolHandle< ISurfaceChargesGenerator > m_sct_SurfaceChargesGenerator
SG::WriteHandle< InDetSimDataCollection > m_simDataCollMap
SDO Map handle.
StatusCode initDisabledCells()
Initialize the SCT_RandomDisabledCellGenerator AlgTool.
std::vector< ISiChargedDiodesProcessorTool * > m_diodeCollectionTools
SG::WriteHandleKey< InDetSimDataCollection > m_simDataCollMapKey
SCT_DigitizationTool(const std::string &type, const std::string &name, const IInterface *parent)
const SCT_ID * m_detID
Handle to the ID helper.
virtual StatusCode initialize() override final
SG::WriteHandle< SCT_RDO_Container > m_rdoContainer
RDO container handle.
virtual StatusCode mergeEvent(const EventContext &ctx) override final
StatusCode getNextEvent(const EventContext &ctx)
bool digitizeElement(const EventContext &ctx, SiChargedDiodeCollection *chargedDiodes, TimedHitCollection< SiHit > *&thpcsi, CLHEP::HepRandomEngine *rndmEngine)
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service.
StatusCode initSurfaceChargesGeneratorTool()
Initialize the SCT_SurfaceChargesGenerator AlgTool.
BooleanProperty m_onlyHitElements
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
std::unique_ptr< TimedHitCollection< SiHit > > m_thpcsi
ServiceHandle< PileUpMergeSvc > m_mergeSvc
IntegerProperty m_HardScatterSplittingMode
void SetupRdoOutputType(Gaudi::Details::PropertyBase &)
Called when m_WriteSCT1_RawData is altered.
StatusCode initFrontEndTool()
Initialize the SCT_FrontEnd AlgTool.
void storeTool(ISiChargedDiodesProcessorTool *p_processor)
BooleanProperty m_createNoiseSDO
void addSDO(SiChargedDiodeCollection *collection, SG::WriteHandle< InDetSimDataCollection > *simDataCollMap) const
SG::ReadHandleKey< SiHitCollection > m_hitsContainerKey
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int) override final
Called before processing physics events.
static const InterfaceID & interfaceID()
SG::WriteHandleKey< SCT_RDO_Container > m_rdoContainerKey
virtual StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
std::unique_ptr< SCT_RDO_Collection > createRDO(SiChargedDiodeCollection *collection) const
Create RDOs from the SiChargedDiodeCollection for the current wafer.
void applyProcessorTools(SiChargedDiodeCollection *chargedDiodes, CLHEP::HepRandomEngine *rndmEngine) const
BooleanProperty m_randomDisabledCells
BooleanProperty m_onlyUseContainerName
std::vector< bool > m_processedElements
vector of processed elements - set by digitizeHits() *‍/
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
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.
Definition SiHit.h:19
Forward declaration.