 |
ATLAS Offline Software
|
|
def | 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) |
|
def | 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") |
|
def | poissonFractions (cc_defect_prob=1e-1, max_n=5) |
|
def | quadProb (circuit_prob) |
|
def | fractionsForExactlyNCoreColumnDefects (ExactlyNCoreColumnDefects=1) |
|
def | 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=[]) |
|
def | makeITkPixelNoise (noiseProb=0.) |
|
def | 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) |
|
def | emulateITkPixelDefectsPoisson (flags, cfg, FrontEndCCDefectProb=0.1, PixelDefectProb=1e-2, ModuleDefectProb=0., CornerDefectProb=0., NoiseProb=0., RngPerDefectType=False, DefectsInputFiles=[], DefectsOutputFile=None, PropagateDefectsToStatus=True, HistogramFileName=None) |
|
def | 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) |
|
◆ emulateITkPixelDefects()
def 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.
40 ModulePatterns=[[-2,2,0,99,-99,99,-99,99,0,9999,0,1,0]],
41 DefectProbabilities=[[0.,1e-2,1e-1,0.]],
42 NDefectFractionsPerPattern=[[1.,-1, 1.]],
45 CornerDefectParamsPerPattern=[],
46 NCornerDefectFractionsPerPattern=[],
47 RngPerDefectType=False,
49 DefectsOutputFile=None,
50 FillHistogramsPerPattern=False,
51 FillEtaPhiHistogramsPerPattern=False,
52 MaxRandomPositionAttempts: int=10,
53 HistogramGroupName: str=
"ITkPixelDefects",
54 HistogramFileName: str=
"itk_pixel_defects_opt1.root",
55 PropagateDefectsToStatus=
True) :
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.
78 from InDetDefectsEmulation.PixelDefectsEmulatorConfig
import (
79 ITkPixelDefectsEmulatorCondAlgCfg,
80 ITkPixelDefectsEmulatorAlgCfg,
81 ITkPixelDefectsEmulatorToDetectorElementStatusCondAlgCfg,
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))
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,
109 WriteKey=
"ITkPixelEmulatedDefects",
115 EmulatedDefectsKey=
"ITkPixelEmulatedDefects",
116 ModulePatterns = ModulePatterns,
117 NoiseProbability = NoiseProbability,
118 NoiseShape = NoiseShape,
120 HistogramGroupName=f
"/{HistogramGroupName}/RejectedRDOs/" if HistogramGroupName
is not None else "",
123 if PropagateDefectsToStatus :
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"
◆ emulateITkPixelDefectsDefault()
def 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 424 of file PixelDefectsEmulatorPostInclude.py.
426 FrontEndCCDefectProb=0.1,
427 PixelDefectProb=1e-2,
428 ModuleDefectProb=1e-2,
429 CornerDefectProb=15e-2,
431 RngPerDefectType=False,
432 DefectsInputFiles=[],
433 DefectsOutputFile=None,
434 PropagateDefectsToStatus=True,
435 HistogramFileName=None) :
437 Enables all defects according to the current expectation.
440 FrontEndCCDefectProb,
445 RngPerDefectType=RngPerDefectType,
446 DefectsInputFiles=DefectsInputFiles,
447 DefectsOutputFile=DefectsOutputFile,
448 PropagateDefectsToStatus=PropagateDefectsToStatus,
449 HistogramFileName=HistogramFileName)
◆ emulateITkPixelDefectsOneCC()
def 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 329 of file PixelDefectsEmulatorPostInclude.py.
331 FrontEndCCDefectProb=0.1,
332 PixelDefectProb=1e-2,
337 RngPerDefectType=False,
338 DefectsInputFiles=[],
339 DefectsOutputFile=None,
340 PropagateDefectsToStatus=True,
341 HistogramFileName=None) :
343 Create exactly one core column defect per module where the probability is given
344 by module_prob, and create single pixel defects according to pixel_defect_prob
348 ModulePatterns, DefectProbabilities, NDefectFractionsPerPattern, NoiseProbability, NoiseShape,cornerDefectParam,cornerDefectFractions =
makeITkDefectsParams(
349 quad_cc_defect_prob=
quadProb(FrontEndCCDefectProb),
350 quad_fractions=fractions,
351 circuit_cc_defect_prob=FrontEndCCDefectProb,
352 circuit_fractions=fractions,
353 pixel_defect_prob=PixelDefectProb,
354 module_defect_prob=ModuleDefectProb,
355 cornerDefectProb=CornerDefectProb,
356 noiseProbability=noiseProbabilitySingle,
357 noiseShape=noiseShapeSingle)
361 ModulePatterns=ModulePatterns,
362 DefectProbabilities=DefectProbabilities,
363 NDefectFractionsPerPattern=NDefectFractionsPerPattern,
364 NoiseProbability=NoiseProbability,
365 NoiseShape=NoiseShape,
366 CornerDefectParamsPerPattern=cornerDefectParam,
367 NCornerDefectFractionsPerPattern=cornerDefectFractions,
368 RngPerDefectType=RngPerDefectType,
369 DefectsInputFiles=DefectsInputFiles,
370 DefectsOutputFile=DefectsOutputFile,
371 FillHistogramsPerPattern=
True,
372 FillEtaPhiHistogramsPerPattern=
True,
373 PropagateDefectsToStatus=PropagateDefectsToStatus,
374 HistogramFileName=HistogramFileName)
◆ emulateITkPixelDefectsPoisson()
def 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 377 of file PixelDefectsEmulatorPostInclude.py.
379 FrontEndCCDefectProb=0.1,
380 PixelDefectProb=1e-2,
384 RngPerDefectType=False,
385 DefectsInputFiles=[],
386 DefectsOutputFile=None,
387 PropagateDefectsToStatus=True,
388 HistogramFileName=None) :
390 Create Poisson distributed core column defects per module where the probability for at least one
391 core column defect is given by front_end_cc_defect_prob for single chip modules and larger for
392 quads, respectively. Single pixel defects are controlled by pixel_defect_prob
395 quad_prob=
quadProb(FrontEndCCDefectProb)
396 ModulePatterns, DefectProbabilities, NDefectFractionsPerPattern, NoiseProbability, NoiseShape,cornerDefectParam,cornerDefectFractions =
makeITkDefectsParams(
397 quad_cc_defect_prob=quad_prob,
399 circuit_cc_defect_prob=FrontEndCCDefectProb,
401 pixel_defect_prob=PixelDefectProb,
402 module_defect_prob=ModuleDefectProb,
403 cornerDefectProb=CornerDefectProb,
404 noiseProbability=noiseProbabilitySingle,
405 noiseShape=noiseShapeSingle)
409 ModulePatterns=ModulePatterns,
410 DefectProbabilities=DefectProbabilities,
411 NDefectFractionsPerPattern=NDefectFractionsPerPattern,
412 NoiseProbability=NoiseProbability,
413 NoiseShape=NoiseShape,
414 CornerDefectParamsPerPattern=cornerDefectParam,
415 NCornerDefectFractionsPerPattern=cornerDefectFractions,
416 RngPerDefectType=RngPerDefectType,
417 DefectsInputFiles=DefectsInputFiles,
418 DefectsOutputFile=DefectsOutputFile,
419 FillHistogramsPerPattern=
True,
420 FillEtaPhiHistogramsPerPattern=
True,
421 PropagateDefectsToStatus=PropagateDefectsToStatus,
422 HistogramFileName=HistogramFileName)
◆ emulatePixelDefects()
def 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.
135 DefectProbabilities=None,
136 NDefectFractionsPerPattern=None,
137 RngPerDefectType=False,
138 DefectsInputFiles=[],
139 DefectsOutputFile=None,
140 FillHistogramsPerPattern=False,
141 FillEtaPhiHistogramsPerPattern=False,
142 HistogramGroupName: str=
"PixelDefects",
143 HistogramFileName: str=
"pixel_defects.root") :
145 Schedule algorithms to emulate run3 pixel defects, and algorithm to drop RDOs which overlap with these defects
147 from InDetDefectsEmulation.PixelDefectsEmulatorConfig
import (
148 PixelDefectsEmulatorCondAlgCfg,
149 PixelDefectsEmulatorAlgCfg,
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))
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],
162 columns_or_strips=[0,9999],
171 ModulePatterns = a_module_pattern_list
172 DefectProbabilities = a_prob_list
173 NDefectFractionsPerPattern = fractions
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,
188 HistogramGroupName=f
"/{HistogramGroupName}/EmulatedDefects/" if HistogramGroupName
is not None else "",
189 WriteKey=
"PixelEmulatedDefects",
195 EmulatedDefectsKey=
"PixelEmulatedDefects",
197 HistogramGroupName=f
"/{HistogramGroupName}/RejectedRDOs/" if HistogramGroupName
is not None else "",
◆ fractionsForExactlyNCoreColumnDefects()
def 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.
229 Create fraction n-tuple, containing zero except for the element corresponding
230 to exactly n defects, which is set to 1.
232 return [ 0.
if idx != ExactlyNCoreColumnDefects
else 1.
for idx
in range(1,ExactlyNCoreColumnDefects+1) ]
◆ makeITkDefectsParams()
def 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.
236 circuit_cc_defect_prob,
238 pixel_defect_prob=1e-2,
239 module_defect_prob=0.,
241 noiseProbability=None,
244 Create different defects for quads and single chip modules, where the corresponding modules are selected by
245 the number of offline columns
252 min_rx=2.,max_rx=8.4,
253 min_ry=2.,max_ry=4.5,
254 min_sagitta=0.,max_sagitta=2.2)
257 corner_defect_n_defect_corners=
poissonFractions(cc_defect_prob=15e-2, max_n=4)
260 moduleDefect(bec=[-2,2],layer=[0,99], phi_range=[-99,99],eta_range=[-99,99],
261 columns_or_strips=[800,800],
264 probability=[module_defect_prob,
269 fractionsOfNDefects=[quad_fractions,[1.]],
270 noiseProbability=noiseProbability,
271 noiseShape=noiseShape,
272 cornerDefectParam=[],
273 cornerDefectNCornerFractions=[]
275 moduleDefect(bec=[-2,2],layer=[0,1], phi_range=[-99,99],eta_range=[-99,99],
276 columns_or_strips=[384,384],
279 probability=[module_defect_prob,
281 circuit_cc_defect_prob,
284 fractionsOfNDefects=[circuit_fractions,[1.]],
285 noiseProbability=noiseProbability,
286 noiseShape=noiseShape,
287 cornerDefectParam=corner_defects,
288 cornerDefectNCornerFractions=corner_defect_n_defect_corners,
290 moduleDefect(bec=[-2,2],layer=[0,1], phi_range=[-99,99],eta_range=[-99,99],
291 columns_or_strips=[200,200],
294 probability=[module_defect_prob,
296 circuit_cc_defect_prob,
299 fractionsOfNDefects=[circuit_fractions,[1.]],
300 noiseProbability=noiseProbability,
301 noiseShape=noiseShape,
302 cornerDefectParam=corner_defects,
303 cornerDefectNCornerFractions=corner_defect_n_defect_corners,
◆ makeITkPixelNoise()
def 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 307 of file PixelDefectsEmulatorPostInclude.py.
309 For NoiseProb>0. create phantasie noise tot shape, with mean at zero width of 0.7
310 truncated below a tot of 1.
316 return [elm/scale
if scale > 0.
else 0.
for elm
in dist]
317 def gaussDist(mean, width, n) :
318 scale = -1./(2*width)
319 return norm([ math.exp( scale *math.pow(i - mean,2.) )
for i
in range(0,n) ])
322 noiseShape=[ 0. ] + gaussDist(-1,0.7,4)
326 return noiseProb,noiseShape
◆ poissonFractions()
def 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.
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.
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) ])
◆ quadProb()
def 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.
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
225 return 1-math.pow(1-circuit_prob,4)
ComponentAccumulator ITkPixelDefectsEmulatorToDetectorElementStatusCondAlgCfg(flags, str name="ITkPixelDefectsEmulatorToDetectorElementStatusCondAlgCfg", **dict kwargs)
ComponentAccumulator DefectsHistSvcCfg(flags, str HistogramGroup="PixelDefects", str FileName='pixel_defects.root')
def moduleDefect(bec=[-2, 2], layer=[0, 8], eta_range=[-99, 99], phi_range=[-99, 99], columns_or_strips=[0, 2000], column_or_strip_length=[0, 1000000], side_range=[0, 1], all_rows=True, probability=[1e-2], fractionsOfNDefects=[], noiseProbability=None, noiseShape=[], cornerDefectParam=None, cornerDefectNCornerFractions=None)
ComponentAccumulator PixelDefectsEmulatorCondAlgCfg(flags, str name="PixelDefectsEmulatorCondAlg", **dict kwargs)
def fractionsForExactlyNCoreColumnDefects(ExactlyNCoreColumnDefects=1)
ComponentAccumulator ITkPixelDefectsEmulatorCondAlgCfg(flags, str name="ITkPixelDefectsEmulatorCondAlg", **dict kwargs)
def makeCornerDefectParam(probability=1e-1, min_rx=0., max_rx=4e-3, min_ry=0., max_ry=4e-3, min_sagitta=0., max_sagitta=2e-3)
def 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)
def 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=[])
ComponentAccumulator PixelDefectsEmulatorAlgCfg(flags, str name="PixelDefectsEmulatorAlg", **dict kwargs)
def 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")
def combineModuleDefects(defects)
ComponentAccumulator ITkPixelDefectsEmulatorAlgCfg(flags, str name="ITkPixelDefectsEmulatorAlg", **dict kwargs)
some useful constants -------------------------------------------------—
def quadProb(circuit_prob)
def emulateITkPixelDefectsPoisson(flags, cfg, FrontEndCCDefectProb=0.1, PixelDefectProb=1e-2, ModuleDefectProb=0., CornerDefectProb=0., NoiseProb=0., RngPerDefectType=False, DefectsInputFiles=[], DefectsOutputFile=None, PropagateDefectsToStatus=True, HistogramFileName=None)
def makeITkPixelNoise(noiseProb=0.)
def 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)
def poissonFractions(cc_defect_prob=1e-1, max_n=5)
def 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)