22 if flags.Trigger.FPGATrackSim.GenScan.initialLayerStudy:
23 cutset = {
"rin": flags.Trigger.FPGATrackSim.GenScan.rin,
24 "rout": flags.Trigger.FPGATrackSim.GenScan.rout,
25 "parBins": flags.Trigger.FPGATrackSim.GenScan.parBins,
26 "parMin": flags.Trigger.FPGATrackSim.GenScan.parMin,
27 "parMax": flags.Trigger.FPGATrackSim.GenScan.parMax,
28 "parSet": flags.Trigger.FPGATrackSim.GenScan.parSet
30 log.info(
"Running initial layer study, taking FPGATrackSimBinning cuts from flags")
32 elif flags.Trigger.FPGATrackSim.GenScan.layerStudyCutFile:
33 if flags.Trigger.FPGATrackSim.oldRegionDefs:
34 cutset = importlib.import_module(flags.Trigger.FPGATrackSim.GenScan.layerStudyCutFile).cuts[flags.Trigger.FPGATrackSim.region]
38 relpath = os.path.join(flags.Trigger.FPGATrackSim.mapsDir, flags.Trigger.FPGATrackSim.GenScan.layerStudyCutFile +
".py")
39 abspath = unixtools.find_datafile(relpath, pathlist=os.getenv(
"CALIBPATH").
split(
":"))
40 spec=importlib.util.spec_from_file_location(
"FPGATrackSimGenScanCuts", abspath)
42 log.fatal(
"Failed to load cuts file")
43 cutmodule = importlib.util.module_from_spec(spec)
44 spec.loader.exec_module(cutmodule)
45 cutset=cutmodule.cuts[flags.Trigger.FPGATrackSim.region]
46 log.info(
"Running layer study using configured cuts file")
49 log.fatal(
"Must either set initialLayerStudy=True or set layerStudyCutFile to the name of a cut file!")
52 BinnnedHits = CompFactory.FPGATrackSimBinnedHits(
"BinnedHits_LayerStudy")
53 BinnnedHits.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
54 BinnnedHits.FPGATrackSimEventSelectionSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimEventSelectionSvcCfg(flags))
57 BinTool = CompFactory.FPGATrackSimBinTool(
"BinTool_LayerStudy")
58 BinTool.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
63 if (cutset[
"parSet"]==
"PhiSlicedKeyLyrPars"):
64 BinDesc = CompFactory.FPGATrackSimKeyLayerBinDesc(
"KeyLayerBinDescLayerStudy")
65 BinDesc.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
66 BinDesc.rin=cutset[
"rin"]
67 BinDesc.rout=cutset[
"rout"]
70 step1 = CompFactory.FPGATrackSimBinStep(
"PhiBinning")
71 step1.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
72 step1.parBins = [1,1,cutset[
"parBins"][2],cutset[
"parBins"][3],cutset[
"parBins"][4]]
73 step2 = CompFactory.FPGATrackSimBinStep(
"FullBinning")
74 step2.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
75 step2.parBins = cutset[
"parBins"]
76 binsteps = [step1,step2]
78 log.fatal(
"Unknown Binning Setup: ",cutset[
"parSet"])
80 BinTool.BinDesc = BinDesc
81 BinTool.Steps = binsteps
85 BinTool.d0FractionalPadding =0.05
86 BinTool.z0FractionalPadding =0.05
87 BinTool.etaFractionalPadding =0.05
88 BinTool.phiFractionalPadding =0.05
89 BinTool.qOverPtFractionalPadding =0.05
90 BinTool.parMin = cutset[
"parMin"]
91 BinTool.parMax = cutset[
"parMax"]
92 BinnnedHits.BinTool = BinTool
94 result.setPrivateTools(BinnnedHits)