ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
ITkStripsByteStreamCnv
src
ITkStripDataRateMonTool.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 ITkStrip encoder to study data rate as a function of chip's position in detector
9
*/
10
11
#ifndef ITKSTRIPBYTESTREAMCNV_ITKSTRIPDATARATEMONTOOL_H
12
#define ITKSTRIPBYTESTREAMCNV_ITKSTRIPDATARATEMONTOOL_H
13
14
#include "
AthenaBaseComps/AthAlgTool.h
"
15
#include "GaudiKernel/ServiceHandle.h"
16
#include "GaudiKernel/ITHistSvc.h"
17
18
#include "
SCT_ReadoutGeometry/SCT_DetectorManager.h
"
19
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
20
21
#include "
InDetIdentifier/SCT_ID.h
"
22
#include "Identifier/Identifier.h"
23
//#include "SCT_ReadoutGeometry/StripModuleDesign.h"
24
25
#include "
ReadoutGeometryBase/DetectorDesign.h
"
26
#include "
ITkStripCabling/ITkStripCablingData.h
"
27
28
#include "TH1.h"
29
#include "TH2.h"
30
#include "TProfile.h"
31
32
class
SCT_ID
;
33
34
class
ITkStripDataRateMonTool
:
public
AthAlgTool
{
35
36
public
:
37
38
ITkStripDataRateMonTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent);
39
virtual
~ITkStripDataRateMonTool
()=
default
;
40
41
virtual
StatusCode
initialize
()
override
;
42
43
void
fill
(
const
uint32_t offlineID,
44
const
std::vector<unsigned int>& encodedstream,
45
const
std::vector<std::bitset<256>>& hitMap)
const
;
46
47
private
:
48
// Function to book histograms
49
StatusCode
bookHistograms
(
const
std::vector<std::vector<float >>& barrel_z,
50
const
std::vector<std::vector<float >>& endcap_z);
51
52
void
fillExpertPlots
(
const
uint32_t offlineID)
const
;
53
54
// Path to histograms
55
Gaudi::Property< std::string >
m_path
{
this
,
"MonitoringPath"
,
"/DataRateMon/"
,
"Name of directory for plots"
};
56
57
// boolean histogram to save expert plots
58
Gaudi::Property< bool >
m_doExpertPlots
{
this
,
"DoExpertPlots"
,
false
,
"Enable expert plots"
};
59
60
// Histogram service
61
ServiceHandle<ITHistSvc>
m_thistSvc
{
this
,
"HistSvc"
,
"THistSvc"
,
"The histogram service"
};
62
63
// Detector manager with same method as in hitSortigTool
64
const
InDetDD::SCT_DetectorManager
*
m_detManager
=
nullptr
;
65
66
// Strip id helper tool
67
const
SCT_ID
*
m_stripIdHelper
=
nullptr
;
68
69
// Parameters of the analysis
70
71
// Number of bits contained in a pack from the encoder
72
const
static
int
s_bitsPerPack
= 32;
73
74
// Readout frequency for a chip
75
const
static
int
s_chipReadoutFrequency
= 640000;
76
77
// --------------For all detector--------------
78
79
// Number of layers
80
const
static
int
N_LAYERS
=9;
81
82
// Regions of the detector
83
enum
Region
{
84
INVALID_REGION
=-1,
REGION_BARREL
,
REGION_ENDCAP
,
N_REGIONS
85
};
86
87
// Labels of regions
88
std::map<int, std::string >
m_regionLabels
{
89
{
INVALID_REGION
,
"invalid"
}, {
REGION_BARREL
,
"barrel"
}, {
REGION_ENDCAP
,
"endcap"
}
90
};
91
92
// Side of the detector
93
enum
Side
{
94
INVALID_SIDE
=-1,
SIDE_POSITIVE
,
SIDE_NEGATIVE
,
N_SIDES
95
};
96
97
// Labels of side if the sides are in different histograms
98
std::map<int, std::string >
m_sideLabels
{
99
{
INVALID_SIDE
,
"invalid"
}, {
SIDE_POSITIVE
,
"pos"
}, {
SIDE_NEGATIVE
,
"neg"
}
100
};
101
102
103
// Histogram of stream length distribution in bits for the whole detector and all the chips
104
mutable
TH1* m_encoded_streamLength
ATLAS_THREAD_SAFE
=
nullptr
;
105
106
// --------------Each region and no z dependance--------------
107
108
// Chip hit map
109
mutable
TH2* m_h2_chip_hitmap[
N_LAYERS
][
N_REGIONS
]
ATLAS_THREAD_SAFE
= {};
110
111
// Chip ToT map
112
mutable
TH2* m_h2_chip_totmap[
N_LAYERS
][
N_REGIONS
]
ATLAS_THREAD_SAFE
= {};
113
114
// --------------Each region and separated positive and negative z--------------
115
116
// T profile of the stream length for different layers and regions
117
mutable
TProfile* m_p_streamLength[
N_LAYERS
][
N_REGIONS
][
N_SIDES
]
ATLAS_THREAD_SAFE
= {};
118
119
// Two dimensional histogram of the stream length for different layers and regions
120
mutable
TH2* m_h2_streamLength[
N_LAYERS
][
N_REGIONS
][
N_SIDES
]
ATLAS_THREAD_SAFE
= {};
121
122
// T profile of the data rate from chips for different layers and regions
123
mutable
TProfile* m_p_dataRate[
N_LAYERS
][
N_REGIONS
][
N_SIDES
]
ATLAS_THREAD_SAFE
= {};
124
125
// Two dimensional histogem of the data rate from chips for different layers and regions
126
mutable
TH2* m_h2_dataRate[
N_LAYERS
][
N_REGIONS
][
N_SIDES
]
ATLAS_THREAD_SAFE
= {};
127
128
// T profile of the hits from chips for different layers and regions
129
mutable
TProfile* m_p_hits[
N_LAYERS
][
N_REGIONS
][
N_SIDES
]
ATLAS_THREAD_SAFE
= {};
130
131
// Two dimensional histogram of the hits from chips for different layers and regions
132
mutable
TH2* m_h2_hits[
N_LAYERS
][
N_REGIONS
][
N_SIDES
]
ATLAS_THREAD_SAFE
= {};
133
134
135
};
136
137
138
#endif
// ITKSTRIPBYTESTREAMCNV_ITKSTRIPDATARATEMONTOOL_H
AthAlgTool.h
DetectorDesign.h
ITkStripCablingData.h
SCT_DetectorManager.h
SCT_ID.h
This is an Identifier helper class for the SCT subdetector.
SiDetectorElement.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
ITkStripDataRateMonTool::m_detManager
const InDetDD::SCT_DetectorManager * m_detManager
Definition
ITkStripDataRateMonTool.h:64
ITkStripDataRateMonTool::fill
void fill(const uint32_t offlineID, const std::vector< unsigned int > &encodedstream, const std::vector< std::bitset< 256 > > &hitMap) const
Definition
ITkStripDataRateMonTool.cxx:75
ITkStripDataRateMonTool::~ITkStripDataRateMonTool
virtual ~ITkStripDataRateMonTool()=default
ITkStripDataRateMonTool::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition
ITkStripDataRateMonTool.h:61
ITkStripDataRateMonTool::m_regionLabels
std::map< int, std::string > m_regionLabels
Definition
ITkStripDataRateMonTool.h:88
ITkStripDataRateMonTool::m_path
Gaudi::Property< std::string > m_path
Definition
ITkStripDataRateMonTool.h:55
ITkStripDataRateMonTool::m_doExpertPlots
Gaudi::Property< bool > m_doExpertPlots
Definition
ITkStripDataRateMonTool.h:58
ITkStripDataRateMonTool::m_sideLabels
std::map< int, std::string > m_sideLabels
Definition
ITkStripDataRateMonTool.h:98
ITkStripDataRateMonTool::bookHistograms
StatusCode bookHistograms(const std::vector< std::vector< float > > &barrel_z, const std::vector< std::vector< float > > &endcap_z)
Definition
ITkStripDataRateMonTool.cxx:127
ITkStripDataRateMonTool::initialize
virtual StatusCode initialize() override
Definition
ITkStripDataRateMonTool.cxx:19
ITkStripDataRateMonTool::ITkStripDataRateMonTool
ITkStripDataRateMonTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
ITkStripDataRateMonTool.cxx:13
ITkStripDataRateMonTool::N_LAYERS
static const int N_LAYERS
Definition
ITkStripDataRateMonTool.h:80
ITkStripDataRateMonTool::s_chipReadoutFrequency
static const int s_chipReadoutFrequency
Definition
ITkStripDataRateMonTool.h:75
ITkStripDataRateMonTool::fillExpertPlots
void fillExpertPlots(const uint32_t offlineID) const
ITkStripDataRateMonTool::Region
Region
Definition
ITkStripDataRateMonTool.h:83
ITkStripDataRateMonTool::REGION_ENDCAP
@ REGION_ENDCAP
Definition
ITkStripDataRateMonTool.h:84
ITkStripDataRateMonTool::N_REGIONS
@ N_REGIONS
Definition
ITkStripDataRateMonTool.h:84
ITkStripDataRateMonTool::REGION_BARREL
@ REGION_BARREL
Definition
ITkStripDataRateMonTool.h:84
ITkStripDataRateMonTool::INVALID_REGION
@ INVALID_REGION
Definition
ITkStripDataRateMonTool.h:84
ITkStripDataRateMonTool::Side
Side
Definition
ITkStripDataRateMonTool.h:93
ITkStripDataRateMonTool::SIDE_NEGATIVE
@ SIDE_NEGATIVE
Definition
ITkStripDataRateMonTool.h:94
ITkStripDataRateMonTool::INVALID_SIDE
@ INVALID_SIDE
Definition
ITkStripDataRateMonTool.h:94
ITkStripDataRateMonTool::SIDE_POSITIVE
@ SIDE_POSITIVE
Definition
ITkStripDataRateMonTool.h:94
ITkStripDataRateMonTool::N_SIDES
@ N_SIDES
Definition
ITkStripDataRateMonTool.h:94
ITkStripDataRateMonTool::m_stripIdHelper
const SCT_ID * m_stripIdHelper
Definition
ITkStripDataRateMonTool.h:67
ITkStripDataRateMonTool::s_bitsPerPack
static const int s_bitsPerPack
Definition
ITkStripDataRateMonTool.h:72
ITkStripDataRateMonTool::ATLAS_THREAD_SAFE
TH1 *m_encoded_streamLength ATLAS_THREAD_SAFE
Definition
ITkStripDataRateMonTool.h:104
InDetDD::SCT_DetectorManager
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
Definition
SCT_DetectorManager.h:49
SCT_ID
This is an Identifier helper class for the SCT subdetector.
Definition
SCT_ID.h:68
ServiceHandle
Definition
ClusterMakerTool.h:36
type
Generated on
for ATLAS Offline Software by
1.17.0