ATLAS Offline Software
TBH6ByteStream-Monitor-EventStorage.py
Go to the documentation of this file.
1 include( "AthenaCommon/Atlas.UnixStandardJob.py" )
2 
3 include( "DetDescrCnvSvc/DetStore_joboptions.py" )
4 
5 DetDescrCnvSvc = Service( "DetDescrCnvSvc" )
6 DetDescrCnvSvc.DetectorManagers+= ["CaloTTDescrManager"]
7 DetDescrCnvSvc.DetectorManagers += [ "CaloMgr" ]
8 
9 # include( "LArDetMgrDetDescrCnv/LArDetMgrDetDescrCnv_joboptions.py" )
10 # include( "LArDetMgrDetDescrCnv/LArDetMgrDetDescrCnv_H8_joboptions.py" )
11 include( "LArDetMgrDetDescrCnv/LArDetMgrDetDescrCnv_H6_joboptions.py" )
12 #
13 
14 from LArRecUtils.LArADC2MeVCondAlgDefault import LArADC2MeVCondAlgDefault
15 LArADC2MeVCondAlgDefault()
16 
17 #---- ByteStream-Files input --------------------
18 #
19 
20 # include( "TBCnv/TBReadH6BS_jobOptions.py" )
21 include( "TBCnv/TBReadH6BS_EventStorage_jobOptions.py" )
22 ByteStreamInputSvc = Service( "ByteStreamInputSvc" )
23 
24 # ByteStreamInputSvc.InputDirectory += ["/scratchdisk1/h6data"]
25 ByteStreamInputSvc.InputDirectory += ["/castor/cern.ch/atlas/testbeam/cbt-ec2/phys"]
26 ByteStreamInputSvc.FilePrefix += ["daq_beamDAQ_H6"]
27 
28 ToolSvc.TBByteStreamCnvTool.Dump = FALSE
29 ToolSvc.TBByteStreamCnvTool.OutputLevel = WARNING
30 
31 #--- Monitoring ---------------------------
32 
33 theApp.TopAlg += [ "TBAlgoSequencer/Seq1" ]
34 
35 theApp.Dlls += [ "AthenaMonitoring"]
36 
37 Seq1 = Algorithm( "Seq1" )
38 
39 Seq1.SubAlgorithms = [
40  "TBEventStreamer/EventInfoStreamer",
41  "AthenaMon/TBMon0",
42  "TBEventStreamer/BeamStreamer",
43  "TBBPCRec/TBBPCRec",
44  "TBPhaseRec/TBPhaseRec",
45  "TBScintillatorRec/TBScintRec",
46  "TBTailCatcherRec/TBTailCatcherRec",
47  "TBMWPCRec/TBMWPCRec",
48  "AthenaMon/TBMon1",
49  "AthenaMon/LArMon1",
50  "LArRawChannelSimpleBuilder/TBLArRawChannelBuilder",
51  "CaloCellMaker/CaloCellMaker",
52  "AthenaMon/CaloCellMon",
53  "AthenaMon/CaloMonitor",
54  "AthenaMon/PhaseMon"
55  ]
56 
57 EventInfoStreamer = Algorithm( "EventInfoStreamer" )
58 EventInfoStreamer.ToolNames = [ "TBEventInfoStreamerTool/EventTypeSelector" ]
59 # possible selection: "Physics", "Special", "f/e_Calibration",
60 # "Random", "BPC_Calibration", default: "Physics"
61 EventInfoStreamer.EventTypeSelector.AcceptedTypes=["Physics"]
62 
63 #
64 BeamStreamer = Algorithm( "BeamStreamer" )
65 #
66 BeamStreamer.ToolNames = [ "TBPatternUnitStreamerTool/BitSelector" ]
67 #
68 BeamStreamer.BitSelector.AcceptPattern = [ "S1", "S2", "S3" ]
69 BeamStreamer.BitSelector.RejectPattern = [
70 # "VetoLeft",
71 # "VetoRight",
72 # "VetoUp",
73 # "VetoDown",
74 # "HoleVeto",
75  "EarlyPU",
76  "LatePU"
77  ]
78 
79 TBMon0 = Algorithm("TBMon0")
80 TBMon0.AthenaMonTools += ["TBTriggerPatternUnitMonTool/PatternUnitMon"]
81 ToolSvc.PatternUnitMon.FakeDetectors = FALSE
82 ToolSvc.PatternUnitMon.TriggFlags = [0x00000001, # S1 accept
83  0x00000002, # S2 accept
84  0x00000004, # S3 accept
85  0x00000008, # B2 accept
86  0x00000010, # VetoLeft
87  0x00000020, # VetoRight
88  0x00000040, # VetoDown
89  0x00000080, # VetoUp
90  0x00000100, # Mu 1 Left
91  0x00000200, # Mu 1 Right
92  0x00000400, # Mu 2 Left
93  0x00000800, # Early PileUp
94  0x00001000, # Late PileUp
95  0x00002000, # In Spill Tag
96  0x00004000, # Off Spill Tag
97  0x00008000, # Cedar 6 of 8 segments
98  0x00010000, # Mu 2 Right
99  0x00020000, # Hole Counter
100  0x00040000, # W1*W2 coincidence
101  0x00080000, # B1 accept
102  0x00100000, # Scaler Reset Tag
103  0x08000000, # Cedar 7 of 8 segments
104  0x10000000, # Cedar 8 of 8 segments
105  ]
106 
107 TBBPCRec = Algorithm("TBBPCRec")
108 include( "TBRec/H6BPCRec_jobOptions.py" )
109 TBBPCRec.OutputLevel = INFO
110 TBBPCRec.CalibFileName = "H6BPCCalib.txt"
111 
112 TBPhaseRec = Algorithm("TBPhaseRec")
113 include( "TBRec/H6PhaseRec_jobOptions.py" )
114 TBPhaseRec.OutputLevel = INFO
115 
116 TBScintRec = Algorithm("TBScintRec")
117 include( "TBRec/H6ScintRec_jobOptions.py" )
118 TBScintRec.OutputLevel = INFO
119 
120 TBTailCatcherRec = Algorithm("TBTailCatcherRec")
121 include( "TBRec/H6TailCatcherRec_jobOptions.py" )
122 
123 TBMWPCRec = Algorithm("TBMWPCRec")
124 include( "TBRec/H6MWPCRec_jobOptions.py" )
125 
126 TBLArRawChannelBuilder = Algorithm("TBLArRawChannelBuilder");
127 TBLArRawChannelBuilder.OutputLevel = INFO
128 TBLArRawChannelBuilder.maxSamp = 3
129 TBLArRawChannelBuilder.RecoMode = "CUBIC"
130 TBLArRawChannelBuilder.CubicAdcCut = 50.
131 TBLArRawChannelBuilder.OutputLevel = INFO
132 
133 include ("CaloRec/CaloCellMakerFromRaw_H6_jobOptions.py" )
134 
135 theApp.Dlls += [ "TBMonitoring" ]
136 theApp.Dlls += [ "LArMonitoring" ]
137 theApp.Dlls += [ "CaloMonitoring" ]
138 
139 TBMon1 = Algorithm( "TBMon1" )
140 LArMon1 = Algorithm( "LArMon1" )
141 
142 tdcbinnum = 100
143 tdcmin = 0
144 tdcmax = 2047
145 
146 bpcmin = -70*mm
147 bpcmax = 70*mm
148 bpcbinnum = 70
149 
150 # ------------- BPC Monitor -------
151 TBMon1.AthenaMonTools += ["TBBPCMonTool/BPCmon"]
152 ToolSvc.BPCmon.MonitorBPC = TRUE
153 ToolSvc.BPCmon.MonitorBPCRaw = TRUE
154 ToolSvc.BPCmon.FakeDetectors = FALSE
155 # H6 BPCs
156 ToolSvc.BPCmon.BPCNames = ["BPC0","BPC1","BPC2","BPC3","BPC4","BPC5"]
157 ToolSvc.BPCmon.BPCMaxPos = bpcmax
158 ToolSvc.BPCmon.BPCMinPos = bpcmin
159 ToolSvc.BPCmon.BPCBinNum = bpcbinnum
160 ToolSvc.BPCmon.TDCBinNum = tdcbinnum
161 ToolSvc.BPCmon.TDCMax = tdcmax
162 ToolSvc.BPCmon.TDCMin = tdcmin
163 ToolSvc.BPCmon.BookAtFirstEvent = TRUE # If false, histos are booked before 1st event (no run number in histo title)
164 
165 # ------------- Scint Monitor -------
166 TBMon1.AthenaMonTools += ["TBScintillatorMonTool/Scintmon"]
167 ToolSvc.Scintmon.FakeDetectors = FALSE
168 # H6 scint names :
169 ToolSvc.Scintmon.ScintNames = ["S1","S2","S3", "B",
170  "Veto","Halo",
171  "muon1","muon2","muon3","muon4",
172  "muon5","muon6","muon7","muon8"]
173 ToolSvc.Scintmon.BookAtFirstEvent = TRUE # If false, histos are booked before 1st event (no run number in histo title)
174 ToolSvc.Scintmon.TDCBinNum = tdcbinnum
175 ToolSvc.Scintmon.TDCMax = tdcmax
176 ToolSvc.Scintmon.TDCMin = tdcmin
177 ToolSvc.Scintmon.OutputLevel = INFO
178 
179 # ------------- MWPC Monitor -------
180 TBMon1.AthenaMonTools += ["TBMWPCMonTool/MWPCmon"]
181 ToolSvc.MWPCmon.MonitorMWPC = TRUE
182 ToolSvc.MWPCmon.MonitorMWPCRaw = TRUE
183 #ToolSvc.MWPCmon.FakeDetectors = FALSE
184 
185 
186 # ------------- TailCatcher Monitor -------
187 TBMon1.AthenaMonTools += ["TBTailCatcherRawMonTool/TCmon"]
188 ToolSvc.TCmon.MonitorTailCatcherRaw = TRUE
189 ToolSvc.TCmon.MonitorTailCatcherRaw = TRUE
190 ToolSvc.TCmon.OutputLevel = INFO
191 
192 #------------- ADC Monitor -------
193 TBMon1.AthenaMonTools += ["TBADCRawMonTool/ADCmon"]
194 ToolSvc.ADCmon.TestADCMonTool = FALSE
195 include( "TBCnv/H6ADCChannelNames.py" ) # list of ADC
196 ToolSvc.ADCmon.ADCBinNum = tdcbinnum
197 ToolSvc.ADCmon.ADCMax = tdcmax
198 ToolSvc.ADCmon.ADCMin = tdcmin
199 
200 #------------- TDC Monitor -------
201 TBMon1.AthenaMonTools += ["TBTDCRawMonTool/TDCmon"]
202 ToolSvc.TDCmon.TestTDCMonTool = FALSE
203 include( "TBCnv/H6TDCChannelNames.py" ) # list of TDC
204 ToolSvc.TDCmon.TDCBinNum = tdcbinnum
205 ToolSvc.TDCmon.TDCMax = tdcmax
206 ToolSvc.TDCmon.TDCMin = tdcmin
207 
208 #------------- LArDigitMonitoring -------------
209 LArMon1.AthenaMonTools += ["LArDigMonTool<LArDigitContainer>/pedmon0"]
210 ToolSvc.pedmon0.histoPathBase = "/stat/pedsamp0"
211 ToolSvc.pedmon0.digitKey = "FREE"
212 ToolSvc.pedmon0.maxSamp = 3
213 ToolSvc.pedmon0.pedMode = "SAMPLE"
214 ToolSvc.pedmon0.pedSamp = 0
215 ToolSvc.pedmon0.adcCut = 50
216 ToolSvc.pedmon0.OutputLevel = INFO
217 
218 #------------- LArDigitTBPhaseMonitoring -------------
219 from LArCabling.LArCablingAccess import LArOnOffIdMapping
220 LArOnOffIdMapping()
221 
222 LArMon1.AthenaMonTools += ["LArDigTBPhaseMonTool<LArDigitContainer>/LArDigitTBTDC0"]
223 ToolSvc.LArDigitTBTDC0.histoPathBase = "/stat/LArDigitTBTDC0"
224 ToolSvc.LArDigitTBTDC0.digitKey = "FREE"
225 ToolSvc.LArDigitTBTDC0.TBPhaseName = "TBPhase"
226 ToolSvc.LArDigitTBTDC0.pedMode = "SAMPLE"
227 ToolSvc.LArDigitTBTDC0.pedSamp = 0
228 #ToolSvc.LArDigitTBTDC0.OutputLevel = INFO
229 
230 #------------- CaloCell Monitoring ---------
231 CaloCellMon = Algorithm( "CaloCellMon")
232 
233 CaloCellMon.AthenaMonTools = ["CaloCellMonitoringTool/calocelltool"]
234 ToolSvc.calocelltool.OutputLevel = INFO
235 
236 #------------- CaloResponse Monitoring ---------
237 CaloMonitor = Algorithm( "CaloMonitor" )
238 CaloMonitor.AthenaMonTools += [ "TBCaloResponseMonTool/calMonitor" ]
239 ToolSvc.calMonitor.OutputLevel = INFO
240 # output
241 ToolSvc.calMonitor.histoPathBase = "/stat/calomon"
242 # input
243 ToolSvc.calMonitor.CellContainerName = "AllCalo" # CaloCellContainer
244 ToolSvc.calMonitor.BPCContainerName = "BPCCont" # TBBPCCont
245 #
246 #IncludedCalos: possible are LAREM, LARHEC, LARFCAL, TILE, or
247 # H6CALO = LAREM, LARHEC, LARFCAL
248 # H8CALO = LAREM, TILE
249 #
250 H8CALO = [ "LAREM", "TILE" ]
251 H6CALO = [ "LAREM", "LARHEC", "LARFCAL" ]
252 ToolSvc.calMonitor.IncludedCalos = H6CALO
253 
254 # IncludedSamplings: possible are PreSamplerB, EMB1, EMB2, EMB3,
255 # PreSamplerE, EME1, EME2, EME3,
256 # TileBar0, TileBar1, TileBar2,
257 # TileGap1, TileGap2, TileGap3,
258 # TileExt0, TileExt1, TileExt2,
259 # FCal1, FCal2, FCal3
260 # or
261 # H6Samplings = EME2, EME3,
262 # HEC0, HEC1, HEC2
263 # FCal1, FCal2, FCal3
264 # H8Samplings = PreSamplerB,
265 # EMB1, EMB2, EMB3,
266 # TileBar0, TileBar1, TileBar2
267 #
268 H6Samplings = [ "EME2", "EME3", "HEC0", "HEC1", "HEC2",
269  "FCal1", "FCal2", "FCal3" ]
270 H8Samplings = [ "PreSamplerB", "EMB1", "EMB2", "EMB3",
271  "TileBar0", "TileBar1", "TileBar2" ]
272 ToolSvc.calMonitor.IncludedSamplings = H6Samplings
273 # calorimeter energy histogram definitions
274 ToolSvc.calMonitor.CaloEnergyBins = 100
275 ToolSvc.calMonitor.CaloEnergyMin = -10.*GeV
276 ToolSvc.calMonitor.CaloEnergyMax = 390.*GeV
277 # calorimeter eta range
278 ToolSvc.calMonitor.CaloEtaBins = 35
279 ToolSvc.calMonitor.CaloEtaMin = 1.5
280 ToolSvc.calMonitor.CaloEtaMax = 5.0
281 # calorimeter phi range
282 ToolSvc.calMonitor.CaloPhiBins = 64
283 ToolSvc.calMonitor.CaloPhiMin = 90.*deg
284 ToolSvc.calMonitor.CaloPhiMax = 180.*deg
285 # BPC x/y ranges
286 ToolSvc.calMonitor.BPCXBins = bpcbinnum
287 ToolSvc.calMonitor.BPCXMin = bpcmin
288 ToolSvc.calMonitor.BPCXMax = bpcmax
289 ToolSvc.calMonitor.BPCYBins = bpcbinnum
290 ToolSvc.calMonitor.BPCYMin = bpcmin
291 ToolSvc.calMonitor.BPCYMax = bpcmax
292 # average profile configurations
293 ToolSvc.calMonitor.MinEventsInBin = 20
294 # display unit switches
295 ToolSvc.calMonitor.EnergyUnits = GeV
296 ToolSvc.calMonitor.LengthUnits = mm
297 ToolSvc.calMonitor.AngleUnits = rad
298 
299 #------------- Phase Monitor -------
300 PhaseMon = Algorithm( "PhaseMon" )
301 PhaseMon.AthenaMonTools = [ "TBPhaseMonTool/phaseMonitor" ]
302 ToolSvc.phaseMonitor.histoPathBase = "/stat/phasemon"
303 ToolSvc.phaseMonitor.TBTDCRawContainerName = "TDCRawCont" # TBTDCRawContainer
304 ToolSvc.phaseMonitor.CellContainerName = "AllCalo" # CaloCellContainer
305 ToolSvc.phaseMonitor.PhaseTDCNames = ["word1frag0x03chan0","word2frag0x03chan0"]
306 # IncludedSamplings: possible are PreSamplerB, EMB1, EMB2, EMB3,
307 # PreSamplerE, EME1, EME2, EME3,
308 # TileBar0, TileBar1, TileBar2,
309 # TileGap1, TileGap2, TileGap3,
310 # TileExt0, TileExt1, TileExt2,
311 # FCal1, FCal2, FCal3
312 # or
313 # H6Samplings = EME2, EME3,
314 # HEC0, HEC1, HEC2
315 # FCal1, FCal2, FCal3
316 # H8Samplings = PreSamplerB,
317 # EMB1, EMB2, EMB3,
318 # TileBar0, TileBar1, TileBar2
319 #
320 # H6Samplings = [ "EME2", "EME3", "HEC0", "HEC1", "HEC2", "FCal1", "FCal2", "FCal3" ]
321 # H8Samplings = [ "PreSamplerB", "EMB1", "EMB2", "EMB3", "TileBar0", "TileBar1", "TileBar2" ]
322 ToolSvc.phaseMonitor.IncludedSamplings = H6Samplings
323 ToolSvc.phaseMonitor.TBPhaseName = "TBPhase"
324 ToolSvc.phaseMonitor.EnergyCut = 5.*GeV
325 ToolSvc.phaseMonitor.TDCBins = 80
326 ToolSvc.phaseMonitor.TDCMin = 200
327 ToolSvc.phaseMonitor.TDCMax = 1000
328 ToolSvc.phaseMonitor.TDCRightMin = 200
329 ToolSvc.phaseMonitor.TDCRightMax = 300
330 ToolSvc.phaseMonitor.TDCLeftMin = -300
331 ToolSvc.phaseMonitor.TDCLeftMax = -200
332 ToolSvc.phaseMonitor.TimeBins = 100
333 # ToolSvc.phaseMonitor.TimeMin = 180.*ns
334 # ToolSvc.phaseMonitor.TimeMax = 220.*ns
335 ToolSvc.phaseMonitor.TimeMin = 45.*ns
336 ToolSvc.phaseMonitor.TimeMax = 95.*ns
337 ToolSvc.phaseMonitor.PhaseBins = 70
338 ToolSvc.phaseMonitor.PhaseMin = -5.*ns
339 ToolSvc.phaseMonitor.PhaseMax = 30.*ns
340 ToolSvc.phaseMonitor.TimeUnits = ns
341 ToolSvc.phaseMonitor.OutputLevel = INFO
342 
343 # -- use root histos --
344 theApp.Dlls += [ "RootHistCnv" ]
345 theApp.HistogramPersistency = "ROOT"
346 HistogramPersistencySvc = Service( "HistogramPersistencySvc" )
347 
348 # -- Use auditors --
349 #theApp.Dlls += [ "GaudiAud" ]
350 # write out a summary of the time spent
351 #
352 #theAuditorSvc = AuditorSvc()
353 #theAuditorSvc.Auditors += [ "ChronoAuditor"]
354 # write out a short message upon entering or leaving each algorithm
355 #
356 # AuditorSvc.Auditors += { "NameAuditor" };
357 #-------------------------------------------------------------------------
358 # user driving parameters
359 #
360 # Number of events to be processed (default is 10)
361 theApp.EvtMax = 1000
362 
363 # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
364 MessageSvc = Service( "MessageSvc" )
365 MessageSvc.OutputLevel = INFO
366 
367 AthenaEventLoopMgr = Service( "AthenaEventLoopMgr" )
368 AthenaEventLoopMgr.OutputLevel = WARNING
369 
370 # Dump all objects available
371 # StoreGateSvc = Service( "StoreGateSvc" )
372 # StoreGateSvc.Dump = TRUE
373 
374 ByteStreamInputSvc.RunNumber = [1367]
375 HistogramPersistencySvc.OutputFile = "run1367.root"
python.FakeAthena.Algorithm
def Algorithm(name)
Definition: FakeAthena.py:41
python.FakeAthena.Service
def Service(name)
Definition: FakeAthena.py:38
python.Include.include
include
Definition: Include.py:319