ATLAS Offline Software
Loading...
Searching...
No Matches
ITkStripDataRateMonTool.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 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
15#include "GaudiKernel/ServiceHandle.h"
16#include "GaudiKernel/ITHistSvc.h"
17
20
22#include "Identifier/Identifier.h"
23//#include "SCT_ReadoutGeometry/StripModuleDesign.h"
24
27
28#include "TH1.h"
29#include "TH2.h"
30#include "TProfile.h"
31
32class SCT_ID;
33
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
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
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
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
This is an Identifier helper class for the SCT subdetector.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
const InDetDD::SCT_DetectorManager * m_detManager
void fill(const uint32_t offlineID, const std::vector< unsigned int > &encodedstream, const std::vector< std::bitset< 256 > > &hitMap) const
virtual ~ITkStripDataRateMonTool()=default
ServiceHandle< ITHistSvc > m_thistSvc
std::map< int, std::string > m_regionLabels
Gaudi::Property< std::string > m_path
Gaudi::Property< bool > m_doExpertPlots
std::map< int, std::string > m_sideLabels
StatusCode bookHistograms(const std::vector< std::vector< float > > &barrel_z, const std::vector< std::vector< float > > &endcap_z)
virtual StatusCode initialize() override
ITkStripDataRateMonTool(const std::string &type, const std::string &name, const IInterface *parent)
static const int s_chipReadoutFrequency
void fillExpertPlots(const uint32_t offlineID) const
TH1 *m_encoded_streamLength ATLAS_THREAD_SAFE
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68