ATLAS Offline Software
Loading...
Searching...
No Matches
LArTTL1Maker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef LARL1SIM_LARTTL1MAKER_H
6#define LARL1SIM_LARTTL1MAKER_H
7// +======================================================================+
8// + +
9// + Author ........: F. Ledroit +
10// + Institut ......: ISN Grenoble +
11// + Creation date .: 09/01/2003 +
12// + +
13// +======================================================================+
14//
15// ....... include
16//
17
19#include "Gaudi/Property.h"
20#include "GaudiKernel/ServiceHandle.h"
21
24
26
30
33
35
36// trigger time
38
39#include <vector>
40#include <array>
41
42class CaloLVL1_ID;
43class LArEM_ID;
44class LArHEC_ID;
45class LArFCAL_ID;
46namespace CLHEP
47{
48 class HepRandomEngine;
49}
50
62
64 public IIncidentListener
65{
66 //
67 // >>>>>>>> public methods
68 //
69public:
70 // delegate Constructor
72
73 //
74 // ..... Gaudi algorithm hooks
75 //
77 virtual StatusCode initialize() override;
81 virtual StatusCode execute() override;
82
83 virtual StatusCode finalize() override;
84 virtual void handle(const Incident&) override;
85
86 virtual bool isClonable() const override final { return true; }
87
88private:
89
90 //
91 // >>>>>>>> private algorithm parts
92 //
93
96
97 //virtual StatusCode initHitMap();
98
99 std::vector<float> computeSignal(const Identifier towerId, const int Ieta, const int specialCase,
100 std::vector<float> visEnergy, const int refTime) const;
101
102 std::vector<float> computeNoise(const Identifier towerId, const int Ieta,
103 std::vector<float>& inputV, CLHEP::HepRandomEngine* rndmEngine);
104
106 //StatusCode fillEMap(int& totHit) ;
107
109 StatusCode readAuxiliary();
110
111 int decodeInverse(int region, int eta);
112
113 // RNGWrapper hacks
114 void setSeed(const std::string& algName, const EventContext& ctx);
115 void setSeed(const std::string& algName, uint64_t ev, uint64_t run);
116 void setSeed(size_t seed);
117
118 //
119 // >>>>>>>> private data parts
120 //
121
122 IChronoStatSvc* m_chronSvc{};
123 ServiceHandle<IAthRNGSvc> m_RandomSvc{this, "RndmSvc", "AthRNGSvc", ""};
124 Gaudi::Property<std::string> m_randomStreamName{this, "RandomStreamName", "LArTTL1Maker", ""};
125 Gaudi::Property<uint32_t> m_randomSeedOffset{this, "RandomSeedOffset", 2, ""};
126 Gaudi::Property<bool> m_useLegacyRandomSeeds{this, "UseLegacyRandomSeeds", false,
127 "Use MC16-style random number seeding"};
128
130 Gaudi::Property<bool> m_useTriggerTime{this, "UseTriggerTime", false};
132 PublicToolHandle<ITriggerTime> m_triggerTimeTool{this, "TriggerTimeToolName", ""}; //"CosmicTriggerTimeTool"
133
135
136 PublicToolHandle<CaloTriggerTowerService> m_ttSvc{this, "CaloTriggerTowerService", "CaloTriggerTowerService"}; // FIXME Naming!!
148 //const DataHandle<ILArfSampl> m_dd_fSampl;
149 SG::ReadCondHandleKey<ILArfSampl> m_fSamplKey{this, "LArfSamplKey", "LArfSamplSym"};
150
152 static const short s_NBDEPTHS = 4 ;
154 static const short s_NBSAMPLES = 7 ;
156 static const short s_MAXSAMPLES = 24 ;
158 static const short s_PEAKPOS = 3 ;
160 static const short s_NBETABINS = 15 ;
162 static const short s_NBENERGIES = 12 ;
163
165 std::vector<float> m_refEnergyEm ;
167 std::vector<std::vector<float> > m_pulseShapeEm ;
169 std::vector<std::vector<float> > m_pulseShapeDerEm ;
171 std::vector<float> m_autoCorrEm ;
172
174 std::vector<float> m_sinThetaEmb ;
176 Gaudi::Property<std::vector<float>> m_calibCoeffEmb{this, "EmBarrelCalibrationCoeffs", std::vector<float>(s_NBETABINS, 1.)};
178 std::vector<float> m_noiseRmsEmb ;
179 // if later we want to disentangle between pre-sum and summing electronic noise...
180 // std::vector<std::vector<float> > m_noiseRmsEmb ;
181
183 std::vector<float> m_sinThetaEmec ;
185 Gaudi::Property<std::vector<float>> m_calibCoeffEmec{this, "EmEndCapCalibrationCoeffs", std::vector<float>(s_NBETABINS, 1.)};
187 std::vector<float> m_noiseRmsEmec ;
188 // if later we want to disentangle between pre-sum and summing electronic noise...
189 // std::vector<std::vector<float> > m_noiseRmsEmec ;
190
192 std::vector<float> m_pulseShapeHec ;
194 std::vector<float> m_pulseShapeDerHec ;
196 Gaudi::Property<std::vector<float>> m_calibCoeffHec{this, "HECCalibrationCoeffs", std::vector<float>(s_NBETABINS, 1.)};
198 std::vector<float> m_sinThetaHec ;
200 std::vector<float> m_satEnergyHec ;
202 std::vector<float> m_noiseRmsHec ;
204 std::vector< std::vector<float> > m_autoCorrHec ;
205
207 std::vector<float> m_cellRelGainFcal ;
209 std::vector< std::vector<float> > m_pulseShapeFcal ;
211 std::vector< std::vector<float> > m_pulseShapeDerFcal ;
213 std::vector< std::vector<float> > m_calibCoeffFcal ;
214 static constexpr int s_nEta = 4;
216 Gaudi::Property<std::vector<float>> m_calibCoeffFcalEm{this, "EmFcalCalibrationCoeffs", std::vector<float>(s_nEta, .03)};
218 Gaudi::Property<std::vector<float>> m_calibCoeffFcalHad{this, "HadFcalCalibrationCoeffs", std::vector<float>(s_nEta, .03)};
220 // std::vector<float> m_noiseRmsFcal ;
221 std::vector< std::vector<float> > m_noiseRmsFcal ;
223 std::vector<float> m_autoCorrFcal ;
224
226 SG::ReadHandleKey<LArHitEMap> m_hitMapKey{this,"LArHitEMapKey","LArHitEMap"};
227
229 SG::WriteHandleKey<LArTTL1Container> m_EmTTL1ContainerName{this, "EmTTL1ContainerName", "LArTTL1EM"};
231 SG::WriteHandleKey<LArTTL1Container> m_HadTTL1ContainerName{this, "HadTTL1ContainerName", "LArTTL1HAD"};
232
233 std::array<SG::ReadHandleKey<LArHitContainer>,4> m_xxxHitContainerName{{
234 {this, "EmBarrelHitContainerName", "LArHitEMB"},
235 {this, "EmEndCapHitContainerName", "LArHitEMEC"},
236 {this, "HecHitContainerName", "LArHitHEC"},
237 {this, "ForWardHitContainerName", "LArHitFCAL"}
238 }};
239
241 Gaudi::Property<bool> m_NoiseOnOff{this, "NoiseOnOff", true};
243 Gaudi::Property<bool> m_PileUp{this, "PileUp", false};
245 Gaudi::Property<bool> m_noEmCalibMode{this, "NoEmCalibrationMode", false};
247 Gaudi::Property<bool> m_noHadCalibMode{this, "NoHadCalibrationMode", false};
249 Gaudi::Property<float> m_debugThresh{this, "DebugThreshold", 5000.};
251 Gaudi::Property<bool> m_chronoTest{this, "ChronoTest", false};
252
254 Gaudi::Property<std::string> m_truthHitsContainer{this, "TruthHitsContainer", "",
255 "Specify a value to get a pair of LArTTL1 containers with the truth hits in them"};
256
257};
258
259#endif
Scalar eta() const
pseudorapidity method
interface to a tool that returns the time offset of the current trigger.
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.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
Helper class for offline TT identifiers.
Definition CaloLVL1_ID.h:66
Helper class for LArEM offline identifiers.
Definition LArEM_ID.h:111
Helper class for LArFCAL offline identifiers.
Definition LArFCAL_ID.h:49
Helper class for LArHEC offline identifiers.
Definition LArHEC_ID.h:76
The aim of this algorithm is the simulation of the LAr analogue trigger tower sums.
std::vector< std::vector< float > > m_noiseRmsFcal
auxiliary FCAL data: noise rms
std::vector< float > m_sinThetaEmec
auxiliary EMEC data: sin(theta)
std::vector< std::vector< float > > m_calibCoeffFcal
auxiliary FCAL data: calibration coefficients
SG::WriteHandleKey< LArTTL1Container > m_HadTTL1ContainerName
algorithm property: container name for the HAD TTL1s
SG::WriteHandleKey< LArTTL1Container > m_EmTTL1ContainerName
algorithm property: container name for the EM TTL1s
Gaudi::Property< bool > m_useLegacyRandomSeeds
void setSeed(const std::string &algName, uint64_t ev, uint64_t run)
virtual StatusCode finalize() override
Gaudi::Property< bool > m_useTriggerTime
Alorithm property: use trigger time or not.
void setSeed(const std::string &algName, const EventContext &ctx)
std::vector< std::vector< float > > m_pulseShapeDerEm
auxiliary EM data: pulse shape derivative
std::vector< float > m_sinThetaEmb
auxiliary EMBarrel data: sin(theta)
virtual void handle(const Incident &) override
IChronoStatSvc * m_chronSvc
std::vector< float > computeNoise(const Identifier towerId, const int Ieta, std::vector< float > &inputV, CLHEP::HepRandomEngine *rndmEngine)
std::vector< std::vector< float > > m_pulseShapeDerFcal
auxiliary FCAL data: pulse shape derivatives
std::vector< std::vector< float > > m_pulseShapeFcal
auxiliary FCAL data: pulse shapes
std::vector< float > m_satEnergyHec
auxiliary HEC data: saturation energy
std::vector< float > computeSignal(const Identifier towerId, const int Ieta, const int specialCase, std::vector< float > visEnergy, const int refTime) const
initialize hit map
Gaudi::Property< std::string > m_truthHitsContainer
key for saving truth
const LArHEC_ID * m_hecHelper
pointer to the offline HEC helper
PublicToolHandle< CaloTriggerTowerService > m_ttSvc
const LArEM_ID * m_emHelper
pointer to the offline EM helper
SG::ReadHandleKey< LArHitEMap > m_hitMapKey
hit map
std::vector< std::vector< float > > m_autoCorrHec
auxiliary HEC data: auto-correlation matrix
std::vector< float > m_noiseRmsEmec
auxiliary EMEC data: noise rms
Gaudi::Property< std::vector< float > > m_calibCoeffFcalHad
auxiliary FCAL data: calibration coefficients
virtual StatusCode initialize() override
Read ascii files for auxiliary data (puslse shapes, noise, etc...)
std::vector< float > m_autoCorrEm
auxiliary EM data: auto-correlation matrix
const CaloLVL1_ID * m_lvl1Helper
pointer to the offline TT helper
static const short s_NBDEPTHS
number of sampling (in depth)
static const short s_MAXSAMPLES
max number of samples in pulse shape
static constexpr int s_nEta
std::vector< std::vector< float > > m_pulseShapeEm
auxiliary EM data: pulse shapes
Gaudi::Property< bool > m_PileUp
algorithm property: pile up or not
std::vector< float > m_sinThetaHec
auxiliary HEC data: sin(theta)
std::vector< float > m_refEnergyEm
auxiliary EM data: reference energies for saturation simulation
const LArFCAL_ID * m_fcalHelper
pointer to the offline FCAL helper
PublicToolHandle< ITriggerTime > m_triggerTimeTool
Alorithm property: name of the TriggerTimeTool.
std::vector< float > m_noiseRmsHec
auxiliary HEC data: noise rms
std::vector< float > m_pulseShapeDerHec
auxiliary HEC data: pulse shape derivative
Gaudi::Property< float > m_debugThresh
algorithm property: debug threshold
Gaudi::Property< std::string > m_randomStreamName
void setSeed(size_t seed)
const CaloCell_ID * m_OflHelper
pointer to the offline id helper
StatusCode readAuxiliary()
method called at the begining of execute() to fill the hit map
Gaudi::Property< bool > m_chronoTest
algorithm property: switch chrono on
Gaudi::Property< bool > m_noEmCalibMode
algorithm property: no calibration mode for EM towers
std::vector< float > m_pulseShapeHec
auxiliary HEC data: pulse shape
static const short s_NBETABINS
number of eta bins
Gaudi::Property< std::vector< float > > m_calibCoeffEmec
auxiliary EMEC data: calibration coeeficient
Gaudi::Property< bool > m_NoiseOnOff
algorithm property: noise (in all sub-detectors) is on if true
Gaudi::Property< uint32_t > m_randomSeedOffset
std::array< SG::ReadHandleKey< LArHitContainer >, 4 > m_xxxHitContainerName
ServiceHandle< IAthRNGSvc > m_RandomSvc
Gaudi::Property< bool > m_noHadCalibMode
algorithm property: no calibration mode for had towers
std::vector< float > m_noiseRmsEmb
auxiliary EMBarrel data: noise rms
std::vector< float > m_cellRelGainFcal
auxiliary FCAL data: relative gains
static const short s_NBENERGIES
number of energies at which saturation is described (em)
SG::ReadCondHandleKey< ILArfSampl > m_fSamplKey
Sampling fractions retrieved from DB.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
virtual bool isClonable() const override final
static const short s_NBSAMPLES
number of samples in TTL1s
std::vector< float > m_autoCorrFcal
auxiliary FCAL data: auto-correlation matrix
static const short s_PEAKPOS
peak position
virtual StatusCode execute() override
Create LArTTL1 object save in TES (2 containers: 1 EM, 1 hadronic)
Gaudi::Property< std::vector< float > > m_calibCoeffEmb
auxiliary EMBarrel data: calibration coefficient
Gaudi::Property< std::vector< float > > m_calibCoeffFcalEm
auxiliary FCAL data: calibration coefficients
int decodeInverse(int region, int eta)
Gaudi::Property< std::vector< float > > m_calibCoeffHec
auxiliary HEC data: calibration coefficients
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.
int ev
Definition globals.cxx:25
Definition run.py:1