Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions
LArNoisyROMonAlg Namespace Reference

Functions

def LArNoisyROMonConfig (flags, inKey="", NoisyFEBDefStr="(>30 chan with Q>4000)", NoisyHVlineDefStr="", MNBTightFEBDefStr="", MNBTight_PsVetoFEBDefStr="", MNBLooseFEBDefStr="")
 
def LArNoisyROMonConfigCore (helper, algoinstance, flags, inKey="", NoisyFEBDefStr="(>30 chan with Q>4000)", NoisyHVlineDefStr="", MNBTightFEBDefStr="", MNBTight_PsVetoFEBDefStr="", MNBLooseFEBDefStr="")
 

Function Documentation

◆ LArNoisyROMonConfig()

def LArNoisyROMonAlg.LArNoisyROMonConfig (   flags,
  inKey = "",
  NoisyFEBDefStr = "(>30 chan with Q>4000)",
  NoisyHVlineDefStr = "",
  MNBTightFEBDefStr = "",
  MNBTight_PsVetoFEBDefStr = "",
  MNBLooseFEBDefStr = "" 
)

Definition at line 5 of file LArNoisyROMonAlg.py.

5 def LArNoisyROMonConfig(flags, inKey="",
6  NoisyFEBDefStr="(>30 chan with Q>4000)", NoisyHVlineDefStr="",
7  MNBTightFEBDefStr="",
8  MNBTight_PsVetoFEBDefStr="",
9  MNBLooseFEBDefStr=""):
10 
11  from AthenaMonitoring import AthMonitorCfgHelper
12  helper = AthMonitorCfgHelper(flags,'LArNoisyROMonAlgCfg')
13 
14  from AthenaConfiguration.ComponentFactory import CompFactory
15  NoisyFEBDefStr="(>"+str(flags.LAr.NoisyRO.BadChanPerFEB)+" chan with Q>"+str(flags.LAr.NoisyRO.CellQuality)+")"
16  NoisyHVlineDefStr="(>"+str(flags.LAr.NoisyRO.BadHVCut)+" HVlines with >"+str(flags.LAr.NoisyRO.BadHVlineFrac)+" channels with Q>"+str(flags.LAr.NoisyRO.CellQuality)+")"
17 
18  MNBTightFEBDefStr="(>"+str(flags.LAr.NoisyRO.MNBTightCut)+" chan with Q>"+str(flags.LAr.NoisyRO.CellQuality)+")"
19  MNBTight_PsVetoFEBDefStr="(>"+str(flags.LAr.NoisyRO.MNBTight_PsVetoCut[0])+" chan with Q>"+str(flags.LAr.NoisyRO.CellQuality)+") + PS veto (<"+str(flags.LAr.NoisyRO.MNBTight_PsVetoCut[1])+" channels)"
20  MNBLooseFEBDefStr="(>"+str(flags.LAr.NoisyRO.MNBLooseCut)+" chan with Q>"+str(flags.LAr.NoisyRO.CellQuality)+")"
21 
22  return LArNoisyROMonConfigCore(helper,CompFactory.LArNoisyROMonAlg, flags, inKey, NoisyFEBDefStr, NoisyHVlineDefStr, MNBTightFEBDefStr, MNBTight_PsVetoFEBDefStr, MNBLooseFEBDefStr)
23 
24 
25 

◆ LArNoisyROMonConfigCore()

def LArNoisyROMonAlg.LArNoisyROMonConfigCore (   helper,
  algoinstance,
  flags,
  inKey = "",
  NoisyFEBDefStr = "(>30 chan with Q>4000)",
  NoisyHVlineDefStr = "",
  MNBTightFEBDefStr = "",
  MNBTight_PsVetoFEBDefStr = "",
  MNBLooseFEBDefStr = "" 
)

Definition at line 26 of file LArNoisyROMonAlg.py.

26 def LArNoisyROMonConfigCore(helper,algoinstance,flags,
27  inKey="",
28  NoisyFEBDefStr="(>30 chan with Q>4000)",
29  NoisyHVlineDefStr="",
30  MNBTightFEBDefStr="",
31  MNBTight_PsVetoFEBDefStr="",
32  MNBLooseFEBDefStr=""):
33 
34  # first configure known bad FEBs
35  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
37  from LArBadChannelTool.LArBadFebsConfig import LArKnownBadFebCfg, LArKnownMNBFebCfg
38  cfg.merge(LArKnownBadFebCfg(flags))
39  cfg.merge(LArKnownMNBFebCfg(flags))
40 
41  larNoisyROMonAlg = helper.addAlgorithm(algoinstance,'larNoisyROMonAlg')
42 
43  NoisyROMonGroupName="LArNoisyROMonGroup"
44 
45  from LArMonitoring.GlobalVariables import lArDQGlobals
46 
47  larNoisyROMonAlg.NoisyROGroupName=NoisyROMonGroupName
48  larNoisyROMonAlg.SubDetNames=lArDQGlobals.SubDet[0:2]
49  larNoisyROMonAlg.PartitionNames=lArDQGlobals.Partitions[0:4]
50 
51  larNoisyROMonAlg.storeLooseMNBFEBs=True
52  if inKey != "":
53  larNoisyROMonAlg.inputKey=inKey
54 
55  if not flags.Common.isOnline:
56  larNoisyROMonAlg.HVMapKey="LArHVIdMap"
57 
58  # variable for testing on ESD
59  try:
60  LArNoisyROMonForceTrigger
61  except NameError:
62  LArNoisyROMonForceTrigger = False
63 
64  EFNoiseBurstTriggersList=[
65  "HLT_larnoiseburst_L1XE60",
66  "HLT_larnoiseburst_L1XE70",
67  "HLT_larnoiseburst_L1XE80",
68  "HLT_larnoiseburst_L1J100",
69  "HLT_larnoiseburst_L1J40_XE60",
70  "HLT_larnoiseburst_L1J40_XE50",
71  "HLT_larpsall_L1J12_FIRSTEMPTY",
72  "HLT_larpsall_L1J30_FIRSTEMPTY",
73  "HLT_larpsallem_L1EM7_FIRSTEMPTY"
74  ]
75  L1NoiseBurstTriggersList = [
76  "L1_J75",
77  "L1_J100",
78  "L1_J40_XE50",
79  "L1_J40_XE60",
80  "L1_J10_EMPTY",
81  "L1_J30_EMPTY",
82  "L1_EM7_FIRSTEMPTY",
83  "L1_J12_FIRSTEMPTY",
84  "L1_J30_FIRSTEMPTY",
85  "L1_XE60",
86  "L1_XE70",
87  "L1_XE80"
88  ]
89 
90  if flags.DQ.useTrigger or LArNoisyROMonForceTrigger:
91  larNoisyROMonAlg.doTrigger = True
92  larNoisyROMonAlg.EFNoiseBurstTriggers = EFNoiseBurstTriggersList
93  larNoisyROMonAlg.L1NoiseBurstTriggers = L1NoiseBurstTriggersList
94  else:
95  larNoisyROMonAlg.doTrigger = False
96  larNoisyROMonAlg.EFNoiseBurstTriggers = []
97  larNoisyROMonAlg.L1NoiseBurstTriggers = []
98 
99  noisyROGroup = helper.addGroup(
100  larNoisyROMonAlg,
101  NoisyROMonGroupName,
102  '/LAr/NoisyRO/'
103  )
104 
105 
106  larNoisyRO_hist_path='Summary/'
107 
108  # first trees
109  noisyROGroup.defineTree('time,time_ns,algo;LArNoise',path=larNoisyRO_hist_path,
110  treedef='time/i:time_ns/i:algo/b')
111 
112  noisyROGroup.defineTree('candidate_MNB_time,candidate_MNB_time_ns,n_candidate_MNBTight_FEB,n_candidate_MNBTight_PsVeto_FEB,n_candidate_MNBLoose_FEB,v_candidate_MNBTightFEB,v_candidate_MNBTight_PsVetoFEB,v_candidate_MNBLooseFEB;CandidateMNBFebs',path=larNoisyRO_hist_path,
113  treedef='candidate_MNB_time/i:candidate_MNB_time_ns/i:n_candidate_MNBTight_FEB/i:n_candidate_MNBTight_PsVeto_FEB/i:n_candidate_MNBLoose_FEB/i:v_candidate_MNBTightFEB/vector<int>:v_candidate_MNBTight_PsVetoFEB/vector<int>:v_candidate_MNBLooseFEB/vector<int>')
114 
115  #then global histo
116  noisyROGroup.defineHistogram('n_noisyFEBs;NoisyFEB',
117  title='Number of noisy FEB '+ NoisyFEBDefStr + ' per event;# of noisy FEB',
118  type='TH1I',
119  path=larNoisyRO_hist_path,
120  xbins=lArDQGlobals.noisyFEB_Bins,xmin=lArDQGlobals.noisyFEB_Min,xmax=lArDQGlobals.noisyFEB_Max)
121  noisyROGroup.defineHistogram('n_noisyHVlines;NoisyHVlines',
122  title='Number of noisy HVlines '+ NoisyHVlineDefStr + ' per event;# of noisy HVlines',
123  type='TH1I',
124  path=larNoisyRO_hist_path,
125  xbins=lArDQGlobals.noisyFEB_Bins,xmin=lArDQGlobals.noisyFEB_Min,xmax=lArDQGlobals.noisyFEB_Max)
126  noisyROGroup.defineHistogram('LBN;LBN',type='TH1I',
127  title='Event counter per LB',
128  path=larNoisyRO_hist_path,
129  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
130 
131  for subdet in range(0,2):
132  hist_path='/LAr/NoisyRO/'+lArDQGlobals.SubDet[subdet]+'/'
133  slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
134  slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
135  slot_n = int(slot_up - slot_low)
136  ft_low = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
137  ft_up = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
138  ft_n = int(ft_up - ft_low)
139 
140  darray = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larNoisyROMonAlg,lArDQGlobals.SubDet[subdet],topPath='/')
141  # Known bad FEBS
142  darray.defineHistogram('slotBad,FTBad;KnownBadFEB', title='Known Bad FEBs {0} ; Slot ; FT',
143  type='TH2I', path=hist_path,
144  xbins=slot_n,xmin=slot_low,xmax=slot_up,
145  ybins=ft_n, ymin=ft_low, ymax=ft_up,
146  merge='identical')
147 
148  darray.defineHistogram('slotMNB,FTMNB;MNBKnownFEB', title='Known MNB FEBs {0} ; Slot ; FT',
149  type='TH2I', path=hist_path,
150  xbins=slot_n,xmin=slot_low,xmax=slot_up,
151  ybins=ft_n, ymin=ft_low, ymax=ft_up,
152  merge='identical')
153 
154  # 2D plots of noisy FEBs with various cuts
155  darray.defineHistogram('slotNoisy,FTNoisy;NoisyFEBPerEvt', title='Yield of events with {0} FEB noisy -'+NoisyFEBDefStr+' (only vetoed events) ; Slot ; FT',
156  type='TH2I', path=hist_path,
157  xbins=slot_n,xmin=slot_low,xmax=slot_up,
158  ybins=ft_n, ymin=ft_low, ymax=ft_up)
159 
160  darray.defineHistogram('slotTight,FTTight;MNBTightFEBPerEvt', title='Yield of events with {0} FEB noisy -'+MNBTightFEBDefStr+' (only vetoed events) ; Slot ; FT',
161  type='TH2I', path=hist_path,
162  xbins=slot_n,xmin=slot_low,xmax=slot_up,
163  ybins=ft_n, ymin=ft_low, ymax=ft_up)
164 
165  darray.defineHistogram('slotTightCan,FTTightCan;CandidateMNBTightFEBPerEvt', title='Yield of events with {0} FEB noisy -'+MNBTightFEBDefStr+' (only vetoed events) ; Slot ; FT',
166  type='TH2I', path=hist_path,
167  xbins=slot_n,xmin=slot_low,xmax=slot_up,
168  ybins=ft_n, ymin=ft_low, ymax=ft_up)
169 
170  darray.defineHistogram('slot_PsVetoTight,FT_PsVetoTight;MNBTight_PsVetoFEBPerEvt', title='Yield of events with {0} FEB noisy -'+MNBTight_PsVetoFEBDefStr+' (only vetoed events) ; Slot ; FT',
171  type='TH2I', path=hist_path,
172  xbins=slot_n,xmin=slot_low,xmax=slot_up,
173  ybins=ft_n, ymin=ft_low, ymax=ft_up)
174 
175  darray.defineHistogram('slot_PsVetoTightCan,FT_PsVetoTightCan;CandidateMNBTight_PsVetoFEBPerEvt', title='Yield of events with {0} FEB noisy -'+MNBTight_PsVetoFEBDefStr+' (only vetoed events) ; Slot ; FT',
176  type='TH2I', path=hist_path,
177  xbins=slot_n,xmin=slot_low,xmax=slot_up,
178  ybins=ft_n, ymin=ft_low, ymax=ft_up)
179 
180  darray.defineHistogram('slotLoose,FTLoose;MNBLooseFEBPerEvt', title='Yield of events with {0} FEB noisy -'+MNBLooseFEBDefStr+' (only vetoed events) ; Slot ; FT',
181  type='TH2I', path=hist_path,
182  xbins=slot_n,xmin=slot_low,xmax=slot_up,
183  ybins=ft_n, ymin=ft_low, ymax=ft_up)
184 
185  darray.defineHistogram('slotLooseCan,FTLooseCan;CandidateMNBLooseFEBPerEvt', title='Yield of events with {0} FEB noisy -'+MNBLooseFEBDefStr+' (only vetoed events) ; Slot ; FT',
186  type='TH2I', path=hist_path,
187  xbins=slot_n,xmin=slot_low,xmax=slot_up,
188  ybins=ft_n, ymin=ft_low, ymax=ft_up)
189 
190  # 1D plots of noisy events of various type
191  darray.defineHistogram('LBStd;NoisyEvent',type='TH1I', path=hist_path,
192  title='Yield of events flagged as RNB-Standard - {0} ; Luminosity Block; Number of events',
193  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
194 
195  darray.defineHistogram('LBSat;SaturatedNoisyEvent',type='TH1I', path=hist_path,
196  title='Yield of events flagged as RNB-Saturated - {0} ; Luminosity Block',
197  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
198 
199  darray.defineHistogram('LBMNBTight;MNBTightEvent',type='TH1I', path=hist_path,
200  title='Yield of events flagged as MNB-Tight - {0} ; Luminosity Block',
201  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
202 
203  darray.defineHistogram('LBMNBTight_PsVeto;MNBTight_PsVetoEvent',type='TH1I', path=hist_path,
204  title='Yield of events flagged as MNB-Tight_PsVeto - {0} ; Luminosity Block',
205  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
206 
207  darray.defineHistogram('LBMNBLoose;MNBLooseEvent',type='TH1I', path=hist_path,
208  title='Yield of events flagged as MNB-Loose - {0} ; Luminosity Block',
209  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
210 
211  # 1D plots of events still noisy after EventVeto
212  darray.defineHistogram('LBStd_Veto;NoisyEvent_TimeVeto',type='TH1I', path=hist_path,
213  title='Yield of events flagged as RNB-Standard not vetoed by time window - {0} ; Luminosity Block',
214  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
215 
216  darray.defineHistogram('LBSat_Veto;SaturatedNoisyEvent_TimeVeto',type='TH1I', path=hist_path,
217  title='Yield of events flagged as RNB-Saturated not vetoed by time window - {0} ; Luminosity Block',
218  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
219 
220  darray.defineHistogram('LBMNBTight_Veto;MNBTightEvent_TimeVeto',type='TH1I', path=hist_path,
221  title='Yield of events flagged as MNB-Tight not vetoed by time window - {0} ; Luminosity Block',
222  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
223 
224  darray.defineHistogram('LBMNBTight_PsVeto_Veto;MNBTight_PsVetoEvent_TimeVeto',type='TH1I', path=hist_path,
225  title='Yield of events flagged as MNB-Tight_PsVeto not vetoed by time window - {0} ; Luminosity Block',
226  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
227 
228  darray.defineHistogram('LBMNBLoose_Veto;MNBLooseEvent_TimeVeto',type='TH1I', path=hist_path,
229  title='Yield of events flagged as MNB-Loose not vetoed by time window - {0} ; Luminosity Block',
230  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
231 
232  # Trigger histos
233  if larNoisyROMonAlg.doTrigger:
234  siz=len(larNoisyROMonAlg.EFNoiseBurstTriggers)
235  darray.defineHistogram('Triggers;NoisyEventTrigger',type='TH1I', path=hist_path,
236  title='Trigger fired for RNB flagged events - {0} ; Special trigger fired',
237  xbins=siz+1,xmin=0.5,xmax=siz+1.5,
238  xlabels=larNoisyROMonAlg.EFNoiseBurstTriggers.append("NONE"))
239 
240  l1siz=len(larNoisyROMonAlg.L1NoiseBurstTriggers)
241  darray.defineHistogram('L1Triggers;NoisyEventL1Term',type='TH1I', path=hist_path,
242  title='L1 term fired for RNB flagged events - {0} ; Special trigger fired',
243  xbins=l1siz+1,xmin=0.5,xmax=l1siz+1.5,
244  xlabels=larNoisyROMonAlg.L1NoiseBurstTriggers.append("NONE"))
245  for subdet in range(0,4):
246  darray1 = helper.addArray([["HV"+ sd for sd in lArDQGlobals.Partitions[2*subdet:2*subdet+2]]],larNoisyROMonAlg,lArDQGlobals.SubDet[subdet],topPath='/')
247 
248  darray1.defineHistogram('LBHV;HVlineNoisyEvent',type='TH1I', path=hist_path,
249  title='Yield of events flagged by HVlines flag - {0} ; Luminosity Block; Number of events',
250  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
251 
252  darray1.defineHistogram('LBHV_Veto;HVlineNoisyEvent_TimeVeto',type='TH1I', path=hist_path,
253  title='Yield of events flagged by HVlines flag not vetoed by time window - {0} ; Luminosity Block',
254  xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
255 
256 
257  cfg.merge(helper.result())
258  return cfg
259 
260 
python.LArBadFebsConfig.LArKnownMNBFebCfg
def LArKnownMNBFebCfg(configFlags, tag=None)
Definition: LArBadFebsConfig.py:25
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
LArNoisyROMonAlg.LArNoisyROMonConfig
def LArNoisyROMonConfig(flags, inKey="", NoisyFEBDefStr="(>30 chan with Q>4000)", NoisyHVlineDefStr="", MNBTightFEBDefStr="", MNBTight_PsVetoFEBDefStr="", MNBLooseFEBDefStr="")
Definition: LArNoisyROMonAlg.py:5
LArNoisyROMonAlg.LArNoisyROMonConfigCore
def LArNoisyROMonConfigCore(helper, algoinstance, flags, inKey="", NoisyFEBDefStr="(>30 chan with Q>4000)", NoisyHVlineDefStr="", MNBTightFEBDefStr="", MNBTight_PsVetoFEBDefStr="", MNBLooseFEBDefStr="")
Definition: LArNoisyROMonAlg.py:26
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.LArBadFebsConfig.LArKnownBadFebCfg
def LArKnownBadFebCfg(configFlags, tag=None)
Definition: LArBadFebsConfig.py:11
str
Definition: BTagTrackIpAccessor.cxx:11