ATLAS Offline Software
Functions
LArSuperCellMonAlg Namespace Reference

Functions

def LArSuperCellMonConfig (flags, **kwargs)
 
def LArSuperCellMonConfigCore (helper, algclass, flags, isCosmics=False, isMC=False, algname='LArSuperCellMonAlg', RemoveMasked=True)
 

Function Documentation

◆ LArSuperCellMonConfig()

def LArSuperCellMonAlg.LArSuperCellMonConfig (   flags,
**  kwargs 
)

Definition at line 5 of file LArSuperCellMonAlg.py.

5 def LArSuperCellMonConfig(flags, **kwargs):
6  from AthenaCommon.Logging import logging
7  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
8  from AthenaConfiguration.ComponentFactory import CompFactory
9  mlog = logging.getLogger( 'LArSuperCellMonConfig' )
10  mask=True
11 
12  from AthenaMonitoring.AthMonitorCfgHelper import AthMonitorCfgHelper
13  helper = AthMonitorCfgHelper(flags,'LArSuperCellMonAlgCfg')
14 
15  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
17 
18  if not flags.DQ.enableLumiAccess and not flags.DQ.Environment == 'online':
19  mlog.warning('This algo needs Lumi access, returning empty config')
20  return cfg
21 
22  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
23  cfg.merge(LArGMCfg(flags))
24  from TileGeoModel.TileGMConfig import TileGMCfg
25  cfg.merge(TileGMCfg(flags))
26 
27  from DetDescrCnvSvc.DetDescrCnvSvcConfig import DetDescrCnvSvcCfg
28  cfg.merge(DetDescrCnvSvcCfg(flags))
29 
30  if flags.Common.isOnline:
31  cfg.addCondAlgo(CompFactory.CaloSuperCellAlignCondAlg('CaloSuperCellAlignCondAlg'))
32 
33  from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
34  cfg.merge(BunchCrossingCondAlgCfg(flags))
35 
36  from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
37  cfg.merge(CaloNoiseCondAlgCfg(flags))
38  cfg.merge(CaloNoiseCondAlgCfg(flags,noisetype="electronicNoise"))
39 
40  cfg.merge(ByteStreamReadCfg(flags))
41  from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg
42  cfg.merge(LArRawSCDataReadingCfg(flags))
43 
44  from TrigT1CaloFexPerf.EmulationConfig import emulateSC_Cfg
45  cfg.merge(emulateSC_Cfg(flags))
46 
47  from LArCellRec.LArRAWtoSuperCellConfig import LArRAWtoSuperCellCfg
48 
49  cfg.merge(LArRAWtoSuperCellCfg(flags,SCellContainerOut="EmulatedSuperCells",mask=mask) )
50 
51  # Reco SC:
52  #get SC onl-offl mapping from DB
53  from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg
54  cfg.merge(LArOnOffIdMappingSCCfg(flags))
55 
56  # and elec. calib. coeffs
57  from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBSCCfg
58 
59  larLATOMEBuilderAlg=CompFactory.LArLATOMEBuilderAlg("LArLATOMEBuilderAlg")
60  from LArConditionsCommon.LArRunFormat import getLArDTInfoForRun
61  try:
62  runinfo=getLArDTInfoForRun(flags.Input.RunNumbers[0], connstring="COOLONL_LAR/CONDBR2")
63  streamTypes=runinfo.streamTypes()
64  except Exception as e:
65  mlog.warning("Could not get DT run info, using defaults !")
66  mlog.warning(e)
67  streamTypes=["RawADC"]
68 
69  for i in range(0,len(streamTypes)):
70  mlog.info("runinfo.streamTypes()[i]: "+str(streamTypes[i]))
71  if streamTypes[i] == "RawADC":
72  larLATOMEBuilderAlg.LArDigitKey = "SC"
73  larLATOMEBuilderAlg.isADCBas = False
74  if streamTypes[i] == "ADC":
75  larLATOMEBuilderAlg.isADCBas = True
76  larLATOMEBuilderAlg.LArDigitKey = "SC_ADC_BAS"
77 
78  cfg.addEventAlgo(larLATOMEBuilderAlg)
79  cfg.merge(LArRAWtoSuperCellCfg(flags,name="LArRAWRecotoSuperCell",mask=mask,doReco=True,SCIn="SC_ET_RECO",SCellContainerOut="SCell_ET_RECO") )
80 
81 
82  cfg.merge(LArElecCalibDBSCCfg(flags, condObjs=["Ramp","DAC2uA", "Pedestal", "uA2MeV", "MphysOverMcal", "OFC", "Shape", "HVScaleCorr"]))
83 
84 
85  #return cfg
86  algname='LArSuperCellMonAlg'
87  lArCellMonAlg=CompFactory.LArSuperCellMonAlg(algname,CaloCellContainerReco="SCell_ET_RECO",CaloCellContainerRef=flags.Trigger.L1.L1CaloSuperCellContainerName,doSCReco=True,CaloCellContainer='EmulatedSuperCells')
88 
89  if flags.Input.isMC is False and not flags.Common.isOnline:
90  from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
91  cfg.merge(LuminosityCondAlgCfg(flags))
92  from LumiBlockComps.LBDurationCondAlgConfig import LBDurationCondAlgCfg
93  cfg.merge(LBDurationCondAlgCfg(flags))
94 
95 
96  from AthenaConfiguration.Enums import BeamType
97  if flags.Beam.Type is BeamType.Cosmics:
98  algname=algname+'Cosmics'
99 
100  LArSuperCellMonConfigCore(helper, lArCellMonAlg, flags,
101  flags.Beam.Type is BeamType.Cosmics,
102  flags.Input.isMC, algname, RemoveMasked=mask)
103 
104  cfg.merge(helper.result())
105 
106  return cfg
107 
108 

◆ LArSuperCellMonConfigCore()

def LArSuperCellMonAlg.LArSuperCellMonConfigCore (   helper,
  algclass,
  flags,
  isCosmics = False,
  isMC = False,
  algname = 'LArSuperCellMonAlg',
  RemoveMasked = True 
)

Definition at line 109 of file LArSuperCellMonAlg.py.

109 def LArSuperCellMonConfigCore(helper, algclass, flags, isCosmics=False, isMC=False, algname='LArSuperCellMonAlg', RemoveMasked=True):
110 
111  # For SC binning
112  from LArMonitoring.GlobalVariables import lArDQGlobals
113 
114 
115  LArSuperCellMonAlg = helper.addAlgorithm(algclass, algname)
116 
117 
118  GroupName="LArSuperCellMon"
119  LArSuperCellMonAlg.MonGroupName = GroupName
120 
121  LArSuperCellMonAlg.EnableLumi = False
122  LArSuperCellMonAlg.CaloCellContainer = 'EmulatedSuperCells'
123  LArSuperCellMonAlg.CaloCellContainerRef = flags.Trigger.L1.L1CaloSuperCellContainerName
124  LArSuperCellMonAlg.RemoveMasked = RemoveMasked
125 
126 
127  do2DOcc = True #TMP
128  print(do2DOcc)
129 
130 
131 
132  #---single Group for non threshold histograms
133  cellMonGroup = helper.addGroup(
134  LArSuperCellMonAlg,
135  GroupName,
136  '/LAr/LArSuperCellMon_NoTrigSel/'
137 
138  )
139 
140 
141  #--define histograms
142  sc_hist_path='SC/'
143 
144 
145  cellMonGroup.defineHistogram('superCellEt;h_SuperCellEt',
146  title='Super Cell E_T [MeV]; MeV; # entries',
147  type='TH1F', path=sc_hist_path,
148  xbins = 100,xmin=0,xmax=50000)
149  cellMonGroup.defineHistogram('superCellEta;h_SuperCellEta',
150  title='Super Cell eta; #eta; # entries',
151  type='TH1F', path=sc_hist_path,
152  xbins = 100,xmin=-5,xmax=5)
153  cellMonGroup.defineHistogram('superCelltime;h_SuperCelltime',
154  title='Super Cell time [ns]; ns; # entries',
155  type='TH1F', path=sc_hist_path,
156  xbins = 100, xmin=-400,xmax=400)
157  cellMonGroup.defineHistogram('superCelltimeReco;h_SuperCelltimeReco',
158  title='Reco Super Cell time [ns]; ns; # entries',
159  type='TH1F', path=sc_hist_path,
160  xbins = 100, xmin=-400,xmax=400)
161  cellMonGroup.defineHistogram('superCellprovenance;h_SuperCellprovenance',
162  title='Super Cell provenance; bitmask ; # entries',
163  type='TH1F', path=sc_hist_path,
164  xbins = 700, xmin=0,xmax=700)
165  cellMonGroup.defineHistogram('BCID,superCellEt;h_SuperCellEt_vs_BCID',
166  title='Super Cell ET [MeV] vs BCID ; BCID from train front; %',
167  type='TH2F', path=sc_hist_path,
168  xbins = 50, xmin=0,xmax=50,
169  ybins = 80, ymin=-1000,ymax=1000)
170  cellMonGroup.defineHistogram('BCID,superCellEtRef;h_SuperCellEtRef_vs_BCID',
171  title='Super Cell ET [MeV] vs BCID ; BCID from train front; %',
172  type='TH2F', path=sc_hist_path,
173  xbins = 50, xmin=0,xmax=50,
174  ybins = 80, ymin=-1000,ymax=1000)
175 
176  cellMonGroup.defineHistogram('resolution;h_SuperCellResolution',
177  title='Super Cell reconstruction resolution ; %; # entries',
178  type='TH1F', path=sc_hist_path,
179  xbins = 70, xmin=-20,xmax=120)
180  cellMonGroup.defineHistogram('resolutionPass;h_SuperCellResolutionPass',
181  title='Super Cell reconstruction resolution for BCIDed ; %; # entries',
182  type='TH1F', path=sc_hist_path,
183  xbins = 70, xmin=-20,xmax=120)
184  cellMonGroup.defineHistogram('superCellEt,resolution;h_SuperCellResolution_vs_ET',
185  title='Super Cell reconstruction resolution vs ET ; [MeV]; %',
186  type='TH2F', path=sc_hist_path,
187  xbins = 100, xmin=0,xmax=50000,
188  ybins = 70, ymin=-20,ymax=120)
189  cellMonGroup.defineHistogram('superCellEta,resolutionHET;h_SuperCellResolution_vs_eta',
190  title='Super Cell reconstruction resolution vs #eta ; #eta; %',
191  type='TH2F', path=sc_hist_path,
192  xbins = 100, xmin=-5,xmax=5,
193  ybins = 40, ymin=-20,ymax=20)
194  cellMonGroup.defineHistogram('BCID,resolution;h_SuperCellResolution_vs_BCID',
195  title='Super Cell reconstruction resolution vs BCID ; BCID from train front; %',
196  type='TH2F', path=sc_hist_path,
197  xbins = 50, xmin=0,xmax=50,
198  ybins = 80, ymin=-120,ymax=120)
199 
200  cellMonGroup.defineHistogram('superCellEtRef,superCellEt;h_SuperCellEtLin',
201  title='Super Cell E_T Linearity; Ref SC E_T [MeV]; SC E_T [MeV]',
202  type='TH2F', path=sc_hist_path,
203  xbins = 100,xmin=0,xmax=50000,
204  ybins = 100,ymin=0,ymax=50000)
205  cellMonGroup.defineHistogram('superCelltimeRef,superCelltimeReco;h_SuperCelltimeLin',
206  title='Super Cell time Linearity; Ref SC time [ns]; Reco SC time [ns]',
207  type='TH2F', path=sc_hist_path,
208  xbins = 100, xmin=-200,xmax=200,
209  ybins = 100, ymin=-200,ymax=200)
210  cellMonGroup.defineHistogram('superCellprovenanceRef,superCellprovenance;h_SuperCellprovenanceLin',
211  title='Super Cell provenance Linearity; Ref SC bitmask ; SC bitmask',
212  type='TH2F', path=sc_hist_path,
213  xbins = 17, xmin=0,xmax=680,
214  ybins = 17, ymin=0,ymax=680)
215  cellMonGroup.defineHistogram('BCID;h_BCID',
216  title='BCID from the front of the train; BCID ; # entries',
217  type='TH1F', path=sc_hist_path,
218  xbins = 120, xmin=0,xmax=120)
219 
220 
221  partxbins=lArDQGlobals.SuperCell_Variables["etaRange"]["All"]["All"]
222  partybins=lArDQGlobals.SuperCell_Variables["phiRange"]["All"]["All"]
223  cellMonGroup.defineHistogram('superCellEta,superCellPhi,superCellEtDiff;h_SuperCellCoverage_EtDiff',
224  title='ET Diff: #phi vs #eta;#eta;#phi',
225  type='TProfile2D', path=sc_hist_path,
226  xbins = partxbins, ybins = partybins)
227 
228 
229  sc_hist_path='SC_Layer/'
230  for part in LArSuperCellMonAlg.LayerNames:
231  partp='('+part+')'
232 
233  Part = part[:-2]
234  if Part == "FCAL":
235  Part = "FCal"
236  Side = part[-1]
237  Sampling = part[-2]
238  if Sampling == "P":
239  Sampling = "0"
240  partxbins=lArDQGlobals.SuperCell_Variables["etaRange"][Part][Side][Sampling]
241  partybins=lArDQGlobals.SuperCell_Variables["phiRange"][Part][Side][Sampling]
242  cellMonGroup.defineHistogram('superCellEta_'+part+',superCellPhi_'+part+',superCellEtDiff_'+part+';h_SuperCellCoverage_EtDiff_'+part,
243  title='ET Diff '+part+': #phi vs #eta;#eta;#phi',
244  type='TProfile2D', path=sc_hist_path,
245  xbins = partxbins, ybins = partybins)
246 
247 
248  cellMonGroup.defineHistogram('superCellEt_'+part+';h_SuperCellEt'+part,
249  title='Super Cell E_T [MeV] '+partp+'; MeV; # entries',
250  type='TH1F', path=sc_hist_path,
251  xbins = 100,xmin=0,xmax=50000)
252  cellMonGroup.defineHistogram('superCellEta_'+part+';h_SuperCellEta'+part,
253  title='Super Cell eta '+partp+'; #eta; # entries',
254  type='TH1F', path=sc_hist_path,
255  xbins = 100,xmin=-5,xmax=5)
256  cellMonGroup.defineHistogram('superCelltime_'+part+';h_SuperCelltime'+part,
257  title='Super Cell time [ns] '+partp+'; ns; # entries',
258  type='TH1F', path=sc_hist_path,
259  xbins = 100, xmin=-400,xmax=400)
260  cellMonGroup.defineHistogram('superCelltimeReco_'+part+';h_SuperCelltimeReco'+part,
261  title='Reco Super Cell time [ns] '+partp+'; ns; # entries',
262  type='TH1F', path=sc_hist_path,
263  xbins = 100, xmin=-400,xmax=400)
264  cellMonGroup.defineHistogram('superCellprovenance_'+part+';h_SuperCellprovenance'+part,
265  title='Super Cell provenance '+partp+'; bitmask ; # entries',
266  type='TH1F', path=sc_hist_path,
267  xbins = 700, xmin=0,xmax=700)
268  cellMonGroup.defineHistogram('BCID,superCellEt_'+part+';h_SuperCellET_vs_BCID'+part,
269  title='Super Cell ET [MeV] vs BCID '+partp+'; BCID from train front; %',
270  type='TH2F', path=sc_hist_path,
271  xbins = 50, xmin=0,xmax=50,
272  ybins = 100, ymin=-1000,ymax=1000)
273  cellMonGroup.defineHistogram('BCID,superCellEtRef_'+part+';h_SuperCellRefET_vs_BCID'+part,
274  title='Super Cell ET [MeV] vs BCID '+partp+'; BCID from train front; %',
275  type='TH2F', path=sc_hist_path,
276  xbins = 50, xmin=0,xmax=50,
277  ybins = 100, ymin=-1000,ymax=1000)
278 
279  cellMonGroup.defineHistogram('resolution_'+part+';h_SuperCellResolution'+part,
280  title='Super Cell reconstruction resolution '+partp+'; %; # entries',
281  type='TH1F', path=sc_hist_path,
282  xbins = 70, xmin=-20,xmax=120)
283  cellMonGroup.defineHistogram('resolutionPass_'+part+';h_SuperCellResolutionPass'+part,
284  title='Super Cell reconstruction resolution for BCIDed '+partp+'; %; # entries',
285  type='TH1F', path=sc_hist_path,
286  xbins = 70, xmin=-20,xmax=120)
287  cellMonGroup.defineHistogram('superCellEt_'+part+',resolution_'+part+';h_SuperCellResolution_vs_ET'+part,
288  title='Super Cell reconstruction resolution vs ET '+partp+'; [MeV]; %',
289  type='TH2F', path=sc_hist_path,
290  xbins = 100, xmin=0,xmax=50000,
291  ybins = 70, ymin=-20,ymax=120)
292  cellMonGroup.defineHistogram('superCellEta_'+part+',resolutionHET_'+part+';h_SuperCellResolution_vs_eta'+part,
293  title='Super Cell reconstruction resolution vs #eta '+partp+'; #eta; %',
294  type='TH2F', path=sc_hist_path,
295  xbins = 100, xmin=-5,xmax=5,
296  ybins = 40, ymin=-20,ymax=20)
297  cellMonGroup.defineHistogram('BCID,resolution_'+part+';h_SuperCellResolution_vs_BCID'+part,
298  title='Super Cell reconstruction resolution vs BCID '+partp+'; BCID from train front; %',
299  type='TH2F', path=sc_hist_path,
300  xbins = 50, xmin=0,xmax=50,
301  ybins = 80, ymin=-120,ymax=120)
302 
303  cellMonGroup.defineHistogram('superCellEtRef_'+part+',superCellEt_'+part+';h_SuperCellEtLin'+part,
304  title='Super Cell E_T Linearity '+partp+'; Ref SC E_T [MeV]; SC E_T [MeV]',
305  type='TH2F', path=sc_hist_path,
306  xbins = 100,xmin=0,xmax=50000,
307  ybins = 100,ymin=0,ymax=50000)
308  cellMonGroup.defineHistogram('superCelltimeRef_'+part+',superCelltimeReco_'+part+';h_SuperCelltimeLin'+part,
309  title='Super Cell time Linearity '+partp+'; Ref SC time [ns]; Reco SC time [ns]',
310  type='TH2F', path=sc_hist_path,
311  xbins = 100, xmin=-200,xmax=200,
312  ybins = 100, ymin=-200,ymax=200)
313  cellMonGroup.defineHistogram('superCellprovenanceRef_'+part+',superCellprovenance_'+part+';h_SuperCellprovenanceLin'+part,
314  title='Super Cell provenance Linearity '+partp+'; Ref SC bitmask ; SC bitmask',
315  type='TH2F', path=sc_hist_path,
316  xbins = 17, xmin=0,xmax=680,
317  ybins = 17, ymin=0,ymax=680)
318 
319 
320  cellMonGroup.defineHistogram('cellEnergy_'+part+';CellEnergy_'+part,
321  title='Cell Energy in ' +part+';Cell Energy [MeV];Cell Events',
322  type='TH1F', path=sc_hist_path,
323  xbins = 100,xmin=0,xmax=50000
324  )
325  LArSuperCellMonAlg.doDatabaseNoiseVsEtaPhi = True
326 
327  for part in LArSuperCellMonAlg.LayerNames:
328 
329  cellMonGroup.defineHistogram('celleta_'+part+';NCellsActiveVsEta_'+part,
330  title="No. of Active Cells in #eta for "+part+";cell #eta",
331  type='TH1F', path=sc_hist_path,
332  xbins = 100,xmin=-5,xmax=5
333  )
334 
335  cellMonGroup.defineHistogram('cellphi_'+part+';NCellsActiveVsPhi_'+part,
336  title="No. of Active Cells in #phi for "+part+";cell #phi",
337  type='TH1F', path=sc_hist_path,
338  xbins = 100,xmin=-5,xmax=5
339  )
340 
341  cellMonGroup.defineHistogram('celleta_'+part+',cellphi_'+part+';DatabaseNoiseVsEtaPhi_'+part,
342  title="Map of Noise Values from the Database vs (#eta,#phi) for "+part+";cell #eta;cell #phi",
343  weight='cellnoisedb_'+part,
344  cutmask='doDatabaseNoisePlot',
345  type='TH2F', path="DatabaseNoise/",
346  xbins = 100,xmin=-5,xmax=5,
347  ybins = 100,ymin=-5,ymax=5,
348  merge='weightedAverage')
349 
350 
351 
352  return LArSuperCellMonAlg
353 
354 
python.LuminosityCondAlgConfig.LuminosityCondAlgCfg
def LuminosityCondAlgCfg(flags, useOnlineLumi=None, suffix=None)
Definition: LuminosityCondAlgConfig.py:17
LArCablingConfig.LArOnOffIdMappingSCCfg
def LArOnOffIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:65
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
LArRAWtoSuperCellConfig.LArRAWtoSuperCellCfg
def LArRAWtoSuperCellCfg(flags, name="LArRAWtoSuperCell", mask=True, SCellContainerOut="", SCIn="", doReco=False, bcidShift=0)
Definition: LArRAWtoSuperCellConfig.py:8
LArSuperCellMonAlg.LArSuperCellMonConfig
def LArSuperCellMonConfig(flags, **kwargs)
Definition: LArSuperCellMonAlg.py:5
LArSuperCellMonAlg.LArSuperCellMonConfigCore
def LArSuperCellMonConfigCore(helper, algclass, flags, isCosmics=False, isMC=False, algname='LArSuperCellMonAlg', RemoveMasked=True)
Definition: LArSuperCellMonAlg.py:109
python.LArRawSCDataReadingConfig.LArRawSCDataReadingCfg
def LArRawSCDataReadingCfg(configFlags, **kwargs)
Definition: LArRawSCDataReadingConfig.py:8
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.BunchCrossingCondAlgConfig.BunchCrossingCondAlgCfg
def BunchCrossingCondAlgCfg(flags)
Definition: BunchCrossingCondAlgConfig.py:8
python.DetDescrCnvSvcConfig.DetDescrCnvSvcCfg
def DetDescrCnvSvcCfg(flags, **kwargs)
Definition: DetDescrCnvSvcConfig.py:6
python.EmulationConfig.emulateSC_Cfg
def emulateSC_Cfg(flags, CellsIn="SeedLessFS")
Definition: EmulationConfig.py:3
python.LArRunFormat.getLArDTInfoForRun
def getLArDTInfoForRun(run, quiet=False, connstring="COOLONL_LAR/CONDBR2")
Definition: LArRunFormat.py:114
python.CaloNoiseCondAlgConfig.CaloNoiseCondAlgCfg
def CaloNoiseCondAlgCfg(flags, noisetype="totalNoise")
Definition: CaloNoiseCondAlgConfig.py:11
LArRunFormat
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.LBDurationCondAlgConfig.LBDurationCondAlgCfg
def LBDurationCondAlgCfg(flags)
Definition: LBDurationCondAlgConfig.py:15
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
python.LArElecCalibDBConfig.LArElecCalibDBSCCfg
def LArElecCalibDBSCCfg(flags, condObjs, sqlite=None)
Definition: LArElecCalibDBConfig.py:126
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
str
Definition: BTagTrackIpAccessor.cxx:11
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7