ATLAS Offline Software
AsgCutBookkeeperAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 #ifndef ASG_ANALYSIS_ALGORITHMS__ASG_CUT_BOOKKEEPER_ALG_H
9 #define ASG_ANALYSIS_ALGORITHMS__ASG_CUT_BOOKKEEPER_ALG_H
10 
18 
19 namespace CP
20 {
23 
25  {
27  public:
29 
30  public:
32  StatusCode initialize () override;
33 
34  public:
36  StatusCode fileExecute () override;
37 
38  public:
40  StatusCode finalize () override;
41 
42  private:
45  size_t index);
46 
48  private:
49  Gaudi::Property<bool> m_enableSystematics {this, "enableSystematics", false, "enable systematics"};
50 
52  private:
53  ToolHandle<PMGTools::IPMGTruthWeightTool> m_truthWeightTool {this, "truthWeightTool", "PMGTools::PMGTruthWeightTool", "the truth weight tool"};
54 
56  private:
57  ServiceHandle<ISystematicsSvc> m_systematics {this, "systematics", "SystematicsSvc", "systematics service"};
58 
60  private:
61  Gaudi::Property<uint32_t> m_runNumber {this, "runNumber", 0, "the run number we are processing"};
62 
64  private:
66 
68  private:
69  struct WeightsGroup
70  {
71  float nEventsProcessed {};
72  float sumOfWeights {};
74  };
75 
77  private:
78  std::unordered_map<size_t, WeightsGroup> m_weights;
79 
81  private:
82  Gaudi::Property<std::string> m_histPattern {this, "histPattern", "CutBookkeeper_%DSID%_%RUN%_%SYS%", "the pattern for histogram names"};
83  };
84 }
85 
86 #endif
CutBookkeeper.h
PropertyWrapper.h
CP::AsgCutBookkeeperAlg::m_mcChannelNumber
uint32_t m_mcChannelNumber
MC channel number we are processing.
Definition: AsgCutBookkeeperAlg.h:65
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
index
Definition: index.py:1
xAOD::CutBookkeeper_v1
Description of the class that is used to keep track of event counts.
Definition: CutBookkeeper_v1.h:29
SystematicSet.h
CP::AsgCutBookkeeperAlg::m_weights
std::unordered_map< size_t, WeightsGroup > m_weights
weights map
Definition: AsgCutBookkeeperAlg.h:78
CP::AsgCutBookkeeperAlg::WeightsGroup::sumOfWeightsSquared
float sumOfWeightsSquared
Definition: AsgCutBookkeeperAlg.h:73
CP::AsgCutBookkeeperAlg::m_systematics
ServiceHandle< ISystematicsSvc > m_systematics
the systematics service
Definition: AsgCutBookkeeperAlg.h:57
CP::AsgCutBookkeeperAlg::processCutBookkeeper
void processCutBookkeeper(const xAOD::CutBookkeeper *cbk, size_t index)
process a CutBookkeeper
Definition: AsgCutBookkeeperAlg.cxx:174
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
EL::AnaAlgorithm::AnaAlgorithm
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition: AnaAlgorithm.cxx:40
CP::AsgCutBookkeeperAlg::WeightsGroup::nEventsProcessed
float nEventsProcessed
Definition: AsgCutBookkeeperAlg.h:71
CP::AsgCutBookkeeperAlg::m_runNumber
Gaudi::Property< uint32_t > m_runNumber
run number we are processing
Definition: AsgCutBookkeeperAlg.h:61
ISystematicsSvc.h
CP::AsgCutBookkeeperAlg::WeightsGroup
weights helper struct
Definition: AsgCutBookkeeperAlg.h:70
AnaAlgorithm.h
EL::AnaAlgorithm
the (new) base class for EventLoop algorithms
Definition: AnaAlgorithm.h:73
CP::AsgCutBookkeeperAlg::m_truthWeightTool
ToolHandle< PMGTools::IPMGTruthWeightTool > m_truthWeightTool
the truth weight tool
Definition: AsgCutBookkeeperAlg.h:53
CP::AsgCutBookkeeperAlg::m_enableSystematics
Gaudi::Property< bool > m_enableSystematics
flag to enable systematics
Definition: AsgCutBookkeeperAlg.h:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::AsgCutBookkeeperAlg::finalize
StatusCode finalize() override
finalize
Definition: AsgCutBookkeeperAlg.cxx:196
CP::AsgCutBookkeeperAlg::WeightsGroup::sumOfWeights
float sumOfWeights
Definition: AsgCutBookkeeperAlg.h:72
CP::AsgCutBookkeeperAlg::m_histPattern
Gaudi::Property< std::string > m_histPattern
the pattern for histogram names
Definition: AsgCutBookkeeperAlg.h:82
IPMGTruthWeightTool.h
CP::AsgCutBookkeeperAlg::initialize
StatusCode initialize() override
initialize
Definition: AsgCutBookkeeperAlg.cxx:32
ServiceHandle.h
CP::AsgCutBookkeeperAlg
an algorithm for dumping the CutBookkeeper metadata into a histogram
Definition: AsgCutBookkeeperAlg.h:25
CP::AsgCutBookkeeperAlg::fileExecute
StatusCode fileExecute() override
run once on each file
Definition: AsgCutBookkeeperAlg.cxx:79
ServiceHandle
Definition: ClusterMakerTool.h:37