ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetValidation
InDetDefectsEmulation
src
DefectsEmulatorBase.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef INDET_DEFECTSEMULATORBASE_H
5
#define INDET_DEFECTSEMULATORBASE_H
6
7
#include "GaudiKernel/ServiceHandle.h"
8
#include "
AthenaBaseComps/AthReentrantAlgorithm.h
"
9
#include "GaudiKernel/ITHistSvc.h"
10
#include "
AthenaKernel/IAthRNGSvc.h
"
11
#include "
ModuleIdentifierMatchUtil.h
"
12
#include "
ActsGeometryInterfaces/ITrackingGeometrySvc.h
"
13
#include "
ActsGeometryInterfaces/GeometryDefs.h
"
14
#include "
ActsGeometry/ActsDetectorElement.h
"
15
16
#include <string>
17
#include <vector>
18
#include <mutex>
19
#include <atomic>
20
#include <string_view>
21
#include <array>
22
23
class
TH2;
24
25
namespace
InDet
{
26
30
class
DefectsEmulatorBase
:
public
AthReentrantAlgorithm
{
31
public
:
32
DefectsEmulatorBase
(
const
std::string &name,ISvcLocator *pSvcLocator);
33
34
StatusCode
initializeBase
(
unsigned
int
wafer_hash_max);
35
virtual
StatusCode
finalize
()
override
;
36
37
protected
:
45
virtual
bool
setModuleData
(
const
ActsDetectorElement
&acts_detector_element,
46
ModuleIdentifierMatchUtil::ModuleData_t
&module_data)
const
= 0;
47
54
std::tuple<TH2 *,TH2 *, TH1 *>
findHist
(
unsigned
int
n_rows,
unsigned
int
n_cols)
const
;
55
56
ServiceHandle<ITHistSvc>
m_histSvc
57
{
this
,
"HistSvc"
,
"THistSvc"
};
58
Gaudi::Property<std::string>
m_histogramGroupName
59
{
this
,
"HistogramGroupName"
,
""
,
"Histogram group name or empty to disable histogramming"
};
60
61
Gaudi::Property<std::vector<std::vector<int> > >
m_modulePattern
62
{
this
,
"ModulePatterns"
, {},
63
"Integer ranges to select: (0-1) barrel/end-cap range, (2-3) layer, (4-5) eta index range, (6-7) phi index range, "
64
"(8-9) module number of columns or strips, (10) both sides (0,1), (11) all rows (0,1)"
};
65
66
Gaudi::Property<std::vector<float> >
m_noiseProbability
67
{
this
,
"NoiseProbability"
,0.,
"Probability for a cell to produce a spurious hit per module pattern"
};
68
Gaudi::Property<std::vector<std::vector<double>> >
m_noiseShape
69
{
this
,
"NoiseShape"
,{},
"Shape of noise distribution (e.g. used for Pixel tot distribution or strip time bin distribution."
};
70
71
enum
EHistType
{
72
kRejectedHits
,
73
kNoiseHits
,
74
kNHistTypes
75
};
76
static
const
std::array<std::string_view,kNHistTypes>
s_histNames
;
77
static
const
std::array<std::string_view,kNHistTypes>
s_histTitles
;
78
79
mutable
std::mutex
m_histMutex
;
80
// access to the following must be protected by m_histMutex during execute
81
mutable
std::vector<unsigned int> m_dimPerHist
ATLAS_THREAD_SAFE
;
82
mutable
std::array<TH2 *,kNHistTypes> m_moduleHist
ATLAS_THREAD_SAFE
{};
83
mutable
std::array<std::vector< TH2 *>,2> m_hist
ATLAS_THREAD_SAFE
;
84
mutable
std::vector< TH1 *> m_noiseShapeHist
ATLAS_THREAD_SAFE
;
85
86
// Simple counters for dropped and copied RDOs
87
mutable
std::atomic<std::size_t>
m_rejectedRDOs
{};
88
mutable
std::atomic<std::size_t>
m_totalRDOs
{};
89
mutable
std::atomic<std::size_t>
m_splitRDOs
{};
90
mutable
std::atomic<std::size_t>
m_totalNoise
{};
91
92
ServiceHandle<ActsTrk::ITrackingGeometrySvc>
m_trackingGeometrySvc
{
this
,
"TrackingGeometrySvc"
,
"ActsTrackingGeometrySvc"
};
93
94
ServiceHandle<IAthRNGSvc>
m_rndmSvc
{
this
,
"RndmSvc"
,
"AthRNGSvc"
,
""
};
95
std::string
m_rngName
;
96
std::vector<unsigned short>
m_noiseParamIdx
;
97
std::vector<std::vector<float> >
m_noiseShapeCummulative
;
98
99
unsigned
int
m_maxNShape
{};
100
101
bool
m_histogrammingEnabled
=
false
;
102
103
};
104
105
}
106
107
#endif
ActsDetectorElement.h
ITrackingGeometrySvc.h
AthReentrantAlgorithm.h
GeometryDefs.h
IAthRNGSvc.h
ModuleIdentifierMatchUtil.h
ActsDetectorElement
Definition
ActsDetectorElement.h:58
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
InDet::DefectsEmulatorBase::m_rejectedRDOs
std::atomic< std::size_t > m_rejectedRDOs
Definition
DefectsEmulatorBase.h:87
InDet::DefectsEmulatorBase::setModuleData
virtual bool setModuleData(const ActsDetectorElement &acts_detector_element, ModuleIdentifierMatchUtil::ModuleData_t &module_data) const =0
Set the module data for matching for the given detector element.
InDet::DefectsEmulatorBase::s_histTitles
static const std::array< std::string_view, kNHistTypes > s_histTitles
Definition
DefectsEmulatorBase.h:77
InDet::DefectsEmulatorBase::m_totalNoise
std::atomic< std::size_t > m_totalNoise
Definition
DefectsEmulatorBase.h:90
InDet::DefectsEmulatorBase::m_totalRDOs
std::atomic< std::size_t > m_totalRDOs
Definition
DefectsEmulatorBase.h:88
InDet::DefectsEmulatorBase::initializeBase
StatusCode initializeBase(unsigned int wafer_hash_max)
Definition
DefectsEmulatorBase.cxx:25
InDet::DefectsEmulatorBase::s_histNames
static const std::array< std::string_view, kNHistTypes > s_histNames
Definition
DefectsEmulatorBase.h:76
InDet::DefectsEmulatorBase::EHistType
EHistType
Definition
DefectsEmulatorBase.h:71
InDet::DefectsEmulatorBase::kNoiseHits
@ kNoiseHits
Definition
DefectsEmulatorBase.h:73
InDet::DefectsEmulatorBase::kRejectedHits
@ kRejectedHits
Definition
DefectsEmulatorBase.h:72
InDet::DefectsEmulatorBase::kNHistTypes
@ kNHistTypes
Definition
DefectsEmulatorBase.h:74
InDet::DefectsEmulatorBase::findHist
std::tuple< TH2 *, TH2 *, TH1 * > findHist(unsigned int n_rows, unsigned int n_cols) const
Get rejected hits and noise histograms for a certain module design.
Definition
DefectsEmulatorBase.cxx:154
InDet::DefectsEmulatorBase::m_splitRDOs
std::atomic< std::size_t > m_splitRDOs
Definition
DefectsEmulatorBase.h:89
InDet::DefectsEmulatorBase::m_rngName
std::string m_rngName
Definition
DefectsEmulatorBase.h:95
InDet::DefectsEmulatorBase::m_histogrammingEnabled
bool m_histogrammingEnabled
Definition
DefectsEmulatorBase.h:101
InDet::DefectsEmulatorBase::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Definition
DefectsEmulatorBase.h:94
InDet::DefectsEmulatorBase::ATLAS_THREAD_SAFE
std::vector< unsigned int > m_dimPerHist ATLAS_THREAD_SAFE
Definition
DefectsEmulatorBase.h:81
InDet::DefectsEmulatorBase::m_noiseShapeCummulative
std::vector< std::vector< float > > m_noiseShapeCummulative
Definition
DefectsEmulatorBase.h:97
InDet::DefectsEmulatorBase::m_trackingGeometrySvc
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
Definition
DefectsEmulatorBase.h:92
InDet::DefectsEmulatorBase::m_modulePattern
Gaudi::Property< std::vector< std::vector< int > > > m_modulePattern
Definition
DefectsEmulatorBase.h:62
InDet::DefectsEmulatorBase::m_histogramGroupName
Gaudi::Property< std::string > m_histogramGroupName
Definition
DefectsEmulatorBase.h:59
InDet::DefectsEmulatorBase::m_histSvc
ServiceHandle< ITHistSvc > m_histSvc
Definition
DefectsEmulatorBase.h:57
InDet::DefectsEmulatorBase::m_noiseParamIdx
std::vector< unsigned short > m_noiseParamIdx
Definition
DefectsEmulatorBase.h:96
InDet::DefectsEmulatorBase::m_noiseShape
Gaudi::Property< std::vector< std::vector< double > > > m_noiseShape
Definition
DefectsEmulatorBase.h:69
InDet::DefectsEmulatorBase::m_noiseProbability
Gaudi::Property< std::vector< float > > m_noiseProbability
Definition
DefectsEmulatorBase.h:67
InDet::DefectsEmulatorBase::m_maxNShape
unsigned int m_maxNShape
Definition
DefectsEmulatorBase.h:99
InDet::DefectsEmulatorBase::DefectsEmulatorBase
DefectsEmulatorBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition
DefectsEmulatorBase.cxx:21
InDet::DefectsEmulatorBase::m_histMutex
std::mutex m_histMutex
Definition
DefectsEmulatorBase.h:79
InDet::DefectsEmulatorBase::finalize
virtual StatusCode finalize() override
Definition
DefectsEmulatorBase.cxx:147
ServiceHandle
Definition
ClusterMakerTool.h:36
InDet::ModuleIdentifierMatchUtil::ModuleData_t
std::array< int, ModuleIdentifierMatchUtil::kAllRows/2 > ModuleData_t
Definition
ModuleIdentifierMatchUtil.h:67
InDet
Primary Vertex Finder.
Definition
VP1ErrorUtils.h:36
Generated on
for ATLAS Offline Software by
1.17.0