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