4 Emulating pixel defects by dropping elements from the RDO input container
6 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory
import CompFactory
16 from SGComps.AddressRemappingConfig
import AddressRemappingCfg
17 renames = [
'%s#%s->%s' % (
'PixelRDO_Container', InputKey, f
"{InputKey}_ORIG") ]
24 def DefectsHistSvcCfg(flags, HistogramGroup: str=
"PixelDefects", FileName: str=
'pixel_defects.root') -> ComponentAccumulator:
26 if HistogramGroup
is not None and len(HistogramGroup) > 0
and FileName
is not None and len(FileName) > 0 :
27 print(
"DEBUG DefectsHistSvcCfg",HistogramGroup,FileName,[f
"{HistogramGroup} DATAFILE='{FileName}', OPT='RECREATE'"])
28 histSvc = CompFactory.THistSvc(Output = [f
"{HistogramGroup} DATAFILE='{FileName}', OPT='RECREATE'"] )
29 acc.addService(histSvc)
37 name: str =
"PixelDefectsEmulatorCondAlg",
38 **kwargs: dict) -> ComponentAccumulator:
40 kwargs.setdefault(
"DefectProbability", 1e-4)
41 kwargs.setdefault(
"CoreColumnDefectProbability", 0.)
42 kwargs.setdefault(
"PixelDetEleCollKey",
"PixelDetectorElementCollection")
43 kwargs.setdefault(
"WriteKey",
"PixelEmulatedDefects")
44 kwargs.setdefault(
"HistogramGroupName",
"")
46 acc.addCondAlgo(CompFactory.InDet.PixelDefectsEmulatorCondAlg(name,**kwargs))
50 name: str =
"ITkPixelDefectsEmulatorCondAlg",
51 **kwargs: dict) -> ComponentAccumulator:
52 kwargs.setdefault(
"DefectProbability", 1e-4)
55 def probColGroupDefect(prob_col_group_defect_per_mod, n_col_groups) :
57 return 1. -
pow( (1-prob_col_group_defect_per_mod), 1/(n_col_groups))
58 kwargs.setdefault(
"CoreColumnDefectProbability", probColGroupDefect(.1, 400/8.) )
59 kwargs.setdefault(
"PixelDetEleCollKey",
"ITkPixelDetectorElementCollection")
60 kwargs.setdefault(
"WriteKey",
"ITkPixelEmulatedDefects")
66 name: str =
"ITkPixelDefectsEmulatorAlg",
67 **kwargs: dict) -> ComponentAccumulator:
70 if "InputKey" not in kwargs :
73 kwargs.setdefault(
"InputKey",
"PixelRDOs_ORIG")
75 if "EmulatedDefectsKey" not in kwargs :
78 kwargs.setdefault(
"EmulatedDefectsKey",
"PixelEmulatedDefects")
79 kwargs.setdefault(
"OutputKey",
"PixelRDOs")
80 kwargs.setdefault(
"HistogramGroupName",
"")
82 acc.addEventAlgo(CompFactory.InDet.PixelDefectsEmulatorAlg(name,**kwargs))
86 name: str =
"ITkPixelDefectsEmulatorAlg",
87 **kwargs: dict) -> ComponentAccumulator:
89 if "InputKey" not in kwargs :
92 kwargs.setdefault(
"InputKey",
"ITkPixelRDOs_ORIG")
94 if "EmulatedDefectsKey" not in kwargs :
97 kwargs.setdefault(
"EmulatedDefectsKey",
"ITkPixelEmulatedDefects")
98 kwargs.setdefault(
"OutputKey",
"ITkPixelRDOs")
100 kwargs.setdefault(
"HistogramGroupName",
"")
102 acc.addEventAlgo(CompFactory.InDet.PixelDefectsEmulatorAlg(name,**kwargs))
106 if __name__ ==
"__main__":
110 from AthenaConfiguration.Enums
import ProductionStep
111 flags.Common.ProductionStep = ProductionStep.Simulation
112 from AthenaConfiguration.TestDefaults
import defaultGeometryTags, defaultConditionsTags
113 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN4
114 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN4_MC
115 flags.GeoModel.Align.Dynamic =
False
116 flags.Input.Files = [
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/RDO/ATLAS-P2-RUN4-03-00-00/mc21_14TeV.601229.PhPy8EG_A14_ttbar_hdamp258p75_SingleLep.recon.RDO.e8481_s4149_r14700/RDO.33629020._000047.pool.root.1']
118 flags.Detector.GeometryITkPixel =
True
119 flags.Detector.GeometryITkStrip =
True
120 flags.Detector.GeometryBpipe =
True
121 flags.Detector.GeometryCalo =
False
123 flags.Concurrency.NumThreads = 8
124 flags.Concurrency.NumConcurrentEvents = 8
126 flags.Exec.MaxEvents = 10
131 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
133 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
137 from ActsConfig.ActsGeometryConfig
import ActsTrackingGeometrySvcCfg
140 RunConsistencyChecks=
False,
141 ObjDebugOutput=
False))
146 acc.printConfig(withDetails=
True, summariseProps=
True,printDefaults=
True)