ATLAS Offline Software
Loading...
Searching...
No Matches
ITkPixelDataRateMonTool.h
Go to the documentation of this file.
1/*
2Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*
6* Author: Paul Chabrillat, starting from Ondra Kovanda and Noemi Calace work
7* Date: 12/11/2024
8* Description: Athena tool wrapper around the ITkPix encoder to study data rate as a function of chip's position in detector
9*/
10
11#ifndef ITKPIXELBYTESTREAMCNV_ITKPIXELDATARATEMONTOOL_H
12#define ITKPIXELBYTESTREAMCNV_ITKPIXELDATARATEMONTOOL_H
13
15#include "GaudiKernel/ServiceHandle.h"
16#include "GaudiKernel/ITHistSvc.h"
17
21
23#include "Identifier/Identifier.h"
25#include "ITkPixLayout.h"
26
29
30#include "TH1.h"
31#include "TH2.h"
32#include "TProfile.h"
33
34class PixelID;
35
37
38 public:
39
40 ITkPixelDataRateMonTool(const std::string& type,const std::string& name,const IInterface* parent);
41 virtual ~ITkPixelDataRateMonTool()=default;
42
43 virtual StatusCode initialize() override;
44
45 void fill(const uint32_t offlineID,
46 const std::vector<unsigned int>& encodedstream,
47 const ITkPixLayout<uint16_t>& hitMap) const;
48
49 private:
50 // Function to book histograms
51 StatusCode bookHistograms(const std::vector<std::vector<float >>& barrel_z,
52 const std::vector<std::vector<float >>& endcap_z);
53
54 void fillExpertPlots(const uint32_t offlineID,
55 const ITkPixLayout<uint16_t>& hitMap) const;
56
57 // Path to histograms
58 Gaudi::Property< std::string > m_path { this, "MonitoringPath", "/DataRateMon/", "Name of directory for plots" };
59
60 // boolean histogram to save expert plots
61 Gaudi::Property< bool > m_doExpertPlots { this, "DoExpertPlots", false, "Enable expert plots" };
62
63 // Histogram service
64 ServiceHandle<ITHistSvc> m_thistSvc{this, "HistSvc", "THistSvc", "The histogram service"};
65
66 // Readout service manager
67 ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout {this, "PixelReadoutManager", "ITkPixelReadoutManager", "Pixel readout manager" };
68
69 // Detector manager with same method as in hitSortigTool
71
72 // Pixel id helper tool
73 const PixelID* m_pixIdHelper = nullptr;
74
75 // Parameters of the analysis
76
77 // Number of bits contained in a pack from the encoder
78 const static int s_bitsPerPack = 32;
79
80 // Readout frequency for a chip
81 const static int s_chipReadoutFrequency = 1000000;
82
83 // Number of columns in one chip
84 const static int s_col_chip = 400;
85
86 // Number of rows in one chip
87 const static int s_row_chip = 384;
88
89 // --------------For all detector--------------
90
91 // Number of layers
92 const static int N_LAYERS=9;
93
94 // Regions of the detector
98
99 // Labels of regions
100 std::map<int, std::string > m_regionLabels {
101 {INVALID_REGION, "invalid"}, {REGION_BARREL, "barrel"}, {REGION_ENDCAP, "endcap"}
102 };
103
104 // Side of the detector
108
109 // Labels of side if the sides are in different histograms
110 std::map<int, std::string > m_sideLabels {
111 {INVALID_SIDE, "invalid"}, {SIDE_POSITIVE, "pos"}, {SIDE_NEGATIVE, "neg"}
112 };
113
114
115 // Histogram of stream length distribution in bits for the whole detector and all the chips
116 mutable TH1* m_encoded_streamLength ATLAS_THREAD_SAFE = nullptr;
117
118 // --------------Each region and no z dependance--------------
119
120 // Chip hit map
121 mutable TH2* m_h2_chip_hitmap[N_LAYERS][N_REGIONS] ATLAS_THREAD_SAFE = {};
122
123 // Chip ToT map
124 mutable TH2* m_h2_chip_totmap[N_LAYERS][N_REGIONS] ATLAS_THREAD_SAFE = {};
125
126 // --------------Each region and separated positive and negative z--------------
127
128 // T profile of the stream length for different layers and regions
129 mutable TProfile* m_p_streamLength[N_LAYERS][N_REGIONS][N_SIDES] ATLAS_THREAD_SAFE = {};
130
131 // Two dimensional histogram of the stream length for different layers and regions
132 mutable TH2* m_h2_streamLength[N_LAYERS][N_REGIONS][N_SIDES] ATLAS_THREAD_SAFE = {};
133
134 // T profile of the data rate from chips for different layers and regions
135 mutable TProfile* m_p_dataRate[N_LAYERS][N_REGIONS][N_SIDES] ATLAS_THREAD_SAFE = {};
136
137 // Two dimensional histogem of the data rate from chips for different layers and regions
138 mutable TH2* m_h2_dataRate[N_LAYERS][N_REGIONS][N_SIDES] ATLAS_THREAD_SAFE = {};
139
140 // T profile of the hits from chips for different layers and regions
141 mutable TProfile* m_p_hits[N_LAYERS][N_REGIONS][N_SIDES] ATLAS_THREAD_SAFE = {};
142
143 // Two dimensional histogram of the hits from chips for different layers and regions
144 mutable TH2* m_h2_hits[N_LAYERS][N_REGIONS][N_SIDES] ATLAS_THREAD_SAFE = {};
145
146
147};
148
149
150#endif // ITKPIXELBYTESTREAMCNV_ITKPIXELDATARATEMONTOOL_H
This is an Identifier helper class for the Pixel subdetector.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
std::map< int, std::string > m_regionLabels
const InDetDD::PixelDetectorManager * m_detManager
virtual StatusCode initialize() override
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
std::map< int, std::string > m_sideLabels
virtual ~ITkPixelDataRateMonTool()=default
Gaudi::Property< bool > m_doExpertPlots
static const int s_chipReadoutFrequency
void fill(const uint32_t offlineID, const std::vector< unsigned int > &encodedstream, const ITkPixLayout< uint16_t > &hitMap) const
void fillExpertPlots(const uint32_t offlineID, const ITkPixLayout< uint16_t > &hitMap) const
Gaudi::Property< std::string > m_path
ITkPixelDataRateMonTool(const std::string &type, const std::string &name, const IInterface *parent)
TH1 *m_encoded_streamLength ATLAS_THREAD_SAFE
StatusCode bookHistograms(const std::vector< std::vector< float > > &barrel_z, const std::vector< std::vector< float > > &endcap_z)
ServiceHandle< ITHistSvc > m_thistSvc
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67