ATLAS Offline Software
Loading...
Searching...
No Matches
LISAnalysisTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ZDCANALYSIS_LISANALYSISTOOL_H
6#define ZDCANALYSIS_LISANALYSISTOOL_H
7
9#include "AsgTools/AsgTool.h"
15
19
20namespace ZDC {
21
22// Results class to hold processed LIS waveform quantities
24 unsigned int m_presampleADC{};
25 int m_ADCsum{};
26 int m_maxADC{};
27 unsigned int m_maxSample{};
28 float m_avgTime{};
29
30public:
31 LISModuleResults(float presampleADC, int ADCsum, int maxADC, unsigned int maxSample, float avgTime) :
32 m_presampleADC(presampleADC),
33 m_ADCsum(ADCsum),
34 m_maxADC(maxADC),
35 m_maxSample(maxSample),
36 m_avgTime(avgTime)
37 {}
38
39 LISModuleResults() = default;
40
41 unsigned int getPresampleADC() const { return m_presampleADC; }
42 int getADCSum() const { return m_ADCsum; }
43 int getMaxADC() const { return m_maxADC; }
44 unsigned int getMaxSample() const { return m_maxSample; }
45 float getAvgTime() const { return m_avgTime; }
46};
47
50
51public:
52 explicit LISAnalysisTool(std::string const& name);
53 virtual ~LISAnalysisTool() override = default;
54
55 StatusCode initialize() override;
56 StatusCode recoZdcModules(xAOD::ZdcModuleContainer const& moduleContainer, xAOD::ZdcModuleContainer const& moduleSumContainer) override;
57 StatusCode reprocessZdc() override;
58
59private:
60 // Configuration initialization methods
61 void initialize_default();
62
63 // Processing methods
65 LISModuleResults processModuleData(int side, int channel,
66 const std::vector<unsigned short>& data,
67 unsigned int startSample, unsigned int endSample);
68
69 bool m_init{false};
70 std::string m_name;
71
72 // Job properties
73 Gaudi::Property<std::string> m_configuration{this, "Configuration", "default", "Which config to use"};
74 Gaudi::Property<bool> m_writeAux{this, "WriteAux", true, "Write auxiliary data"};
75 Gaudi::Property<std::string> m_auxSuffix{this, "AuxSuffix", "", "Suffix for aux data names"};
76 Gaudi::Property<unsigned int> m_nBaselineStart{this, "BaselineStart", 0, "Start index for baseline calculation"};
77 Gaudi::Property<unsigned int> m_nBaselineEnd{this, "BaselineEnd", 5, "End index for baseline calculation"};
78
79 std::vector<unsigned int> m_LEDCalreqIdx;
80 std::vector<unsigned int> m_LEDBCID;
81
82 const std::vector<std::string> m_LEDNames = {"Blue1", "Green", "Blue2"};
83 const std::vector<std::string> m_calreqNames = {"CalReq1", "CalReq2", "CalReq3"};
84
85 // Configuration settings
86 unsigned int m_numSamples{24};
87 unsigned int m_preSample{0};
88 float m_deltaTSample{3.125}; // ns per sample
89 unsigned int m_sampleAnaStart{5};
90 unsigned int m_sampleAnaEnd{23};
91 unsigned int m_nBaselineSamples{5}; // default to 5 samples for baseline calculation
92
93 // Module container names
94 Gaudi::Property<std::string> m_zdcModuleContainerName{this, "ZdcModuleContainerName", "ZdcModules", "Location of ZDC processed data"};
95 Gaudi::Property<std::string> m_zdcSumContainerName{this, "ZdcSumContainerName", "ZdcSums", "Location of ZDC processed sums"};
98
99 // Read handles
100 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfo", "Location of the event info"};
101 SG::ReadDecorHandleKey<xAOD::ZdcModuleContainer> m_eventTypeKey{this, "ZdcEventTypeKey", "", "ZDC Event type"};
102 SG::ReadDecorHandleKey<xAOD::ZdcModuleContainer> m_robBCIDKey {this, "ROBBCIDKey", "", "BCID from LUCROD ROB headers"};
103 SG::ReadDecorHandleKey<xAOD::ZdcModuleContainer> m_DAQModeKey{this, "ZdcDAQModeKey", "", "ZDC DAQ mode"};
104
105 // Write decoration handles for LIS-specific outputs
106 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_ZdcLEDType{this, "ZdcLEDType", "", "ZDC LED Type (0-Blue1, 1-Green, 2-Blue2}"};
107 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_LISPresampleADC{this, "LISPresampleADC", "", "LIS presample ADC"};
108 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_LISADCSum{this, "LISADCSum", "", "LIS pulse FADC sum"};
109 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_LISMaxADC{this, "LISMaxADC", "", "LIS pulse max FADC value"};
110 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_LISMaxSample{this, "LISMaxSample", "", "LIS max FADC sample"};
111 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_LISAvgTime{this, "LISAvgTime", "", "LIS average time"};
112
114 double getAmplitudeCorrection(int iside, int imod, bool highGain, float fitAmp);
115 void setFADCCorrections(unsigned int runNumber);
116
117
118};
119
120} // namespace ZDC
121
122#endif // ZDCANALYSIS_LISANALYSISTOOL_H
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_LISMaxADC
Gaudi::Property< bool > m_writeAux
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_LISMaxSample
Gaudi::Property< unsigned int > m_nBaselineEnd
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_LISADCSum
const std::vector< std::string > m_LEDNames
LISAnalysisTool(std::string const &name)
Gaudi::Property< std::string > m_auxSuffix
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_robBCIDKey
unsigned int m_sampleAnaStart
LISModuleResults processModuleData(int side, int channel, const std::vector< unsigned short > &data, unsigned int startSample, unsigned int endSample)
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_LISPresampleADC
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_eventTypeKey
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcLEDType
Gaudi::Property< unsigned int > m_nBaselineStart
LISModuleResults processLISModule(const xAOD::ZdcModule &module)
std::vector< unsigned int > m_LEDCalreqIdx
StatusCode reprocessZdc() override
std::vector< unsigned int > m_LEDBCID
double getAmplitudeCorrection(int iside, int imod, bool highGain, float fitAmp)
Gaudi::Property< std::string > m_configuration
unsigned int m_nBaselineSamples
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_DAQModeKey
const xAOD::ZdcModuleContainer * m_zdcSums
Gaudi::Property< std::string > m_zdcModuleContainerName
void setFADCCorrections(unsigned int runNumber)
virtual ~LISAnalysisTool() override=default
const xAOD::ZdcModuleContainer * m_zdcModules
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_LISAvgTime
const std::vector< std::string > m_calreqNames
unsigned int m_numSamples
Gaudi::Property< std::string > m_zdcSumContainerName
unsigned int m_sampleAnaEnd
StatusCode recoZdcModules(xAOD::ZdcModuleContainer const &moduleContainer, xAOD::ZdcModuleContainer const &moduleSumContainer) override
LISModuleResults(float presampleADC, int ADCsum, int maxADC, unsigned int maxSample, float avgTime)
unsigned int m_presampleADC
unsigned int getPresampleADC() const
unsigned int getMaxSample() const
LISModuleResults()=default
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
ZdcModuleContainer_v1 ZdcModuleContainer
ZdcModule_v1 ZdcModule
Definition ZdcModule.h:15
void initialize()