ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellNoiseAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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"
26
27#include "GaudiKernel/ITHistSvc.h"
28#include "TTree.h"
29
32
33
35 public:
36 //Gaudi style constructor and execution methods
38 CaloCellNoiseAlg(const std::string& name, ISvcLocator* pSvcLocator);
41
43 virtual StatusCode initialize() override;
45 virtual StatusCode execute() override;
47 virtual StatusCode stop() override;
48
49 private:
50
51 StatusCode fillNtuple();
52 StatusCode fitNoise();
53 static StatusCode readNtuple();
54 float getLuminosity();
55
56 //---------------------------------------------------
57 // Member variables
58 //---------------------------------------------------
59 ServiceHandle<ITHistSvc> m_thistSvc{this,"THistSvc","THistSvc"};
60
62 , "CaloDetDescrManager"
63 , "CaloDetDescrManager"
64 , "SG Key for CaloDetDescrManager in the Condition Store" };
65
66 const CaloCell_ID* m_calo_id{nullptr};
67 SG::ReadCondHandleKey<ILArNoise> m_noiseKey{this,"NoiseKey","LArNoiseSym","SG Key of ILArNoise object"};
68 SG::ReadCondHandleKey<ILArPedestal> m_pedestalKey{this,"PedestalKey","LArPedestal","SG Key of LArPedestal object"};
70 { this, "ADC2MeVKey", "LArADC2MeV", "SG Key of the LArADC2MeV CDO" };
72 { this, "TotalNoiseKey", "totalNoise", "SG conditions key for total noise" };
74 { this, "ElecNoiseKey", "electronicNoise", "SG conditions key for electronic noise" };
75
76 // list of cell energies
77 struct CellInfo {
78 int nevt;
80 double average;
81 double rms;
84 float eta;
85 float phi;
86 float reference;
87 };
88 std::vector<CellInfo> m_CellList;
89 int m_ncell{0};
90
91 unsigned int m_lumiblock{0};
92 unsigned int m_lumiblockOld{0};
93 bool m_first{false};
94
95 // Split this out into a separate, dynamically-allocated block.
96 // Otherwise, the CaloCellNoiseAlg is so large that it violates
97 // the ubsan sanity checks.
98 struct TreeData {
99 float m_luminosity {0};
100 int m_ncell {0};
101 int m_nevt[200000] {0};
102 int m_nevt_good[200000] {0};
103 int m_layer[200000] {0};
104 int m_identifier[200000] {0};
105 float m_eta[200000] {0};
106 float m_phi[200000] {0};
107 float m_average[200000] {0};
108 float m_rms[200000] {0};
109 float m_reference[200000] {0};
110 };
111 std::unique_ptr<TreeData> m_treeData;
112 TTree* m_tree{};
113
114 Gaudi::Property<bool> m_doMC{this, "doMC", false};
115 Gaudi::Property<bool> m_readNtuple{this, "readNtuple", false};
116 Gaudi::Property<bool> m_doFit{this, "doFit", true};
117 Gaudi::Property<bool> m_doLumiFit{this, "doLumiFit", true};
118 Gaudi::Property<int> m_nmin{this, "nevtMin", 10};
119 ToolHandle<Trig::TrigDecisionTool> m_trigDecTool{this, "TrigDecisionTool", ""};
120 Gaudi::Property<std::string> m_triggerChainProp{this, "TriggerChain", ""};
121 FloatArrayProperty m_cuts{this, "EnergyCuts", {}};
122 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
123 Gaudi::Property<std::string> m_lumiFolderName{this, "LumiFolderName", "/TRIGGER/LUMI/LBLESTONL"};
124 Gaudi::Property<int> m_addlumiblock{this, "NAddLumiBlock", 5, "Number of consecutive lumiblocks to add together"};
125 Gaudi::Property<float> m_deltaLumi{this, "DeltaLumi", 0.05};
126 };
127#endif
Definition of CaloDetDescrManager.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
SG::ReadCondHandleKey< ILArNoise > m_noiseKey
SG::ReadCondHandleKey< CaloNoise > m_elecNoiseKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
std::vector< CellInfo > m_CellList
SG::ReadCondHandleKey< ILArPedestal > m_pedestalKey
CaloCellNoiseAlg(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
FloatArrayProperty m_cuts
Gaudi::Property< int > m_addlumiblock
virtual StatusCode execute() override
standard Athena-Algorithm method
unsigned int m_lumiblock
Gaudi::Property< std::string > m_lumiFolderName
Gaudi::Property< bool > m_doMC
virtual StatusCode stop() override
standard Athena-Algorithm method
virtual ~CaloCellNoiseAlg()
Default Destructor.
const CaloCell_ID * m_calo_id
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
Gaudi::Property< bool > m_doFit
Gaudi::Property< bool > m_readNtuple
Gaudi::Property< bool > m_doLumiFit
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
virtual StatusCode initialize() override
standard Athena-Algorithm method
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
ToolHandle< Trig::TrigDecisionTool > m_trigDecTool
TDT handle.
ServiceHandle< ITHistSvc > m_thistSvc
Gaudi::Property< std::string > m_triggerChainProp
unsigned int m_lumiblockOld
static StatusCode readNtuple()
Gaudi::Property< int > m_nmin
std::unique_ptr< TreeData > m_treeData
Gaudi::Property< float > m_deltaLumi
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34