ATLAS Offline Software
ZdcLEDAnalysisTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <sstream>
6 #include <memory>
7 
18 #include <TFile.h>
19 
20 namespace ZDC
21 {
23  asg::AsgTool(name),
24  m_name(name)
25 {
26 
27 
28 #ifndef XAOD_STANDALONE
29  declareInterface<IZdcAnalysisTool>(this);
30 #endif
31  declareProperty("ForceCalibRun", m_forceCalibRun = -1);
32  declareProperty("DoFADCCorr", m_doFADCCorr = false);
33 }
34 
36 {
37  ATH_MSG_DEBUG("Deleting ZdcLEDAnalysisTool named " << m_name);
38 }
39 
41 {
42  // Use configuration to direct initialization.
43  //
44  if (m_configuration == "ppPbPb2023") {
46  }
47  else if (m_configuration == "ppALFA2023") {
49  }
50  else if (m_configuration == "zdcStandalone") {
52  }
53  else {
54  ATH_MSG_ERROR("Unknown configuration: " << m_configuration);
55  return StatusCode::FAILURE;
56  }
57 
58  // Check for valid configuration
59  //
61  ATH_MSG_ERROR("Invalid initialization of tool for configuration " << m_configuration);
62  return StatusCode::FAILURE;
63  }
64 
65  ATH_MSG_INFO("doZDC: " << (m_doZDC ? "true" : "false"));
66  ATH_MSG_INFO("doRPD: " << (m_doRPD ? "true" : "false"));
67  ATH_MSG_INFO("Configuration: " << m_configuration);
68  ATH_MSG_DEBUG("AuxSuffix: " << m_auxSuffix);
69  ATH_MSG_DEBUG("NumSamples: " << m_numSamples);
70  ATH_MSG_DEBUG("Presample: " << m_preSample);
71  ATH_MSG_DEBUG("DeltaTSample: " << m_deltaTSample);
72 
73  if (m_writeAux && m_auxSuffix != "") {
74  ATH_MSG_DEBUG("suffix string = " << m_auxSuffix);
75  }
76 
77  std::ostringstream BCIDList;
78  BCIDList << "LED BCIDs:";
79 
80  for (unsigned int idxLED = 0; idxLED < ZdcEventInfo::NumLEDs; idxLED++) {
81  BCIDList << m_LEDNames[idxLED] << " - BCID " << m_LEDBCID[idxLED];
82  if (idxLED < ZdcEventInfo::NumLEDs - 1) BCIDList << ", ";
83  }
84 
85  ATH_MSG_DEBUG(BCIDList.str());
86 
87 
88  // If an aux suffix is provided, prepend it with "_" so we don't have to do so at each use
89  //
90  if (m_auxSuffix != "") m_auxSuffix = "_" + m_auxSuffix;
91 
92  // initialize eventInfo access
93  //
95 
96  // initialize keys for reading ZDC event-level aux decor information
97  //
98  m_eventTypeKey = m_zdcSumContainerName + ".EventType";
99  ATH_CHECK(m_eventTypeKey.initialize());
100 
101  m_DAQModeKey = m_zdcSumContainerName + ".DAQMode";
102  ATH_CHECK(m_DAQModeKey.initialize());
103 
104  m_robBCIDKey = m_zdcSumContainerName + ".rodBCID";
105  ATH_CHECK(m_robBCIDKey.initialize());
106 
107  // Initialize writeDecor handles
108  //
110  ATH_CHECK( m_ZdcLEDPresampleADC.initialize());
111 
113  ATH_CHECK( m_ZdcLEDADCSum.initialize());
114 
116  ATH_CHECK( m_ZdcLEDMaxADC.initialize());
117 
119  ATH_CHECK( m_ZdcLEDMaxSample.initialize());
120 
122  ATH_CHECK( m_ZdcLEDAvgTime.initialize());
123 
124  // The LED type gets writting to the module 0 sum container
125  //
127  ATH_CHECK( m_ZdcLEDType.initialize());
128 
129  // prepare FADC correction per sample
130 
131  m_init = true;
132  return StatusCode::SUCCESS;
133 }
134 
136 {
137  // Use the defaults for now except for sampleAnaStart values and the BCIDs
138  //
141 
142  m_LEDBCID = {1152, 1154, 1156};
143  m_LEDCalreqIdx = {2, 1, 0};
144 }
145 
147 {
148  // Use the defaults for now except for sampleAnaStart values and the BCIDs
149  //
152 
153  m_LEDBCID = {3476, 3479, 3482};
154  m_LEDCalreqIdx = {0, 1, 2};
155 }
156 
158 {
159  // Use the defaults for now except for sampleAnaStart values and the BCIDs
162 
163  m_LEDBCID = {3479, 3482, 3485};
164  m_LEDCalreqIdx = {0 ,1 ,2};
165 }
166 
168  const xAOD::ZdcModuleContainer& moduleSumContainer)
169 {
170  if (!m_init) {
171  ATH_MSG_WARNING("Tool not initialized!");
172  return StatusCode::FAILURE;
173  }
174 
175  if (moduleContainer.size()==0) return StatusCode::SUCCESS; // if no modules, do nothing
176 
178  if (!eventInfo.isValid()) return StatusCode::FAILURE;
179 
182  if (zdcErr||rpdErr)
183  {
184  ATH_MSG_WARNING("ZDC or RPD decoding error found - abandoning ZdcLEDAnalysisTool!");
185  return StatusCode::SUCCESS;
186  }
187 
188  unsigned int thisRunNumber = eventInfo->runNumber();
189  if (thisRunNumber != m_runNumber) {
190  ATH_MSG_INFO("ZDC LED analysis tool will be configured for run " << thisRunNumber << " m_doFADCCorr = " << m_doFADCCorr);
191  if (m_doFADCCorr)
192  {
193  unsigned int calibRunNumber = thisRunNumber;
194  if (m_forceCalibRun > -1) calibRunNumber = m_forceCalibRun;
195  ATH_MSG_INFO("FADC corrections will be configured for run " << calibRunNumber);
196  setFADCCorrections(calibRunNumber);
197  }
198  m_runNumber = thisRunNumber;
199  }
202 
203  // Loop over the sum container to find event-level info (side == 0)
204  //
205  bool haveZdcEventInfo = false;
206  unsigned int eventType = ZdcEventInfo::ZdcEventUnknown;
207  unsigned int bcid = eventInfo->bcid();
208  unsigned int DAQMode = ZdcEventInfo::DAQModeUndef;
209 
210  const xAOD::ZdcModule* moduleSumEventInfo_ptr = 0;
211 
212  for (auto modSum : moduleSumContainer) {
213  //
214  // Module sum object with side == 0 contains event-level information
215  //
216  if (modSum->zdcSide() == 0) {
217  //
218  // Add the event type and bcid as aux decors
219  //
220  ATH_MSG_DEBUG("Found global sum");
221  eventType = eventTypeHandle(*modSum);
222  DAQMode = DAQModeHandle(*modSum);
223  haveZdcEventInfo = true;
224  moduleSumEventInfo_ptr = modSum;
225  }
226  }
227  if (!haveZdcEventInfo) {
228  ATH_MSG_ERROR("Zdc event data not available (moduleSum with side = 0)");
229  return StatusCode::FAILURE;
230  }
231 
232  //
233  // only do something on LED calibration events
234  //
235  if (eventType != ZdcEventInfo::ZdcEventLED) return StatusCode::SUCCESS;
236 
237  // In standalone mode, we have to read the BCID from the rob header
238  //
241  if (!robBCIDHandle.isValid()) return StatusCode::FAILURE;
242 
243  const std::vector<uint16_t>& robBCIDvec = robBCIDHandle(*moduleSumEventInfo_ptr);
244  if (robBCIDHandle->size() == 0) return StatusCode::FAILURE;
245 
246  unsigned int checkBCID = robBCIDvec[0];
247  for (unsigned int bcid : robBCIDvec) {
248  if (bcid != checkBCID) {
249  ATH_MSG_ERROR("Inconsistent BCIDs in rob header, cannot continue in standalone mode");
250  return StatusCode::FAILURE;
251  }
252  }
253 
254  bcid = checkBCID;
255  }
256 
257  // Determine the LED type
258  //
259  unsigned int evtLEDType = ZdcEventInfo::LEDNone;
260 
261  for (unsigned int idxLED = 0; idxLED < ZdcEventInfo::NumLEDs; idxLED++) {
262  //
263  // Does the BCID match one of those associated with the LEDs?
264  //
265  if (m_LEDBCID[idxLED] == bcid) {
267  //
268  // Also check the calreq trigger (to be implemented)
269  //
270  if (false) continue;
271  }
272 
273  evtLEDType = idxLED;
274  break;
275  }
276  }
277 
278  if (evtLEDType == ZdcEventInfo::LEDNone) {
279  //
280  // Thie BCID does not appear to be associated with one of the LEDs, print warning and quit processing
281  //
282  ATH_MSG_WARNING("Unexpected BCID found in data: bcid = " << bcid << m_configuration);
283  return StatusCode::SUCCESS;
284  }
285  else {
286  ATH_MSG_DEBUG("Event with BCID = " << bcid << " has LED type " << evtLEDType);
287  }
288 
289  // We are currently calculating the presample as an unsigned it, but there is another "presample"
290  // from ZdcAnalysisTool which for good reasons is float. So we have to match the type.
291  //
297 
299 
300  ATH_MSG_DEBUG("Starting event processing for LED " << m_LEDNames[evtLEDType]);
301 
302  for (const auto zdcModule : moduleContainer)
303  {
305  if (zdcModule->zdcType() == 0) {
306  results = processZDCModule(*zdcModule);
307  }
308  else if (zdcModule->zdcType() == 1 && zdcModule->zdcModule() == 4) {
309  results = processRPDModule(*zdcModule);
310  }
311 
312  ATH_MSG_DEBUG("Writing aux decors to module with side, module, channel = " << zdcModule->zdcSide() << ", " << zdcModule->zdcModule()
313  << ", " << zdcModule->zdcChannel());
314 
315  moduleLEDPresampleADCHandle(*zdcModule) = std::floor(results.getPresampleADC() + 1.0e-6);
316  moduleLEDADCSumHandle(*zdcModule) = results.getADCSum();
317  moduleLEDMaxADCHandle(*zdcModule) = results.getMaxADC();
318  moduleLEDMaxSampleHandle(*zdcModule) = results.getMaxSample();
319  moduleLEDAvgTimeHandle(*zdcModule) = results.getAvgTime();
320  }
321 
322  // Write the LED type to the moduleSum container keep event-level data
323  //
324  LEDTypeHandle(*moduleSumEventInfo_ptr) = evtLEDType;
325 
326  ATH_MSG_DEBUG("Finishing event processing");
327 
328 
329  return StatusCode::SUCCESS;
330  }
331 
333 {
334  if (!m_init) {
335  ATH_MSG_WARNING("Tool not initialized!");
336  return StatusCode::FAILURE;
337  }
338 
339  ATH_MSG_DEBUG ("Trying to retrieve " << m_zdcModuleContainerName);
340 
341  m_zdcModules = 0;
343 
344 
346 
347  return StatusCode::SUCCESS;
348 }
349 
351 {
352  ATH_MSG_DEBUG("Processing ZDC side, channel = " << module.zdcSide() << ", " << module.zdcModule());
353  bool doLG = false;
354 
355  static const SG::ConstAccessor<std::vector<uint16_t> > g1dataAcc ("g1data");
356  static const SG::ConstAccessor<std::vector<uint16_t> > g0dataAcc ("g0data");
357  std::vector<uint16_t> HGSamples = g1dataAcc (module);
358  std::vector<uint16_t> LGSamples = g0dataAcc (module);
359 
360  std::vector<uint16_t>::const_iterator maxIter = std::max_element(HGSamples.begin(), HGSamples.end());
361  if (maxIter != HGSamples.end()) {
362  if (*maxIter > m_HGADCOverflow) doLG = true;
363  }
364 
365  if (doLG) {
366  return processModuleData(module.zdcSide(),module.zdcModule(),LGSamples, m_sampleAnaStartZDC, m_sampleAnaEndZDC, m_ZdcLowGainScale);
367  }
368  else {
369  return processModuleData(module.zdcSide(),module.zdcModule(),HGSamples, m_sampleAnaStartZDC, m_sampleAnaEndZDC, 1);
370  }
371 }
372 
374 {
375  ATH_MSG_DEBUG("Processing RPD side, channel = " << module.zdcSide() << ", " << module.zdcChannel());
376  static const SG::ConstAccessor<std::vector<uint16_t> > g0dataAcc ("g0data");
377  return processModuleData(-1,-1,g0dataAcc (module), m_sampleAnaStartRPD, m_sampleAnaEndRPD, 1);
378 }
379 
380 ZDCLEDModuleResults ZdcLEDAnalysisTool::processModuleData(int iside, int imod, const std::vector<unsigned short>& data,
381  unsigned int startSample, unsigned int endSample, float gainScale)
382 {
383 
384  int ADCSum = 0;
385  int maxADCsub = -999;
386  unsigned int maxSample = 0;
387  float avgTime = 0.f;
388  bool highgain = (gainScale<1.1); // HG is 1 and LG is 10
389 
390  if (startSample > m_numSamples || endSample > m_numSamples) {
391  ATH_MSG_ERROR("Start or end sample number greater than number of samples");
392  return ZDCLEDModuleResults();
393  }
394 
395  int preFADC = data[m_preSample];
396 
397  for (unsigned int sample = startSample; sample <= endSample; sample++) {
398 
399  int FADCsub = data[sample] - preFADC;
400  if (m_doFADCCorr && (iside!=-1) ) // iside==-1 dummy to indicate RPD and ensure no FADC correction
401  {
402  float corr = getAmplitudeCorrection(iside,imod,highgain,FADCsub);
403  FADCsub *= corr;
404  }
405 
406  float time = (sample + 0.5f)*m_deltaTSample;
407  ADCSum += FADCsub;
408  if (FADCsub > maxADCsub) {
409  maxADCsub = FADCsub;
410  maxSample = sample;
411  }
412 
413  avgTime += time*FADCsub;
414  }
415  if (ADCSum!=0){
416  avgTime /= ADCSum;
417  } else {
418  avgTime = 0.f; //used as default in the ZDCLEDModuleResults c'tor
419  }
420 
421  return ZDCLEDModuleResults(preFADC, ADCSum*gainScale, maxADCsub*gainScale, maxSample, avgTime);
422 }
423 
424 // FADC corrections
425 
426 double ZdcLEDAnalysisTool::getAmplitudeCorrection(int iside, int imod, bool highGain, float fitAmp)
427 {
428  double amplCorrFactor = 1;
429 
430  double fadcCorr = highGain ? m_FADCCorrHG[iside][imod]->Interpolate(fitAmp) : m_FADCCorrLG[iside][imod]->Interpolate(fitAmp);
431  amplCorrFactor *= fadcCorr;
432 
433  return amplCorrFactor;
434 }
435 
437 {
438  std::string filename;
439  std::string runString;
440 
441  if (runNumber == 0) runString = "ZdcFADCCorr_" + m_configuration + "_default.root";
442  else runString = ("ZdcFADCCorr_Run"+TString::Itoa(runNumber,10)+".root").Data();
443 
444  filename = PathResolverFindCalibFile("ZdcAnalysis/" + runString );
445 
446  if (filename.empty())
447  {
448  ATH_MSG_INFO("No FADC corrections file - disabling correction");
449  m_doFADCCorr = false; // disable correction
450  return;
451  }
452 
453  ATH_MSG_INFO("Opening FADC corrections file " << filename);
454  std::unique_ptr<TFile> fFADCCorr(TFile::Open(filename.c_str(), "READ"));
455 
456  if (!fFADCCorr->IsOpen()) {
457  ATH_MSG_INFO ("setFADCCorrections: failed to open file: " << filename << ". Disabling correction.");
458  m_doFADCCorr = false; // disable correctio
459  return;
460  //throw std::runtime_error ("ZdcAnalysisTool failed to open FADCCorrections file " + filename);
461  }
462 
463  // Attempt to read histograms with corrections from file
464  //
465  bool readSuccess = true;
466  std::array<std::array<std::unique_ptr<const TH1>, 4>, 2> histogramsHG;
467  std::array<std::array<std::unique_ptr<const TH1>, 4>, 2> histogramsLG;
468 
469  for (size_t side : {0, 1}) {
470  for (int module : {0, 1, 2, 3}) {
471  std::string histNameHG = "ZDC_FADCCorr_s" + std::to_string(side) + "_m" + std::to_string(module)+"_HG";
472  std::string histNameLG = "ZDC_FADCCorr_s" + std::to_string(side) + "_m" + std::to_string(module)+"_LG";
473 
474  ATH_MSG_DEBUG("setFADCCorrections: Searching for histograms HG and LG: " << histNameHG << ", " << histNameLG);
475 
476  TH1* histHG_ptr = static_cast<TH1*>(fFADCCorr->GetObjectChecked(histNameHG.c_str(), "TH1"));
477  TH1* histLG_ptr = static_cast<TH1*>(fFADCCorr->GetObjectChecked(histNameLG.c_str(), "TH1"));
478 
479  if (!histHG_ptr || !histLG_ptr) {
480  std::string errMsg = "setFADCCorrections: unable to read FADC correction histogram(s) ";
481  if (!histHG_ptr) errMsg += histNameHG + " ";
482  if (!histLG_ptr) errMsg += histNameLG;
483 
484  ATH_MSG_ERROR(errMsg);
485  readSuccess = false;
486  break;
487  }
488  else {
489  //
490  // Check for valid range (Lion uses -0.5 to 4095.5)
491  //
492 
493  if ( std::abs(histHG_ptr->GetXaxis()->GetXmin()+0.5) > 1e-3 || std::abs(histHG_ptr->GetXaxis()->GetXmax() - 4095.5) > 1e-3) {
494  ATH_MSG_ERROR("setFADCCorrections: invalid axis range for HG FADC corrections in histogram with name " << histNameHG);
495  readSuccess = false;
496  break;
497  }
498  if (std::abs(histLG_ptr->GetXaxis()->GetXmin()+0.5) > 1e-3 || std::abs(histLG_ptr->GetXaxis()->GetXmax() - 4095.5) > 1e-3) {
499  ATH_MSG_ERROR("setFADCCorrections: invalid axis range for HG FADC corrections in histogram with name " << histNameLG);
500  readSuccess = false;
501  break;
502  }
503  ATH_MSG_INFO("Configuring FADC histos for side " << side << " mod " << module);
504  m_FADCCorrHG[side][module].reset(histHG_ptr);
505  m_FADCCorrLG[side][module].reset(histLG_ptr);
506 
507  }
508  }
509  }
510 
511  fFADCCorr->Close();
512 
513  if (readSuccess) {
514  ATH_MSG_INFO("Successfully configured FADC correction");
515  m_doFADCCorr = true;
516  }
517  else {
518  ATH_MSG_ERROR("setFADCCorrections: due to at least one error, FADC corrections are not implemented");
519  m_doFADCCorr = false;
520  }
521 
522  return;
523 }
524 
525 
526 } // namespace ZDC
527 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ZDC::ZdcLEDAnalysisTool::m_preSample
unsigned int m_preSample
Definition: ZdcLEDAnalysisTool.h:127
WriteHandle.h
Handle class for recording to StoreGate.
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ZDC::ZdcLEDAnalysisTool::m_LEDNames
const std::vector< std::string > m_LEDNames
Definition: ZdcLEDAnalysisTool.h:122
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ZDC::ZdcLEDAnalysisTool::m_sampleAnaEndZDC
unsigned int m_sampleAnaEndZDC
Definition: ZdcLEDAnalysisTool.h:130
ZDC::ZdcLEDAnalysisTool::m_auxSuffix
Gaudi::Property< std::string > m_auxSuffix
Definition: ZdcLEDAnalysisTool.h:110
ZDC::ZdcLEDAnalysisTool::m_ZdcLEDPresampleADC
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcLEDPresampleADC
Definition: ZdcLEDAnalysisTool.h:158
ZDC::ZdcLEDAnalysisTool::m_configuration
Gaudi::Property< std::string > m_configuration
Definition: ZdcLEDAnalysisTool.h:107
ZDC::ZdcLEDAnalysisTool::m_FADCCorrLG
std::array< std::array< std::unique_ptr< const TH1 >, 4 >, 2 > m_FADCCorrLG
Definition: ZdcLEDAnalysisTool.h:171
ZDC::ZdcLEDAnalysisTool::m_zdcSums
const xAOD::ZdcModuleContainer * m_zdcSums
Definition: ZdcLEDAnalysisTool.h:141
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ZDC::ZdcLEDAnalysisTool::~ZdcLEDAnalysisTool
virtual ~ZdcLEDAnalysisTool() override
Definition: ZdcLEDAnalysisTool.cxx:35
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
ZDC::ZdcLEDAnalysisTool::m_DAQModeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_DAQModeKey
Definition: ZdcLEDAnalysisTool.h:154
xAOD::ZdcModule_v1
Class containing ZDC Module information.
Definition: ZdcModule_v1.h:25
asg
Definition: DataHandleTestTool.h:28
ZDC::ZdcLEDAnalysisTool::m_ZdcLEDType
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcLEDType
Definition: ZdcLEDAnalysisTool.h:157
ZDC::ZdcLEDAnalysisTool::initialize_ppALFA2023
void initialize_ppALFA2023()
Definition: ZdcLEDAnalysisTool.cxx:157
ZDC::ZdcLEDAnalysisTool::m_FADCCorrHG
std::array< std::array< std::unique_ptr< const TH1 >, 4 >, 2 > m_FADCCorrHG
Definition: ZdcLEDAnalysisTool.h:170
ZdcEventInfo::ZdcEventUnknown
@ ZdcEventUnknown
Definition: ZdcEventInfo.h:16
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
ZdcLEDAnalysisTool.h
ZDC::ZdcLEDAnalysisTool::m_ZdcLowGainScale
float m_ZdcLowGainScale
Definition: ZdcLEDAnalysisTool.h:134
m_name
std::string m_name
Definition: ColumnarPhysliteTest.cxx:62
ZDC::ZdcLEDAnalysisTool::m_eventTypeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_eventTypeKey
Definition: ZdcLEDAnalysisTool.h:148
ZdcEventInfo::DAQMode
DAQMode
Definition: ZdcEventInfo.h:17
ZDC::ZdcLEDAnalysisTool::m_HGADCOverflow
unsigned int m_HGADCOverflow
Definition: ZdcLEDAnalysisTool.h:125
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
TRT::Hit::side
@ side
Definition: HitInfo.h:83
ZDC::ZdcLEDAnalysisTool::m_doRPD
Gaudi::Property< bool > m_doRPD
Definition: ZdcLEDAnalysisTool.h:114
ZdcModuleAuxContainer.h
ZDC::ZdcLEDAnalysisTool::m_doZDC
Gaudi::Property< bool > m_doZDC
Definition: ZdcLEDAnalysisTool.h:115
ZDC::ZdcLEDAnalysisTool::recoZdcModules
StatusCode recoZdcModules(const xAOD::ZdcModuleContainer &moduleContainer, const xAOD::ZdcModuleContainer &moduleSumContainer) override
Definition: ZdcLEDAnalysisTool.cxx:167
python.PyAthena.module
module
Definition: PyAthena.py:131
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
ZDC::ZdcLEDAnalysisTool::processModuleData
ZDCLEDModuleResults processModuleData(int iside, int imod, const std::vector< unsigned short > &data, unsigned int startSample, unsigned int endSample, float gainScale)
Definition: ZdcLEDAnalysisTool.cxx:380
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
ZdcEventInfo::ZDCDECODINGERROR
@ ZDCDECODINGERROR
Definition: ZdcEventInfo.h:19
ZDC::ZdcLEDAnalysisTool::m_LEDBCID
std::vector< unsigned int > m_LEDBCID
Definition: ZdcLEDAnalysisTool.h:120
ZDC::ZdcLEDAnalysisTool::m_zdcSumContainerName
Gaudi::Property< std::string > m_zdcSumContainerName
Definition: ZdcLEDAnalysisTool.h:140
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ZdcEventInfo::LEDNone
@ LEDNone
Definition: ZdcEventInfo.h:18
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
ZDC::ZdcLEDAnalysisTool::m_deltaTSample
float m_deltaTSample
Definition: ZdcLEDAnalysisTool.h:128
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
ZDC::ZdcLEDAnalysisTool::setFADCCorrections
void setFADCCorrections(unsigned int runNumber)
Definition: ZdcLEDAnalysisTool.cxx:436
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ZdcEventInfo::NumLEDs
@ NumLEDs
Definition: ZdcEventInfo.h:18
add-xsec-uncert-quadrature-N.results
dictionary results
Definition: add-xsec-uncert-quadrature-N.py:39
ZDC::ZdcLEDAnalysisTool::m_zdcModuleContainerName
Gaudi::Property< std::string > m_zdcModuleContainerName
Definition: ZdcLEDAnalysisTool.h:138
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
ZDC::ZdcLEDAnalysisTool::m_sampleAnaStartZDC
unsigned int m_sampleAnaStartZDC
Definition: ZdcLEDAnalysisTool.h:129
ZDC::ZdcLEDAnalysisTool::m_forceCalibRun
int m_forceCalibRun
Definition: ZdcLEDAnalysisTool.h:169
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ZDC::ZdcLEDAnalysisTool::m_robBCIDKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_robBCIDKey
Definition: ZdcLEDAnalysisTool.h:151
ZDC::ZdcLEDAnalysisTool::m_name
std::string m_name
Definition: ZdcLEDAnalysisTool.h:106
WriteDecorHandle.h
Handle class for adding a decoration to an object.
xAOD::EventInfo_v1::ForwardDet
@ ForwardDet
The forward detectors.
Definition: EventInfo_v1.h:338
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ZDC::ZDCLEDModuleResults
Definition: ZdcLEDAnalysisTool.h:27
ZDC::ZdcLEDAnalysisTool::m_init
bool m_init
Definition: ZdcLEDAnalysisTool.h:102
PathResolver.h
ZDC::ZdcLEDAnalysisTool::reprocessZdc
StatusCode reprocessZdc() override
Definition: ZdcLEDAnalysisTool.cxx:332
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
ReadHandle.h
Handle class for reading from StoreGate.
ZDC::ZdcLEDAnalysisTool::m_LEDCalreqIdx
std::vector< unsigned int > m_LEDCalreqIdx
Definition: ZdcLEDAnalysisTool.h:119
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
ZDC::ZdcLEDAnalysisTool::initialize
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: ZdcLEDAnalysisTool.cxx:40
EventInfo.h
ZDC::ZdcLEDAnalysisTool::m_ZdcLEDADCSum
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcLEDADCSum
Definition: ZdcLEDAnalysisTool.h:159
ZdcEventInfo::DAQModeUndef
@ DAQModeUndef
Definition: ZdcEventInfo.h:17
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:283
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
ZDC::ZdcLEDAnalysisTool::m_sampleAnaStartRPD
unsigned int m_sampleAnaStartRPD
Definition: ZdcLEDAnalysisTool.h:131
ZDC::ZdcLEDAnalysisTool::ZdcLEDAnalysisTool
ZdcLEDAnalysisTool(const std::string &name)
Definition: ZdcLEDAnalysisTool.cxx:22
ZDC::ZdcLEDAnalysisTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: ZdcLEDAnalysisTool.h:145
ZDC::ZdcLEDAnalysisTool::m_writeAux
bool m_writeAux
Definition: ZdcLEDAnalysisTool.h:108
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ZDC::ZdcLEDAnalysisTool::initialize_ppPbPb2023
void initialize_ppPbPb2023()
Definition: ZdcLEDAnalysisTool.cxx:146
ZDC::ZdcLEDAnalysisTool::getAmplitudeCorrection
double getAmplitudeCorrection(int iside, int imod, bool highGain, float fitAmp)
Definition: ZdcLEDAnalysisTool.cxx:426
ZDC
Definition: RPDAnalysisTool.cxx:12
ZDC::ZdcLEDAnalysisTool::m_sampleAnaEndRPD
unsigned int m_sampleAnaEndRPD
Definition: ZdcLEDAnalysisTool.h:132
ReadDecorHandle.h
Handle class for reading a decoration on an object.
ZDC::ZdcLEDAnalysisTool::processRPDModule
ZDCLEDModuleResults processRPDModule(const xAOD::ZdcModule &module)
Definition: ZdcLEDAnalysisTool.cxx:373
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
ZdcEventInfo::Standalone
@ Standalone
Definition: ZdcEventInfo.h:17
ZDC::ZdcLEDAnalysisTool::m_ZdcLEDAvgTime
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcLEDAvgTime
Definition: ZdcLEDAnalysisTool.h:162
xAOD::EventInfo_v1::isEventFlagBitSet
bool isEventFlagBitSet(EventFlagSubDet subDet, size_t bit) const
Check one particular bit of one particular sub-detector.
Definition: EventInfo_v1.cxx:703
ZDC::ZdcLEDAnalysisTool::m_runNumber
unsigned int m_runNumber
Definition: ZdcLEDAnalysisTool.h:168
ZDC::ZdcLEDAnalysisTool::m_zdcModules
const xAOD::ZdcModuleContainer * m_zdcModules
Definition: ZdcLEDAnalysisTool.h:139
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
ZDC::ZdcLEDAnalysisTool::m_ZdcLEDMaxSample
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcLEDMaxSample
Definition: ZdcLEDAnalysisTool.h:161
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
ZDC::ZdcLEDAnalysisTool::initialize_zdcStandalone
void initialize_zdcStandalone()
Definition: ZdcLEDAnalysisTool.cxx:135
ZDC::ZdcLEDAnalysisTool::m_doFADCCorr
bool m_doFADCCorr
Definition: ZdcLEDAnalysisTool.h:167
ZDC::ZdcLEDAnalysisTool::processZDCModule
ZDCLEDModuleResults processZDCModule(const xAOD::ZdcModule &module)
Definition: ZdcLEDAnalysisTool.cxx:350
ZDC::ZdcLEDAnalysisTool::m_numSamples
unsigned int m_numSamples
Definition: ZdcLEDAnalysisTool.h:126
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
ZdcEventInfo.h
Define enumerations for event-level ZDC data.
ZdcEventInfo::ZdcEventLED
@ ZdcEventLED
Definition: ZdcEventInfo.h:16
ZDC::ZdcLEDAnalysisTool::m_ZdcLEDMaxADC
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcLEDMaxADC
Definition: ZdcLEDAnalysisTool.h:160
ZdcEventInfo::RPDDECODINGERROR
@ RPDDECODINGERROR
Definition: ZdcEventInfo.h:19