ATLAS Offline Software
Loading...
Searching...
No Matches
ZDC_PileUpTool.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 ZDC_DIGITIZATION_TOOL_H
6#define ZDC_DIGITIZATION_TOOL_H
7
9#include "Gaudi/Property.h"
10#include "GaudiKernel/ServiceHandle.h"
11
19
20#include <vector>
21#include <string>
22#include <memory>
23
24
25class ZdcID;
27
28namespace CLHEP {
29 class HepRandomEngine;
30}
31
33
35
36public:
37
38 ZDC_PileUpTool(const std::string& type,
39 const std::string& name,
40 const IInterface* parent);
41
42 virtual StatusCode initialize() override final;
43 void initializePbPb2015();
44 void initializeLHCf2022();
45 void initializePbPb2023();
46 virtual StatusCode finalize() override final { return StatusCode::SUCCESS; }
47
49 virtual StatusCode prepareEvent(const EventContext& ctx,const unsigned int nInputEvents) override final;
50
52 virtual StatusCode processBunchXing( int bunchXing,
53 SubEventIterator bSubEvents,
54 SubEventIterator eSubEvents
55 ) override final;
58 // virtual bool toProcess(int bunchXing) const;
59
61 virtual StatusCode mergeEvent(const EventContext& ctx) override final;
62 virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
63
64 private:
65
67 void fillContainer(const ZDC_SimFiberHit_Collection*, CLHEP::HepRandomEngine*, xAOD::ZdcModuleContainer*);
69 void createAndStoreWaveform(const ZDC_SimFiberHit &hit, CLHEP::HepRandomEngine*, xAOD::ZdcModuleContainer*);
70 void addEmptyWaveforms(xAOD::ZdcModuleContainer *zdcModuleContainer, CLHEP::HepRandomEngine* rndEngine);
71 std::vector<short unsigned int> generateWaveform(std::shared_ptr<ZDCWaveformSampler> wfSampler, float amplitude, float t0);
72
73 void SetDumps(bool, bool);
74
76 const ZdcID* m_ZdcID{};
77 std::unique_ptr<xAOD::ZdcModuleContainer> m_ZdcModuleContainer;
78 std::unique_ptr<xAOD::ZdcModuleAuxContainer> m_ZdcModuleAuxContainer;
79
80 ServiceHandle<PileUpMergeSvc> m_mergeSvc{this, "mergeSvc", "PileUpMergeSvc", ""};
81 ServiceHandle<IAthRNGSvc> m_randomSvc{this, "RndmSvc", "AthRNGSvc", ""};
82 Gaudi::Property<std::string> m_randomStreamName{this, "RandomStreamName", "ZDCRndEng", ""};
83
84 SG::ReadHandleKey<ZDC_SimFiberHit_Collection> m_SimFiberHitCollectionKey{this, "ZDC_SimFiberHit_CollectionName", "ZDC_SimFiberHit_Collection"};
85 SG::WriteHandleKey<xAOD::ZdcModuleContainer> m_ZdcModuleContainerName{this, "ZdcModuleContainerName", "ZdcModules"};
87
88 Gaudi::Property<std::string> m_HitCollectionName{this, "HitCollectionName" , "ZDC_SimFiberHit_Collection",
89 "Name of the input Collection of the simulation Hits"};
90 Gaudi::Property<std::string> m_outputContainerName{this, "OutputContainerName" , "ZDC_SimModuleContainer",
91 "Name of the output ZDC module container"};
92
93 Gaudi::Property<std::string> m_configuration {this, "configuration" , "PbPb2023", "Named configuration to be used. Overwrites other properties if used" };
94 Gaudi::Property<int > m_Pedestal {this, "Pedestal" , 100 , "DC offset of the pulse in ADC" };
95 Gaudi::Property<int > m_numTimeBins {this, "MaxTimeBin" , 7 , "The number of time-slices after digitization(Typically 5 or 7)" };
96 Gaudi::Property<double> m_freqMHz {this, "freqMHz" , 40 , "Digitizer frequence in MHz" };
97 Gaudi::Property<double> m_zdct0 {this, "zdct0" , 40 , "Start time of the pulse in the digitization window" };
98 Gaudi::Property<double> m_rpdt0 {this, "rpdt0" , 40 , "Start time of the pulse in the digitization window" };
99 Gaudi::Property<double> m_zdcRiseTime {this, "zdcRiseTime" , 4 , "Rise time of the ZDC pulses" };
100 Gaudi::Property<double> m_zdcFallTime {this, "zdcFallTime" , 0.5 , "Fall time of the ZDC pulses" };
101 Gaudi::Property<double> m_rpdRiseTime {this, "rpdRiseTime" , 4 , "Rise time of the RPD pulses" };
102 Gaudi::Property<double> m_rpdFallTime {this, "rpdFallTime" , 0.5 , "Fall time of the RPD pulses" };
103 Gaudi::Property<double> m_qsfRiseTime {this, "qsfRiseTime" , 4 , "Rise time of the RPD pulses" };
104 Gaudi::Property<double> m_qsfFallTime {this, "qsfFallTime" , 4 , "Rise time of the RPD pulses" };
105 Gaudi::Property<double> m_qsfFilter {this, "qsfFilter" , 4 , "Rise time of the RPD pulses" };
106 Gaudi::Property<float > m_zdcAdcPerPhoton {this, "zdcAdcPerPhoton" , 0.000498 , "ADC counts per detected photon in the ZDCs" };
107 Gaudi::Property<bool > m_LTQuadStepFilt {this, "LTQuadStepFilt" , false , "Use LT Quad Step Filter waveform for ZDC channels" };
108 Gaudi::Property<bool > m_delayChannels {this, "delayChannels" , false , "Include delayed channels in the output" };
109 Gaudi::Property<bool > m_doRPD {this, "doRPD" , false , "Include RPD channels in the output" };
110 Gaudi::Property<bool > m_doBRAN {this, "doBRAN" , false , "Include BRAN channels in the output" };
111 Gaudi::Property<std::vector< float> > m_rpdAdcPerPhoton {this, "rpdAdcPerPhoton", {5.25 , 1.7}, "ADC counts per detected photon in the RPDs"};
112
113};
114
115#endif
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition IPileUpTool.h:22
static Double_t t0
the preferred mechanism to access information from the different event stores in a pileup job.
helper base class IPileUpTool::toProcess().
PileUpMergeSvc::TimedList< ZDC_SimFiberHit_Collection >::type TimedFiberHitCollList
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.
Gaudi::Property< double > m_zdcRiseTime
Gaudi::Property< double > m_zdcFallTime
SG::ReadHandleKey< ZDC_SimFiberHit_Collection > m_SimFiberHitCollectionKey
std::vector< short unsigned int > generateWaveform(std::shared_ptr< ZDCWaveformSampler > wfSampler, float amplitude, float t0)
Gaudi::Property< double > m_freqMHz
virtual StatusCode prepareEvent(const EventContext &ctx, const unsigned int nInputEvents) override final
called before the subevts loop. Not (necessarily) able to access SubEvents
Gaudi::Property< double > m_rpdRiseTime
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
Gaudi::Property< double > m_rpdt0
Gaudi::Property< bool > m_LTQuadStepFilt
Gaudi::Property< double > m_qsfFallTime
void createAndStoreWaveform(const ZDC_SimFiberHit &hit, CLHEP::HepRandomEngine *, xAOD::ZdcModuleContainer *)
virtual StatusCode finalize() override final
Gaudi::Property< int > m_numTimeBins
SG::WriteHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumsContainerName
void addEmptyWaveforms(xAOD::ZdcModuleContainer *zdcModuleContainer, CLHEP::HepRandomEngine *rndEngine)
Gaudi::Property< std::string > m_randomStreamName
Gaudi::Property< bool > m_doRPD
virtual StatusCode initialize() override final
Gaudi::Property< bool > m_doBRAN
Gaudi::Property< double > m_rpdFallTime
SG::WriteHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleContainerName
std::unique_ptr< xAOD::ZdcModuleAuxContainer > m_ZdcModuleAuxContainer
Gaudi::Property< bool > m_delayChannels
const ZdcID * m_ZdcID
Gaudi::Property< double > m_qsfRiseTime
Gaudi::Property< std::string > m_HitCollectionName
Gaudi::Property< double > m_qsfFilter
Gaudi::Property< std::string > m_configuration
Gaudi::Property< double > m_zdct0
void fillContainer(TimedHitCollection< ZDC_SimFiberHit > &, CLHEP::HepRandomEngine *, xAOD::ZdcModuleContainer *)
TimedHitCollection< ZDC_SimFiberHit > doZDClightGuideCuts(const ZDC_SimFiberHit_Collection *hitCollection)
Gaudi::Property< std::string > m_outputContainerName
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
Gaudi::Property< float > m_zdcAdcPerPhoton
void SetDumps(bool, bool)
std::unique_ptr< xAOD::ZdcModuleContainer > m_ZdcModuleContainer
ServiceHandle< PileUpMergeSvc > m_mergeSvc
Gaudi::Property< std::vector< float > > m_rpdAdcPerPhoton
ServiceHandle< IAthRNGSvc > m_randomSvc
virtual StatusCode mergeEvent(const EventContext &ctx) override final
return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase...
Gaudi::Property< int > m_Pedestal
ZDC_SimFiberHit_Collection * m_mergedFiberHitList
ZDC_PileUpTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition ZdcID.h:25
ZdcModuleContainer_v1 ZdcModuleContainer
std::list< value_t > type
type of the collection of timed data object