ATLAS Offline Software
Loading...
Searching...
No Matches
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"
9#include "GaudiKernel/ITHistSvc.h"
15
16#include <string>
17#include <vector>
18#include <mutex>
19#include <atomic>
20#include <string_view>
21#include <array>
22
23class TH2;
24
25namespace InDet {
26
31public:
32 DefectsEmulatorBase(const std::string &name,ISvcLocator *pSvcLocator);
33
34 StatusCode initializeBase(unsigned int wafer_hash_max);
35 virtual StatusCode finalize() override;
36
37protected:
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
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
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 PublicToolHandle<ActsTrk::ITrackingGeometryTool> m_trackingGeometryTool
93 {this, "TrackingGeometryTool", "ActsTrackingGeometryTool"};
94
95 ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
96 std::string m_rngName;
97 std::vector<unsigned short> m_noiseParamIdx;
98 std::vector<std::vector<float> > m_noiseShapeCummulative;
99
100 unsigned int m_maxNShape {};
101
103
104};
105
106}
107
108#endif
An algorithm that can be simultaneously executed in multiple threads.
std::atomic< std::size_t > m_rejectedRDOs
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.
static const std::array< std::string_view, kNHistTypes > s_histTitles
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
std::atomic< std::size_t > m_totalNoise
std::atomic< std::size_t > m_totalRDOs
StatusCode initializeBase(unsigned int wafer_hash_max)
static const std::array< std::string_view, kNHistTypes > s_histNames
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.
std::atomic< std::size_t > m_splitRDOs
ServiceHandle< IAthRNGSvc > m_rndmSvc
std::vector< unsigned int > m_dimPerHist ATLAS_THREAD_SAFE
std::vector< std::vector< float > > m_noiseShapeCummulative
Gaudi::Property< std::vector< std::vector< int > > > m_modulePattern
Gaudi::Property< std::string > m_histogramGroupName
ServiceHandle< ITHistSvc > m_histSvc
std::vector< unsigned short > m_noiseParamIdx
Gaudi::Property< std::vector< std::vector< double > > > m_noiseShape
Gaudi::Property< std::vector< float > > m_noiseProbability
DefectsEmulatorBase(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode finalize() override
std::array< int, ModuleIdentifierMatchUtil::kAllRows/2 > ModuleData_t
Primary Vertex Finder.