ATLAS Offline Software
Loading...
Searching...
No Matches
CscDigitizationTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONDIGITIZATION_CSCDIGITIZATIONTOOL_H
6#define MUONDIGITIZATION_CSCDIGITIZATIONTOOL_H
7
8#include <memory>
9
11
12#include "GaudiKernel/ServiceHandle.h"
13#include "GaudiKernel/ToolHandle.h"
15#include "CLHEP/Random/RandomEngine.h"
26
27#include "CSC_Digitizer.h"
28
29// Author: Ketevi A. Assamagan
30// BNL, October 27, 2003
31
32// Digitization algorithm for the CSC:
33// get the hit container from Storegate
34// loop over the hits
35// digitize each hit
36// loop over the digit and build the digit container
37// store the digits in StoreGate
38
40
41 typedef std::vector<CscSimData::Deposit> deposits;
42 typedef std::map<IdentifierHash,std::pair<double,double> > csc_map;
43 typedef std::map<IdentifierHash,std::vector<float> > csc_newmap;
44
45
46public:
47
48 CscDigitizationTool(const std::string& type, const std::string& name, const IInterface* pIID);
49
51
52 virtual StatusCode initialize() override final;
53
54 // PileUpTool methods...
56 virtual StatusCode mergeEvent(const EventContext& ctx) override final;
57
59 virtual StatusCode processBunchXing(
60 int bunchXing,
61 SubEventIterator bSubEvents,
62 SubEventIterator eSubEvents
63 ) override final;
64
67 // virtual bool toProcess(int bunchXing) const;
68 virtual StatusCode prepareEvent(const EventContext& ctx, unsigned int /*nInputEvents*/) override final;
69
72 virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
73
76 StatusCode FillCollectionWithNewDigitEDM(csc_newmap& data_SampleMap, //csc_newmap& data_SampleMapOddPhase,
77 std::map<IdentifierHash,deposits>& myDeposits,bool phaseToSet,
78 Collections_t& collections,
79 CscSimDataCollection* cscSimData);
80 StatusCode FillCollectionWithOldDigitEDM(csc_map& data_map, std::map<IdentifierHash,deposits>& myDeposits,
81 Collections_t& collections,
82 CscSimDataCollection* cscSimData);
83
84 StatusCode CoreDigitization(Collections_t& collections,CscSimDataCollection* cscSimData, CLHEP::HepRandomEngine* rndmEngine, const EventContext& ctx);
85
86 // Get next event and extract collection of hit collections:
87 StatusCode getNextEvent(const EventContext& ctx);
88
89 ToolHandle<ICscCalibTool> m_pcalib{this, "cscCalibTool", "CscCalibTool", "CSC calibration tool"};
90
91 BooleanProperty m_onlyUseContainerName{this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};
92 SG::ReadHandleKey<CSCSimHitCollection> m_hitsContainerKey{this, "InputObjectName", "CSC_Hits", "name of the input objects"}; // name of the input objects
93 std::string m_inputObjectName{""};
94 SG::WriteHandleKey<CscSimDataCollection> m_cscSimDataCollectionWriteHandleKey{this,"CSCSimDataCollectionOutputName","CSC_SDO","WriteHandleKey for Output CscSimDataCollection"};
95 SG::WriteHandleKey<CscDigitContainer> m_cscDigitContainerKey{this,"OutputObjectName","CSC_DIGITS","CSC digit container object"};
96
97 std::unique_ptr<CSC_Digitizer> m_cscDigitizer{nullptr};
98
99 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
100
101 Gaudi::Property<double> m_pedestal{this, "pedestal",0.0, ""};
102 Gaudi::Property<bool> m_maskBadChannel{this, "maskBadChannels", true, ""};
103 Gaudi::Property<double> m_amplification{this, "amplification", 0.58e5, ""};
104
105 //pile-up
107 std::list<CSCSimHitCollection*> m_cscHitCollList; // only for pileup events..
108 //pileup truth veto
109 Gaudi::Property<bool> m_includePileUpTruth{this, "IncludePileUpTruth", true, "Include pile-up truth info"};
110
111 Gaudi::Property<double> m_timeWindowLowerOffset{this, "WindowLowerOffset", -25., ""};
112 Gaudi::Property<double> m_timeWindowUpperOffset{this, "WindowUpperOffset", +25., ""};
113 Gaudi::Property<bool> m_isPileUp{this, "isPileUp", false, ""};
114 Gaudi::Property<bool> m_newDigitEDM{this, "NewDigitEDM", true, ""};
115 Gaudi::Property<double> m_driftVelocity{this, "DriftVelocity", 60, ""}; // 60 / (1e-6 * 1e9); // 6 cm/microsecond -> mm/ns // 0.06
116 Gaudi::Property<double> m_electronEnergy{this, "ElectronEnergy", 66, ""}; // eV
117 Gaudi::Property<bool> m_NInterFixed{this, "NInterFixed", false, ""};
118
119 ServiceHandle<PileUpMergeSvc> m_mergeSvc{this, "PileUpMergeSvc", "PileUpMergeSvc", ""}; // Pile up service
120
121 ServiceHandle <IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""}; // Random number service
122};
123
124#endif // MUONDIGITIZATION_CSCDIGITIZATIONTOOL_H
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().
CscDigitizationTool(const std::string &type, const std::string &name, const IInterface *pIID)
std::map< IdentifierHash, std::vector< float > > csc_newmap
TimedHitCollection< CSCSimHit > * m_thpcCSC
SG::WriteHandleKey< CscDigitContainer > m_cscDigitContainerKey
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
Gaudi::Property< bool > m_isPileUp
ServiceHandle< IAthRNGSvc > m_rndmSvc
Gaudi::Property< double > m_timeWindowUpperOffset
ToolHandle< ICscCalibTool > m_pcalib
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
StatusCode FillCollectionWithNewDigitEDM(csc_newmap &data_SampleMap, std::map< IdentifierHash, deposits > &myDeposits, bool phaseToSet, Collections_t &collections, CscSimDataCollection *cscSimData)
virtual StatusCode initialize() override final
Gaudi::Property< double > m_driftVelocity
StatusCode FillCollectionWithOldDigitEDM(csc_map &data_map, std::map< IdentifierHash, deposits > &myDeposits, Collections_t &collections, CscSimDataCollection *cscSimData)
std::vector< std::unique_ptr< CscDigitCollection > > Collections_t
Gaudi::Property< bool > m_NInterFixed
std::map< IdentifierHash, std::pair< double, double > > csc_map
Gaudi::Property< double > m_pedestal
ServiceHandle< PileUpMergeSvc > m_mergeSvc
std::vector< CscSimData::Deposit > deposits
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the subevts loop. Not (necessarily) able to access subEvents
Gaudi::Property< bool > m_includePileUpTruth
Gaudi::Property< bool > m_maskBadChannel
~CscDigitizationTool()=default
SG::WriteHandleKey< CscSimDataCollection > m_cscSimDataCollectionWriteHandleKey
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
StatusCode getNextEvent(const EventContext &ctx)
std::list< CSCSimHitCollection * > m_cscHitCollList
Gaudi::Property< bool > m_newDigitEDM
Gaudi::Property< double > m_timeWindowLowerOffset
std::unique_ptr< CSC_Digitizer > m_cscDigitizer
SG::ReadHandleKey< CSCSimHitCollection > m_hitsContainerKey
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int) override final
return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase...
BooleanProperty m_onlyUseContainerName
StatusCode CoreDigitization(Collections_t &collections, CscSimDataCollection *cscSimData, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx)
Gaudi::Property< double > m_electronEnergy
Gaudi::Property< double > m_amplification
This is a "hash" representation of an Identifier.
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.
STL class.
STL class.
STL namespace.
#define private