ATLAS Offline Software
LArSCL1Maker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARL1SIM_LARSCL1MAKER_H
6 #define LARL1SIM_LARSCL1MAKER_H
7 // +======================================================================+
8 // + +
9 // + Author ........: Denis O. Damazio +
10 // + Institut ......: BNL +
11 // + Creation date .: 18/11/2013 +
12 // + +
13 // +======================================================================+
14 //
15 // ....... include
16 //
17 
20 #include "Gaudi/Property.h"
21 #include "GaudiKernel/ServiceHandle.h"
22 //
32 //
33 #include "LArElecCalib/ILArNoise.h"
35 #include "LArElecCalib/ILArShape.h"
37 
38 class ITriggerTime;
40 class CaloCell_ID;
42 
61  //
62  // >>>>>>>> public methods
63  //
64  public:
66  LArSCL1Maker(const std::string& name, ISvcLocator* pSvcLocator);
67 
69  ~LArSCL1Maker();
70  //
71  // ..... Gaudi algorithm hooks
72  //
78  StatusCode execute(const EventContext& context) const;
79 
81 
82  private:
84  this, "ScCablingKey", "LArOnOffIdMapSC",
85  "SG Key of SC LArOnOffIdMapping object"};
88  this, "ShapeKey", "LArShapeSC", "SG Key of Shape conditions object"};
89 
92  this, "FracSKey", "LArfSamplSC", "SG Key of fSamplS conditions object"};
93 
96  this, "PedestalKey", "LArPedestalSC", "SGKey of LArPedestal object"};
97 
100  this, "LArNoiseKey", "LArNoiseSC", "SGKey of LArNoise object"};
101 
104  this, "LArAutoCorrKey", "LArAutoCorrNoiseSC",
105  "SGKey of LArAutoCorrNoise object"};
106 
109  this, "LArADC2MeVKey", "LArADC2MeVSC", "SGKey of LArADC2MeV object"};
110 
111  template <class T>
112  const T* retrieve(const EventContext& context,
113  SG::ReadCondHandleKey<T> handleKey) const {
114  SG::ReadCondHandle<T> handle(handleKey, context);
115  if (not handle.isValid()) {
116  ATH_MSG_ERROR("could not retrieve : " << handle.key());
117  return nullptr;
118  } else
119  return handle.cptr();
120  }
121 
122  //
123  // >>>>>>>> private algorithm parts
124  //
128  std::vector<float> computeSignal(const Identifier towerId, const int Ieta,
129  const int specialCase,
130  std::vector<float> visEnergy,
131  const int refTime) const;
132 
133  std::vector<float> computeNoise(const Identifier towerId, const int Ieta,
134  std::vector<float>& inputV);
135 
137  void printConditions(const HWIdentifier& hwSC);
138 
141  void ConvertHits2Samples(const EventContext& context,
143  const std::vector<std::pair<float, float> >& TimeE,
144  std::vector<float>& samples) const;
145 
146  //
147  // >>>>>>>> private data parts
148  //
149 
150  IChronoStatSvc* m_chronSvc;
151  Gaudi::Property<std::string> m_randomStreamName{this, "RandomStreamName",
152  "LArSCL1Maker", ""};
153  ServiceHandle<IAthRNGSvc> m_atRndmGenSvc{this, "RndmSvc", "AthRNGSvc", ""};
154  Gaudi::Property<uint32_t> m_randomSeedOffset{this, "RandomSeedOffset", 2, ""};
155  Gaudi::Property<bool> m_useLegacyRandomSeeds{
156  this, "UseLegacyRandomSeeds", false,
157  "Use MC16-style random number seeding"};
158 
162  // ToolHandle<ITriggerTime> p_triggerTimeTool;
163 
165 
166  ToolHandle<ICaloSuperCellIDTool> m_scidtool;
170  const CaloCell_ID* m_OflHelper = nullptr;
173 
175 
177  static const short s_NBDEPTHS = 4;
179  static const short s_NBSAMPLES = 7;
181  static const short s_MAXSAMPLES = 24;
183  static const short s_PEAKPOS = 3;
185  static const short s_NBETABINS = 15;
187  static const short s_NBENERGIES = 12;
188 
190  std::vector<std::vector<float> > m_autoCorrHec;
191 
194  "LArHitEMap"};
199  this, "SCL1ContainerName", "LArDigitSCL1", "Output LArDigit container"};
200 
202  std::vector<std::string> m_HitContainer;
203 
205  std::string m_SubDetectors;
206 
207 #ifdef DONTDO
208 
209  std::string m_EmBarrelHitContainerName;
211  std::string m_EmEndCapHitContainerName;
213  std::string m_HecHitContainerName;
215  std::string m_ForWardHitContainerName;
216 #endif
217 
221  bool m_PileUp;
228 
230  unsigned int m_nSamples;
232  unsigned int m_firstSample;
233 
234  std::string m_saveHitsContainer;
235 };
236 
237 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
LArSCL1Maker::s_NBENERGIES
static const short s_NBENERGIES
number of energies at which saturation is described (em)
Definition: LArSCL1Maker.h:187
LArSCL1Maker::initialize
StatusCode initialize()
Read ascii files for auxiliary data (puslse shapes, noise, etc...)
Definition: LArSCL1Maker.cxx:115
LArSCL1Maker::printConditions
void printConditions(const HWIdentifier &hwSC)
Method to print SuperCell Conditions.
Definition: LArSCL1Maker.cxx:469
LArSCL1Maker::m_nSamples
unsigned int m_nSamples
output number of samples
Definition: LArSCL1Maker.h:230
LArSCL1Maker::m_useTriggerTime
bool m_useTriggerTime
Alorithm property: use trigger time or not.
Definition: LArSCL1Maker.h:160
ILArNoise.h
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
LArSCL1Maker::m_NoiseOnOff
bool m_NoiseOnOff
algorithm property: noise (in all sub-detectors) is on if true
Definition: LArSCL1Maker.h:219
LArSCL1Maker::s_MAXSAMPLES
static const short s_MAXSAMPLES
max number of samples in pulse shape
Definition: LArSCL1Maker.h:181
LArSCL1Maker::m_autoCorrHec
std::vector< std::vector< float > > m_autoCorrHec
auxiliary HEC data: auto-correlation matrix
Definition: LArSCL1Maker.h:190
LArSCL1Maker::LArSCL1Maker
LArSCL1Maker(const std::string &name, ISvcLocator *pSvcLocator)
constructor
Definition: LArSCL1Maker.cxx:59
LArSCL1Maker::s_NBETABINS
static const short s_NBETABINS
number of eta bins
Definition: LArSCL1Maker.h:185
LArSCL1Maker::m_OnlSCHelper
const LArOnline_SuperCellID * m_OnlSCHelper
pointer to the online LAr helper
Definition: LArSCL1Maker.h:172
LArSCL1Maker::m_noHadCalibMode
bool m_noHadCalibMode
algorithm property: no calibration mode for had towers
Definition: LArSCL1Maker.h:225
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
LArSCL1Maker::m_bkgDigitsKey
SG::ReadHandleKey< LArDigitContainer > m_bkgDigitsKey
Background Digit Overlay, default key is Bkg_LArDigitSCL2.
Definition: LArSCL1Maker.h:196
LArSCL1Maker::m_saveHitsContainer
std::string m_saveHitsContainer
Definition: LArSCL1Maker.h:234
LArSCL1Maker::execute
StatusCode execute(const EventContext &context) const
Create LArSCL1 object save in TES (2 containers: 1 EM, 1 hadronic)
Definition: LArSCL1Maker.cxx:222
SG::ReadHandleKey< LArHitEMap >
LArSCL1Maker::m_scHelper
const CaloCell_SuperCell_ID * m_scHelper
pointer to the offline TT helper
Definition: LArSCL1Maker.h:168
HWIdentifier
Definition: HWIdentifier.h:13
LArSCL1Maker::m_noEmCalibMode
bool m_noEmCalibMode
algorithm property: no calibration mode for EM towers
Definition: LArSCL1Maker.h:223
LArAutoCorrNoise.h
LArSCL1Maker::m_PileUp
bool m_PileUp
algorithm property: pile up or not
Definition: LArSCL1Maker.h:221
LArSCL1Maker::retrieve
const T * retrieve(const EventContext &context, SG::ReadCondHandleKey< T > handleKey) const
Definition: LArSCL1Maker.h:112
ICaloSuperCellIDTool.h
LArSCL1Maker::~LArSCL1Maker
~LArSCL1Maker()
destructor
Definition: LArSCL1Maker.cxx:109
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
LArSCL1Maker::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
LArSCL1Maker::computeNoise
std::vector< float > computeNoise(const Identifier towerId, const int Ieta, std::vector< float > &inputV)
LArSCL1Maker::m_autoCorrNoiseSCKey
SG::ReadCondHandleKey< LArAutoCorrNoise > m_autoCorrNoiseSCKey
Property: AutoCorr Noise (conditions input).
Definition: LArSCL1Maker.h:103
LArSCL1Maker::m_randomStreamName
Gaudi::Property< std::string > m_randomStreamName
Definition: LArSCL1Maker.h:151
LArADC2MeV.h
LArOnOffIdMapping.h
LArHitEMap.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::WriteHandleKey< LArDigitContainer >
CaloCell_SuperCell_ID
Helper class for offline supercell identifiers.
Definition: CaloCell_SuperCell_ID.h:48
LArSCL1Maker::m_noiseSCKey
SG::ReadCondHandleKey< ILArNoise > m_noiseSCKey
Property: Electronics Noise (conditions input).
Definition: LArSCL1Maker.h:99
LArSCL1Maker
The aim of this algorithm is the simulation of the LAr analogue Super-Cell sums.
Definition: LArSCL1Maker.h:60
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArSCL1Maker::m_pedestalSCKey
SG::ReadCondHandleKey< ILArPedestal > m_pedestalSCKey
Property: Pedestal offset (conditions input).
Definition: LArSCL1Maker.h:95
LArSCL1Maker::ConvertHits2Samples
void ConvertHits2Samples(const EventContext &context, const HWIdentifier &hwSC, CaloGain::CaloGain igain, const std::vector< std::pair< float, float > > &TimeE, std::vector< float > &samples) const
Method for converting Hits from samples (simplified version of the same method in LarPileUpTool)
Definition: LArSCL1Maker.cxx:473
LArSCL1Maker::m_fracSKey
SG::ReadCondHandleKey< ILArfSampl > m_fracSKey
Property: Fraction of Energy Sampled (conditions input).
Definition: LArSCL1Maker.h:91
LArSCL1Maker::m_incSvc
ServiceHandle< IIncidentSvc > m_incSvc
Definition: LArSCL1Maker.h:174
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
WriteCellNoiseToCool.igain
igain
Definition: WriteCellNoiseToCool.py:338
LArSCL1Maker::m_BeginRunPriority
int m_BeginRunPriority
pointer to the TriggerTimeTool
Definition: LArSCL1Maker.h:164
LArSCL1Maker::m_chronSvc
IChronoStatSvc * m_chronSvc
Definition: LArSCL1Maker.h:150
ReadCondHandleKey.h
AthReentrantAlgorithm.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
LArSCL1Maker::m_chronoTest
bool m_chronoTest
algorithm property: switch chrono on
Definition: LArSCL1Maker.h:227
ILArShape.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LArSCL1Maker::m_HitContainer
std::vector< std::string > m_HitContainer
list of hit containers
Definition: LArSCL1Maker.h:202
ITriggerTime
interface to a tool that returns the time offset of the current trigger. Used by PileUpMergeSvc
Definition: ITriggerTime.h:19
LArSCL1Maker::m_atRndmGenSvc
ServiceHandle< IAthRNGSvc > m_atRndmGenSvc
Definition: LArSCL1Maker.h:153
LArDigitContainer.h
LArSCL1Maker::finalize
StatusCode finalize()
Definition: LArSCL1Maker.cxx:460
LArOnline_SuperCellID
Definition: LArOnline_SuperCellID.h:20
LArSCL1Maker::m_cablingKeySC
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
Definition: LArSCL1Maker.h:83
LArSCL1Maker::m_scidtool
ToolHandle< ICaloSuperCellIDTool > m_scidtool
Definition: LArSCL1Maker.h:166
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
SG::ReadCondHandleKey< LArOnOffIdMapping >
LArSCL1Maker::s_PEAKPOS
static const short s_PEAKPOS
peak position
Definition: LArSCL1Maker.h:183
ILArPedestal.h
LArSCL1Maker::m_useLegacyRandomSeeds
Gaudi::Property< bool > m_useLegacyRandomSeeds
Definition: LArSCL1Maker.h:155
LArSCL1Maker::m_firstSample
unsigned int m_firstSample
output first samples
Definition: LArSCL1Maker.h:232
LArSCL1Maker::m_randomSeedOffset
Gaudi::Property< uint32_t > m_randomSeedOffset
Definition: LArSCL1Maker.h:154
LArSCL1Maker::m_SubDetectors
std::string m_SubDetectors
algorithm property: sub-detectors to be simulated
Definition: LArSCL1Maker.h:205
LArSCL1Maker::m_shapesKey
SG::ReadCondHandleKey< ILArShape > m_shapesKey
Property: Pulse shape (conditions input).
Definition: LArSCL1Maker.h:87
LArSCL1Maker::m_sLArDigitsContainerKey
SG::WriteHandleKey< LArDigitContainer > m_sLArDigitsContainerKey
output Lar Digits SC container
Definition: LArSCL1Maker.h:198
LArSCL1Maker::s_NBDEPTHS
static const short s_NBDEPTHS
number of sampling (in depth)
Definition: LArSCL1Maker.h:177
LArSCL1Maker::m_hitMapKey
SG::ReadHandleKey< LArHitEMap > m_hitMapKey
hit map
Definition: LArSCL1Maker.h:193
SG::ReadCondHandle::key
const std::string & key() const
Definition: ReadCondHandle.h:59
LArSCL1Maker::m_OflHelper
const CaloCell_ID * m_OflHelper
pointer to the offline id helper
Definition: LArSCL1Maker.h:170
LArSCL1Maker::m_adc2mevSCKey
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevSCKey
Property: ADC2MeV conversion (conditions input).
Definition: LArSCL1Maker.h:108
ILArfSampl.h
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
LArSCL1Maker::s_NBSAMPLES
static const short s_NBSAMPLES
number of samples in TTL1s
Definition: LArSCL1Maker.h:179
IAthRNGSvc.h
ServiceHandle< IAthRNGSvc >
SG::ReadCondHandle::cptr
const_pointer_type cptr()
Definition: ReadCondHandle.h:67
Identifier
Definition: IdentifierFieldParser.cxx:14