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

Functions

 L1CaloMenuCfg (flags)
 fromRunArgs (runArgs)

Function Documentation

◆ fromRunArgs()

LArSCDumperSkeleton.fromRunArgs ( runArgs)

Definition at line 39 of file LArSCDumperSkeleton.py.

39def fromRunArgs(runArgs):
40
41 from AthenaCommon.Logging import logging
42 mlog_SCD = logging.getLogger( 'LArSCDumpSkeleton' )
43
44 from AthenaConfiguration.AllConfigFlags import initConfigFlags
45 flags=initConfigFlags()
46
47 from LArCafJobs.LArSCDumperFlags import addSCDumpFlags
48 addSCDumpFlags(flags)
49
50 commonRunArgsToFlags(runArgs, flags)
51
52 processPreInclude(runArgs, flags)
53 processPreExec(runArgs, flags)
54
55 flags.Input.Files=runArgs.inputBSFile
56 flags.LArSCDump.outputNtup=runArgs.outputNTUP_SCMONFile
57
58 # real geom not working yet
59 flags.LArSCDump.doGeom=False
60
61 if hasattr(runArgs,"ETThresh"):
62 flags.LArSCDump.ETThresh=float(runArgs.ETThresh)
63
64 if hasattr(runArgs,"ETThreshMain"):
65 flags.LArSCDump.ETThreshMain=float(runArgs.ETThreshMain)
66
67 from LArConditionsCommon.LArRunFormat import getLArDTInfoForRun
68 try:
69 runinfo=getLArDTInfoForRun(flags.Input.RunNumbers[0], connstring="COOLONL_LAR/CONDBR2")
70 except Exception:
71 mlog_SCD.warning("Could not get DT run info, using defaults !")
72 flags.LArSCDump.doEt=True
73 flags.LArSCDump.nSamples=5
74 flags.LArSCDump.nEt=1
75 CKeys=["SC_ET"]
76 fw=5
77 else:
78 fw=runinfo.FWversion()
79 CKeys=[]
80 flags.LArSCDump.digitsKey=""
81 if hasattr(runArgs,"doPEBStream") and runArgs.doPEBStream:
82 for i in range(0,len(runinfo.streamTypesPEB())):
83 if runinfo.streamTypesPEB()[i] == "SelectedEnergy":
84 CKeys += ["SC_ET_ID"]
85 flags.LArSCDump.doEt=True
86 flags.LArSCDump.nEt=runinfo.streamLengthsPEB()[i]
87 elif runinfo.streamTypesPEB()[i] == "Energy":
88 CKeys += ["SC_ET"]
89 flags.LArSCDump.doEt=True
90 flags.LArSCDump.nEt=runinfo.streamLengthsPEB()[i]
91 elif runinfo.streamTypesPEB()[i] == "RawADC":
92 flags.LArSCDump.digitsKey="SC"
93 flags.LArSCDump.nSamples=runinfo.streamLengthsPEB()[i]
94 elif runinfo.streamTypesPEB()[i] == "ADC":
95 CKeys += ["SC_ADC_BAS"]
96 flags.LArSCDump.nSamples=runinfo.streamLengthsPEB()[i]
97 else:
98 for i in range(0,len(runinfo.streamTypes())):
99 if runinfo.streamTypes()[i] == "SelectedEnergy":
100 CKeys += ["SC_ET_ID"]
101 flags.LArSCDump.doEt=True
102 flags.LArSCDump.nEt=runinfo.streamLengths()[i]
103 elif runinfo.streamTypes()[i] == "Energy":
104 CKeys += ["SC_ET"]
105 flags.LArSCDump.doEt=True
106 flags.LArSCDump.nEt=runinfo.streamLengths()[i]
107 elif runinfo.streamTypes()[i] == "RawADC":
108 flags.LArSCDump.digitsKey="SC"
109 flags.LArSCDump.nSamples=runinfo.streamLengths()[i]
110 elif runinfo.streamTypes()[i] == "ADC":
111 CKeys += ["SC_ADC_BAS"]
112 flags.LArSCDump.nSamples=runinfo.streamLengths()[i]
113
114 finally:
115 flags.LArSCDump.doRawChan=True
116 flags.LArSCDump.fillNoisyRO=False
117 CKeys+=["LArRawChannels"]
118
119 mlog_SCD.debug("CKeys generated %s",str(CKeys))
120
121 flags.Trigger.triggerConfig = 'DB'
122 flags.Trigger.L1.doCTP = True
123 flags.Trigger.L1.doMuon = False
124 flags.Trigger.L1.doCalo = False
125 flags.Trigger.L1.doTopo = False
126
127 flags.Trigger.enableL1CaloLegacy = True
128 flags.Trigger.enableL1CaloPhase1 = True
129
130 # To respect --athenaopts
131 flags.fillFromArgs()
132
133 flags.lock()
134
135 cfg=MainServicesCfg(flags)
136 cfg.merge(L1CaloMenuCfg(flags))
137
138 from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
139 tdt = cfg.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
140
141 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
142 cfg.merge(LArGMCfg(flags))
143
144 if fw==6:
145 from IOVDbSvc.IOVDbSvcConfig import addOverride
146 cfg.merge(addOverride(flags,"/LAR/Identifier/LatomeMapping","LARIdentifierLatomeMapping-fw6"))
147
148 if flags.LArSCDump.doBC:
149 # FIXME should be SC version
150 from LArBadChannelTool.LArBadChannelConfig import LArBadFebCfg, LArBadChannelCfg
151 cfg.merge(LArBadChannelCfg(flags))
152 cfg.merge(LArBadFebCfg(flags))
153
154 from LArCellRec.LArTimeVetoAlgConfig import LArTimeVetoAlgCfg
155 cfg.merge(LArTimeVetoAlgCfg(flags))
156
157 cfg.merge(LArSC2NtupleCfg(flags, AddBadChannelInfo=flags.LArSCDump.doBC, AddFEBTempInfo=False, isSC=True, isFlat=False,
158 OffId=flags.LArSCDump.doOfflineId, AddHash=flags.LArSCDump.doHash, AddCalib=flags.LArSCDump.doCalib,
159 RealGeometry=flags.LArSCDump.doGeom, ExpandId=flags.LArSCDump.expandId, BadChanKey="LArBadChannelSC", # from LArCond2NtupleBase
160 NSamples=flags.LArSCDump.nSamples, FTlist=[], FillBCID=flags.LArSCDump.doBCID, ContainerKey=flags.LArSCDump.digitsKey, # from LArDigits2Ntuple
161 SCContainerKeys=CKeys, OverwriteEventNumber = flags.LArSCDump.overwriteEvN, Net=flags.LArSCDump.nEt,
162 FillRODEnergy = flags.LArSCDump.doRawChan, FillLB = True, FillTriggerType = True,
163 ETThreshold = flags.LArSCDump.ETThresh, ETThresholdMain = flags.LArSCDump.ETThreshMain, ADCThreshold=int(runArgs.ADCThresh),
164 TrigNames=["L1_EM3","L1_EM7","L1_EM15","L1_EM22VHI","L1_eEM5","L1_eEM15","L1_eEM22M"],
165 TrigDecisionTool=tdt, OutputLevel=3))
166
167 if os.path.exists(flags.LArSCDump.outputNtup):
168 os.remove(flags.LArSCDump.outputNtup)
169 from AthenaConfiguration.ComponentFactory import CompFactory
170 cfg.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+flags.LArSCDump.outputNtup+"' OPT='NEW'" ]))
171 cfg.setAppProperty("HistogramPersistency","ROOT")
172
173
174 processPostInclude(runArgs, flags, cfg)
175 processPostExec(runArgs, flags, cfg)
176
177 #example how to dump the stores
178 #cfg.getService("StoreGateSvc").Dump=True
179 #from AthenaCommon.Constants import DEBUG
180 #cfg.getService("MessageSvc").OutputLevel=DEBUG
181 # Run the final accumulator
182 sc = cfg.run()
183 sys.exit(not sc.isSuccess())

◆ L1CaloMenuCfg()

LArSCDumperSkeleton.L1CaloMenuCfg ( flags)

Definition at line 11 of file LArSCDumperSkeleton.py.

11def L1CaloMenuCfg(flags):
12
13
14 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
15
16 acc=ComponentAccumulator()
17 from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg, HLTConfigSvcCfg, L1PrescaleCondAlgCfg, HLTPrescaleCondAlgCfg
18 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1TriggerByteStreamDecoderCfg
19
20 acc.merge( L1TriggerByteStreamDecoderCfg(flags) )
21 acc.merge( L1ConfigSvcCfg(flags) )
22 acc.merge( HLTConfigSvcCfg(flags) )
23 acc.merge( L1PrescaleCondAlgCfg(flags) )
24 acc.merge( HLTPrescaleCondAlgCfg(flags) )
25
26
27 from TrigConfigSvc.TrigConfigSvcCfg import BunchGroupCondAlgCfg
28 acc.merge( BunchGroupCondAlgCfg( flags ) )
29
30 from AthenaConfiguration.ComponentFactory import CompFactory
31 tdm = CompFactory.getComp('TrigDec::TrigDecisionMakerMT')()
32 tdm.doL1 = True
33 tdm.doHLT = False
34 acc.addEventAlgo( tdm, 'AthAlgSeq' )
35
36 return acc
37
38