ATLAS Offline Software
LArHitEMapToDigitAlg.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
4 #include "LArHitEMapToDigitAlg.h"
6 #include "CLHEP/Random/RandGaussZiggurat.h"
9 #include "CaloIdentifier/LArID.h"
14 
16 #include "CLHEP/Random/RandomEngine.h"
17 #include <CLHEP/Random/Randomize.h>
18 
19 
20 using CLHEP::RandFlat;
21 using CLHEP::RandGaussZiggurat;
22 
23 LArHitEMapToDigitAlg::LArHitEMapToDigitAlg(const std::string& name, ISvcLocator* pSvcLocator) :
24  AthReentrantAlgorithm(name,pSvcLocator)
25 {
26  // default properties
27  m_LowGainThresh[EM] = 3900;//ADC counts in MediumGain
28  m_HighGainThresh[EM] = 1300;//ADC counts in MediumGain
29  m_LowGainThresh[HEC] = 2500;//ADC counts in MediumGain
30  m_HighGainThresh[HEC] = 0;//-> high-gain never used for HEC
31  m_LowGainThresh[FCAL] = 2000.;//ADC counts in Medium Gain
32  m_HighGainThresh[FCAL] = 1100.;//ADCcounts in MediumGain
33  m_LowGainThresh[EMIW] = 3900;//ADC counts in MediumGain
34  m_HighGainThresh[EMIW] = 1300;//ADC counts in MediumGain
35  // given the enum, it seems complicated to do it with modern configuration
36  declareProperty("LowGainThreshEM",m_LowGainThresh[EM],"Medium/Low gain transition in EM");
37  declareProperty("HighGainThreshEM",m_HighGainThresh[EM],"Medium/High gain transition in EM");
38  declareProperty("LowGainThreshHEC",m_LowGainThresh[HEC],"Medium/Low gain transition in HEC");
39  declareProperty("HighGainThreshHEC",m_HighGainThresh[HEC],"Medium/High gain transition in HEC");
40  declareProperty("LowGainThreshFCAL",m_LowGainThresh[FCAL],"Medium/Low gain transition in FCAL");
41  declareProperty("HighGainThreshFCAL",m_HighGainThresh[FCAL],"Medium/High gain transition in FCAL");
42  declareProperty("LowGainThreshEMECIW",m_LowGainThresh[EMIW],"Medium/Low gain transition in EMEC IW");
43  declareProperty("HighGainThreshEMECIW",m_HighGainThresh[EMIW],"Medium/High gain transition in EMEC IW");
44 }
45 
47 {
48 
49  if (m_NSamples > s_MaxNSamples) {
50  ATH_MSG_ERROR("Requested Nsamples " << m_NSamples << " larger than max "
51  << s_MaxNSamples);
52  return StatusCode::FAILURE;
53  }
56 
62  ATH_CHECK(m_bcContKey.initialize());
63  ATH_CHECK(m_badFebKey.initialize());
66 
68 
69  // helpers
70  //retrieve ID helpers
71  ATH_CHECK(detStore()->retrieve(m_calocell_id,"CaloCell_ID"));
72 
73 
74  const CaloIdManager* caloIdMgr = nullptr;
75  StatusCode sc = detStore()->retrieve(caloIdMgr);
76  if (sc.isFailure()) {
77  ATH_MSG_ERROR(" Unable to retrieve CaloIdManager from DetectoreStore");
78  return StatusCode::FAILURE;
79  }
80  m_larem_id = caloIdMgr->getEM_ID();
81  m_larhec_id = caloIdMgr->getHEC_ID();
82  m_larfcal_id = caloIdMgr->getFCAL_ID();
83 
84  sc = detStore()->retrieve(m_laronline_id);
85  if (sc.isFailure()) {
86  ATH_MSG_ERROR(" Unable to retrieve LArOnlineId from DetectoreStore");
87  return StatusCode::FAILURE;
88  }
90 
91  // Services
92  ATH_CHECK(m_rndmGenSvc.retrieve());
95 
98  return StatusCode::SUCCESS;
99 
100 }
101 
102 StatusCode LArHitEMapToDigitAlg::execute(const EventContext& context) const {
103 
104  // load many conditions
105  const LArBadFebCont* badFebs = pointerFromKey<LArBadFebCont>(context,m_badFebKey);
107  const LArOnOffIdMapping* cabling=*cablingHdl;
108  if(!cabling) {
109  ATH_MSG_ERROR("Failed to retrieve LAr Cabling map with key " << m_cablingKey.key() );
110  return StatusCode::FAILURE;
111  }
112 
113  // Inputs
114  SG::ReadHandle<LArHitEMap> hitmap(m_hitMapKey,context);
115  const LArHitEMap* hitmapPtr = hitmap.cptr();
116  const LArHitEMap* hitmapPtr_DigiHSTruth = nullptr;
117  if ( m_doDigiTruth ) {
118  SG::ReadHandle<LArHitEMap> hitmap_DigitHSTruth(m_hitMapKey_DigiHSTruth,context);
119  hitmapPtr_DigiHSTruth = hitmap_DigitHSTruth.cptr();
120  }
121 
122  int it,it_end;
123  it = 0;
124  it_end = hitmapPtr->GetNbCells();
125 
126  // Prepare Output
127  //
128  // For the standard one lets use a DataPool
129  auto DigitContainer = std::make_unique<LArDigitContainer>(SG::VIEW_ELEMENTS);
130  DigitContainer->reserve(it_end);
131  DataPool<LArDigit> dataItemsPool(context);
132  dataItemsPool.reserve(it_end);
133  //
134  // HSTruth outputt might not be needed so avoid doing anything
135  // in that case
136  std::unique_ptr<LArDigitContainer> DigitContainer_DigiHSTruth = nullptr;
137  if (m_doDigiTruth){
138  DigitContainer_DigiHSTruth = std::make_unique<LArDigitContainer>();
139  DigitContainer_DigiHSTruth->reserve(it_end);
140  }
141  //
142  const std::vector<std::pair<float,float> >* TimeE;
143  const std::vector<std::pair<float,float> >* TimeE_DigiHSTruth = nullptr;
144 
145  ATHRNG::RNGWrapper* rngWrapper = m_rndmGenSvc->getEngine(this, m_randomStreamName);
146  CLHEP::HepRandomEngine * engine = rngWrapper->getEngine(context);
148  rngWrapper->setSeedLegacy( m_randomStreamName, context, m_randomSeedOffset, seedingmode );
149 
150  for( ; it!=it_end;++it) // now loop on cells
151  {
152  const LArHitList& hitlist = hitmapPtr->GetCell(it);
153 
154  if (!m_Windows || hitlist.inWindows()) {
155  TimeE = &(hitlist.getData());
156  if(m_doDigiTruth) {
157  const auto& hitlist_DigiHSTruth=hitmapPtr_DigiHSTruth->GetCell(it);
158  TimeE_DigiHSTruth = &(hitlist_DigiHSTruth.getData());
159  }
160 
161  if (!TimeE->empty() || m_NoiseOnOff || m_RndmEvtOverlay) {
163  HWIdentifier ch_id = cabling->createSignalChannelIDFromHash(IdentifierHash(it));
164  HWIdentifier febId = m_laronline_id->feb_Id(ch_id);
165  bool missing=!(badFebs->status(febId).good());
166  if (!missing) {
167  const LArDigit * digit = nullptr ;
168  if(m_RndmEvtOverlay) digit = hitmapPtr->GetDigit(it);
169  // MakeDigit called if in no overlay mode or
170  // if in overlay mode and random digit exists
171  if ((!m_RndmEvtOverlay) || (m_RndmEvtOverlay && digit)) {
172  LArDigit* Digit = nullptr;
173  LArDigit* Digit_DigiHSTruth = nullptr;
174  ATH_CHECK(MakeDigit(context, cellID, ch_id, Digit,
175  dataItemsPool,
176  Digit_DigiHSTruth, TimeE, digit, engine,
177  TimeE_DigiHSTruth));
178  DigitContainer->push_back(Digit);
179  if (DigitContainer_DigiHSTruth){
180  DigitContainer_DigiHSTruth->push_back(Digit_DigiHSTruth);
181  }
182  }
183  }
184  }
185  } // check window
186  } // end of loop over the cells
187 
188 
189  ATH_MSG_DEBUG(" number of created digits = " << DigitContainer->size());
190 
191  SG::WriteHandle<LArDigitContainer> DigitContainerHandle( m_DigitContainerName, context);
192  ATH_CHECK(DigitContainerHandle.record( std::move(DigitContainer) ) );
193  if ( DigitContainer_DigiHSTruth ){
194  SG::WriteHandle<LArDigitContainer> DigitContainer_DigiHSTruthHandle( m_DigitContainerName_DigiHSTruth, context);
195  ATH_CHECK(DigitContainer_DigiHSTruthHandle.record( std::move(DigitContainer_DigiHSTruth) ) );
196  }
197 
198 
199  return StatusCode::SUCCESS;
200 }
201 
203  const EventContext& ctx,
204  const Identifier& cellId,
205  const HWIdentifier& ch_id,
206  LArDigit*& Digit,
207  DataPool<LArDigit>& dataItemsPool,
208  LArDigit*& Digit_DigiHSTruth,
209  const std::vector<std::pair<float, float>>* TimeE,
210  const LArDigit* rndmEvtDigit,
211  CLHEP::HepRandomEngine* engine,
212  const std::vector<std::pair<float, float>>* TimeE_DigiHSTruth) const {
213  bool createDigit_DigiHSTruth = true;
214 
215  int sampleGainChoice{2};
216  if (m_firstSample<0) sampleGainChoice-=m_firstSample;
217 
218  int i;
219  short Adc;
220  short Adc_DigiHSTruth;
221 
223  std::vector<short> AdcSample(m_NSamples);
224  std::vector<short> AdcSample_DigiHSTruth(m_NSamples);
225 
226  float MeV2GeV=0.001; // to convert hit from MeV to GeV before apply GeV->ADC
227 
228  float SF=1.;
229  float SigmaNoise;
230  staticVecFloat_t rndm_energy_samples(m_NSamples) ;
231 
232 
234  const LArADC2MeV* adc2MeVs=*adc2mevHdl;
235 
237  const ILArfSampl* fSampl=*fSamplHdl;
238 
240  const ILArPedestal* pedestal=*pedHdl;
241 
242  const ILArNoise* noise=nullptr;
245  noise=*noiseHdl;
246  }
247 
248  const LArAutoCorrNoise* autoCorrNoise=nullptr;
249  if ( !m_RndmEvtOverlay && m_NoiseOnOff) {
251  autoCorrNoise=*autoCorrNoiseHdl;
252  }
253 
256  const LArBadChannelCont* bcCont{*bch};
257 
258  int iCalo=0;
259  if(m_larem_id->is_lar_em(cellId)) {
260  if (m_larem_id->is_em_endcap_inner(cellId)) iCalo=EMIW;
261  else iCalo=EM;
262  }
263  if(m_larem_id->is_lar_hec(cellId)) iCalo=HEC;
264  if(m_larem_id->is_lar_fcal(cellId)) iCalo=FCAL;
265 
267  if (iCalo==HEC) initialGain = CaloGain::LARMEDIUMGAIN;
268 
270 
271 // ........ retrieve data (1/2) ................................
272 //
273  SF=fSampl->FSAMPL(ch_id);
274 
275 //
276 // ....... dump info ................................
277 //
278 #ifndef NDEBUG
279  ATH_MSG_DEBUG(" Cellid " << m_larem_id->show_to_string(cellId));
280  ATH_MSG_DEBUG(" SF: " << SF);
281 #endif
282 
283  staticVecDouble_t Samples;
284  staticVecDouble_t Samples_DigiHSTruth;
285  staticVecDouble_t Noise;
286  Samples.resize(m_NSamples,0);
287  if(m_doDigiTruth) Samples_DigiHSTruth.resize(m_NSamples,0);
288  Noise.resize(m_NSamples,0);
289 
290 //
291 // ....... make the five samples
292 //
293 
294 #ifndef NDEBUG
295  ATH_MSG_DEBUG(" number of hit for this cell " << TimeE->size());
296 #endif
297 
298 //
299 // convert Hits into energy samples and add result to Samples assuming LARHIGHGAIN for pulse shape
300 //
301  bool isDead = m_bcMask.cellShouldBeMasked(bcCont,ch_id);
302 
303 
304  if (!isDead) {
305  if( this->ConvertHits2Samples(ctx, cellId,ch_id,initialGain,TimeE, Samples).isFailure() ) {
306  return StatusCode::SUCCESS;
307  }
308  if(m_doDigiTruth){
309  if( this->ConvertHits2Samples(ctx, cellId,ch_id,initialGain,TimeE_DigiHSTruth, Samples_DigiHSTruth).isFailure() ) {
310  return StatusCode::SUCCESS;
311  }
312  }
313  }
314 
315 //
316 // .... add random event digit if needed
317 //
318  float energy2adc ;
319  float rAdc ;
320  if(m_RndmEvtOverlay && rndmEvtDigit ) // no overlay if missing random digit
321  {
322  rndmGain= rndmEvtDigit->gain();
323  auto polynom_adc2mev =adc2MeVs->ADC2MEV(cellId,rndmEvtDigit->gain());
324  if (polynom_adc2mev.size() > 1) {
325  float adc2energy = SF * polynom_adc2mev[1];
326  const std::vector<short> & rndm_digit_samples = rndmEvtDigit->samples() ;
327  float Pedestal = pedestal->pedestal(ch_id,rndmEvtDigit->gain());
328  if (Pedestal <= (1.0+LArElecCalib::ERRORCODE)) {
329  ATH_MSG_WARNING(" Pedestal not found in database for this channel offID " << cellId << " Use sample 0 for random");
330  Pedestal = rndm_digit_samples[0];
331  }
332  ATH_MSG_DEBUG(" Params for inverting LAr Digitization: pedestal " << Pedestal << " adc2energy " << adc2energy);
333 
334 // in case Medium or low gain, take into account ramp intercept in ADC->"energy" computation
335 // this requires to take into account the sum of the optimal filter coefficients, as they don't compute with ADC shift
336  float adc0=0.;
337  if (!m_isMcOverlay && rndmEvtDigit->gain()>0) {
339  if (larOFC.cptr() != nullptr) {
340  ILArOFC::OFCRef_t ofc_a = larOFC->OFC_a(ch_id,rndmEvtDigit->gain(),0);
341  float sumOfc=0.;
342  if (ofc_a.size()>0) {
343  for (unsigned int j=0;j<ofc_a.size();j++) sumOfc += ofc_a.at(j);
344  }
345  if (sumOfc>0) adc0 = polynom_adc2mev[0] * SF /sumOfc;
346  }
347  }
348 
349  int nmax=m_NSamples;
350  if ((int)(rndm_digit_samples.size()) < m_NSamples) {
352  "Less digit Samples than requested in digitization for cell "
353  << ch_id.get_compact() << " Digit has " << rndm_digit_samples.size()
354  << " samples. Digitization request " << m_NSamples);
355  nmax = rndm_digit_samples.size();
356  }
357  for(i=0 ; i<nmax ; i++)
358  {
359  rAdc = (rndm_digit_samples[i] - Pedestal ) * adc2energy + adc0;
360  rndm_energy_samples[i] = rAdc ;
361  Samples[i] += rAdc ;
362  }
363  }
364  else {
365  ATH_MSG_WARNING(" No ramp found for this random cell " << m_larem_id->show_to_string(cellId) << " for gain " << rndmEvtDigit->gain());
366  }
367  }
368 //...................................................................
369 
370 //
371 //........ choice of the gain
372 //
373 //
374 // fix the shift +1 if HEC and nSamples 4 and firstSample 0
375  int ihecshift=0;
376  if(iCalo == HEC && m_NSamples.value() == 4 && m_firstSample.value() == 0) ihecshift=1;
377  float samp2=Samples[sampleGainChoice-ihecshift]*MeV2GeV;
378  if ( samp2 <= m_EnergyThresh ) return(StatusCode::SUCCESS);
379 
380  if(m_doDigiTruth){
381  float Samp2_DigiHSTruth=Samples_DigiHSTruth[sampleGainChoice-ihecshift]*MeV2GeV;
382  if ( Samp2_DigiHSTruth <= m_EnergyThresh ) createDigit_DigiHSTruth = false;
383  }
384  //We choose the gain in applying thresholds on the 3rd Sample (index "2")
385  //converted in ADC counts in MediumGain (index "1" of (ADC2MEV)).
386  //Indeed, thresholds in ADC counts are defined with respect to the MediumGain.
387  //
388  // 1300 3900
389  // ---------------|----------------|--------------> ADC counts in MediumGain
390  // HighGain <--- MediumGain ---> LowGain
391 
392  float pseudoADC3;
393  float Pedestal = pedestal->pedestal(ch_id,CaloGain::LARMEDIUMGAIN);
394  if (Pedestal <= (1.0+LArElecCalib::ERRORCODE)) {
395  ATH_MSG_DEBUG(" Pedestal not found for medium gain ,cellID " << cellId << " assume 1000 ");
396  Pedestal=1000.;
397  }
398  auto polynom_adc2mev = adc2MeVs->ADC2MEV(cellId,CaloGain::LARMEDIUMGAIN);
399  if ( polynom_adc2mev.size() < 2) {
400  ATH_MSG_WARNING(" No medium gain ramp found for cell " << m_larem_id->show_to_string(cellId) << " no digit produced...");
401  return StatusCode::SUCCESS;
402  }
403  pseudoADC3 = Samples[sampleGainChoice-ihecshift]/(polynom_adc2mev[1])/SF + Pedestal ;
404  //
405  // ......... try a gain
406  //
407  if (pseudoADC3 <= m_HighGainThresh[iCalo]) {
409  } else if (pseudoADC3 <= m_LowGainThresh[iCalo]) {
411  } else {
413  }
414 
415  // check that select gain is never lower than random gain in case of overlay
418 
419 //
420 // recompute Samples if igain != HIGHGAIN
421 //
422  if (igain != initialGain ){
423  for (i=0;i<m_NSamples;i++) {
424  if(m_doDigiTruth) Samples_DigiHSTruth[i] = 0.;
425  if (m_RndmEvtOverlay) Samples[i]= rndm_energy_samples[i] ;
426  else Samples[i] = 0.;
427  }
428 
429  if (!isDead) {
430  if( this->ConvertHits2Samples(ctx, cellId,ch_id,igain,TimeE, Samples) == StatusCode::FAILURE ) {
431  return StatusCode::SUCCESS;
432  }
433  if(m_doDigiTruth){
434  if( this->ConvertHits2Samples(ctx, cellId,ch_id,igain,TimeE_DigiHSTruth, Samples_DigiHSTruth) == StatusCode::FAILURE ) {
435  return StatusCode::SUCCESS;
436  }
437  }
438  }
439  }
440 
441 //
442 // ........ add the noise ................................
443 //
444 
445  double Rndm[32]{};
446  int BvsEC=0;
447  if(iCalo==EM || iCalo==EMIW) BvsEC=std::abs(m_larem_id->barrel_ec(cellId));
448 
449  bool addedNoise=false;
450  if (m_NoiseOnOff &&
451  ((BvsEC == 1 && m_NoiseInEMB) || (BvsEC > 1 && m_NoiseInEMEC) ||
452  (iCalo == HEC && m_NoiseInHEC) || (iCalo == FCAL && m_NoiseInFCAL)))
453  // add the noise only in the wanted sub-detectors
454  {
455  if (!m_RndmEvtOverlay) {
456  if (!m_pedestalNoise) {
457  SigmaNoise = noise->noise(ch_id, igain);
458  } else {
459  float noise = pedestal->pedestalRMS(ch_id, igain);
460  if (noise >= (1.0 + LArElecCalib::ERRORCODE))
461  SigmaNoise = noise;
462  else
463  SigmaNoise = 0.;
464  }
465  // Sqrt of noise covariance matrix
466  const std::vector<float>& CorGen =
467  autoCorrNoise->autoCorrSqrt(cellId, igain);
468  if (CorGen.size() < (unsigned)m_NSamples * m_NSamples) {
469  ATH_MSG_ERROR("Noise AutoCorr too small, need "
470  << m_NSamples * m_NSamples << " points for "
471  << m_NSamples << " samples.");
472  return StatusCode::FAILURE;
473  }
474 
475  RandGaussZiggurat::shootArray(engine, m_NSamples, Rndm, 0., 1.);
476 
477  int index;
478  for (int i = 0; i < m_NSamples; i++) {
479  Noise[i] = 0.;
480  for (int j = 0; j <= i; j++) {
481  index = i * m_NSamples + j;
482  Noise[i] += Rndm[j] * CorGen[index];
483  }
484  Noise[i] = Noise[i] * SigmaNoise;
485  }
486  addedNoise = true;
487  } else {
488  // overlay case a priori don't add any noise
489  for (int i = 0; i < m_NSamples; i++)
490  Noise[i] = 0.;
491  // if gain from zerobias events is < gain from mixed events => add extra
492  // noise to account for gain vs noise dependance
493  // done in a simple way without taking into account the time
494  // correlation of this extra noise properly
495  if (rndmEvtDigit) {
496  // if gain of cell is different from ZB event gain
497  if (igain > rndmEvtDigit->gain()) {
498  double SigmaNoiseZB = 0.; // noise in ZB event for gain of ZB event
499  double SigmaNoise = 0.; // noise expected for new gain value
500  double SigmaExtraNoise = 0.; // quadratic difference of noise values
501  if (!m_pedestalNoise) {
502  SigmaNoiseZB = noise->noise(ch_id, rndmEvtDigit->gain());
503  SigmaNoise = noise->noise(ch_id, igain);
504  } else {
505  float noise = pedestal->pedestalRMS(ch_id, rndmEvtDigit->gain());
506  if (noise >= (1.0 + LArElecCalib::ERRORCODE))
507  SigmaNoiseZB = noise;
508  else
509  SigmaNoiseZB = 0.;
510  noise = pedestal->pedestalRMS(ch_id, igain);
511  if (noise >= (1.0 + LArElecCalib::ERRORCODE))
512  SigmaNoise = noise;
513  else
514  SigmaNoise = 0.;
515  }
516  // Convert SigmaNoiseZB in noise in ADC counts for igain conversion
517  auto polynom_adc2mevZB =
518  adc2MeVs->ADC2MEV(cellId, rndmEvtDigit->gain());
519  auto polynom_adc2mev = adc2MeVs->ADC2MEV(cellId, igain);
520  if (polynom_adc2mevZB.size() > 1 && polynom_adc2mev.size() > 1) {
521  if (polynom_adc2mev[1] > 0.) {
522  SigmaNoiseZB = SigmaNoiseZB * (polynom_adc2mevZB[1]) /
523  (polynom_adc2mev[1]);
524  if (SigmaNoise > SigmaNoiseZB)
525  SigmaExtraNoise = sqrt(SigmaNoise * SigmaNoise -
526  SigmaNoiseZB * SigmaNoiseZB);
527  }
528  } // check that AC2MeV factors are there
529  RandGaussZiggurat::shootArray(engine, m_NSamples, Rndm, 0.,
530  1.); // generate noise
531  for (int i = 0; i < m_NSamples; i++)
532  Noise[i] = SigmaExtraNoise * Rndm[i];
533  addedNoise = true;
534  } // different gains
535  } // rndm Digit is there
536  } // rndm Overlay test
537  } // add noise ?
538  //
539 // ......... convert into adc counts ................................
540 //
541  Pedestal = pedestal->pedestal(ch_id,igain);
542  if (Pedestal <= (1.0+LArElecCalib::ERRORCODE)) {
543  ATH_MSG_WARNING(" pedestal not found for cellId " << cellId << " assume 1000" );
544  Pedestal=1000.;
545  }
546  polynom_adc2mev = adc2MeVs->ADC2MEV(cellId,igain);
547  if (polynom_adc2mev.size() < 2) {
548  ATH_MSG_WARNING(" No ramp found for requested gain " << igain << " for cell " << m_larem_id->show_to_string(cellId) << " no digit made...");
549  return StatusCode::SUCCESS;
550  }
551 
552  energy2adc=1./(polynom_adc2mev[1])/SF;
553 
554 // in case Medium or low gain, take into account ramp intercept in energy->ADC computation
555 // this requires to take into account the sum of the optimal filter coefficients, as they don't compute with ADC shift
557  {
559  if (larOFC.cptr() != nullptr) {
560  float sumOfc=0.;
561  ILArOFC::OFCRef_t ofc_a = larOFC->OFC_a(ch_id,igain,0);
562  if (ofc_a.size()>0) {
563  for (unsigned int j=0;j<ofc_a.size();j++) sumOfc+= ofc_a.at(j);
564  }
565  if ((polynom_adc2mev[1])>0 && sumOfc>0) Pedestal = Pedestal - (polynom_adc2mev[0])/(polynom_adc2mev[1])/sumOfc;
566  ATH_MSG_DEBUG(" Params for final LAr Digitization gain: " << igain << " pedestal: " << Pedestal << " energy2adc: " << energy2adc);
567  }
568  }
569  for(i=0;i<m_NSamples;i++)
570  {
571  double xAdc;
572  double xAdc_DigiHSTruth = 0;
573 
574  if ( addedNoise ){
575  xAdc = Samples[i]*energy2adc + Noise[i] + Pedestal + 0.5;
576  if(m_doDigiTruth) {
577  xAdc_DigiHSTruth = Samples_DigiHSTruth[i]*energy2adc + Noise[i] + Pedestal + 0.5;
578  }
579  }
580 
581  else {
582  if (m_roundingNoNoise) {
583  float flatRndm = RandFlat::shoot(engine);
584  xAdc = Samples[i]*energy2adc + Pedestal + flatRndm;
585  if(m_doDigiTruth) {
586  xAdc_DigiHSTruth = Samples_DigiHSTruth[i]*energy2adc + Pedestal + flatRndm;
587  }
588 
589  }
590  else{
591  xAdc = Samples[i]*energy2adc + Pedestal + 0.5;
592  if(m_doDigiTruth) {
593  xAdc_DigiHSTruth = Samples_DigiHSTruth[i]*energy2adc + Pedestal + 0.5;
594  }
595  }
596 
597  }
598 
599 //
600 // ........ truncate at maximum value + 1
601 // add possibility to saturate at 0 for negative signals
602 //
603  if (xAdc <0) Adc=0;
604  else if (xAdc >= MAXADC) Adc=MAXADC;
605  else Adc = (short) xAdc;
606 
607  AdcSample[i]=Adc;
608 
609  if(m_doDigiTruth){
610  if (xAdc_DigiHSTruth <0) Adc_DigiHSTruth=0;
611  else if (xAdc_DigiHSTruth >= MAXADC) Adc_DigiHSTruth=MAXADC;
612  else Adc_DigiHSTruth = (short) xAdc_DigiHSTruth;
613  AdcSample_DigiHSTruth[i] = Adc_DigiHSTruth;
614  }
615 
616 #ifndef NDEBUG
617  ATH_MSG_DEBUG(" Sample " << i << " Energy= " << Samples[i] << " Adc=" << Adc);
618 #endif
619 
620  }
621 
622 //
623 // ...... create the LArDigit .............
624 //
625  Digit = dataItemsPool.nextElementPtr();
626  (*Digit)=LArDigit(ch_id,igain,std::move(AdcSample));
627 
628  if (m_doDigiTruth && createDigit_DigiHSTruth) {
629  createDigit_DigiHSTruth = false;
630  Digit_DigiHSTruth = nullptr;
631 
632  for (int i = 0; i < m_NSamples; i++) {
633  if (Samples_DigiHSTruth[i] != 0)
634  createDigit_DigiHSTruth = true;
635  }
636 
637  Digit_DigiHSTruth =
638  new LArDigit(ch_id, igain, std::move(AdcSample_DigiHSTruth));
639  }
640 
641  return StatusCode::SUCCESS;
642 }
643 
644 // ---------------------------------------------------------------------------------------
645 
647  const Identifier & cellId, const HWIdentifier ch_id, CaloGain::CaloGain igain,
648  const std::vector<std::pair<float,float> > *TimeE, staticVecDouble_t &sampleList) const
649 
650 {
651 // Converts hits of a particular LAr cell into energy samples
652 // declarations
653  int nsamples ;
654  int nsamples_der ;
655  int i ;
656  int j ;
657  float energy ;
658  float time ;
659 
661  const ILArShape* shape=*shapeHdl;
662 
663 
664 // ........ retrieve data (1/2) ................................
665 //
666  ILArShape::ShapeRef_t Shape = shape->Shape(ch_id,igain);
667  ILArShape::ShapeRef_t ShapeDer = shape->ShapeDer(ch_id,igain);
668 
669  nsamples = Shape.size();
670  nsamples_der = ShapeDer.size();
671 
672  if (nsamples==0) {
673  ATH_MSG_INFO(" No samples for cell = " << cellId );
674  return StatusCode::FAILURE;
675  }
676 
677 #ifndef NDEBUG
678  ATH_MSG_DEBUG(" Cellid " << m_larem_id->show_to_string(cellId));
679  for (i=0;i<nsamples;i++)
680  {
681  ATH_MSG_DEBUG(Shape[i] << " ");
682  }
683 #endif
684 
685  std::vector<std::pair<float,float> >::const_iterator first = TimeE->begin();
686  std::vector<std::pair<float,float> >::const_iterator last = TimeE->end();
687 
688  while (first != last)
689  {
690  energy = (*first).first;
691  time = (*first).second;
692 
693 #ifndef NDEBUG
694  ATH_MSG_DEBUG("m_NSamples, m_usePhase " << m_NSamples << " " << m_usePhase);
695 #endif
696 
697  // fix the shift +1 if HEC and nSamples 4 and firstSample 0
698  // in case of data overlay this should NOT be done as the pulse shape read from the database is already shifted
699  // but this should still be done in case of MC overlay
700  int ihecshift=0;
701  if((!m_RndmEvtOverlay || m_isMcOverlay) && m_larem_id->is_lar_hec(cellId) && m_NSamples.value() == 4 && m_firstSample.value() == 0) ihecshift=1;
702 
703 
704  if (!m_usePhase) {
705 
706  // Atlas like mode where we use 25ns binned pulse shape and derivative to deal with time offsets
707 
708 // shift between reference shape and this time
709  int ishift=(int)(rint(time*(1./25.)));
710  double dtime=time-25.*((double)(ishift));
711  for (i=0;i<m_NSamples.value();i++)
712  {
713  j = i - ishift + m_firstSample + ihecshift;
714 #ifndef NDEBUG
715  ATH_MSG_DEBUG(" time/i/j " << time << " "<< i << " " << j);
716 #endif
717  if (j >=0 && j < nsamples ) {
718  if (j<nsamples_der && std::abs(ShapeDer[j])<10. )
719  sampleList[i] += (Shape[j]- ShapeDer[j]*dtime)*energy ;
720  else sampleList[i] += Shape[j]*energy ;
721  }
722  }
723  }
724 // Mode to use phase (tbin) to get pulse shape ( pulse shape with fine time binning should be available)
725 
726  else {
727 
728  // FIXME hardcode 8phases3ns configuration (cannot access parameters from ILArShape interface now)
729  int nTimeBins = 8;
730  float timeBinWidth = 25./24.*3.;
731 
732 // -50<t<-25 phase=-t-25, shift by one peak time (for s2 uses shape(3) with tbin)
733 // for -25<t<0 phase = -t, no shift of peak time
734 // for 0<t<25 phase=25-t, shift by one peak time (for s2 uses shape(1) with tbin)
735 // 25<t<50 phase=50-t, shift by two
736 // etc...
737 
738  int ishift = (int)(time*(1./25.));
739  int tbin;
740  if (time>0) {
741  tbin = (int)(fmod(time,25)/timeBinWidth);
742  if (tbin>0) {
743  tbin=nTimeBins-tbin;
744  ishift +=1;
745  }
746  } else {
747  tbin = (int)(fmod(-time,25)/timeBinWidth);
748  }
749 
750  double dtime = time - ( 25.*((float)(ishift)) - timeBinWidth*tbin);
751 
752  Shape = shape->Shape(ch_id,igain,tbin);
753  ShapeDer = shape->ShapeDer(ch_id,igain,tbin);
754 
755  nsamples = Shape.size();
756  nsamples_der = ShapeDer.size();
757 
758 
759  for (i=0;i<m_NSamples.value();i++)
760  {
761  j = i - ishift+m_firstSample + ihecshift;
762 #ifndef NDEBUG
763  ATH_MSG_DEBUG(" time/i/j " << time << " "<< i << " " << j);
764 #endif
765  if (j >=0 && j < nsamples ) {
766  if (j<nsamples_der && std::abs(ShapeDer[j])<10. )
767  sampleList[i] += (Shape[j]- ShapeDer[j]*dtime)*energy ;
768  else sampleList[i] += Shape[j]*energy ;
769  }
770  }
771 
772  } // else if of m_usePhase
773 
774  ++first;
775  } // loop over hits
776 
777  return StatusCode::SUCCESS;
778 
779 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
LArHitEMapToDigitAlg::m_OFCKey
SG::ReadCondHandleKey< ILArOFC > m_OFCKey
Definition: LArHitEMapToDigitAlg.h:96
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ILArPedestal::pedestal
virtual float pedestal(const HWIdentifier &id, int gain) const =0
LArAutoCorrNoise
Definition: LArAutoCorrNoise.h:13
LArADC2MeV::ADC2MEV
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
Definition: LArADC2MeV.h:32
ATHRNG::RNGWrapper::SeedingOptionType
SeedingOptionType
Options for seeding option=0 is setSeed as in MC20 option=1 is setSeedLegacy as in MC16 option=2 is s...
Definition: RNGWrapper.h:97
LArHitEMapToDigitAlg::m_shapeKey
SG::ReadCondHandleKey< ILArShape > m_shapeKey
Definition: LArHitEMapToDigitAlg.h:98
LArHitEMapToDigitAlg::m_NoiseInEMEC
Gaudi::Property< bool > m_NoiseInEMEC
Definition: LArHitEMapToDigitAlg.h:153
xAOD::short
short
Definition: Vertex_v1.cxx:165
LArHitEMapToDigitAlg::m_NoiseInFCAL
Gaudi::Property< bool > m_NoiseInFCAL
Definition: LArHitEMapToDigitAlg.h:157
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
AtlasDetectorID::is_lar_fcal
bool is_lar_fcal(Identifier id) const
Definition: AtlasDetectorID.h:839
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
LArHitEMapToDigitAlg::m_autoCorrNoiseKey
SG::ReadCondHandleKey< LArAutoCorrNoise > m_autoCorrNoiseKey
Definition: LArHitEMapToDigitAlg.h:103
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArHitEMapToDigitAlg::s_MaxNSamples
static constexpr int s_MaxNSamples
Definition: LArHitEMapToDigitAlg.h:71
ATHRNG::RNGWrapper::setSeedLegacy
void setSeedLegacy(const std::string &algName, size_t slot, uint64_t ev, uint64_t run, uint64_t offset, SeedingOptionType seeding, EventContext::ContextEvt_t evt=EventContext::INVALID_CONTEXT_EVT)
Set the random seed using a string (e.g.
Definition: RNGWrapper.cxx:104
ILArPedestal
Definition: ILArPedestal.h:12
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
LArHitEMapToDigitAlg::m_badFebKey
SG::ReadCondHandleKey< LArBadFebCont > m_badFebKey
Definition: LArHitEMapToDigitAlg.h:106
LArHitEMapToDigitAlg::m_randomSeedOffset
Gaudi::Property< uint32_t > m_randomSeedOffset
Definition: LArHitEMapToDigitAlg.h:126
CaloIdManager::getEM_ID
const LArEM_ID * getEM_ID(void) const
Definition: CaloIdManager.cxx:80
LArID_Exception.h
LArHitEMapToDigitAlg::m_NoiseOnOff
Gaudi::Property< bool > m_NoiseOnOff
Definition: LArHitEMapToDigitAlg.h:138
ATHRNG::RNGWrapper::SeedingDefault
@ SeedingDefault
Definition: RNGWrapper.h:101
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
ILArShape::ShapeDer
virtual ShapeRef_t ShapeDer(const HWIdentifier &id, int gain, int tbin=0, int mode=0) const =0
LArHitEMapToDigitAlg::m_hitMapKey_DigiHSTruth
SG::ReadHandleKey< LArHitEMap > m_hitMapKey_DigiHSTruth
Definition: LArHitEMapToDigitAlg.h:114
LArDigit::samples
const std::vector< short > & samples() const
Definition: LArDigit.h:78
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TRT_PAI_gasdata::SF
const float SF[NF]
Cross sections for Fluor.
Definition: TRT_PAI_gasdata.h:285
LArHitEMapToDigitAlg::m_larfcal_id
const LArFCAL_ID * m_larfcal_id
Definition: LArHitEMapToDigitAlg.h:176
LArHitEMapToDigitAlg::m_laronline_id
const LArOnlineID * m_laronline_id
Definition: LArHitEMapToDigitAlg.h:177
LArBadChannelMask::buildBitMask
StatusCode buildBitMask(const std::vector< std::string > &problemsToMask, MsgStream &msg)
Definition: LArBadChannelMask.cxx:10
DataPool::reserve
void reserve(unsigned int size)
Set the desired capacity.
Identifier::get_compact
value_type get_compact() const
Get the compact id.
LArHitEMapToDigitAlg::initialize
virtual StatusCode initialize()
Definition: LArHitEMapToDigitAlg.cxx:46
LArHitEMapToDigitAlg::m_RndmEvtOverlay
Gaudi::Property< bool > m_RndmEvtOverlay
Definition: LArHitEMapToDigitAlg.h:144
LArHitEMapToDigitAlg::FCAL
@ FCAL
Definition: LArHitEMapToDigitAlg.h:130
LArHitEMapToDigitAlg::m_rndmGenSvc
ServiceHandle< IAthRNGSvc > m_rndmGenSvc
Definition: LArHitEMapToDigitAlg.h:125
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
LArAutoCorrNoise::autoCorrSqrt
const std::vector< float > & autoCorrSqrt(const HWIdentifier &id, int gain) const
Definition: LArAutoCorrNoise.cxx:24
HWIdentifier
Definition: HWIdentifier.h:13
LArBadChannelMask::cellShouldBeMasked
bool cellShouldBeMasked(const LArBadChannelCont *bcCont, const HWIdentifier &hardwareId) const
Definition: LArBadChannelMask.h:42
LArBadXCont::status
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.
LArHitEMapToDigitAlg::m_noiseKey
SG::ReadCondHandleKey< ILArNoise > m_noiseKey
Definition: LArHitEMapToDigitAlg.h:94
LArHitEMap::GetCell
const LArHitList & GetCell(const unsigned int index) const
Definition: LArHitEMap.h:43
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
ILArNoise
Definition: ILArNoise.h:12
LArHitEMapToDigitAlg::m_fSamplKey
SG::ReadCondHandleKey< ILArfSampl > m_fSamplKey
Definition: LArHitEMapToDigitAlg.h:95
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
LArHitEMapToDigitAlg::m_bcContKey
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
Definition: LArHitEMapToDigitAlg.h:105
LArHitEMapToDigitAlg::m_pedestalKey
SG::ReadCondHandleKey< ILArPedestal > m_pedestalKey
Definition: LArHitEMapToDigitAlg.h:97
LArHitEMapToDigitAlg::m_Windows
Gaudi::Property< bool > m_Windows
Definition: LArHitEMapToDigitAlg.h:163
LArHitEMap
Definition: LArHitEMap.h:22
LArHitEMapToDigitAlg.h
LArHitList::getData
const LARLIST & getData() const
Definition: LArHitList.h:25
LArHitEMapToDigitAlg::m_NoiseInEMB
Gaudi::Property< bool > m_NoiseInEMB
Definition: LArHitEMapToDigitAlg.h:151
DataPool::nextElementPtr
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
CaloIdManager::getHEC_ID
const LArHEC_ID * getHEC_ID(void) const
Definition: CaloIdManager.cxx:95
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
CaloIdManager
This class initializes the Calo (LAr and Tile) offline identifiers.
Definition: CaloIdManager.h:45
LArHitEMapToDigitAlg::m_adc2mevKey
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
Definition: LArHitEMapToDigitAlg.h:99
LArVectorProxy::at
value_type at(size_t i) const
Vector indexing with bounds check.
LArDigit
Liquid Argon digit base class.
Definition: LArDigit.h:25
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArHitEMapToDigitAlg::m_roundingNoNoise
Gaudi::Property< bool > m_roundingNoNoise
Definition: LArHitEMapToDigitAlg.h:161
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ILArfSampl::FSAMPL
virtual const float & FSAMPL(const HWIdentifier &id) const =0
CaloIdManager::getFCAL_ID
const LArFCAL_ID * getFCAL_ID(void) const
Definition: CaloIdManager.cxx:85
LArHitEMapToDigitAlg::staticVecFloat_t
boost::container::static_vector< float, s_MaxNSamples > staticVecFloat_t
Definition: LArHitEMapToDigitAlg.h:73
LArHitEMapToDigitAlg::m_HighGainThresh
double m_HighGainThresh[4]
Definition: LArHitEMapToDigitAlg.h:132
LArHitEMapToDigitAlg::m_bcMask
LArBadChannelMask m_bcMask
Definition: LArHitEMapToDigitAlg.h:108
LArHitEMapToDigitAlg::MakeDigit
StatusCode MakeDigit(const EventContext &ctx, const Identifier &cellId, const HWIdentifier &ch_id, LArDigit *&Digit, DataPool< LArDigit > &dataItemsPool, LArDigit *&Digit_DigiHSTruth, const std::vector< std::pair< float, float > > *TimeE, const LArDigit *rndm_digit, CLHEP::HepRandomEngine *engine, const std::vector< std::pair< float, float > > *TimeE_DigiHSTruth=nullptr) const
Definition: LArHitEMapToDigitAlg.cxx:202
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArHitEMapToDigitAlg::m_NSamples
Gaudi::Property< int > m_NSamples
Definition: LArHitEMapToDigitAlg.h:136
AtlasDetectorID::is_lar_hec
bool is_lar_hec(Identifier id) const
Definition: AtlasDetectorID.h:829
WriteCellNoiseToCool.igain
igain
Definition: WriteCellNoiseToCool.py:338
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
LArHitEMapToDigitAlg::ConvertHits2Samples
StatusCode ConvertHits2Samples(const EventContext &ctx, const Identifier &cellId, HWIdentifier ch_id, CaloGain::CaloGain igain, const std::vector< std::pair< float, float > > *TimeE, staticVecDouble_t &sampleList) const
Definition: LArHitEMapToDigitAlg.cxx:646
LArHitEMap::GetDigit
const LArDigit * GetDigit(unsigned int index) const
Definition: LArHitEMap.h:48
ReadBchFromCool.bch
bch
Definition: ReadBchFromCool.py:446
LArOnlineID_Base::feb_Id
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
Definition: LArOnlineID_Base.cxx:1479
LArHitEMapToDigitAlg::m_LowGainThresh
double m_LowGainThresh[4]
Definition: LArHitEMapToDigitAlg.h:131
LArHitList::inWindows
bool inWindows() const
Definition: LArHitList.h:26
LArHitList
Definition: LArHitList.h:9
LArHitEMapToDigitAlg::m_usePhase
Gaudi::Property< bool > m_usePhase
Definition: LArHitEMapToDigitAlg.h:142
LArHitEMapToDigitAlg::staticVecDouble_t
boost::container::static_vector< double, s_MaxNSamples > staticVecDouble_t
Definition: LArHitEMapToDigitAlg.h:72
LArHitEMapToDigitAlg::LArHitEMapToDigitAlg
LArHitEMapToDigitAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArHitEMapToDigitAlg.cxx:23
LArHitEMapToDigitAlg::m_NoiseInHEC
Gaudi::Property< bool > m_NoiseInHEC
Definition: LArHitEMapToDigitAlg.h:155
LArHitEMapToDigitAlg::m_larem_id
const LArEM_ID * m_larem_id
Definition: LArHitEMapToDigitAlg.h:174
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
IdentifierHash.h
LArEM_Base_ID::barrel_ec
int barrel_ec(const Identifier id) const
return barrel_ec according to :
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
CaloCell_Base_ID::cell_id
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
LArHitEMapToDigitAlg::m_larhec_id
const LArHEC_ID * m_larhec_id
Definition: LArHitEMapToDigitAlg.h:175
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
RNGWrapper.h
LArEM_Base_ID::is_em_endcap_inner
bool is_em_endcap_inner(const Identifier id) const
test if the id belongs to the EM Endcap inner wheel
LArHitEMapToDigitAlg::EMIW
@ EMIW
Definition: LArHitEMapToDigitAlg.h:130
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
LArID.h
LArHitEMapToDigitAlg::m_problemsToMask
Gaudi::Property< std::vector< std::string > > m_problemsToMask
Definition: LArHitEMapToDigitAlg.h:107
LArHitEMapToDigitAlg::m_isMcOverlay
Gaudi::Property< bool > m_isMcOverlay
Definition: LArHitEMapToDigitAlg.h:146
ReadOfcFromCool.nsamples
nsamples
Definition: ReadOfcFromCool.py:115
LArADC2MeV
Definition: LArADC2MeV.h:21
LArHitEMapToDigitAlg::m_pedestalNoise
Gaudi::Property< bool > m_pedestalNoise
Definition: LArHitEMapToDigitAlg.h:159
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition: CaloGain.h:18
LArHitEMapToDigitAlg::m_DigitContainerName_DigiHSTruth
SG::WriteHandleKey< LArDigitContainer > m_DigitContainerName_DigiHSTruth
Definition: LArHitEMapToDigitAlg.h:120
DeMoScan.index
string index
Definition: DeMoScan.py:364
LArDigit::gain
CaloGain::CaloGain gain() const
Definition: LArDigit.h:72
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
MAXADC
#define MAXADC
Definition: LArHitEMapToDigitAlg.h:57
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DeMoScan.first
bool first
Definition: DeMoScan.py:536
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LArHitEMapToDigitAlg::m_DigitContainerName
SG::WriteHandleKey< LArDigitContainer > m_DigitContainerName
Definition: LArHitEMapToDigitAlg.h:118
DataPool
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Definition: DataPool.h:63
LArHitEMapToDigitAlg::execute
virtual StatusCode execute(const EventContext &context) const
Definition: LArHitEMapToDigitAlg.cxx:102
ILArOFC::OFC_a
virtual OFCRef_t OFC_a(const HWIdentifier &id, int gain, int tbin=0) const =0
access to OFCs by online ID, gain, and tbin (!=0 for testbeam)
LArHitEMapToDigitAlg::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArHitEMapToDigitAlg.h:100
CaloIdManager.h
LArHitEMapToDigitAlg::m_EnergyThresh
Gaudi::Property< double > m_EnergyThresh
Definition: LArHitEMapToDigitAlg.h:134
LArElecCalib::ERRORCODE
@ ERRORCODE
Definition: LArCalibErrorCode.h:17
LArHitEMapToDigitAlg::m_calocell_id
const CaloCell_ID * m_calocell_id
Definition: LArHitEMapToDigitAlg.h:173
LArHitEMap::GetNbCells
int GetNbCells(void) const
Definition: LArHitEMap.cxx:64
CaloGain::LARLOWGAIN
@ LARLOWGAIN
Definition: CaloGain.h:18
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
LArNeighbours.h
ILArShape
Definition: ILArShape.h:13
ILArPedestal::pedestalRMS
virtual float pedestalRMS(const HWIdentifier &id, int gain) const =0
access to RMS of Pedestal index by Identifier, and gain setting
AtlasDetectorID::is_lar_em
bool is_lar_em(Identifier id) const
Definition: AtlasDetectorID.h:818
LArHitEMapToDigitAlg::EM
@ EM
Definition: LArHitEMapToDigitAlg.h:130
ATHRNG::RNGWrapper::MC16Seeding
@ MC16Seeding
Definition: RNGWrapper.h:99
LArHitEMapToDigitAlg::m_randomStreamName
Gaudi::Property< std::string > m_randomStreamName
Definition: LArHitEMapToDigitAlg.h:122
LArHitEMapToDigitAlg::m_hitMapKey
SG::ReadHandleKey< LArHitEMap > m_hitMapKey
Definition: LArHitEMapToDigitAlg.h:113
nmax
const int nmax(200)
readCCLHist.float
float
Definition: readCCLHist.py:83
LArHitEMapToDigitAlg::m_firstSample
Gaudi::Property< int > m_firstSample
Definition: LArHitEMapToDigitAlg.h:140
WriteCellNoiseToCool.noise
noise
Definition: WriteCellNoiseToCool.py:380
ITriggerTime.h
interface to a tool that returns the time offset of the current trigger. Used by PileUpMergeSvc
LArHitEMapToDigitAlg::m_doDigiTruth
Gaudi::Property< bool > m_doDigiTruth
Definition: LArHitEMapToDigitAlg.h:148
LArOnlineID.h
LArHitEMapToDigitAlg::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: LArHitEMapToDigitAlg.h:110
LArVectorProxy
Proxy for accessing a range of float values like a vector.
Definition: LArVectorProxy.h:38
ILArfSampl
Definition: ILArfSampl.h:14
LArHitEMapToDigitAlg::m_useLegacyRandomSeeds
Gaudi::Property< bool > m_useLegacyRandomSeeds
Definition: LArHitEMapToDigitAlg.h:127
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
ILArShape::Shape
virtual ShapeRef_t Shape(const HWIdentifier &id, int gain, int tbin=0, int mode=0) const =0
SG::ReadCondHandle::cptr
const_pointer_type cptr()
Definition: ReadCondHandle.h:67
LArHitEMapToDigitAlg::HEC
@ HEC
Definition: LArHitEMapToDigitAlg.h:130
Identifier
Definition: IdentifierFieldParser.cxx:14