ATLAS Offline Software
LArTTL1Maker.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 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 
34 #include <vector>
35 #include <array>
36 
37 class ITriggerTime;
39 class CaloLVL1_ID;
40 class LArEM_ID;
41 class LArHEC_ID;
42 class LArFCAL_ID;
43 namespace CLHEP
44 {
45  class HepRandomEngine;
46 }
47 
60 class LArTTL1Maker : public AthAlgorithm,
61  public IIncidentListener
62 {
63 //
64 // >>>>>>>> public methods
65 //
66  public:
68  LArTTL1Maker(const std::string& name, ISvcLocator* pSvcLocator);
69 
71  virtual ~LArTTL1Maker();
72 //
73 // ..... Gaudi algorithm hooks
74 //
76  virtual StatusCode initialize() override;
80  virtual StatusCode execute() override;
81 
82  virtual StatusCode finalize() override;
83  virtual void handle(const Incident&) override;
84 
85  virtual bool isClonable() const override final { return true; }
86 
87  private:
88 
89 //
90 // >>>>>>>> private algorithm parts
91 //
92 
96  //virtual StatusCode initHitMap();
97 
98  std::vector<float> computeSignal(const Identifier towerId, const int Ieta, const int specialCase,
99  std::vector<float> visEnergy, const int refTime) const;
100 
101  std::vector<float> computeNoise(const Identifier towerId, const int Ieta,
102  std::vector<float>& inputV, CLHEP::HepRandomEngine* rndmEngine);
103 
105  //StatusCode fillEMap(int& totHit) ;
106 
109 
110  int decodeInverse(int region, int eta);
111 
112  // RNGWrapper hacks
113  void setSeed(const std::string& algName, const EventContext& ctx);
114  void setSeed(const std::string& algName, uint64_t ev, uint64_t run);
115  void setSeed(size_t seed);
116 
117 //
118 // >>>>>>>> private data parts
119 //
120 
121  IChronoStatSvc* m_chronSvc;
122  ServiceHandle<IAthRNGSvc> m_RandomSvc{this, "RndmSvc", "AthRNGSvc", ""};
123  Gaudi::Property<std::string> m_randomStreamName{this, "RandomStreamName", "LArTTL1Maker", ""};
124  Gaudi::Property<uint32_t> m_randomSeedOffset{this, "RandomSeedOffset", 2, ""};
125  Gaudi::Property<bool> m_useLegacyRandomSeeds{this, "UseLegacyRandomSeeds", false,
126  "Use MC16-style random number seeding"};
127 
131  ToolHandle<ITriggerTime> m_triggerTimeTool;
132 
134 
135  ToolHandle<CaloTriggerTowerService> m_ttSvc;
145  const CaloCell_ID* m_OflHelper = nullptr;
147  //const DataHandle<ILArfSampl> m_dd_fSampl;
149 
151  static const short s_NBDEPTHS = 4 ;
153  static const short s_NBSAMPLES = 7 ;
155  static const short s_MAXSAMPLES = 24 ;
157  static const short s_PEAKPOS = 3 ;
159  static const short s_NBETABINS = 15 ;
161  static const short s_NBENERGIES = 12 ;
162 
164  std::vector<float> m_refEnergyEm ;
166  std::vector<std::vector<float> > m_pulseShapeEm ;
168  std::vector<std::vector<float> > m_pulseShapeDerEm ;
170  std::vector<float> m_autoCorrEm ;
171 
173  std::vector<float> m_sinThetaEmb ;
175  std::vector<float> m_calibCoeffEmb ;
177  std::vector<float> m_noiseRmsEmb ;
178  // if later we want to disentangle between pre-sum and summing electronic noise...
179  // std::vector<std::vector<float> > m_noiseRmsEmb ;
180 
182  std::vector<float> m_sinThetaEmec ;
184  std::vector<float> m_calibCoeffEmec ;
186  std::vector<float> m_noiseRmsEmec ;
187  // if later we want to disentangle between pre-sum and summing electronic noise...
188  // std::vector<std::vector<float> > m_noiseRmsEmec ;
189 
191  std::vector<float> m_pulseShapeHec ;
193  std::vector<float> m_pulseShapeDerHec ;
195  std::vector<float> m_calibCoeffHec ;
197  std::vector<float> m_sinThetaHec ;
199  std::vector<float> m_satEnergyHec ;
201  std::vector<float> m_noiseRmsHec ;
203  std::vector< std::vector<float> > m_autoCorrHec ;
204 
206  std::vector<float> m_cellRelGainFcal ;
208  std::vector< std::vector<float> > m_pulseShapeFcal ;
210  std::vector< std::vector<float> > m_pulseShapeDerFcal ;
212  std::vector< std::vector<float> > m_calibCoeffFcal ;
214  std::vector<float> m_calibCoeffFcalEm ;
216  std::vector<float> m_calibCoeffFcalHad ;
218  // std::vector<float> m_noiseRmsFcal ;
219  std::vector< std::vector<float> > m_noiseRmsFcal ;
221  std::vector<float> m_autoCorrFcal ;
222 
224  SG::ReadHandleKey<LArHitEMap> m_hitMapKey{this,"LArHitEMapKey","LArHitEMap"};
225 
230 
231  std::array<SG::ReadHandleKey<LArHitContainer>,4> m_xxxHitContainerName;
232 
236  bool m_PileUp;
245 
247  std::string m_truthHitsContainer;
248 
249 };
250 
251 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
LArTTL1Maker::m_sinThetaEmb
std::vector< float > m_sinThetaEmb
auxiliary EMBarrel data: sin(theta)
Definition: LArTTL1Maker.h:173
LArTTL1Maker::m_xxxHitContainerName
std::array< SG::ReadHandleKey< LArHitContainer >, 4 > m_xxxHitContainerName
Definition: LArTTL1Maker.h:231
LArTTL1Maker::s_NBENERGIES
static const short s_NBENERGIES
number of energies at which saturation is described (em)
Definition: LArTTL1Maker.h:161
LArTTL1Maker::m_noiseRmsHec
std::vector< float > m_noiseRmsHec
auxiliary HEC data: noise rms
Definition: LArTTL1Maker.h:201
LArTTL1Maker::s_PEAKPOS
static const short s_PEAKPOS
peak position
Definition: LArTTL1Maker.h:157
LArTTL1Maker::m_fSamplKey
SG::ReadCondHandleKey< ILArfSampl > m_fSamplKey
Sampling fractions retrieved from DB.
Definition: LArTTL1Maker.h:148
LArTTL1Maker::readAuxiliary
StatusCode readAuxiliary()
method called at the begining of execute() to fill the hit map
Definition: LArTTL1Maker.cxx:1232
LArTTL1Maker::m_EmTTL1ContainerName
SG::WriteHandleKey< LArTTL1Container > m_EmTTL1ContainerName
algorithm property: container name for the EM TTL1s
Definition: LArTTL1Maker.h:227
LArTTL1Maker::m_autoCorrHec
std::vector< std::vector< float > > m_autoCorrHec
auxiliary HEC data: auto-correlation matrix
Definition: LArTTL1Maker.h:203
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
LArTTL1Maker::computeSignal
std::vector< float > computeSignal(const Identifier towerId, const int Ieta, const int specialCase, std::vector< float > visEnergy, const int refTime) const
initialize hit map
Definition: LArTTL1Maker.cxx:860
LArTTL1Maker::decodeInverse
int decodeInverse(int region, int eta)
Definition: LArTTL1Maker.cxx:1748
xAOD::JetAlgorithmType::algName
const std::string & algName(ID id)
Converts a JetAlgorithmType::ID into a string.
Definition: JetContainerInfo.cxx:67
LArTTL1Maker::setSeed
void setSeed(size_t seed)
CaloTriggerTowerService
Tool providing the mapping of the online and offline TriggerTower identifiers as well as the TT-cells...
Definition: CaloTriggerTowerService.h:50
LArTTL1Maker::m_calibCoeffFcalHad
std::vector< float > m_calibCoeffFcalHad
auxiliary FCAL data: calibration coefficients
Definition: LArTTL1Maker.h:216
LArHEC_ID
Helper class for LArHEC offline identifiers.
Definition: LArHEC_ID.h:85
LArTTL1Maker::s_NBSAMPLES
static const short s_NBSAMPLES
number of samples in TTL1s
Definition: LArTTL1Maker.h:153
LArTTL1Maker::initialize
virtual StatusCode initialize() override
Read ascii files for auxiliary data (puslse shapes, noise, etc...)
Definition: LArTTL1Maker.cxx:148
LArTTL1Maker::m_calibCoeffEmec
std::vector< float > m_calibCoeffEmec
auxiliary EMEC data: calibration coeeficient
Definition: LArTTL1Maker.h:184
LArTTL1Maker::m_NoiseOnOff
bool m_NoiseOnOff
algorithm property: noise (in all sub-detectors) is on if true
Definition: LArTTL1Maker.h:234
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
SG::ReadHandleKey< LArHitEMap >
LArTTL1Maker::m_sinThetaHec
std::vector< float > m_sinThetaHec
auxiliary HEC data: sin(theta)
Definition: LArTTL1Maker.h:197
LArTTL1Maker::m_debugThresh
float m_debugThresh
algorithm property: debug threshold
Definition: LArTTL1Maker.h:242
LArTTL1Container.h
LArTTL1Maker::m_noiseRmsFcal
std::vector< std::vector< float > > m_noiseRmsFcal
auxiliary FCAL data: noise rms
Definition: LArTTL1Maker.h:219
LArTTL1Maker::m_randomSeedOffset
Gaudi::Property< uint32_t > m_randomSeedOffset
Definition: LArTTL1Maker.h:124
LArTTL1Maker::LArTTL1Maker
LArTTL1Maker(const std::string &name, ISvcLocator *pSvcLocator)
constructor
Definition: LArTTL1Maker.cxx:54
LArTTL1Maker::m_hitMapKey
SG::ReadHandleKey< LArHitEMap > m_hitMapKey
hit map
Definition: LArTTL1Maker.h:224
LArTTL1Maker::m_truthHitsContainer
std::string m_truthHitsContainer
key for saving truth
Definition: LArTTL1Maker.h:247
AthAlgorithm.h
LArTTL1Maker::execute
virtual StatusCode execute() override
Create LArTTL1 object save in TES (2 containers: 1 EM, 1 hadronic)
Definition: LArTTL1Maker.cxx:298
LArTTL1Maker::m_pulseShapeFcal
std::vector< std::vector< float > > m_pulseShapeFcal
auxiliary FCAL data: pulse shapes
Definition: LArTTL1Maker.h:208
LArTTL1Maker::m_ttSvc
ToolHandle< CaloTriggerTowerService > m_ttSvc
Definition: LArTTL1Maker.h:135
LArTTL1Maker::computeNoise
std::vector< float > computeNoise(const Identifier towerId, const int Ieta, std::vector< float > &inputV, CLHEP::HepRandomEngine *rndmEngine)
Definition: LArTTL1Maker.cxx:1077
ev
int ev
Definition: globals.cxx:25
LArTTL1Maker::m_BeginRunPriority
int m_BeginRunPriority
Definition: LArTTL1Maker.h:133
LArHitEMap.h
SG::WriteHandleKey< LArTTL1Container >
LArTTL1Maker::m_fcalHelper
const LArFCAL_ID * m_fcalHelper
pointer to the offline FCAL helper
Definition: LArTTL1Maker.h:143
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArTTL1Maker::m_cellRelGainFcal
std::vector< float > m_cellRelGainFcal
auxiliary FCAL data: relative gains
Definition: LArTTL1Maker.h:206
LArTTL1Maker::m_noiseRmsEmb
std::vector< float > m_noiseRmsEmb
auxiliary EMBarrel data: noise rms
Definition: LArTTL1Maker.h:177
LArTTL1Maker::m_noEmCalibMode
bool m_noEmCalibMode
algorithm property: no calibration mode for EM towers
Definition: LArTTL1Maker.h:238
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
LArTTL1Maker::m_pulseShapeDerFcal
std::vector< std::vector< float > > m_pulseShapeDerFcal
auxiliary FCAL data: pulse shape derivatives
Definition: LArTTL1Maker.h:210
LArTTL1Maker::s_NBETABINS
static const short s_NBETABINS
number of eta bins
Definition: LArTTL1Maker.h:159
LArTTL1Maker::m_noHadCalibMode
bool m_noHadCalibMode
algorithm property: no calibration mode for had towers
Definition: LArTTL1Maker.h:240
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
LArTTL1Maker::m_pulseShapeHec
std::vector< float > m_pulseShapeHec
auxiliary HEC data: pulse shape
Definition: LArTTL1Maker.h:191
LArTTL1Maker::m_calibCoeffFcal
std::vector< std::vector< float > > m_calibCoeffFcal
auxiliary FCAL data: calibration coefficients
Definition: LArTTL1Maker.h:212
run
Definition: run.py:1
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
LArTTL1Maker::s_NBDEPTHS
static const short s_NBDEPTHS
number of sampling (in depth)
Definition: LArTTL1Maker.h:151
LArTTL1Maker::m_refEnergyEm
std::vector< float > m_refEnergyEm
auxiliary EM data: reference energies for saturation simulation
Definition: LArTTL1Maker.h:164
LArTTL1Maker::setSeed
void setSeed(const std::string &algName, uint64_t ev, uint64_t run)
LArTTL1Maker
The aim of this algorithm is the simulation of the LAr analogue trigger tower sums.
Definition: LArTTL1Maker.h:62
LArTTL1Maker::m_satEnergyHec
std::vector< float > m_satEnergyHec
auxiliary HEC data: saturation energy
Definition: LArTTL1Maker.h:199
AthAlgorithm
Definition: AthAlgorithm.h:47
ReadCondHandleKey.h
LArTTL1Maker::m_pulseShapeEm
std::vector< std::vector< float > > m_pulseShapeEm
auxiliary EM data: pulse shapes
Definition: LArTTL1Maker.h:166
LArTTL1Maker::finalize
virtual StatusCode finalize() override
Definition: LArTTL1Maker.cxx:841
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
LArTTL1Maker::~LArTTL1Maker
virtual ~LArTTL1Maker()
destructor
Definition: LArTTL1Maker.cxx:146
CaloLVL1_ID
Helper class for offline TT identifiers.
Definition: CaloLVL1_ID.h:66
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ITriggerTime
interface to a tool that returns the time offset of the current trigger. Used by PileUpMergeSvc
Definition: ITriggerTime.h:20
LArTTL1Maker::m_lvl1Helper
const CaloLVL1_ID * m_lvl1Helper
pointer to the offline TT helper
Definition: LArTTL1Maker.h:137
LArTTL1Maker::m_OflHelper
const CaloCell_ID * m_OflHelper
pointer to the offline id helper
Definition: LArTTL1Maker.h:145
LArTTL1Maker::m_calibCoeffEmb
std::vector< float > m_calibCoeffEmb
auxiliary EMBarrel data: calibration coefficient
Definition: LArTTL1Maker.h:175
LArTTL1Maker::m_emHelper
const LArEM_ID * m_emHelper
pointer to the offline EM helper
Definition: LArTTL1Maker.h:139
LArTTL1Maker::m_useTriggerTime
bool m_useTriggerTime
Alorithm property: use trigger time or not.
Definition: LArTTL1Maker.h:129
LArTTL1Maker::m_PileUp
bool m_PileUp
algorithm property: pile up or not
Definition: LArTTL1Maker.h:236
LArTTL1Maker::m_autoCorrEm
std::vector< float > m_autoCorrEm
auxiliary EM data: auto-correlation matrix
Definition: LArTTL1Maker.h:170
LArTTL1Maker::m_randomStreamName
Gaudi::Property< std::string > m_randomStreamName
Definition: LArTTL1Maker.h:123
SG::ReadCondHandleKey< ILArfSampl >
LArTTL1Maker::m_RandomSvc
ServiceHandle< IAthRNGSvc > m_RandomSvc
Definition: LArTTL1Maker.h:122
LArTTL1Maker::s_MAXSAMPLES
static const short s_MAXSAMPLES
max number of samples in pulse shape
Definition: LArTTL1Maker.h:155
LArTTL1Maker::m_useLegacyRandomSeeds
Gaudi::Property< bool > m_useLegacyRandomSeeds
Definition: LArTTL1Maker.h:125
LArTTL1Maker::isClonable
virtual bool isClonable() const override final
Definition: LArTTL1Maker.h:85
LArTTL1Maker::m_noiseRmsEmec
std::vector< float > m_noiseRmsEmec
auxiliary EMEC data: noise rms
Definition: LArTTL1Maker.h:186
LArTTL1Maker::m_sinThetaEmec
std::vector< float > m_sinThetaEmec
auxiliary EMEC data: sin(theta)
Definition: LArTTL1Maker.h:182
LArHitContainer.h
LArTTL1Maker::m_chronoTest
bool m_chronoTest
algorithm property: switch chrono on
Definition: LArTTL1Maker.h:244
LArTTL1Maker::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
LArTTL1Maker::m_chronSvc
IChronoStatSvc * m_chronSvc
Definition: LArTTL1Maker.h:121
LArTTL1Maker::m_hecHelper
const LArHEC_ID * m_hecHelper
pointer to the offline HEC helper
Definition: LArTTL1Maker.h:141
LArTTL1Maker::m_calibCoeffFcalEm
std::vector< float > m_calibCoeffFcalEm
auxiliary FCAL data: calibration coefficients
Definition: LArTTL1Maker.h:214
LArTTL1Maker::m_HadTTL1ContainerName
SG::WriteHandleKey< LArTTL1Container > m_HadTTL1ContainerName
algorithm property: container name for the HAD TTL1s
Definition: LArTTL1Maker.h:229
LArEM_ID
Helper class for LArEM offline identifiers.
Definition: LArEM_ID.h:118
LArFCAL_ID
Helper class for LArFCAL offline identifiers.
Definition: LArFCAL_ID.h:60
LArTTL1Maker::m_pulseShapeDerEm
std::vector< std::vector< float > > m_pulseShapeDerEm
auxiliary EM data: pulse shape derivative
Definition: LArTTL1Maker.h:168
LArTTL1Maker::handle
virtual void handle(const Incident &) override
Definition: LArTTL1Maker.cxx:286
LArTTL1Maker::m_pulseShapeDerHec
std::vector< float > m_pulseShapeDerHec
auxiliary HEC data: pulse shape derivative
Definition: LArTTL1Maker.h:193
ILArfSampl.h
LArTTL1Maker::m_triggerTimeTool
ToolHandle< ITriggerTime > m_triggerTimeTool
Alorithm property: name of the TriggerTimeTool.
Definition: LArTTL1Maker.h:131
IAthRNGSvc.h
ServiceHandle< IAthRNGSvc >
LArTTL1Maker::m_calibCoeffHec
std::vector< float > m_calibCoeffHec
auxiliary HEC data: calibration coefficients
Definition: LArTTL1Maker.h:195
LArTTL1Maker::m_autoCorrFcal
std::vector< float > m_autoCorrFcal
auxiliary FCAL data: auto-correlation matrix
Definition: LArTTL1Maker.h:221