ATLAS Offline Software
ZdcMonitorAlgorithm.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ZDCMONITORALGORITHM_H
6 #define ZDCMONITORALGORITHM_H
7 
12 #include "TRandom3.h"
13 #include "array"
14 
15 //---------------------------------------------------
19 //---------------------------------------------------
20 #include "ZdcUtils/ZdcEventInfo.h"
21 
23 public:
24  ZdcMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
25  virtual ~ZdcMonitorAlgorithm();
26  virtual StatusCode initialize() override;
27  virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
28  StatusCode fillPhysicsDataHistograms( const EventContext& ctx ) const;
29 
30 private:
31 
32  // see the standalone version of the Gaudi::Property class (a wrapper in AsgTools) at
33  // athena/Control/AthToolSupport/AsgTools/AsgTools/PropertyWrapper.h
34  // input to constructor: owner, name, value, title = "" (by default)
35  Gaudi::Property<bool> m_CalInfoOn {this,"CalInfoOn",false};
36  Gaudi::Property<bool> m_enableTrigger {this,"EnableTrigger",true};
37 
38  Gaudi::Property<std::string> m_zdcModuleContainerName {this, "ZdcModuleContainerName", "ZdcModules", "Location of ZDC processed data"};
39  Gaudi::Property<std::string> m_zdcSumContainerName {this, "ZdcSumContainerName", "ZdcSums", "Location of ZDC processed sums"};
40  Gaudi::Property<std::string> m_auxSuffix{this, "AuxSuffix", "", "Append this tag onto end of AuxData"};
41  Gaudi::Property<float> m_expected1N{this, "Expected1NADC", 1000., "Expected 1N position in ADC"}; // only needs to indicate the rough scale, only used in the >20N cut mask
42 
43  // single side triggers - less error-prone if defined as separate properties then in a vector (where order would be crucial)
44  Gaudi::Property<std::string> m_triggerSideA{this, "triggerSideA", "L1_ZDC_A", "Trigger on side A, needed for 1N-peak monitoring on side C"};
45  Gaudi::Property<std::string> m_triggerSideC{this, "triggerSideC", "L1_ZDC_C", "Trigger on side C, needed for 1N-peak monitoring on side A"};
46 
47 
48  static const int m_nSides = 2;
49  static const int m_nModules = 4;
50  static const int m_nChannels = 16;
51  static const int m_nZdcStatusBits = 18; // ignoring the last one
52  static const int m_nRpdStatusBits = 15; // ignoring the last one
53  static const int m_nRpdCentroidStatusBits = 21; // ignoring the last one
54 
55  // the i-th element (or (i,j)-th element for 2D vector) here gives the index of the generic monitoring tool (GMT)
56  // in the array of all GMT's --> allows faster tool retrieving and hence faster histogram filling
57  std::vector<int> m_ZDCSideToolIndices;
58  std::vector<std::vector<int>> m_ZDCModuleToolIndices;
59  std::vector<std::vector<int>> m_RPDChannelToolIndices;
60 
61  //---------------------------------------------------
62 
63  // owner, name (allows us to modify the key in python configuration), key
64  SG::ReadHandleKey<xAOD::ZdcModuleContainer> m_ZdcSumContainerKey {this, "ZdcSumContainerKey", "ZdcSums"};
65  SG::ReadHandleKey<xAOD::ZdcModuleContainer> m_ZdcModuleContainerKey {this, "ZdcModuleContainerKey", "ZdcModules"};
66  SG::ReadHandleKey<xAOD::HIEventShapeContainer> m_HIEventShapeContainerKey {this, "HIEventShapeContainerKey", "HIEventShape"};
67 
69  // SG::ReadDecorHandleKey<xAOD::ZdcModuleContainer> m_ZdcBCIDKey {this, "ZdcBCIDKey", m_zdcSumContainerName + ".BCID" + m_auxSuffix};
71 
76 
83 
85  SG::ReadDecorHandleKey<xAOD::ZdcModuleContainer> m_RPDChannelAmplitudeCalibKey {this, "RPDChannelAmplitudeCalibKey", m_zdcModuleContainerName + ".RPDChannelAmplitudeCalib" + m_auxSuffix};
88 
89 
90  SG::ReadDecorHandleKey<xAOD::ZdcModuleContainer> m_RPDrowKey { // needed since the subtracted amplitudes for each side are written in a nrow * ncol matrix and saved in zdcSums
91  this, "rowKey", m_zdcModuleContainerName + ".row" + m_auxSuffix, // need to convert channel to row & column to plot the subtracted amplitudes using rpdChannelMonToolArr (reading in the row and column for each RPD channel, instead of using an analytical expression, allows flexibility for future different RPD geometry / run conditions)
92  "Row index of RPD channel"
93  };
94  SG::ReadDecorHandleKey<xAOD::ZdcModuleContainer> m_RPDcolKey { // needed since the subtracted amplitudes for each side are written in a nrow * ncol matrix and saved in zdcSums
95  this, "colKey", m_zdcModuleContainerName + ".col" + m_auxSuffix, // need to convert channel to row & column to plot the subtracted amplitudes using rpdChannelMonToolArr (reading in the row and column for each RPD channel, instead of using an analytical expression, allows flexibility for future different RPD geometry / run conditions)
96  "Column index of RPD channel"
97  };
98 
100  this, "RpdChannelPileupExpFitParamsKey", m_zdcModuleContainerName+".RPDChannelPileupExpFitParams"+m_auxSuffix,
101  "RPD channel pileup exponential fit parameters: exp( [0] + [1]*sample )"};
103  this, "RPDChannelPileupFracKey", m_zdcModuleContainerName+".RPDChannelPileupFrac"+m_auxSuffix,
104  "RPD channel pileup as fraction of total (nominal baseline-subtracted) sum ADC"};
106  this, "RPDChannelSubtrAmpKey", m_zdcSumContainerName + ".RPDChannelSubtrAmp" + m_auxSuffix,
107  "RPD channel subtracted amplitudes (tile mass) used in centroid calculation"};
109  this, "RPDSubtrAmpSumKey", m_zdcSumContainerName + ".RPDSubtrAmpSum" + m_auxSuffix,
110  "Sum of RPD channel subtracted amplitudes (total mass) used in centroid calculation"};
112  this, "xCentroidKey", m_zdcSumContainerName + ".xCentroid" + m_auxSuffix,
113  "X centroid after geometry corrections and after average centroid subtraction"};
115  this, "yCentroidKey", m_zdcSumContainerName + ".yCentroid" + m_auxSuffix,
116  "Y centroid after geometry corrections and after average centroid subtraction"};
117 
119  this, "reactionPlaneAngleKey", m_zdcSumContainerName + ".reactionPlaneAngle" + m_auxSuffix,
120  "Reaction plane angle in [-pi, pi) from the positive x axis (angle of centorid on side C, angle of centroid + pi on side A)"};
122  this, "cosDeltaReactionPlaneAngleKey", m_zdcSumContainerName + ".cosDeltaReactionPlaneAngle" + m_auxSuffix,
123  "Cosine of the difference between the reaction plane angles of the two sides"};
125  this, "centroidStatusKey", m_zdcSumContainerName + ".centroidStatus" + m_auxSuffix,
126  "Centroid status word"};
128  this, "RPDSideStatusKey", m_zdcSumContainerName + ".RPDStatus" + m_auxSuffix,
129  "Centroid status word"};
130  //---------------------------------------------------
131 
132 };
133 #endif
ZdcMonitorAlgorithm::fillPhysicsDataHistograms
StatusCode fillPhysicsDataHistograms(const EventContext &ctx) const
Definition: ZdcMonitorAlgorithm.cxx:76
ZdcMonitorAlgorithm::m_RPDcolKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDcolKey
Definition: ZdcMonitorAlgorithm.h:94
ZdcMonitorAlgorithm::m_ZdcSumAverageTimeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumAverageTimeKey
Definition: ZdcMonitorAlgorithm.h:73
ZdcMonitorAlgorithm::m_ZdcModuleChisqKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleChisqKey
Definition: ZdcMonitorAlgorithm.h:80
ZdcMonitorAlgorithm::m_zdcSumContainerName
Gaudi::Property< std::string > m_zdcSumContainerName
Definition: ZdcMonitorAlgorithm.h:39
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
ZdcMonitorAlgorithm::m_nRpdStatusBits
static const int m_nRpdStatusBits
Definition: ZdcMonitorAlgorithm.h:52
ZdcMonitorAlgorithm::m_RPDSideStatusKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDSideStatusKey
Definition: ZdcMonitorAlgorithm.h:127
ZdcMonitorAlgorithm::m_ZdcSumUncalibSumKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumUncalibSumKey
Definition: ZdcMonitorAlgorithm.h:74
ZdcMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: ZdcMonitorAlgorithm.cxx:412
ZdcMonitorAlgorithm
Definition: ZdcMonitorAlgorithm.py:1
ZdcMonitorAlgorithm::m_RPDChannelPileupFracKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelPileupFracKey
Definition: ZdcMonitorAlgorithm.h:102
ZdcMonitorAlgorithm::m_ZDCSideToolIndices
std::vector< int > m_ZDCSideToolIndices
Definition: ZdcMonitorAlgorithm.h:57
ZdcMonitorAlgorithm::m_RPDyCentroidKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDyCentroidKey
Definition: ZdcMonitorAlgorithm.h:114
ZdcMonitorAlgorithm::m_RPDChannelAmplitudeCalibKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelAmplitudeCalibKey
Definition: ZdcMonitorAlgorithm.h:85
ZdcMonitorAlgorithm::m_ZdcModuleContainerKey
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleContainerKey
Definition: ZdcMonitorAlgorithm.h:65
ZdcMonitorAlgorithm::m_zdcModuleContainerName
Gaudi::Property< std::string > m_zdcModuleContainerName
Definition: ZdcMonitorAlgorithm.h:38
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
ZdcMonitorAlgorithm::m_RPDChannelToolIndices
std::vector< std::vector< int > > m_RPDChannelToolIndices
Definition: ZdcMonitorAlgorithm.h:59
ZdcMonitorAlgorithm::m_nSides
static const int m_nSides
Definition: ZdcMonitorAlgorithm.h:48
ZdcMonitorAlgorithm::m_triggerSideA
Gaudi::Property< std::string > m_triggerSideA
Definition: ZdcMonitorAlgorithm.h:44
ZdcMonitorAlgorithm::m_RPDChannelMaxADCKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelMaxADCKey
Definition: ZdcMonitorAlgorithm.h:86
ZdcMonitorAlgorithm::m_ZdcModuleCalibTimeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleCalibTimeKey
Definition: ZdcMonitorAlgorithm.h:82
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
ZdcMonitorAlgorithm::m_triggerSideC
Gaudi::Property< std::string > m_triggerSideC
Definition: ZdcMonitorAlgorithm.h:45
ZdcMonitorAlgorithm::m_expected1N
Gaudi::Property< float > m_expected1N
Definition: ZdcMonitorAlgorithm.h:41
ZdcMonitorAlgorithm::m_HIEventShapeContainerKey
SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_HIEventShapeContainerKey
Definition: ZdcMonitorAlgorithm.h:66
ZdcMonitorAlgorithm::m_RPDSubtrAmpSumKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDSubtrAmpSumKey
Definition: ZdcMonitorAlgorithm.h:108
ZdcMonitorAlgorithm::m_ZdcModuleStatusKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleStatusKey
Definition: ZdcMonitorAlgorithm.h:77
ZdcMonitorAlgorithm::m_RPDxCentroidKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDxCentroidKey
Definition: ZdcMonitorAlgorithm.h:111
ZdcMonitorAlgorithm::m_DAQModeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_DAQModeKey
Definition: ZdcMonitorAlgorithm.h:70
ZdcMonitorAlgorithm::m_nModules
static const int m_nModules
Definition: ZdcMonitorAlgorithm.h:49
ZdcMonitorAlgorithm::m_ZdcSumModuleMaskKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumModuleMaskKey
Definition: ZdcMonitorAlgorithm.h:75
ZdcMonitorAlgorithm::m_CalInfoOn
Gaudi::Property< bool > m_CalInfoOn
Definition: ZdcMonitorAlgorithm.h:35
ZdcMonitorAlgorithm::m_RPDChannelStatusKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelStatusKey
Definition: ZdcMonitorAlgorithm.h:87
ZdcMonitorAlgorithm::m_RPDChannelSubtrAmpKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelSubtrAmpKey
Definition: ZdcMonitorAlgorithm.h:105
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthMonitorAlgorithm.h
HIEventShapeContainer.h
ZdcMonitorAlgorithm::~ZdcMonitorAlgorithm
virtual ~ZdcMonitorAlgorithm()
Definition: ZdcMonitorAlgorithm.cxx:16
ZdcMonitorAlgorithm::m_RPDChannelAmplitudeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelAmplitudeKey
Definition: ZdcMonitorAlgorithm.h:84
ZdcMonitorAlgorithm::m_ZdcModuleCalibEnergyKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleCalibEnergyKey
Definition: ZdcMonitorAlgorithm.h:81
ZdcMonitorAlgorithm::m_RPDChannelPileupExpFitParamsKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelPileupExpFitParamsKey
Definition: ZdcMonitorAlgorithm.h:99
ZdcMonitorAlgorithm::m_auxSuffix
Gaudi::Property< std::string > m_auxSuffix
Definition: ZdcMonitorAlgorithm.h:40
ZdcMonitorAlgorithm::m_ZdcSumContainerKey
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumContainerKey
Definition: ZdcMonitorAlgorithm.h:64
ZdcMonitorAlgorithm::m_ZDCModuleToolIndices
std::vector< std::vector< int > > m_ZDCModuleToolIndices
Definition: ZdcMonitorAlgorithm.h:58
ZdcMonitorAlgorithm::m_nRpdCentroidStatusBits
static const int m_nRpdCentroidStatusBits
Definition: ZdcMonitorAlgorithm.h:53
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ZdcMonitorAlgorithm::m_eventTypeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_eventTypeKey
Definition: ZdcMonitorAlgorithm.h:68
ZdcMonitorAlgorithm::m_ZdcModuleTimeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleTimeKey
Definition: ZdcMonitorAlgorithm.h:79
EventInfo.h
ZdcMonitorAlgorithm::ZdcMonitorAlgorithm
ZdcMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: ZdcMonitorAlgorithm.cxx:10
ZdcMonitorAlgorithm::m_ZdcModuleAmplitudeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleAmplitudeKey
Definition: ZdcMonitorAlgorithm.h:78
ZdcMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: ZdcMonitorAlgorithm.cxx:19
ZdcMonitorAlgorithm::m_nChannels
static const int m_nChannels
Definition: ZdcMonitorAlgorithm.h:50
ZdcMonitorAlgorithm::m_RPDreactionPlaneAngleKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDreactionPlaneAngleKey
Definition: ZdcMonitorAlgorithm.h:118
ReadDecorHandle.h
Handle class for reading a decoration on an object.
ZdcMonitorAlgorithm::m_RPDrowKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDrowKey
Definition: ZdcMonitorAlgorithm.h:90
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
ZdcMonitorAlgorithm::m_RPDcosDeltaReactionPlaneAngleKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDcosDeltaReactionPlaneAngleKey
Definition: ZdcMonitorAlgorithm.h:121
ZdcMonitorAlgorithm::m_ZdcSumCalibEnergyKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumCalibEnergyKey
Definition: ZdcMonitorAlgorithm.h:72
ZdcModuleContainer.h
ZdcEventInfo.h
Define enumerations for event-level ZDC data.
ZdcMonitorAlgorithm::m_enableTrigger
Gaudi::Property< bool > m_enableTrigger
Definition: ZdcMonitorAlgorithm.h:36
ZdcMonitorAlgorithm::m_RPDcentroidStatusKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDcentroidStatusKey
Definition: ZdcMonitorAlgorithm.h:124
ZdcMonitorAlgorithm::m_nZdcStatusBits
static const int m_nZdcStatusBits
Definition: ZdcMonitorAlgorithm.h:51