ATLAS Offline Software
LArSuperCellMonAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 // Morvaj, P.Strizenec - develop for Digital Trigger monitoring (2021)
5 
6 #ifndef LARMONITORING_LARSUPERCELLMONALG_H
7 #define LARMONITORING_LARSUPERCELLMONALG_H
8 
10 
11 //#include "LArRecConditions/ILArBadChannelMasker.h"
12 
15 
17 //#include "LArRecConditions/LArBadChannelCont.h"
21 
22 //#include "TrigDecisionTool/TrigDecisionTool.h"
24 
25 #include <vector>
26 #include <string>
27 #include <bitset>
28 #include <array>
29 #include <map>
30 #include <unordered_map>
31 
32 namespace Trig {
33  class ChainGroup;
34 }
35 
36 class CaloCell;
37 class TileID;
38 class CaloCell_ID;
39 
40 
42 
43  public:
44 
45  LArSuperCellMonAlg(const std::string& name, ISvcLocator* pSvcLocator);
47 
48  virtual StatusCode initialize() override final;
49  virtual StatusCode fillHistograms(const EventContext& ctx) const override final;
50 
51 
52 private:
53 
54  // Job properties
55  SG::ReadHandleKey<CaloCellContainer> m_superCellContainerKey{this,"CaloCellContainer","SCell","SG key of the input super cell container"};
56  SG::ReadHandleKey<CaloCellContainer> m_superCellContainerRefKey{this,"CaloCellContainerRef","SCellEm","SG key of the reference super cell container"};
57  SG::ReadHandleKey<CaloCellContainer> m_superCellContainerRecoKey{this,"CaloCellContainerReco","","SG key of reconstructed SC"};
58 
61  {this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"};
62 
63  Gaudi::Property<std::string> m_MonGroupName {this, "MonGroupName", "LArSuperCellMonGroup"};
64  //Gaudi::Property<std::string> m_SuperCellContainer {this, "SuperCellContainer", "LArSuperCellContainer"};
65  // std::string m_SuperCellContainer;
66 
67  Gaudi::Property<std::vector<std::string> > m_streams{this, "Streams", {}, "Which streams to monitor, if empty, only simple profile per partition (offline case)"};
68  Gaudi::Property<std::vector<std::string> > m_SubDetNames{this, "SubDetNames", {} };
69 
70  SG::ReadCondHandleKey<CaloNoise> m_noiseCDOKey{this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"};
71 
72  //Tool maps, for thr. histograms
73  std::map<std::string,std::map<std::string,int>> m_toolmapAll;
74 
75 
76  // Thresholds for time and Time vs Energy plots:
77  // Energy thresholds hardcoded following official timing analysis. See for example:
78  // https://indico.cern.ch/event/522351/
79  FloatArrayProperty m_eCutForTiming {this, "EcutForTiming",
80  //EMBPNS=0, EMB1NS, EMB2NS, EMB3NS, HEC0NS, HEC1NS, HEC2NS, HEC3NS,EMECPNS,EMEC1NS,EMEC2NS,EMEC3NS,FCAL1NS,FCAL2NS,FCAL3NS
81  {1000., 1000., 3000., 1500., 3500., 3500., 3500., 3500., 1500., 3000., 3000., 2000., 10000., 10000., 10000.}
82  };
83 
84  StringArrayProperty m_layerNames{this, "LayerNames", {"EMBPA", "EMBPC", "EMB1A", "EMB1C", "EMB2A", "EMB2C", "EMB3A", "EMB3C",
85  "HEC0A", "HEC0C", "HEC1A", "HEC1C", "HEC2A", "HEC2C", "HEC3A", "HEC3C",
86  "EMECPA", "EMECPC", "EMEC1A", "EMEC1C", "EMEC2A", "EMEC2C", "EMEC3A", "EMEC3C",
87  "FCAL1A", "FCAL1C", "FCAL2A", "FCAL2C", "FCAL3A", "FCAL3C"},
88  "Names of individual layers to monitor"};
89  IntegerArrayProperty m_layerNcells{this,"LayerNcells",{ 3905, 3905, 29376, 29376, 14595, 14595, 6912, 6912,
90  768, 768, 736, 736, 672, 672, 640, 640,
91  768, 768, 14272, 14272, 11712, 11712, 5120, 5120,
92  1008, 1008, 500, 500, 254, 254},
93  "Number of expected cells per layer"};
94 
95  BooleanProperty m_doDatabaseNoiseVsEtaPhi{this, "doDatabaseNoiseVsEtaPhi", true};
96 
97  BooleanProperty m_doSCReco{this, "doSCReco", false};
98 
99  //enums to help with the conversion of Layer, partitions and such:
100  //Enumerate layers
105 
106  //Enumerate layer-types, ignoring sides. Useful for configuration that is per-definition symmetric
109 
110  FloatArrayProperty m_thresholdsProp[MAXLYRNS];
111  FloatProperty m_thresholdsForResolution{this,"Threshold",5e2};
112  BooleanProperty m_removeMasked{this, "RemoveMasked", true};
113 
114  //Enumerate partitions
116 
117 
118 
119  //Mapping of CaloCell nomencature to CaloCellMonitoring nomencature
120  const std::map<unsigned,LayerEnumNoSides> m_caloSamplingToLyrNS{
125  };
126 
127  //Private methods: Initialization and job-option interpretation
129 
130  std::string strToLower(const std::string& input) const;
131 
132 
133  //Private methods: Histogram filling
134  StatusCode createPerJobHistograms(const CaloCellContainer* cellcont, const CaloNoise *noisep) const;
135 
136  //Helpers for histogram filling
137  void getHistoCoordinates(const CaloDetDescrElement* dde, float& celleta, float& cellphi, unsigned& iLyr, unsigned& iLyrNS) const;
138 
139  // other private variables
140 
141 
142  // Identifer helpers and such
143 
145 
146 
147 };
148 
149 #endif
150 
LArSuperCellMonAlg::EMBPNS
@ EMBPNS
Definition: LArSuperCellMonAlg.h:107
LArSuperCellMonAlg::m_superCellContainerRefKey
SG::ReadHandleKey< CaloCellContainer > m_superCellContainerRefKey
Definition: LArSuperCellMonAlg.h:56
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
LArSuperCellMonAlg::FCAL3NS
@ FCAL3NS
Definition: LArSuperCellMonAlg.h:108
LArSuperCellMonAlg::EMEC3C
@ EMEC3C
Definition: LArSuperCellMonAlg.h:103
LArSuperCellMonAlg::HEC1C
@ HEC1C
Definition: LArSuperCellMonAlg.h:102
LArSuperCellMonAlg
Definition: LArSuperCellMonAlg.py:1
Trig
The common trigger namespace for trigger analysis tools.
Definition: LArCellMonAlg.h:33
LArSuperCellMonAlg::FCAL2C
@ FCAL2C
Definition: LArSuperCellMonAlg.h:104
LArSuperCellMonAlg::m_toolmapAll
std::map< std::string, std::map< std::string, int > > m_toolmapAll
Definition: LArSuperCellMonAlg.h:73
LArSuperCellMonAlg::EMEC1C
@ EMEC1C
Definition: LArSuperCellMonAlg.h:103
LArSuperCellMonAlg::LayerEnumNoSides
LayerEnumNoSides
Definition: LArSuperCellMonAlg.h:107
LArSuperCellMonAlg::HECA
@ HECA
Definition: LArSuperCellMonAlg.h:115
LArSuperCellMonAlg::EMECC
@ EMECC
Definition: LArSuperCellMonAlg.h:115
LArSuperCellMonAlg::EMECPC
@ EMECPC
Definition: LArSuperCellMonAlg.h:103
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
LArSuperCellMonAlg::EMB3NS
@ EMB3NS
Definition: LArSuperCellMonAlg.h:107
LArSuperCellMonAlg::EMEC3NS
@ EMEC3NS
Definition: LArSuperCellMonAlg.h:108
LArSuperCellMonAlg::FCALA
@ FCALA
Definition: LArSuperCellMonAlg.h:115
LArSuperCellMonAlg::m_doSCReco
BooleanProperty m_doSCReco
Definition: LArSuperCellMonAlg.h:97
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
LArSuperCellMonAlg::m_doDatabaseNoiseVsEtaPhi
BooleanProperty m_doDatabaseNoiseVsEtaPhi
Definition: LArSuperCellMonAlg.h:95
LArSuperCellMonAlg::m_SubDetNames
Gaudi::Property< std::vector< std::string > > m_SubDetNames
Definition: LArSuperCellMonAlg.h:68
LArSuperCellMonAlg::EMBA
@ EMBA
Definition: LArSuperCellMonAlg.h:115
LArSuperCellMonAlg::EMB2C
@ EMB2C
Definition: LArSuperCellMonAlg.h:101
LArSuperCellMonAlg::HEC2C
@ HEC2C
Definition: LArSuperCellMonAlg.h:102
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
LArSuperCellMonAlg::m_thresholdsForResolution
FloatProperty m_thresholdsForResolution
Definition: LArSuperCellMonAlg.h:111
SG::ReadHandleKey< CaloCellContainer >
LArSuperCellMonAlg::m_calo_id
const CaloCell_ID * m_calo_id
Definition: LArSuperCellMonAlg.h:144
LArSuperCellMonAlg::EMBPC
@ EMBPC
Definition: LArSuperCellMonAlg.h:101
LArSuperCellMonAlg::m_layerNames
StringArrayProperty m_layerNames
Definition: LArSuperCellMonAlg.h:84
LArSuperCellMonAlg::EMB3C
@ EMB3C
Definition: LArSuperCellMonAlg.h:101
LArSuperCellMonAlg::FCAL1NS
@ FCAL1NS
Definition: LArSuperCellMonAlg.h:108
LArSuperCellMonAlg::m_superCellContainerKey
SG::ReadHandleKey< CaloCellContainer > m_superCellContainerKey
Definition: LArSuperCellMonAlg.h:55
LArSuperCellMonAlg::MAXLAYER
@ MAXLAYER
Definition: LArSuperCellMonAlg.h:104
LArSuperCellMonAlg::HEC0NS
@ HEC0NS
Definition: LArSuperCellMonAlg.h:107
LArSuperCellMonAlg::FCAL3C
@ FCAL3C
Definition: LArSuperCellMonAlg.h:104
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
LArSuperCellMonAlg::m_bcDataKey
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
Property: Bunch crossing data (MC only) (conditions input).
Definition: LArSuperCellMonAlg.h:61
LArSuperCellMonAlg::HEC3NS
@ HEC3NS
Definition: LArSuperCellMonAlg.h:107
LArSuperCellMonAlg::m_MonGroupName
Gaudi::Property< std::string > m_MonGroupName
Definition: LArSuperCellMonAlg.h:63
LArOnOffIdMapping.h
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
LArSuperCellMonAlg::EMEC2A
@ EMEC2A
Definition: LArSuperCellMonAlg.h:103
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
LArSuperCellMonAlg::LArSuperCellMonAlg
LArSuperCellMonAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArSuperCellMonAlg.cxx:30
TileID
Helper class for TileCal offline identifiers.
Definition: TileID.h:68
LArSuperCellMonAlg::EMB1C
@ EMB1C
Definition: LArSuperCellMonAlg.h:101
LArSuperCellMonAlg::m_thresholdsProp
FloatArrayProperty m_thresholdsProp[MAXLYRNS]
Definition: LArSuperCellMonAlg.h:110
LArSuperCellMonAlg::~LArSuperCellMonAlg
~LArSuperCellMonAlg()
Definition: LArSuperCellMonAlg.cxx:39
LArSuperCellMonAlg::HEC3C
@ HEC3C
Definition: LArSuperCellMonAlg.h:102
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArSuperCellMonAlg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override final
adds event to the monitoring histograms
Definition: LArSuperCellMonAlg.cxx:73
AthMonitorAlgorithm.h
LArSuperCellMonAlg::MAXPARTITIONS
@ MAXPARTITIONS
Definition: LArSuperCellMonAlg.h:115
LArSuperCellMonAlg::m_layerNcells
IntegerArrayProperty m_layerNcells
Definition: LArSuperCellMonAlg.h:89
LArSuperCellMonAlg::EMEC2NS
@ EMEC2NS
Definition: LArSuperCellMonAlg.h:108
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
LArSuperCellMonAlg::HEC2NS
@ HEC2NS
Definition: LArSuperCellMonAlg.h:107
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
LArSuperCellMonAlg::HEC2A
@ HEC2A
Definition: LArSuperCellMonAlg.h:102
LArSuperCellMonAlg::EMB3A
@ EMB3A
Definition: LArSuperCellMonAlg.h:101
LArSuperCellMonAlg::EMB1NS
@ EMB1NS
Definition: LArSuperCellMonAlg.h:107
LArSuperCellMonAlg::m_eCutForTiming
FloatArrayProperty m_eCutForTiming
Definition: LArSuperCellMonAlg.h:79
LArSuperCellMonAlg::EMEC1A
@ EMEC1A
Definition: LArSuperCellMonAlg.h:103
LArSuperCellMonAlg::HECC
@ HECC
Definition: LArSuperCellMonAlg.h:115
LArSuperCellMonAlg::FCAL1C
@ FCAL1C
Definition: LArSuperCellMonAlg.h:104
LArSuperCellMonAlg::strToLower
std::string strToLower(const std::string &input) const
Definition: LArSuperCellMonAlg.cxx:323
LArSuperCellMonAlg::EMECA
@ EMECA
Definition: LArSuperCellMonAlg.h:115
ReadCondHandleKey.h
LArSuperCellMonAlg::HEC0C
@ HEC0C
Definition: LArSuperCellMonAlg.h:102
CaloNoise
Definition: CaloNoise.h:16
LArSuperCellMonAlg::EMEC2C
@ EMEC2C
Definition: LArSuperCellMonAlg.h:103
LArSuperCellMonAlg::HEC3A
@ HEC3A
Definition: LArSuperCellMonAlg.h:102
LArSuperCellMonAlg::initThresh
StatusCode initThresh()
Definition: LArSuperCellMonAlg.cxx:66
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
LArSuperCellMonAlg::FCAL2NS
@ FCAL2NS
Definition: LArSuperCellMonAlg.h:108
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
IdentifierHash.h
CaloNoise.h
LArSuperCellMonAlg::FCALC
@ FCALC
Definition: LArSuperCellMonAlg.h:115
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
LArSuperCellMonAlg::FCAL1A
@ FCAL1A
Definition: LArSuperCellMonAlg.h:104
LArSuperCellMonAlg::FCAL2A
@ FCAL2A
Definition: LArSuperCellMonAlg.h:104
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
SG::ReadCondHandleKey< BunchCrossingCondData >
LArSuperCellMonAlg::EMEC3A
@ EMEC3A
Definition: LArSuperCellMonAlg.h:103
LArSuperCellMonAlg::HEC1NS
@ HEC1NS
Definition: LArSuperCellMonAlg.h:107
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
LArSuperCellMonAlg::EMBPA
@ EMBPA
Definition: LArSuperCellMonAlg.h:101
LArSuperCellMonAlg::initialize
virtual StatusCode initialize() override final
initialize
Definition: LArSuperCellMonAlg.cxx:43
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
LArSuperCellMonAlg::EMB2A
@ EMB2A
Definition: LArSuperCellMonAlg.h:101
LArSuperCellMonAlg::m_superCellContainerRecoKey
SG::ReadHandleKey< CaloCellContainer > m_superCellContainerRecoKey
Definition: LArSuperCellMonAlg.h:57
LArSuperCellMonAlg::EMB1A
@ EMB1A
Definition: LArSuperCellMonAlg.h:101
LArSuperCellMonAlg::m_noiseCDOKey
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
Definition: LArSuperCellMonAlg.h:70
LArSuperCellMonAlg::m_removeMasked
BooleanProperty m_removeMasked
Definition: LArSuperCellMonAlg.h:112
LArSuperCellMonAlg::EMBC
@ EMBC
Definition: LArSuperCellMonAlg.h:115
LArSuperCellMonAlg::HEC0A
@ HEC0A
Definition: LArSuperCellMonAlg.h:102
LArSuperCellMonAlg::FCAL3A
@ FCAL3A
Definition: LArSuperCellMonAlg.h:104
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
LArSuperCellMonAlg::EMECPA
@ EMECPA
Definition: LArSuperCellMonAlg.h:103
BunchCrossingCondData.h
Replaces the BunchCrossing AlgTool used in run1/2.
LArSuperCellMonAlg::m_caloSamplingToLyrNS
const std::map< unsigned, LayerEnumNoSides > m_caloSamplingToLyrNS
Definition: LArSuperCellMonAlg.h:120
LArSuperCellMonAlg::m_streams
Gaudi::Property< std::vector< std::string > > m_streams
Definition: LArSuperCellMonAlg.h:67
LArSuperCellMonAlg::EMECPNS
@ EMECPNS
Definition: LArSuperCellMonAlg.h:108
LArSuperCellMonAlg::PartitionEnum
PartitionEnum
Definition: LArSuperCellMonAlg.h:115
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
LArSuperCellMonAlg::EMEC1NS
@ EMEC1NS
Definition: LArSuperCellMonAlg.h:108
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
LArSuperCellMonAlg::getHistoCoordinates
void getHistoCoordinates(const CaloDetDescrElement *dde, float &celleta, float &cellphi, unsigned &iLyr, unsigned &iLyrNS) const
Definition: LArSuperCellMonAlg.cxx:333
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
LArSuperCellMonAlg::EMB2NS
@ EMB2NS
Definition: LArSuperCellMonAlg.h:107
LArSuperCellMonAlg::LayerEnum
LayerEnum
Definition: LArSuperCellMonAlg.h:101
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
LArSuperCellMonAlg::HEC1A
@ HEC1A
Definition: LArSuperCellMonAlg.h:102
LArSuperCellMonAlg::MAXLYRNS
@ MAXLYRNS
Definition: LArSuperCellMonAlg.h:108
LArOnlineID.h
LArSuperCellMonAlg::createPerJobHistograms
StatusCode createPerJobHistograms(const CaloCellContainer *cellcont, const CaloNoise *noisep) const
Definition: LArSuperCellMonAlg.cxx:269