ATLAS Offline Software
CaloCellNoiseAlg.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 // TheCaloCellNoiseAlg.h
6 //
7 
8 #ifndef CALOCONDPHYSALGS_CALOCELLNOISEALG_H
9 #define CALOCONDPHYSALGS_CALOCELLNOISEALG_H
10 
11 #include <string>
12 
13 // Gaudi includes
14 
16 #include "GaudiKernel/ToolHandle.h"
20 #include "CaloGeoHelpers/CaloSampling.h"
22 #include "LArElecCalib/ILArNoise.h"
26 
27 #include "GaudiKernel/ITHistSvc.h"
28 #include "TTree.h"
29 
32 
33 
34  class CaloCellNoiseAlg : public AthAlgorithm {
35  public:
36  //Gaudi style constructor and execution methods
38  CaloCellNoiseAlg(const std::string& name, ISvcLocator* pSvcLocator);
40  virtual ~CaloCellNoiseAlg();
41 
43  virtual StatusCode initialize() override;
45  virtual StatusCode execute() override;
47  virtual StatusCode finalize() override;
49  virtual StatusCode stop() override;
50 
51  private:
52 
55  static StatusCode readNtuple();
56  float getLuminosity();
57 
58  //---------------------------------------------------
59  // Member variables
60  //---------------------------------------------------
61  ServiceHandle<ITHistSvc> m_thistSvc{this,"THistSvc","THistSvc"};
62 
64  , "CaloDetDescrManager"
65  , "CaloDetDescrManager"
66  , "SG Key for CaloDetDescrManager in the Condition Store" };
67 
68  const CaloCell_ID* m_calo_id{nullptr};
69  SG::ReadCondHandleKey<ILArNoise> m_noiseKey{this,"NoiseKey","LArNoiseSym","SG Key of ILArNoise object"};
70  SG::ReadCondHandleKey<ILArPedestal> m_pedestalKey{this,"PedestalKey","LArPedestal","SG Key of LArPedestal object"};
72  { this, "ADC2MeVKey", "LArADC2MeV", "SG Key of the LArADC2MeV CDO" };
74  { this, "TotalNoiseKey", "totalNoise", "SG conditions key for total noise" };
76  { this, "ElecNoiseKey", "electronicNoise", "SG conditions key for electronic noise" };
77 
78  // list of cell energies
79  struct CellInfo {
80  int nevt;
81  int nevt_good;
82  double average;
83  double rms;
85  int sampling;
86  float eta;
87  float phi;
88  float reference;
89  };
90  std::vector<CellInfo> m_CellList;
91  int m_ncell;
92 
93  unsigned int m_lumiblock;
94  unsigned int m_lumiblockOld;
95  bool m_first;
96 
97  // Split this out into a separate, dynamically-allocated block.
98  // Otherwise, the CaloCellNoiseAlg is so large that it violates
99  // the ubsan sanity checks.
100  struct TreeData {
101  float m_luminosity {0};
102  int m_ncell {0};
103  int m_nevt[200000] {0};
104  int m_nevt_good[200000] {0};
105  int m_layer[200000] {0};
106  int m_identifier[200000] {0};
107  float m_eta[200000] {0};
108  float m_phi[200000] {0};
109  float m_average[200000] {0};
110  float m_rms[200000] {0};
111  float m_reference[200000] {0};
112  };
113  std::unique_ptr<TreeData> m_treeData;
114  TTree* m_tree;
115 
116  bool m_doMC;
118  bool m_doFit;
120  int m_nmin;
121  ToolHandle<Trig::TrigDecisionTool> m_trigDecTool;
122  std::string m_triggerChainProp;
123  FloatArrayProperty m_cuts;
124  SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
125  std::string m_lumiFolderName;
127  float m_deltaLumi;
128 
129  };
130 #endif
CaloCellNoiseAlg::CellInfo::phi
float phi
Definition: CaloCellNoiseAlg.h:87
CaloCellNoiseAlg::TreeData::m_nevt_good
int m_nevt_good[200000]
Definition: CaloCellNoiseAlg.h:104
CaloCellNoiseAlg::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: CaloCellNoiseAlg.h:63
CaloCellNoiseAlg::finalize
virtual StatusCode finalize() override
standard Athena-Algorithm method
Definition: CaloCellNoiseAlg.cxx:663
ILArNoise.h
CaloCellNoiseAlg::m_lumiblock
unsigned int m_lumiblock
Definition: CaloCellNoiseAlg.h:93
CaloCellNoiseAlg::TreeData::m_luminosity
float m_luminosity
Definition: CaloCellNoiseAlg.h:101
CaloCellNoiseAlg::m_readNtuple
bool m_readNtuple
Definition: CaloCellNoiseAlg.h:117
CaloCellNoiseAlg::m_first
bool m_first
Definition: CaloCellNoiseAlg.h:95
CaloCellNoiseAlg::m_elecNoiseKey
SG::ReadCondHandleKey< CaloNoise > m_elecNoiseKey
Definition: CaloCellNoiseAlg.h:76
CaloCellNoiseAlg::getLuminosity
float getLuminosity()
Definition: CaloCellNoiseAlg.cxx:324
CaloCellNoiseAlg::CaloCellNoiseAlg
CaloCellNoiseAlg(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition: CaloCellNoiseAlg.cxx:24
CaloCellNoiseAlg::CellInfo::rms
double rms
Definition: CaloCellNoiseAlg.h:83
CaloCellNoiseAlg::TreeData::m_phi
float m_phi[200000]
Definition: CaloCellNoiseAlg.h:108
CaloCellNoiseAlg::m_ncell
int m_ncell
Definition: CaloCellNoiseAlg.h:91
CaloCellNoiseAlg::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: CaloCellNoiseAlg.h:61
CaloCellNoiseAlg::m_treeData
std::unique_ptr< TreeData > m_treeData
Definition: CaloCellNoiseAlg.h:113
TrigDecisionTool.h
CaloCellNoiseAlg::~CaloCellNoiseAlg
virtual ~CaloCellNoiseAlg()
Default Destructor.
Definition: CaloCellNoiseAlg.cxx:83
CaloCellNoiseAlg::fillNtuple
StatusCode fillNtuple()
Definition: CaloCellNoiseAlg.cxx:355
CaloCellNoiseAlg::fitNoise
StatusCode fitNoise()
Definition: CaloCellNoiseAlg.cxx:392
CaloCellNoiseAlg::m_calo_id
const CaloCell_ID * m_calo_id
Definition: CaloCellNoiseAlg.h:68
CaloCellNoiseAlg::m_lumiFolderName
std::string m_lumiFolderName
Definition: CaloCellNoiseAlg.h:125
CaloCellNoiseAlg::m_doFit
bool m_doFit
Definition: CaloCellNoiseAlg.h:118
CaloCellNoiseAlg::m_deltaLumi
float m_deltaLumi
Definition: CaloCellNoiseAlg.h:127
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloCellNoiseAlg::CellInfo::identifier
int identifier
Definition: CaloCellNoiseAlg.h:84
CaloCell_ID.h
CaloCellNoiseAlg
Definition: CaloCellNoiseAlg.h:34
CaloCellNoiseAlg::CellInfo::nevt_good
int nevt_good
Definition: CaloCellNoiseAlg.h:81
CaloCellNoiseAlg::TreeData::m_eta
float m_eta[200000]
Definition: CaloCellNoiseAlg.h:107
AthAlgorithm.h
LArADC2MeV.h
CaloCellNoiseAlg::CellInfo::eta
float eta
Definition: CaloCellNoiseAlg.h:86
LArOnOffIdMapping.h
CaloCellNoiseAlg::m_tree
TTree * m_tree
Definition: CaloCellNoiseAlg.h:114
CaloCellNoiseAlg::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: CaloCellNoiseAlg.h:124
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloCellNoiseAlg::TreeData
Definition: CaloCellNoiseAlg.h:100
CaloCellNoiseAlg::m_noiseKey
SG::ReadCondHandleKey< ILArNoise > m_noiseKey
Definition: CaloCellNoiseAlg.h:69
CaloCellNoiseAlg::TreeData::m_average
float m_average[200000]
Definition: CaloCellNoiseAlg.h:109
CaloCellNoiseAlg::TreeData::m_identifier
int m_identifier[200000]
Definition: CaloCellNoiseAlg.h:106
CaloCellNoiseAlg::m_addlumiblock
int m_addlumiblock
Definition: CaloCellNoiseAlg.h:126
CaloCellNoiseAlg::CellInfo::nevt
int nevt
Definition: CaloCellNoiseAlg.h:80
CaloCellNoiseAlg::TreeData::m_rms
float m_rms[200000]
Definition: CaloCellNoiseAlg.h:110
CaloCellNoiseAlg::TreeData::m_nevt
int m_nevt[200000]
Definition: CaloCellNoiseAlg.h:103
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
CaloCellNoiseAlg::m_trigDecTool
ToolHandle< Trig::TrigDecisionTool > m_trigDecTool
TDT handle.
Definition: CaloCellNoiseAlg.h:121
CaloCellNoiseAlg::m_doMC
bool m_doMC
Definition: CaloCellNoiseAlg.h:116
AthAlgorithm
Definition: AthAlgorithm.h:47
ReadCondHandleKey.h
CaloCellNoiseAlg::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: CaloCellNoiseAlg.cxx:88
CaloCellNoiseAlg::readNtuple
static StatusCode readNtuple()
Definition: CaloCellNoiseAlg.cxx:386
CaloCellNoiseAlg::CellInfo::reference
float reference
Definition: CaloCellNoiseAlg.h:88
CaloCellNoiseAlg::m_lumiblockOld
unsigned int m_lumiblockOld
Definition: CaloCellNoiseAlg.h:94
CaloCellNoiseAlg::m_triggerChainProp
std::string m_triggerChainProp
Definition: CaloCellNoiseAlg.h:122
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CaloNoise.h
CaloCellNoiseAlg::m_pedestalKey
SG::ReadCondHandleKey< ILArPedestal > m_pedestalKey
Definition: CaloCellNoiseAlg.h:70
CaloCellNoiseAlg::TreeData::m_ncell
int m_ncell
Definition: CaloCellNoiseAlg.h:102
CaloCellNoiseAlg::CellInfo
Definition: CaloCellNoiseAlg.h:79
CaloCellNoiseAlg::m_cuts
FloatArrayProperty m_cuts
Definition: CaloCellNoiseAlg.h:123
SG::ReadCondHandleKey< CaloDetDescrManager >
CaloCellNoiseAlg::TreeData::m_reference
float m_reference[200000]
Definition: CaloCellNoiseAlg.h:111
ILArPedestal.h
CaloCellNoiseAlg::CellInfo::sampling
int sampling
Definition: CaloCellNoiseAlg.h:85
CaloCellNoiseAlg::CellInfo::average
double average
Definition: CaloCellNoiseAlg.h:82
CaloIdManager.h
CaloCellNoiseAlg::execute
virtual StatusCode execute() override
standard Athena-Algorithm method
Definition: CaloCellNoiseAlg.cxx:153
CaloCellNoiseAlg::m_totalNoiseKey
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
Definition: CaloCellNoiseAlg.h:74
CaloCellNoiseAlg::m_doLumiFit
bool m_doLumiFit
Definition: CaloCellNoiseAlg.h:119
CaloCellNoiseAlg::m_nmin
int m_nmin
Definition: CaloCellNoiseAlg.h:120
CaloCellNoiseAlg::stop
virtual StatusCode stop() override
standard Athena-Algorithm method
Definition: CaloCellNoiseAlg.cxx:125
CaloCellNoiseAlg::m_adc2mevKey
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
Definition: CaloCellNoiseAlg.h:72
CaloCellNoiseAlg::TreeData::m_layer
int m_layer[200000]
Definition: CaloCellNoiseAlg.h:105
ServiceHandle< ITHistSvc >
CaloCellNoiseAlg::m_CellList
std::vector< CellInfo > m_CellList
Definition: CaloCellNoiseAlg.h:90