ATLAS Offline Software
PhysValTool.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 #ifndef ACTS_PHYSVAL_TOOL_H
6 #define ACTS_PHYSVAL_TOOL_H
7 
14 #include "InDetIdentifier/SCT_ID.h"
21 
22 namespace ActsTrk {
23 
24  class PhysValTool :
26  {
27  public:
28  PhysValTool(const std::string & type,
29  const std::string& name,
30  const IInterface* parent);
31  virtual ~PhysValTool() = default;
32 
33  virtual StatusCode initialize() override;
34  virtual StatusCode bookHistograms() override;
35  virtual StatusCode fillHistograms() override;
36  virtual StatusCode procHistograms() override;
37 
38  private:
39  template<typename external_collection_t>
40  StatusCode bookCollection(external_collection_t*);
41 
42  StatusCode fillPixelClusters(const EventContext& ctx,
43  float beamSpotWeight);
44  StatusCode fillStripClusters(const EventContext& ctx,
45  float beamSpotWeight);
46  StatusCode fillHgtdClusters(const EventContext& ctx,
47  float beamSpotWeight);
48 
49  StatusCode fillPixelSpacePoints(const EventContext& ctx,
50  float beamSpotWeight);
51  StatusCode fillStripSpacePoints(const EventContext& ctx,
52  float beamSpotWeight);
53  StatusCode fillStripOverlapSpacePoints(const EventContext& ctx,
54  float beamSpotWeight);
55 
56  private:
57  SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo {this, "EventInfo", "EventInfo",
58  "Event info key"};
59 
60  SG::ReadHandleKey< xAOD::PixelClusterContainer > m_pixelClusterContainerKey {this, "PixelClusterContainerKey", "ITkPixelClusters",
61  "Key of input pixel clusters"};
62  SG::ReadHandleKey< xAOD::StripClusterContainer > m_stripClusterContainerKey {this, "StripClusterContainerKey", "ITkStripClusters",
63  "Key of input pixel clusters"};
64  SG::ReadHandleKey< xAOD::HGTDClusterContainer > m_hgtdClusterContainerKey {this, "HGTDClusterContainerKey", "HGTD_Clusters",
65  "Key of input hgtd clusters"};
66 
67  SG::ReadHandleKey< xAOD::SpacePointContainer > m_pixelSpacePointContainerKey {this, "PixelSpacePointContainerKey", "ITkPixelSpacePoints",
68  "Key of input pixel space points"};
69  SG::ReadHandleKey< xAOD::SpacePointContainer > m_stripSpacePointContainerKey {this, "StripSpacePointContainerKey", "ITkStripSpacePoints",
70  "Key of input strip space points"};
71  SG::ReadHandleKey< xAOD::SpacePointContainer > m_stripOverlapSpacePointContainerKey {this, "StripOverlapSpacePointContainerKey", "ITkStripOverlapSpacePoints",
72  "Key of input strip overlap space points"};
73 
74  SG::ReadCondHandleKey<InDetDD::HGTD_DetectorElementCollection> m_HGTDDetEleCollKey {this, "HGTDDetEleCollKey", "HGTD_DetectorElementCollection",
75  "Key of HGTD_DetectorElementCollection for HGTD"};
76 
77  Gaudi::Property<bool> m_doPixelClusters {this, "doPixelClusters", false, "Analyse Pixel Clusters"};
78  Gaudi::Property<bool> m_doStripClusters {this, "doStripClusters", false, "Analyse Strip Clusters"};
79  Gaudi::Property<bool> m_doHgtdClusters {this, "doHgtdClusters", false, "Analyse HGTD Clusters"};
80  Gaudi::Property<bool> m_doPixelSpacePoints {this, "doPixelSpacePoints", false, "Analyse Pixel Space Points"};
81  Gaudi::Property<bool> m_doStripSpacePoints {this, "doStripSpacePoints", false, "Analyse Strip Space Points"};
82  Gaudi::Property<bool> m_doStripOverlapSpacePoints {this, "doStripOverlapSpacePoints", false, "Analyse Overlap Strip Space Points"};
83 
84  std::unique_ptr< ActsTrk::PixelClusterValidationPlots > m_pixelClusterValidationPlots;
85  std::unique_ptr< ActsTrk::StripClusterValidationPlots > m_stripClusterValidationPlots;
86  std::unique_ptr< ActsTrk::HgtdClusterValidationPlots > m_hgtdClusterValidationPlots;
87 
88  std::unique_ptr< ActsTrk::PixelSpacePointValidationPlots > m_pixelSpacePointValidationPlots;
89  std::unique_ptr< ActsTrk::StripSpacePointValidationPlots > m_stripSpacePointValidationPlots;
90  std::unique_ptr< ActsTrk::StripSpacePointValidationPlots > m_stripOverlapSpacePointValidationPlots;
91 
92  const PixelID *m_pixelID {};
93  const SCT_ID *m_stripID {};
94  const HGTD_ID *m_hgtdID {};
95  };
96 
97  template<typename external_collection_t>
98  StatusCode PhysValTool::bookCollection(external_collection_t* plot_collection)
99  {
100  std::vector<HistData> hists = plot_collection->retrieveBookedHistograms();
101  for (auto& [histo, directory] : hists) {
102  ATH_MSG_DEBUG ("Initializing " << histo << " " << histo->GetName() << " " << directory << "...");
104  }
105  plot_collection->initialize();
106  return StatusCode::SUCCESS;
107  }
108 
109 }
110 
111 #endif
ActsTrk::PhysValTool::m_pixelClusterContainerKey
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_pixelClusterContainerKey
Definition: PhysValTool.h:60
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
ActsTrk::PhysValTool::m_stripOverlapSpacePointContainerKey
SG::ReadHandleKey< xAOD::SpacePointContainer > m_stripOverlapSpacePointContainerKey
Definition: PhysValTool.h:71
ActsTrk::PhysValTool::m_HGTDDetEleCollKey
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection > m_HGTDDetEleCollKey
Definition: PhysValTool.h:74
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
ActsTrk::PhysValTool::m_hgtdClusterContainerKey
SG::ReadHandleKey< xAOD::HGTDClusterContainer > m_hgtdClusterContainerKey
Definition: PhysValTool.h:64
PixelSpacePointValidationPlots.h
ActsTrk::PhysValTool::m_stripClusterContainerKey
SG::ReadHandleKey< xAOD::StripClusterContainer > m_stripClusterContainerKey
Definition: PhysValTool.h:62
ActsTrk::PhysValTool::m_eventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Definition: PhysValTool.h:57
ActsTrk::PhysValTool::bookHistograms
virtual StatusCode bookHistograms() override
An inheriting class should either override this function or bookHists().
Definition: PhysValTool.cxx:102
ActsTrk::PhysValTool::initialize
virtual StatusCode initialize() override
Definition: PhysValTool.cxx:15
ManagedMonitorToolBase
Provides functionality for users to implement and save histograms, ntuples, and summary data,...
Definition: ManagedMonitorToolBase.h:73
ActsTrk::PhysValTool::m_stripSpacePointContainerKey
SG::ReadHandleKey< xAOD::SpacePointContainer > m_stripSpacePointContainerKey
Definition: PhysValTool.h:69
ActsTrk::PhysValTool::fillPixelSpacePoints
StatusCode fillPixelSpacePoints(const EventContext &ctx, float beamSpotWeight)
Definition: PhysValTool.cxx:177
ActsTrk::PhysValTool::m_doStripSpacePoints
Gaudi::Property< bool > m_doStripSpacePoints
Definition: PhysValTool.h:81
ActsTrk::PhysValTool::fillPixelClusters
StatusCode fillPixelClusters(const EventContext &ctx, float beamSpotWeight)
Definition: PhysValTool.cxx:142
ActsTrk::PhysValTool::fillHgtdClusters
StatusCode fillHgtdClusters(const EventContext &ctx, float beamSpotWeight)
Definition: PhysValTool.cxx:117
PixelClusterValidationPlots.h
ActsTrk::PhysValTool::m_doStripOverlapSpacePoints
Gaudi::Property< bool > m_doStripOverlapSpacePoints
Definition: PhysValTool.h:82
ActsTrk::PhysValTool::m_stripSpacePointValidationPlots
std::unique_ptr< ActsTrk::StripSpacePointValidationPlots > m_stripSpacePointValidationPlots
Definition: PhysValTool.h:89
ActsTrk::PhysValTool::m_stripClusterValidationPlots
std::unique_ptr< ActsTrk::StripClusterValidationPlots > m_stripClusterValidationPlots
Definition: PhysValTool.h:85
ActsTrk::PhysValTool::m_doHgtdClusters
Gaudi::Property< bool > m_doHgtdClusters
Definition: PhysValTool.h:79
SG::ReadHandleKey< xAOD::EventInfo >
ManagedMonitorToolBase.h
ActsTrk::PhysValTool::fillHistograms
virtual StatusCode fillHistograms() override
An inheriting class should either override this function or fillHists().
Definition: PhysValTool.cxx:229
ActsTrk::PhysValTool::m_doPixelClusters
Gaudi::Property< bool > m_doPixelClusters
Definition: PhysValTool.h:77
DeMoScan.directory
string directory
Definition: DeMoScan.py:80
ActsTrk::PhysValTool::procHistograms
virtual StatusCode procHistograms() override
An inheriting class should either override this function or finalHists().
Definition: PhysValTool.cxx:255
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ActsTrk::PhysValTool::m_hgtdID
const HGTD_ID * m_hgtdID
Definition: PhysValTool.h:94
PixelClusterContainer.h
ActsTrk::PhysValTool::m_doPixelSpacePoints
Gaudi::Property< bool > m_doPixelSpacePoints
Definition: PhysValTool.h:80
HGTDClusterContainer.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ActsTrk::PhysValTool::m_pixelID
const PixelID * m_pixelID
Definition: PhysValTool.h:92
ActsTrk::PhysValTool::bookCollection
StatusCode bookCollection(external_collection_t *)
Definition: PhysValTool.h:98
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MakeTH3DFromTH2Ds.hists
hists
Definition: MakeTH3DFromTH2Ds.py:72
HGTD_ID
Definition: HGTD_ID.h:47
ActsTrk::PhysValTool::m_pixelSpacePointValidationPlots
std::unique_ptr< ActsTrk::PixelSpacePointValidationPlots > m_pixelSpacePointValidationPlots
Definition: PhysValTool.h:88
ActsTrk::PhysValTool
Definition: PhysValTool.h:26
StripSpacePointValidationPlots.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::PhysValTool::m_pixelClusterValidationPlots
std::unique_ptr< ActsTrk::PixelClusterValidationPlots > m_pixelClusterValidationPlots
Definition: PhysValTool.h:84
HGTD_ID.h
EventInfo.h
ActsTrk::PhysValTool::~PhysValTool
virtual ~PhysValTool()=default
ActsTrk::PhysValTool::fillStripSpacePoints
StatusCode fillStripSpacePoints(const EventContext &ctx, float beamSpotWeight)
Definition: PhysValTool.cxx:194
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection >
SCT_ID
Definition: SCT_ID.h:68
ActsTrk::PhysValTool::m_stripID
const SCT_ID * m_stripID
Definition: PhysValTool.h:93
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ManagedMonitorToolBase::all
@ all
Definition: ManagedMonitorToolBase.h:115
ActsTrk::PhysValTool::m_pixelSpacePointContainerKey
SG::ReadHandleKey< xAOD::SpacePointContainer > m_pixelSpacePointContainerKey
Definition: PhysValTool.h:67
ActsTrk::PhysValTool::PhysValTool
PhysValTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PhysValTool.cxx:9
StripClusterValidationPlots.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:49
ActsTrk::PhysValTool::fillStripClusters
StatusCode fillStripClusters(const EventContext &ctx, float beamSpotWeight)
Definition: PhysValTool.cxx:159
ActsTrk::PhysValTool::m_hgtdClusterValidationPlots
std::unique_ptr< ActsTrk::HgtdClusterValidationPlots > m_hgtdClusterValidationPlots
Definition: PhysValTool.h:86
ActsTrk::PhysValTool::m_stripOverlapSpacePointValidationPlots
std::unique_ptr< ActsTrk::StripSpacePointValidationPlots > m_stripOverlapSpacePointValidationPlots
Definition: PhysValTool.h:90
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:415
PixelID
Definition: PixelID.h:67
HgtdClusterValidationPlots.h
ManagedMonitorToolBase::regHist
virtual StatusCode regHist(TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...
Definition: ManagedMonitorToolBase.cxx:1346
ActsTrk::PhysValTool::fillStripOverlapSpacePoints
StatusCode fillStripOverlapSpacePoints(const EventContext &ctx, float beamSpotWeight)
Definition: PhysValTool.cxx:211
ActsTrk::PhysValTool::m_doStripClusters
Gaudi::Property< bool > m_doStripClusters
Definition: PhysValTool.h:78