ATLAS Offline Software
Loading...
Searching...
No Matches
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
21
22namespace 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 Gaudi::Property< std::string > m_folder { this, "folder", "SquirrelPlots/Acts", "Main output directory path" };
86 Gaudi::Property< std::string > m_pixelClustersDir { this, "pixelClustersDirectory", "", "Name of directory for pixel cluster plots" };
87 Gaudi::Property< std::string > m_stripClustersDir { this, "stripClustersDirectory", "", "Name of directory for strip cluster plots" };
88 Gaudi::Property< std::string > m_hgtdClustersDir { this, "hgtdClustersDirectory", "", "Name of directory for HGTD cluster plots" };
89 Gaudi::Property< std::string > m_pixelSPDir { this, "pixelSpacePointsDirectory", "", "Name of directory for pixel space points plots" };
90 Gaudi::Property< std::string > m_stripSPDir { this, "stripSpacePointsDirectory", "", "Name of directory for strip space points plots" };
91 Gaudi::Property< std::string > m_stripOSPDir { this, "stripSpaceOverlapPointsDirectory", "", "Name of directory for strip overlap space points plots" };
92
93 std::unique_ptr< ActsTrk::PixelClusterValidationPlots > m_pixelClusterValidationPlots;
94 std::unique_ptr< ActsTrk::StripClusterValidationPlots > m_stripClusterValidationPlots;
95 std::unique_ptr< ActsTrk::HgtdClusterValidationPlots > m_hgtdClusterValidationPlots;
96
97 std::unique_ptr< ActsTrk::PixelSpacePointValidationPlots > m_pixelSpacePointValidationPlots;
98 std::unique_ptr< ActsTrk::StripSpacePointValidationPlots > m_stripSpacePointValidationPlots;
99 std::unique_ptr< ActsTrk::StripSpacePointValidationPlots > m_stripOverlapSpacePointValidationPlots;
100
102 const SCT_ID *m_stripID {};
103 const HGTD_ID *m_hgtdID {};
104 };
105
106 template<typename external_collection_t>
107 StatusCode PhysValTool::bookCollection(external_collection_t* plot_collection)
108 {
109 std::vector<HistData> hists = plot_collection->retrieveBookedHistograms();
110 for (auto& [histo, directory] : hists) {
111 ATH_MSG_DEBUG ("Initializing " << histo << " " << histo->GetName() << " " << directory << "...");
112 ATH_CHECK(regHist(histo, directory, all));
113 }
114 plot_collection->initialize();
115 return StatusCode::SUCCESS;
116 }
117
118}
119
120#endif
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
Property holding a SG store/key/clid from which a ReadHandle is made.
StatusCode fillStripClusters(const EventContext &ctx, float beamSpotWeight)
const SCT_ID * m_stripID
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection > m_HGTDDetEleCollKey
Definition PhysValTool.h:74
std::unique_ptr< ActsTrk::StripSpacePointValidationPlots > m_stripSpacePointValidationPlots
Definition PhysValTool.h:98
virtual StatusCode fillHistograms() override
An inheriting class should either override this function or fillHists().
std::unique_ptr< ActsTrk::StripClusterValidationPlots > m_stripClusterValidationPlots
Definition PhysValTool.h:94
Gaudi::Property< std::string > m_pixelSPDir
Definition PhysValTool.h:89
SG::ReadHandleKey< xAOD::SpacePointContainer > m_stripOverlapSpacePointContainerKey
Definition PhysValTool.h:71
const PixelID * m_pixelID
StatusCode bookCollection(external_collection_t *)
SG::ReadHandleKey< xAOD::StripClusterContainer > m_stripClusterContainerKey
Definition PhysValTool.h:62
SG::ReadHandleKey< xAOD::HGTDClusterContainer > m_hgtdClusterContainerKey
Definition PhysValTool.h:64
virtual StatusCode procHistograms() override
An inheriting class should either override this function or finalHists().
Gaudi::Property< std::string > m_stripClustersDir
Definition PhysValTool.h:87
Gaudi::Property< std::string > m_pixelClustersDir
If these propeties are empty (default) the directories are created with the same name of the correspo...
Definition PhysValTool.h:86
virtual ~PhysValTool()=default
Gaudi::Property< bool > m_doStripClusters
Definition PhysValTool.h:78
virtual StatusCode bookHistograms() override
An inheriting class should either override this function or bookHists().
Gaudi::Property< std::string > m_stripSPDir
Definition PhysValTool.h:90
PhysValTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< bool > m_doStripSpacePoints
Definition PhysValTool.h:81
virtual StatusCode initialize() override
std::unique_ptr< ActsTrk::PixelSpacePointValidationPlots > m_pixelSpacePointValidationPlots
Definition PhysValTool.h:97
Gaudi::Property< std::string > m_hgtdClustersDir
Definition PhysValTool.h:88
SG::ReadHandleKey< xAOD::SpacePointContainer > m_stripSpacePointContainerKey
Definition PhysValTool.h:69
Gaudi::Property< bool > m_doHgtdClusters
Definition PhysValTool.h:79
StatusCode fillStripOverlapSpacePoints(const EventContext &ctx, float beamSpotWeight)
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_pixelClusterContainerKey
Definition PhysValTool.h:60
StatusCode fillStripSpacePoints(const EventContext &ctx, float beamSpotWeight)
StatusCode fillPixelClusters(const EventContext &ctx, float beamSpotWeight)
Gaudi::Property< bool > m_doPixelSpacePoints
Definition PhysValTool.h:80
Gaudi::Property< bool > m_doStripOverlapSpacePoints
Definition PhysValTool.h:82
Gaudi::Property< std::string > m_stripOSPDir
Definition PhysValTool.h:91
Gaudi::Property< bool > m_doPixelClusters
Definition PhysValTool.h:77
Gaudi::Property< std::string > m_folder
Definition PhysValTool.h:84
const HGTD_ID * m_hgtdID
std::unique_ptr< ActsTrk::HgtdClusterValidationPlots > m_hgtdClusterValidationPlots
Definition PhysValTool.h:95
std::unique_ptr< ActsTrk::StripSpacePointValidationPlots > m_stripOverlapSpacePointValidationPlots
Definition PhysValTool.h:99
StatusCode fillPixelSpacePoints(const EventContext &ctx, float beamSpotWeight)
std::unique_ptr< ActsTrk::PixelClusterValidationPlots > m_pixelClusterValidationPlots
Definition PhysValTool.h:93
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Definition PhysValTool.h:57
StatusCode fillHgtdClusters(const EventContext &ctx, float beamSpotWeight)
SG::ReadHandleKey< xAOD::SpacePointContainer > m_pixelSpacePointContainerKey
Definition PhysValTool.h:67
This is an Identifier helper class for the HGTD subdetector.
Definition HGTD_ID.h:47
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 ...
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
Property holding a SG store/key/clid from which a ReadHandle is made.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...