Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #ifndef INDET_DEFECTSEMULATORCONDALGBASE_H
8 #define INDET_DEFECTSEMULATORCONDALGBASE_H
15 #include "GaudiKernel/ServiceHandle.h"
20 #include "GaudiKernel/ITHistSvc.h"
24 class HepRandomEngine;
47 {
this,
"ModulePatterns", {},
48 "Integer ranges to select: (0-1) barrel/end-cap range, (2-3) layer, (4-5) eta index range, (6-7) phi index range, "
49 "(8-9) module number of columns or strips, (10) both sides (0,1), (11) all rows (0,1)" };
51 {
this,
"DefectProbabilities", {},
52 "Defect probabilities per module pattern: defect module, defect strip." };
54 {
this,
"NDefectFractionsPerPattern", {},
55 "List of fractions per pattern for exactly 1 to n defects under the codition that there is a defect, where -1. marks the"
56 "end of this lists, before the fractions for the next mask start." };
58 {
this,
"CornerDefectParamsPerPattern", {},
59 "Set of corner defect parameters (probability, x-intersection pos min, max, y-intersection pos min, max, sagitta minm max). "
60 "per module pattern. " };
62 {
this,
"NCornerDefectFractionsPerPattern", {},
63 "List of fractions per pattern for exactly 1 to 4 corner defects under the codition that there is a defect." };
71 {
this,
"OddRowToggle",
false};
73 {
this,
"OddColToggle",
false};
75 {
this,
"CheckerBoardDefects",
false};
77 {
this,
"MaxRandomPositionAttempts", 10};
81 {
this,
"HistogramGroupName",
"",
"Histogram group name or empty to disable histogramming"};
83 {
this,
"FillHistogramsPerPattern",
false,
"If true, histogram per module defects etc. separately per pattern."};
85 {
this,
"FillEtaPhiHistogramsPerPattern",
false,
"If true, histogram per eta, phi amd z, R are filled separately per pattern."};
115 double totalProbability(
const std::vector<unsigned int> &module_pattern_idx,
unsigned int prob_idx)
const {
117 for (
unsigned int pattern_i : module_pattern_idx) {
131 unsigned int prob_idx,
132 std::vector<double> &cumulative_prob)
const {
133 cumulative_prob.clear();
134 double total_prob=0.f;
135 for (
unsigned int pattern_i : module_pattern_idx) {
138 cumulative_prob.push_back(total_prob);
162 const std::vector<unsigned int> &module_pattern_idx,
163 unsigned int n_masks,
164 unsigned int n_cells,
165 std::vector<unsigned int> &n_mask_defects)
const;
173 unsigned int n_error,
174 unsigned int n_defects_total,
175 const std::vector<std::array<unsigned int,kNCounts> > &counts)
const;
186 std::pair<unsigned int, unsigned int>
findHist(
unsigned int pattern_i,
unsigned int n_rows,
unsigned int n_cols)
const;
199 unsigned int pattern_hist_i,
200 unsigned int matrix_histogram_index,
201 unsigned int matrix_index,
202 unsigned int module_i,
203 unsigned int n_masks,
204 const std::vector<unsigned int> &n_mask_defects,
Conditions algorithms for emulating ITK pixel defects.
Gaudi::Property< bool > m_oddRowToggle
ServiceHandle< IAthRNGSvc > m_rndmSvc
Gaudi::Property< std::vector< std::vector< double > > > m_nDefectFractionsPerPattern
Gaudi::Property< bool > m_checkerBoardToggle
std::pair< unsigned int, unsigned int > findHist(unsigned int pattern_i, unsigned int n_rows, unsigned int n_cols) const
std::array< std::vector< TH2 * >, kNPosHists > m_defectModuleEtaPhiHist ATLAS_THREAD_SAFE
StatusCode initializeCornerDefects()
unsigned int throwNumberOfDefects(CLHEP::HepRandomEngine *rndmEngine, const std::vector< unsigned int > &module_pattern_idx, unsigned int n_masks, unsigned int n_cells, std::vector< unsigned int > &n_mask_defects) const
Gaudi::Property< bool > m_oddColToggle
double totalProbability(const std::vector< unsigned int > &module_pattern_idx, unsigned int prob_idx) const
Compute the total probability using the probabilities associated to the given list of patterns.
virtual ~DefectsEmulatorCondAlgBase() override=default
DefectsEmulatorCondAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< std::string > m_histogramGroupName
std::vector< std::vector< std::vector< float > > > m_perPatternAndMaskFractions
ServiceHandle< ITHistSvc > m_histSvc
Gaudi::Property< bool > m_fillEtaPhiHistogramsPerPattern
std::vector< std::vector< TH2 * > > m_hist ATLAS_THREAD_SAFE
An algorithm that can be simultaneously executed in multiple threads.
std::vector< std::vector< float > > m_perPatternCornerDefectNCornerCummulativeProb
Gaudi::Property< std::vector< std::vector< double > > > m_defectProbability
std::vector< std::vector< unsigned int > > m_dimPerHist ATLAS_THREAD_SAFE
std::vector< std::vector< TH2 * > > m_moduleHist ATLAS_THREAD_SAFE
void printSummaryOfDefectGeneration(unsigned int n_masks, unsigned int n_error, unsigned int n_defects_total, const std::vector< std::array< unsigned int, kNCounts > > &counts) const
::StatusCode StatusCode
StatusCode definition for legacy code.
void histogramDefectModule(unsigned int module_pattern_i, unsigned int hist_pattern_i, unsigned int id_hash, const Amg::Vector3D ¢er) const
StatusCode initializeProbabilities(unsigned int n_masks)
virtual StatusCode finalize() override
@ kCornerDefectkWidthRowDirectionOffset
Gaudi::Property< std::vector< std::vector< int > > > m_modulePattern
std::array< std::vector< TH2 * >, kNPosHists > m_defectModuleEtaLayerHist ATLAS_THREAD_SAFE
@ kCornerDefectWidthColumnDirection
Gaudi::Property< std::vector< std::vector< double > > > m_cornerDefectNCornerFractionsPerPattern
Property holding a SG store/key/clid from which a WriteHandle is made.
Gaudi::Property< bool > m_fillHistogramsPerPattern
Eigen::Matrix< double, 3, 1 > Vector3D
StatusCode checkProbabilities(unsigned int n_probabilities) const
Consistency check of module patterns, probabilities.
StatusCode initializeBase(unsigned int n_masks, unsigned int wafer_hash_max)
@ kCornerDefectkWidthRowDirection
@ kCornerDefectWidthColumnDirectionOffset
bool m_histogrammingEnabled
@ kCornerDefectkSagittaOffset
std::vector< unsigned int > m_maxNGroupDefects
Gaudi::Property< unsigned int > m_maxAttempts
void makeCumulativeProbabilityDist(std::vector< unsigned int > &module_pattern_idx, unsigned int prob_idx, std::vector< double > &cumulative_prob) const
Create a cumulative distribution from the referenced set of probabilities.
std::atomic< unsigned int > m_modulesWithoutDefectParameters
Gaudi::Property< std::vector< std::vector< double > > > m_cornerDefectParamsPerPattern
std::vector< std::string > m_groupDefectHistNames
std::vector< unsigned int > m_matrixTypeId ATLAS_THREAD_SAFE
std::vector< std::vector< std::vector< TH1 * > > > m_groupDefectHists ATLAS_THREAD_SAFE
void fillPerModuleHistograms(unsigned int module_pattern_i, unsigned int pattern_hist_i, unsigned int matrix_histogram_index, unsigned int matrix_index, unsigned int module_i, unsigned int n_masks, const std::vector< unsigned int > &n_mask_defects, const Amg::Vector3D ¢er) const