ATLAS Offline Software
Loading...
Searching...
No Matches
PixelDefectsEmulatorPostInclude Namespace Reference

Functions

 emulateITkPixelDefects (flags, cfg, ModulePatterns=[[-2, 2, 0, 99,-99, 99,-99, 99, 0, 9999, 0, 1, 0]], DefectProbabilities=[[0., 1e-2, 1e-1, 0.]], NDefectFractionsPerPattern=[[1.,-1, 1.]], NoiseProbability=[], NoiseShape=[], CornerDefectParamsPerPattern=[], NCornerDefectFractionsPerPattern=[], RngPerDefectType=False, DefectsInputFiles=[], DefectsOutputFile=None, FillHistogramsPerPattern=False, FillEtaPhiHistogramsPerPattern=False, int MaxRandomPositionAttempts=10, str HistogramGroupName="ITkPixelDefects", str HistogramFileName="itk_pixel_defects_opt1.root", PropagateDefectsToStatus=True)
 emulatePixelDefects (flags, cfg, ModulePatterns=None, DefectProbabilities=None, NDefectFractionsPerPattern=None, RngPerDefectType=False, DefectsInputFiles=[], DefectsOutputFile=None, FillHistogramsPerPattern=False, FillEtaPhiHistogramsPerPattern=False, str HistogramGroupName="PixelDefects", str HistogramFileName="pixel_defects.root")
 poissonFractions (cc_defect_prob=1e-1, max_n=5)
 quadProb (circuit_prob)
 fractionsForExactlyNCoreColumnDefects (ExactlyNCoreColumnDefects=1)
 makeITkDefectsParams (quad_cc_defect_prob, quad_fractions, circuit_cc_defect_prob, circuit_fractions, pixel_defect_prob=1e-2, module_defect_prob=0., cornerDefectProb=0., noiseProbability=None, noiseShape=[])
 makeITkPixelNoise (noiseProb=0.)
 emulateITkPixelDefectsOneCC (flags, cfg, FrontEndCCDefectProb=0.1, PixelDefectProb=1e-2, NumberOfCCDefects=1, ModuleDefectProb=0., CornerDefectProb=0., NoiseProb=0., RngPerDefectType=False, DefectsInputFiles=[], DefectsOutputFile=None, PropagateDefectsToStatus=True, HistogramFileName=None)
 emulateITkPixelDefectsPoisson (flags, cfg, FrontEndCCDefectProb=0.1, PixelDefectProb=1e-2, ModuleDefectProb=0., CornerDefectProb=0., NoiseProb=0., RngPerDefectType=False, DefectsInputFiles=[], DefectsOutputFile=None, PropagateDefectsToStatus=True, HistogramFileName=None)
 emulateITkPixelDefectsDefault (flags, cfg, FrontEndCCDefectProb=0.1, PixelDefectProb=1e-2, ModuleDefectProb=1e-2, CornerDefectProb=15e-2, NoiseProb=0., RngPerDefectType=False, DefectsInputFiles=[], DefectsOutputFile=None, PropagateDefectsToStatus=True, HistogramFileName=None)

Function Documentation

◆ emulateITkPixelDefects()

PixelDefectsEmulatorPostInclude.emulateITkPixelDefects ( flags,
cfg,
ModulePatterns = [[-2,2,0,99,-99,99,-99,99,0,9999,0,1,0]],
DefectProbabilities = [[0.,1e-2,1e-1,0.]],
NDefectFractionsPerPattern = [[1.,-1, 1.]],
NoiseProbability = [],
NoiseShape = [],
CornerDefectParamsPerPattern = [],
NCornerDefectFractionsPerPattern = [],
RngPerDefectType = False,
DefectsInputFiles = [],
DefectsOutputFile = None,
FillHistogramsPerPattern = False,
FillEtaPhiHistogramsPerPattern = False,
int MaxRandomPositionAttempts = 10,
str HistogramGroupName = "ITkPixelDefects",
str HistogramFileName = "itk_pixel_defects_opt1.root",
PropagateDefectsToStatus = True )
Schedule conditions algorithm for emulated ITk pixel defects, and algorithms to drop RDOs overlapping with the emulated defects.
ModulePattern: criteria to match modules, which are lists of n-tuples where every two numbers of each n-tuple define a range
               to match parts of module identifiers (barrel/ec, layer/disk, eta., phi, columns, side) plus a flag (last
               element of each n-tuple), which is unused for pixel.
DefectProbabilities: list of n-tuples per criterion containing 4 probabilities: module, pixel to be defect, a module
                     to have at least one core column defect, circuit defect.
NDefectFractionsPerPattern: Fractions of exactly n-group defects (core-column, circuit) under condition that there is at least one
                            such group defect. There must be one n-tuple with fractions per criterion, and each fraction
                            n-tuple must contain for each group defect probability a non empty set of fractions of exactly 1, ... n defects.
                            Fractions for different group defects are separated by -1. There should be two sequences of
                            positive fractions separated by -1.
NoiseProbability: Empty or probabilities of a pixel to produce a spurious hit.
NoiseShape: binned PDF (i.e. list of fractions) to create tot values for spurious hits.
CornerDefectParamsPerPattern: parameters for corner defects per pattern can be created with e.g. makeCornerDefectParam
NCornerDefectFractionsPerPattern: fractions of 1,..4 corner defects
FillHistogramsPerPattern: if True histograms are filled per module pattern
FillEtaPhiHistogramsPerPattern: if True also fill xy, and rz histograms of defects per module.
HistogramGroupName: None (disables histogramming) or the histogram group name must be unique
HistogramFileName: None (disables histogramming) or a file name for writing the histograms.

Definition at line 38 of file PixelDefectsEmulatorPostInclude.py.

55 PropagateDefectsToStatus=True) :
56 """
57 Schedule conditions algorithm for emulated ITk pixel defects, and algorithms to drop RDOs overlapping with the emulated defects.
58 ModulePattern: criteria to match modules, which are lists of n-tuples where every two numbers of each n-tuple define a range
59 to match parts of module identifiers (barrel/ec, layer/disk, eta., phi, columns, side) plus a flag (last
60 element of each n-tuple), which is unused for pixel.
61 DefectProbabilities: list of n-tuples per criterion containing 4 probabilities: module, pixel to be defect, a module
62 to have at least one core column defect, circuit defect.
63 NDefectFractionsPerPattern: Fractions of exactly n-group defects (core-column, circuit) under condition that there is at least one
64 such group defect. There must be one n-tuple with fractions per criterion, and each fraction
65 n-tuple must contain for each group defect probability a non empty set of fractions of exactly 1, ... n defects.
66 Fractions for different group defects are separated by -1. There should be two sequences of
67 positive fractions separated by -1.
68 NoiseProbability: Empty or probabilities of a pixel to produce a spurious hit.
69 NoiseShape: binned PDF (i.e. list of fractions) to create tot values for spurious hits.
70 CornerDefectParamsPerPattern: parameters for corner defects per pattern can be created with e.g. makeCornerDefectParam
71 NCornerDefectFractionsPerPattern: fractions of 1,..4 corner defects
72 FillHistogramsPerPattern: if True histograms are filled per module pattern
73 FillEtaPhiHistogramsPerPattern: if True also fill xy, and rz histograms of defects per module.
74 HistogramGroupName: None (disables histogramming) or the histogram group name must be unique
75 HistogramFileName: None (disables histogramming) or a file name for writing the histograms.
76 """
77
78 from InDetDefectsEmulation.PixelDefectsEmulatorConfig import (
79 ITkPixelDefectsEmulatorCondAlgCfg,
80 ITkPixelDefectsEmulatorAlgCfg,
81 ITkPixelDefectsEmulatorToDetectorElementStatusCondAlgCfg,
82 DefectsHistSvcCfg
83 )
84 from AthenaCommon.Constants import INFO
85
86 if HistogramFileName is None or len(HistogramFileName) ==0 :
87 HistogramGroupName = None
88 if HistogramGroupName is not None :
89 cfg.merge( DefectsHistSvcCfg(flags, HistogramGroup=HistogramGroupName, FileName=HistogramFileName))
90
91 # schedule custom defects generating conditions alg
92 cfg.merge( ITkPixelDefectsEmulatorCondAlgCfg(flags,
93 # to enable histogramming:
94 HistogramGroupName=f"/{HistogramGroupName}/EmulatedDefects/" if HistogramGroupName is not None else "",
95 ModulePatterns = ModulePatterns,
96 DefectProbabilities = DefectProbabilities,
97 NDefectFractionsPerPattern = NDefectFractionsPerPattern,
98 MaxRandomPositionAttempts=MaxRandomPositionAttempts,
99 CornerDefectParamsPerPattern=CornerDefectParamsPerPattern,
100 NCornerDefectFractionsPerPattern=NCornerDefectFractionsPerPattern,
101 RngPerDefectType=RngPerDefectType,
102 DefectsInputFiles=DefectsInputFiles,
103 DefectsOutputFile=DefectsOutputFile,
104 FillHistogramsPerPattern=FillHistogramsPerPattern,
105 FillEtaPhiHistogramsPerPattern=FillEtaPhiHistogramsPerPattern,
106 CheckerBoardDefects=False,
107 OddColToggle=False,
108 OddRowToggle=False,
109 WriteKey="ITkPixelEmulatedDefects", # the default should match the key below
110 ))
111
112 # schedule the algorithm which drops elements from the ITk Pixel RDO collection
113 cfg.merge( ITkPixelDefectsEmulatorAlgCfg(flags,
114 # prevent default cond alg from being scheduled :
115 EmulatedDefectsKey="ITkPixelEmulatedDefects",
116 ModulePatterns = ModulePatterns,
117 NoiseProbability = NoiseProbability,
118 NoiseShape = NoiseShape,
119 # to enable histogramming:
120 HistogramGroupName=f"/{HistogramGroupName}/RejectedRDOs/" if HistogramGroupName is not None else "",
121 OutputLevel=INFO))
122
123 if PropagateDefectsToStatus :
124 # propagate defects to detector element status
125 cfg.merge(ITkPixelDefectsEmulatorToDetectorElementStatusCondAlgCfg(flags,
126 name="ITkPixelDefectsEmulatorToDetectorElementStatusCondAlg",
127 EmulatedDefectsKey="ITkPixelEmulatedDefects",
128 WriteKey="ITkPixelDetectorElementStatusFromEmulatedDefects"))
129 pixel_det_el_status_cond_alg=cfg.getCondAlgo("ITkPixelDetectorElementStatusCondAlgNoByteStreamErrors")
130 pixel_det_el_status_cond_alg.ConditionsSummaryTool.PixelDetElStatusCondDataBaseKey="ITkPixelDetectorElementStatusFromEmulatedDefects"
131

◆ emulateITkPixelDefectsDefault()

PixelDefectsEmulatorPostInclude.emulateITkPixelDefectsDefault ( flags,
cfg,
FrontEndCCDefectProb = 0.1,
PixelDefectProb = 1e-2,
ModuleDefectProb = 1e-2,
CornerDefectProb = 15e-2,
NoiseProb = 0.,
RngPerDefectType = False,
DefectsInputFiles = [],
DefectsOutputFile = None,
PropagateDefectsToStatus = True,
HistogramFileName = None )
Enables all defects according to the current expectation.

Definition at line 427 of file PixelDefectsEmulatorPostInclude.py.

438 HistogramFileName=None) :
439 """
440 Enables all defects according to the current expectation.
441 """
442 emulateITkPixelDefectsPoisson(flags,cfg,
443 FrontEndCCDefectProb,
444 PixelDefectProb,
445 ModuleDefectProb,
446 CornerDefectProb,
447 NoiseProb,
448 RngPerDefectType=RngPerDefectType,
449 DefectsInputFiles=DefectsInputFiles,
450 DefectsOutputFile=DefectsOutputFile,
451 PropagateDefectsToStatus=PropagateDefectsToStatus,
452 HistogramFileName=HistogramFileName)

◆ emulateITkPixelDefectsOneCC()

PixelDefectsEmulatorPostInclude.emulateITkPixelDefectsOneCC ( flags,
cfg,
FrontEndCCDefectProb = 0.1,
PixelDefectProb = 1e-2,
NumberOfCCDefects = 1,
ModuleDefectProb = 0.,
CornerDefectProb = 0.,
NoiseProb = 0.,
RngPerDefectType = False,
DefectsInputFiles = [],
DefectsOutputFile = None,
PropagateDefectsToStatus = True,
HistogramFileName = None )
Create exactly one core column defect per module where the probability is given
by module_prob, and create single pixel defects according to pixel_defect_prob

Definition at line 332 of file PixelDefectsEmulatorPostInclude.py.

344 HistogramFileName=None) :
345 """
346 Create exactly one core column defect per module where the probability is given
347 by module_prob, and create single pixel defects according to pixel_defect_prob
348 """
349 noiseProbabilitySingle,noiseShapeSingle = makeITkPixelNoise(NoiseProb)
350 fractions=fractionsForExactlyNCoreColumnDefects(NumberOfCCDefects)
351 ModulePatterns, DefectProbabilities, NDefectFractionsPerPattern, NoiseProbability, NoiseShape,cornerDefectParam,cornerDefectFractions = makeITkDefectsParams(
352 quad_cc_defect_prob=quadProb(FrontEndCCDefectProb),
353 quad_fractions=fractions, # same fractions for quads and other modules
354 circuit_cc_defect_prob=FrontEndCCDefectProb,
355 circuit_fractions=fractions,
356 pixel_defect_prob=PixelDefectProb,
357 module_defect_prob=ModuleDefectProb,
358 cornerDefectProb=CornerDefectProb,
359 noiseProbability=noiseProbabilitySingle,
360 noiseShape=noiseShapeSingle)
361
362 return emulateITkPixelDefects(flags,
363 cfg,
364 ModulePatterns=ModulePatterns,
365 DefectProbabilities=DefectProbabilities,
366 NDefectFractionsPerPattern=NDefectFractionsPerPattern,
367 NoiseProbability=NoiseProbability,
368 NoiseShape=NoiseShape,
369 CornerDefectParamsPerPattern=cornerDefectParam,
370 NCornerDefectFractionsPerPattern=cornerDefectFractions,
371 RngPerDefectType=RngPerDefectType,
372 DefectsInputFiles=DefectsInputFiles,
373 DefectsOutputFile=DefectsOutputFile,
374 FillHistogramsPerPattern=True,
375 FillEtaPhiHistogramsPerPattern=True,
376 PropagateDefectsToStatus=PropagateDefectsToStatus,
377 HistogramFileName=HistogramFileName)
378
379

◆ emulateITkPixelDefectsPoisson()

PixelDefectsEmulatorPostInclude.emulateITkPixelDefectsPoisson ( flags,
cfg,
FrontEndCCDefectProb = 0.1,
PixelDefectProb = 1e-2,
ModuleDefectProb = 0.,
CornerDefectProb = 0.,
NoiseProb = 0.,
RngPerDefectType = False,
DefectsInputFiles = [],
DefectsOutputFile = None,
PropagateDefectsToStatus = True,
HistogramFileName = None )
Create Poisson distributed  core column defects per module where the probability for at least one
core column defect is given by front_end_cc_defect_prob for single chip modules and larger for
quads, respectively. Single pixel defects are controlled by pixel_defect_prob

Definition at line 380 of file PixelDefectsEmulatorPostInclude.py.

391 HistogramFileName=None) :
392 """
393 Create Poisson distributed core column defects per module where the probability for at least one
394 core column defect is given by front_end_cc_defect_prob for single chip modules and larger for
395 quads, respectively. Single pixel defects are controlled by pixel_defect_prob
396 """
397 noiseProbabilitySingle,noiseShapeSingle = makeITkPixelNoise(NoiseProb)
398 quad_prob=quadProb(FrontEndCCDefectProb)
399 ModulePatterns, DefectProbabilities, NDefectFractionsPerPattern, NoiseProbability, NoiseShape,cornerDefectParam,cornerDefectFractions = makeITkDefectsParams(
400 quad_cc_defect_prob=quad_prob,
401 quad_fractions=poissonFractions(quad_prob),
402 circuit_cc_defect_prob=FrontEndCCDefectProb,
403 circuit_fractions=poissonFractions(FrontEndCCDefectProb),
404 pixel_defect_prob=PixelDefectProb,
405 module_defect_prob=ModuleDefectProb,
406 cornerDefectProb=CornerDefectProb,
407 noiseProbability=noiseProbabilitySingle,
408 noiseShape=noiseShapeSingle)
409
410 return emulateITkPixelDefects(flags,
411 cfg,
412 ModulePatterns=ModulePatterns,
413 DefectProbabilities=DefectProbabilities,
414 NDefectFractionsPerPattern=NDefectFractionsPerPattern,
415 NoiseProbability=NoiseProbability,
416 NoiseShape=NoiseShape,
417 CornerDefectParamsPerPattern=cornerDefectParam,
418 NCornerDefectFractionsPerPattern=cornerDefectFractions,
419 RngPerDefectType=RngPerDefectType,
420 DefectsInputFiles=DefectsInputFiles,
421 DefectsOutputFile=DefectsOutputFile,
422 FillHistogramsPerPattern=True,
423 FillEtaPhiHistogramsPerPattern=True,
424 PropagateDefectsToStatus=PropagateDefectsToStatus,
425 HistogramFileName=HistogramFileName)
426

◆ emulatePixelDefects()

PixelDefectsEmulatorPostInclude.emulatePixelDefects ( flags,
cfg,
ModulePatterns = None,
DefectProbabilities = None,
NDefectFractionsPerPattern = None,
RngPerDefectType = False,
DefectsInputFiles = [],
DefectsOutputFile = None,
FillHistogramsPerPattern = False,
FillEtaPhiHistogramsPerPattern = False,
str HistogramGroupName = "PixelDefects",
str HistogramFileName = "pixel_defects.root" )
Schedule algorithms to emulate run3 pixel defects, and algorithm to drop RDOs which overlap with these defects

Definition at line 132 of file PixelDefectsEmulatorPostInclude.py.

143 HistogramFileName: str="pixel_defects.root") :
144 """
145 Schedule algorithms to emulate run3 pixel defects, and algorithm to drop RDOs which overlap with these defects
146 """
147 from InDetDefectsEmulation.PixelDefectsEmulatorConfig import (
148 PixelDefectsEmulatorCondAlgCfg,
149 PixelDefectsEmulatorAlgCfg,
150 DefectsHistSvcCfg
151 )
152 from AthenaCommon.Constants import INFO
153
154 if HistogramFileName is None or len(HistogramFileName) ==0 :
155 HistogramGroupName = None
156 if HistogramGroupName is not None :
157 cfg.merge( DefectsHistSvcCfg(flags, HistogramGroup=HistogramGroupName, FileName=HistogramFileName))
158
159 if ModulePatterns is None and DefectProbabilities is None and NDefectFractionsPerPattern is None:
160 a_module_pattern_list, a_prob_list,fractions,ignore_NoiseProbability,ignore_NoiseShape, cornerDefectParam, cornerDefectFractions = combineModuleDefects([
161 moduleDefect(bec=[-2,-2],layer=[0,99], phi_range=[-99,99],eta_range=[-99,99], # select all modules
162 columns_or_strips=[0,9999], # sensors with all kind of numbers of columns
163 side_range=[0,0], # there is only a single side
164 all_rows=False, # there is no connection between modules
165 probability=[1e-2, # probability of a module to be defect
166 1e-2, # probability of a pixel to be defect
167 0., # probability of a module to have at least one core-column defect
168 0. # probability of a module to have at least one defect circuit
169 ])
170 ])
171 ModulePatterns = a_module_pattern_list
172 DefectProbabilities = a_prob_list
173 NDefectFractionsPerPattern = fractions
174
175 # schedule custom defects generating conditions alg
176 cfg.merge( PixelDefectsEmulatorCondAlgCfg(flags,
177 ModulePatterns = ModulePatterns,
178 DefectProbabilities = DefectProbabilities,
179 NDefectFractionsPerPattern = NDefectFractionsPerPattern,
180 CornerDefectParamsPerPattern=cornerDefectParam,
181 NCornerDefectFractionsPerPattern=cornerDefectFractions,
182 RngPerDefectType=RngPerDefectType,
183 DefectsInputFiles=DefectsInputFiles,
184 DefectsOutputFile=DefectsOutputFile,
185 FillHistogramsPerPattern=FillHistogramsPerPattern,
186 FillEtaPhiHistogramsPerPattern=FillEtaPhiHistogramsPerPattern,
187 # to enable histogramming:
188 HistogramGroupName=f"/{HistogramGroupName}/EmulatedDefects/" if HistogramGroupName is not None else "",
189 WriteKey="PixelEmulatedDefects", # the default should match the key below
190 ))
191
192 # schedule the algorithm which drops elements from the ITk Pixel RDO collection
193 cfg.merge( PixelDefectsEmulatorAlgCfg(flags,
194 # prevent default cond alg from being scheduled :
195 EmulatedDefectsKey="PixelEmulatedDefects",
196 # to enable histogramming:
197 HistogramGroupName=f"/{HistogramGroupName}/RejectedRDOs/" if HistogramGroupName is not None else "",
198 # (prefix "/PixelDefects/" is assumed by THistSvc config)
199 OutputLevel=INFO))
200
201

◆ fractionsForExactlyNCoreColumnDefects()

PixelDefectsEmulatorPostInclude.fractionsForExactlyNCoreColumnDefects ( ExactlyNCoreColumnDefects = 1)
Create fraction n-tuple, containing zero except for the element corresponding
to exactly n defects, which is set to 1.

Definition at line 227 of file PixelDefectsEmulatorPostInclude.py.

227def fractionsForExactlyNCoreColumnDefects(ExactlyNCoreColumnDefects=1) :
228 """
229 Create fraction n-tuple, containing zero except for the element corresponding
230 to exactly n defects, which is set to 1.
231 """
232 return [ 0. if idx != ExactlyNCoreColumnDefects else 1. for idx in range(1,ExactlyNCoreColumnDefects+1) ]
233

◆ makeITkDefectsParams()

PixelDefectsEmulatorPostInclude.makeITkDefectsParams ( quad_cc_defect_prob,
quad_fractions,
circuit_cc_defect_prob,
circuit_fractions,
pixel_defect_prob = 1e-2,
module_defect_prob = 0.,
cornerDefectProb = 0.,
noiseProbability = None,
noiseShape = [] )
Create different defects for quads and single chip modules, where the corresponding modules are selected by
the number of offline columns

Definition at line 234 of file PixelDefectsEmulatorPostInclude.py.

242 noiseShape=[]) :
243 """
244 Create different defects for quads and single chip modules, where the corresponding modules are selected by
245 the number of offline columns
246 """
247 # corner defects:
248 # - 50% of ~30% of the 3D modules have disconnected corners area 2-4mm x 2-2.5mm,
249 # - roughly circular shape with a sagitta (defined by circle crossing sensor edges) of ~0-2mm,
250 # - impact on all 3D sensors which are all single chip modules i.e. modules with 384 or 400 columns
251 # Update: after defect mitigation, new measurement of remaining defects: 4.1mm x 1.3 sagitta 0.44 (representative?)
252 corner_defects=makeCornerDefectParam(probability=cornerDefectProb,
253 min_rx=2.,max_rx=5.,
254 min_ry=0.5,max_ry=1.5,
255 min_sagitta=0.2,max_sagitta=0.5)
256 # assume each corner has equal probability to suffer corner defects
257 # Assume number of corners with defects Poisson distributed
258 # According to the information on JIRA https://its.cern.ch/jira/browse/ATLITKSW-302 only bottom of
259 # sensors suffers such defects (currently not taken into account
260 corner_defect_n_defect_corners=poissonFractions(cc_defect_prob=15e-2, max_n=4)
261
262 return combineModuleDefects([
263 moduleDefect(bec=[-2,2],layer=[0,99], phi_range=[-99,99],eta_range=[-99,99], # select all modules
264 columns_or_strips=[800,800], # but only quads
265 side_range=[0,0], # there is only a single side
266 all_rows=False, # there is no connection between modules
267 probability=[module_defect_prob, # probability of a module to be defect
268 pixel_defect_prob, # probability of a pixel to be defect
269 quad_cc_defect_prob, # probability of a module to have at least one core-column defect
270 0. # probability of a module to have at least one defect circuit
271 ],
272 fractionsOfNDefects=[[1.], quad_fractions,[1.]], # dummy fractions for cell and circuit defects
273 noiseProbability=noiseProbability,
274 noiseShape=noiseShape,
275 cornerDefectParam=[], # need empty lists here
276 cornerDefectNCornerFractions=[] # and here, otherwise resulting property will be non-conform,
277 ),
278 moduleDefect(bec=[-2,2],layer=[0,1], phi_range=[-99,99],eta_range=[-99,99], # select all modules
279 columns_or_strips=[384,384], # but only ring triplet modules
280 side_range=[0,0], # there is only a single side
281 all_rows=False, # there is no connection between modules
282 probability=[module_defect_prob, # probability of a module to be defect
283 pixel_defect_prob, # probability of a pixel to be defect
284 circuit_cc_defect_prob, # probability of a module to have at least one core-column defect
285 0. # probability of a module to have at least one defect circuit
286 ],
287 fractionsOfNDefects=[[1.], circuit_fractions,[1.]], # dummy fractions for cell and circuit defects
288 noiseProbability=noiseProbability,
289 noiseShape=noiseShape,
290 cornerDefectParam=corner_defects,
291 cornerDefectNCornerFractions=corner_defect_n_defect_corners,
292 ),
293 moduleDefect(bec=[-2,2],layer=[0,1], phi_range=[-99,99],eta_range=[-99,99], # select all modules
294 columns_or_strips=[200,200], # but only barrel triplet modules
295 side_range=[0,0], # there is only a single side
296 all_rows=False, # there is no connection between modules
297 probability=[module_defect_prob, # probability of a module to be defect
298 pixel_defect_prob, # probability of a pixel to be defect
299 circuit_cc_defect_prob, # probability of a module to have at least one core-column defect
300 0. # probability of a module to have at least one defect circuit
301 ],
302 fractionsOfNDefects=[[1.],circuit_fractions,[1.]], # dummy fractions for cell and circuit defects
303 noiseProbability=noiseProbability,
304 noiseShape=noiseShape,
305 cornerDefectParam=corner_defects,
306 cornerDefectNCornerFractions=corner_defect_n_defect_corners,
307 )
308 ])
309

◆ makeITkPixelNoise()

PixelDefectsEmulatorPostInclude.makeITkPixelNoise ( noiseProb = 0.)
For NoiseProb>0. create phantasie noise tot shape, with mean at zero width of 0.7
truncated below a tot of 1.

Definition at line 310 of file PixelDefectsEmulatorPostInclude.py.

310def makeITkPixelNoise(noiseProb=0.) :
311 """
312 For NoiseProb>0. create phantasie noise tot shape, with mean at zero width of 0.7
313 truncated below a tot of 1.
314 """
315 if noiseProb > 0. :
316 import math
317 def norm(dist) :
318 scale = sum(dist)
319 return [elm/scale if scale > 0. else 0. for elm in dist]
320 def gaussDist(mean, width, n) :
321 scale = -1./(2*width)
322 return norm([ math.exp( scale *math.pow(i - mean,2.) ) for i in range(0,n) ])
323
324 # Guassian tot distribution with mean of 0 but tot >=1
325 noiseShape=[ 0. ] + gaussDist(-1,0.7,4)
326 else :
327 noiseProb=None
328 noiseShape=[]
329 return noiseProb,noiseShape
330
331

◆ poissonFractions()

PixelDefectsEmulatorPostInclude.poissonFractions ( cc_defect_prob = 1e-1,
max_n = 5 )
Create fractions for exactly 1..max_n defects, under the condition that
the probability for at least one such defects is cc_defect_prob, and
assuming that the fractions are Poisson distributed.

Definition at line 202 of file PixelDefectsEmulatorPostInclude.py.

202def poissonFractions(cc_defect_prob=1e-1, max_n=5) :
203 """
204 Create fractions for exactly 1..max_n defects, under the condition that
205 the probability for at least one such defects is cc_defect_prob, and
206 assuming that the fractions are Poisson distributed.
207 """
208 if cc_defect_prob > 0. :
209 def PoissonProb(expected, n) :
210 return math.pow(expected,n)*math.exp(-expected)/math.gamma(n+1)
211 def norm(fractions) :
212 Norm = 1./sum (fractions)
213 return [Norm*elm for elm in fractions ]
214 expectation=-math.log(1-cc_defect_prob)
215 return norm([ PoissonProb(expectation,i) for i in range(1,max_n+1) ])
216 else :
217 return [1.]
218

◆ quadProb()

PixelDefectsEmulatorPostInclude.quadProb ( circuit_prob)
Compute the defect probability for a quad module from the probabilities
of a single chip module, assuming that the defect is a "feature" of the
chip.

Definition at line 219 of file PixelDefectsEmulatorPostInclude.py.

219def quadProb(circuit_prob) :
220 """
221 Compute the defect probability for a quad module from the probabilities
222 of a single chip module, assuming that the defect is a "feature" of the
223 chip.
224 """
225 return 1-math.pow(1-circuit_prob,4) # not (no defect core column on none of the sensors)
226