ATLAS Offline Software
Loading...
Searching...
No Matches
RPDAnalysisTool.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 ZDCANALYSIS_RPDANALYSISTOOL_H
6#define ZDCANALYSIS_RPDANALYSISTOOL_H
7
9#include "AsgTools/AsgTool.h"
11
15
16namespace ZDC {
17
20 public:
21 explicit RPDAnalysisTool(std::string const& name);
22 ~RPDAnalysisTool() override = default;
23
24 // this tool should never be copied or moved
29
30 StatusCode initialize() override;
31
32 private:
33 StatusCode recoZdcModules(xAOD::ZdcModuleContainer const& moduleContainer, xAOD::ZdcModuleContainer const& moduleSumContainer) override;
34 StatusCode reprocessZdc() override;
35
36 // reconstruction steps
37 void reset();
38 void readAOD(xAOD::ZdcModuleContainer const& moduleContainer);
39 void analyze();
40 void writeAOD(xAOD::ZdcModuleContainer const& moduleContainer, xAOD::ZdcModuleContainer const& moduleSumContainer) const;
41
42 StatusCode initializeWriteKey(std::string const& containerName, SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> & writeHandleKey, std::string const& key);
44
45 bool m_initialized = false;
46 // tool properties to be configured in Python
47 std::string m_configuration;
49 std::string m_auxSuffix;
52 // these are optional and null by default; if their values are set, they will overwrite the bulk configuration from config string
53 RPDUtils::OptionalToolProperty<unsigned int> m_forceNSamples; // total number of FADC samples in readout window
54 RPDUtils::OptionalToolProperty<unsigned int> m_forceNBaselineSamples; // number of baseline samples; the sample equal to this number is the start of signal region
55 RPDUtils::OptionalToolProperty<unsigned int> m_forceEndSignalSample; // samples before (not including) this sample are the signal region; 0 or Nsamples goes to end of window
56 RPDUtils::OptionalToolProperty<float> m_forcePulse2ndDerivThresh; // second differences less than or equal to this number indicate a pulse
57 RPDUtils::OptionalToolProperty<float> m_forcePostPulseFracThresh; // if there is a good pulse and post-pulse and size of post-pulse as a fraction of good pulse is less than or equal to this number, ignore post-pulse
58 RPDUtils::OptionalToolProperty<unsigned int> m_forceGoodPulseSampleStart; // pulses before this sample are considered pre-pulses
59 RPDUtils::OptionalToolProperty<unsigned int> m_forceGoodPulseSampleStop; // pulses after this sample are considered post-pulses
60 RPDUtils::OptionalToolProperty<float> m_forceNominalBaseline; // the global nominal baseline; used when pileup is detected
61 RPDUtils::OptionalToolProperty<float> m_forcePileupBaselineSumThresh; // baseline sum (after subtracting nominal baseline) less than this number indicates there is NO pileup
62 RPDUtils::OptionalToolProperty<float> m_forcePileupBaselineStdDevThresh; // baseline standard deviations less than this number indicate there is NO pileup
63 RPDUtils::OptionalToolProperty<unsigned int> m_forceNNegativesAllowed; // maximum number of negative ADC values after baseline and pileup subtraction allowed in signal range
64 RPDUtils::OptionalToolProperty<unsigned int> m_forceADCOverflow; // ADC values greater than or equal to this number are considered overflow
65 std::array<RPDUtils::OptionalToolProperty<std::vector<float>>, 2> m_forceOutputCalibFactors; // multiplicative calibration factors to apply to RPD output, e.g., sum/max ADC, per channel, per side
66
67 // one for each side
68 std::array<std::unique_ptr<RPDDataAnalyzer>, 2> m_dataAnalyzers;
69
70 // read/write handles
71 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chBaselineKey {this, "RPDChannelBaseline", "", "RPD channel baseline"};
72 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chPileupExpFitParamsKey {this, "RPDChannelPileupExpFitParams", "", "RPD channel pileup exponential fit parameters: exp( [0] + [1]*sample )"};
73 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chPileupStretchedExpFitParamsKey {this, "RPDChannelPileupStretchedExpFitParams", "", "RPD channel pileup stretched exponential fit parameters: exp( [0] + [1]*(sample + 4)**0.5 + [2]*(sample + 4)**-0.5 )"};
74 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chPileupExpFitParamErrsKey {this, "RPDChannelPileupExpFitParamErrs", "", "RPD channel pileup exponential fit parameter errors"};
75 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chPileupStretchedExpFitParamErrsKey {this, "RPDChannelPileupStretchedExpFitParamErrs", "", "RPD channel pileup stretched exponential fit parameter errors"};
76 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chPileupExpFitMSEKey {this, "RPDChannelPileupExpFitMSE", "", "RPD Channel pileup exponential fit mean squared error in baseline samples"};
77 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chPileupStretchedExpFitMSEKey {this, "RPDChannelPileupStretchedExpFitMSE", "", "RPD channel pileup stretched exponential fit mean squared error in baseline samples"};
78 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chAmplitudeKey {this, "RPDChannelAmplitude", "", "RPD channel sum ADC (baseline and pileup subtracted)"};
79 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chAmplitudeCalibKey {this, "RPDChannelAmplitudeCalib", "", "RPD channel sum ADC (baseline and pileup subtracted) with output calibration factors applied"};
80 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chMaxADCKey {this, "RPDChannelMaxADC", "", "RPD channel max ADC (baseline and pileup subtracted)"};
81 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chMaxADCCalibKey {this, "RPDChannelMaxADCCalib", "", "RPD channel max ADC (baseline and pileup subtracted) with output calibration factors applied"};
82 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chMaxSampleKey {this, "RPDChannelMaxSample", "", "RPD channel max sample"};
83 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chStatusKey {this, "RPDChannelStatus", "", "RPD channel status"};
84 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_chPileupFracKey {this, "RPDChannelPileupFrac", "", "RPD channel pileup as fraction of total (nominal baseline-subtracted) sum ADC"};
85
86 SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> m_sideStatusKey {this, "ZdcSumRPDStatus", "", "RPD side level status"};
87
88 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey {this, "EventInfoKey", "EventInfo", "Location of the event info."};
89};
90
91} // namespace ZDC
92
93#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
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 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_chPileupStretchedExpFitParamErrsKey
RPDAnalysisTool & operator=(RPDAnalysisTool &&)=delete
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_sideStatusKey
RPDUtils::OptionalToolProperty< float > m_forcePostPulseFracThresh
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chAmplitudeCalibKey
RPDUtils::OptionalToolProperty< unsigned int > m_forceNBaselineSamples
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chPileupExpFitParamErrsKey
std::string m_ZDCSumContainerName
RPDAnalysisTool(std::string const &name)
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chPileupExpFitParamsKey
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chBaselineKey
RPDUtils::OptionalToolProperty< unsigned int > m_forceADCOverflow
RPDUtils::OptionalToolProperty< unsigned int > m_forceGoodPulseSampleStop
RPDUtils::OptionalToolProperty< unsigned int > m_forceEndSignalSample
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chMaxSampleKey
void readAOD(xAOD::ZdcModuleContainer const &moduleContainer)
RPDUtils::OptionalToolProperty< float > m_forcePileupBaselineStdDevThresh
RPDUtils::OptionalToolProperty< unsigned int > m_forceGoodPulseSampleStart
StatusCode reprocessZdc() override
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chAmplitudeKey
std::string m_ZDCModuleContainerName
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chStatusKey
ZDCMsg::MessageFunctionPtr MakeMessageFunction()
RPDUtils::OptionalToolProperty< unsigned int > m_forceNNegativesAllowed
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chMaxADCCalibKey
RPDUtils::OptionalToolProperty< unsigned int > m_forceNSamples
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
StatusCode recoZdcModules(xAOD::ZdcModuleContainer const &moduleContainer, xAOD::ZdcModuleContainer const &moduleSumContainer) override
RPDAnalysisTool(RPDAnalysisTool const &)=delete
RPDAnalysisTool & operator=(RPDAnalysisTool const &)=delete
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chPileupStretchedExpFitMSEKey
std::string m_configuration
RPDAnalysisTool(RPDAnalysisTool &&)=delete
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chMaxADCKey
StatusCode initializeWriteKey(std::string const &containerName, SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > &writeHandleKey, std::string const &key)
std::array< std::unique_ptr< RPDDataAnalyzer >, 2 > m_dataAnalyzers
RPDUtils::OptionalToolProperty< float > m_forceNominalBaseline
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chPileupStretchedExpFitParamsKey
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chPileupExpFitMSEKey
void writeAOD(xAOD::ZdcModuleContainer const &moduleContainer, xAOD::ZdcModuleContainer const &moduleSumContainer) const
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_chPileupFracKey
RPDUtils::OptionalToolProperty< float > m_forcePulse2ndDerivThresh
RPDUtils::OptionalToolProperty< float > m_forcePileupBaselineSumThresh
std::array< RPDUtils::OptionalToolProperty< std::vector< float > >, 2 > m_forceOutputCalibFactors
~RPDAnalysisTool() override=default
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
std::shared_ptr< MessageFunction > MessageFunctionPtr
Definition ZDCMsg.h:14
ZdcModuleContainer_v1 ZdcModuleContainer
void initialize()