ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
ITkPixelByteStreamCnv
src
ITkPixelDataRateMonTool.h
Go to the documentation of this file.
1
/*
2
Copyright (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
14
#include "
AthenaBaseComps/AthAlgTool.h
"
15
#include "GaudiKernel/ServiceHandle.h"
16
#include "GaudiKernel/ITHistSvc.h"
17
18
#include "
PixelReadoutGeometry/IPixelReadoutManager.h
"
19
#include "
PixelReadoutGeometry/PixelDetectorManager.h
"
20
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
21
22
#include "
InDetIdentifier/PixelID.h
"
23
#include "Identifier/Identifier.h"
24
#include "
PixelReadoutGeometry/PixelModuleDesign.h
"
25
#include "
ITkPixLayout.h
"
26
27
#include "
ReadoutGeometryBase/DetectorDesign.h
"
28
#include "
ITkPixelCabling/ITkPixelCablingData.h
"
29
30
#include "TH1.h"
31
#include "TH2.h"
32
#include "TProfile.h"
33
34
class
PixelID
;
35
36
class
ITkPixelDataRateMonTool
:
public
AthAlgTool
{
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
70
const
InDetDD::PixelDetectorManager
*
m_detManager
=
nullptr
;
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
95
enum
Region
{
96
INVALID_REGION
=-1,
REGION_BARREL
,
REGION_ENDCAP
,
N_REGIONS
97
};
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
105
enum
Side
{
106
INVALID_SIDE
=-1,
SIDE_POSITIVE
,
SIDE_NEGATIVE
,
N_SIDES
107
};
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
AthAlgTool.h
DetectorDesign.h
IPixelReadoutManager.h
ITkPixLayout.h
ITkPixelCablingData.h
PixelDetectorManager.h
PixelID.h
This is an Identifier helper class for the Pixel subdetector.
PixelModuleDesign.h
SiDetectorElement.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
ITkPixLayout
Definition
ITkPixLayout.h:18
ITkPixelDataRateMonTool::m_regionLabels
std::map< int, std::string > m_regionLabels
Definition
ITkPixelDataRateMonTool.h:100
ITkPixelDataRateMonTool::m_detManager
const InDetDD::PixelDetectorManager * m_detManager
Definition
ITkPixelDataRateMonTool.h:70
ITkPixelDataRateMonTool::Side
Side
Definition
ITkPixelDataRateMonTool.h:105
ITkPixelDataRateMonTool::N_SIDES
@ N_SIDES
Definition
ITkPixelDataRateMonTool.h:106
ITkPixelDataRateMonTool::SIDE_NEGATIVE
@ SIDE_NEGATIVE
Definition
ITkPixelDataRateMonTool.h:106
ITkPixelDataRateMonTool::SIDE_POSITIVE
@ SIDE_POSITIVE
Definition
ITkPixelDataRateMonTool.h:106
ITkPixelDataRateMonTool::INVALID_SIDE
@ INVALID_SIDE
Definition
ITkPixelDataRateMonTool.h:106
ITkPixelDataRateMonTool::initialize
virtual StatusCode initialize() override
Definition
ITkPixelDataRateMonTool.cxx:20
ITkPixelDataRateMonTool::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition
ITkPixelDataRateMonTool.h:67
ITkPixelDataRateMonTool::m_sideLabels
std::map< int, std::string > m_sideLabels
Definition
ITkPixelDataRateMonTool.h:110
ITkPixelDataRateMonTool::~ITkPixelDataRateMonTool
virtual ~ITkPixelDataRateMonTool()=default
ITkPixelDataRateMonTool::m_doExpertPlots
Gaudi::Property< bool > m_doExpertPlots
Definition
ITkPixelDataRateMonTool.h:61
ITkPixelDataRateMonTool::N_LAYERS
static const int N_LAYERS
Definition
ITkPixelDataRateMonTool.h:92
ITkPixelDataRateMonTool::Region
Region
Definition
ITkPixelDataRateMonTool.h:95
ITkPixelDataRateMonTool::REGION_BARREL
@ REGION_BARREL
Definition
ITkPixelDataRateMonTool.h:96
ITkPixelDataRateMonTool::N_REGIONS
@ N_REGIONS
Definition
ITkPixelDataRateMonTool.h:96
ITkPixelDataRateMonTool::REGION_ENDCAP
@ REGION_ENDCAP
Definition
ITkPixelDataRateMonTool.h:96
ITkPixelDataRateMonTool::INVALID_REGION
@ INVALID_REGION
Definition
ITkPixelDataRateMonTool.h:96
ITkPixelDataRateMonTool::s_chipReadoutFrequency
static const int s_chipReadoutFrequency
Definition
ITkPixelDataRateMonTool.h:81
ITkPixelDataRateMonTool::s_bitsPerPack
static const int s_bitsPerPack
Definition
ITkPixelDataRateMonTool.h:78
ITkPixelDataRateMonTool::fill
void fill(const uint32_t offlineID, const std::vector< unsigned int > &encodedstream, const ITkPixLayout< uint16_t > &hitMap) const
Definition
ITkPixelDataRateMonTool.cxx:84
ITkPixelDataRateMonTool::fillExpertPlots
void fillExpertPlots(const uint32_t offlineID, const ITkPixLayout< uint16_t > &hitMap) const
Definition
ITkPixelDataRateMonTool.cxx:124
ITkPixelDataRateMonTool::m_path
Gaudi::Property< std::string > m_path
Definition
ITkPixelDataRateMonTool.h:58
ITkPixelDataRateMonTool::m_pixIdHelper
const PixelID * m_pixIdHelper
Definition
ITkPixelDataRateMonTool.h:73
ITkPixelDataRateMonTool::ITkPixelDataRateMonTool
ITkPixelDataRateMonTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
ITkPixelDataRateMonTool.cxx:14
ITkPixelDataRateMonTool::ATLAS_THREAD_SAFE
TH1 *m_encoded_streamLength ATLAS_THREAD_SAFE
Definition
ITkPixelDataRateMonTool.h:116
ITkPixelDataRateMonTool::bookHistograms
StatusCode bookHistograms(const std::vector< std::vector< float > > &barrel_z, const std::vector< std::vector< float > > &endcap_z)
Definition
ITkPixelDataRateMonTool.cxx:150
ITkPixelDataRateMonTool::s_col_chip
static const int s_col_chip
Definition
ITkPixelDataRateMonTool.h:84
ITkPixelDataRateMonTool::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition
ITkPixelDataRateMonTool.h:64
ITkPixelDataRateMonTool::s_row_chip
static const int s_row_chip
Definition
ITkPixelDataRateMonTool.h:87
InDetDD::PixelDetectorManager
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
Definition
PixelDetectorManager.h:47
PixelID
This is an Identifier helper class for the Pixel subdetector.
Definition
PixelID.h:69
ServiceHandle
Definition
ClusterMakerTool.h:36
type
Generated on
for ATLAS Offline Software by
1.17.0