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

Functions

 LArCoherentNoisefractionConfig (inputFlags, groupsToMonitor=[], doTrigSel=False)
 LArCoherentNoisefractionConfigCore (helper, algoinstance, inputFlags, groupsToMonitor)

Variables

 flags = initConfigFlags()
 Files
 calibRun
 HISTFileName
 enableLumiAccess
 useTrigger
 Type
 cfg = ComponentAccumulator()
list feblist = []
 aff_acc = LArCoherentNoisefractionConfig(flags,feblist)
 f = open("LArCNFMon.pkl","wb")

Detailed Description

@file LArCoherentNoisefractionAlg
@author P. Strizenec
@date 22-05-2021
@brief Adapted from LArNoiseCorrelationMonAlg by M. Spalla 

Function Documentation

◆ LArCoherentNoisefractionConfig()

LArCoherentNoisefractionAlg.LArCoherentNoisefractionConfig ( inputFlags,
groupsToMonitor = [],
doTrigSel = False )

Definition at line 10 of file LArCoherentNoisefractionAlg.py.

10def LArCoherentNoisefractionConfig(inputFlags, groupsToMonitor=[], doTrigSel=False):
11
12 from AthenaMonitoring.AthMonitorCfgHelper import AthMonitorCfgHelper
13 helper = AthMonitorCfgHelper(inputFlags,'LArCoherentNoisefractionMonAlgCfg')
14
15 from AthenaConfiguration.ComponentFactory import CompFactory
16 return LArCoherentNoisefractionConfigCore(helper, CompFactory.LArCoherentNoisefractionMonAlg(CheckTrigger=doTrigSel),inputFlags,groupsToMonitor)
17

◆ LArCoherentNoisefractionConfigCore()

LArCoherentNoisefractionAlg.LArCoherentNoisefractionConfigCore ( helper,
algoinstance,
inputFlags,
groupsToMonitor )

Definition at line 18 of file LArCoherentNoisefractionAlg.py.

18def LArCoherentNoisefractionConfigCore(helper, algoinstance, inputFlags, groupsToMonitor):
19 from LArMonitoring.GlobalVariables import lArDQGlobals
20 from AthenaCommon.Logging import logging
21 log = logging.getLogger('LArCoherentNoisefractionConfigCore ')
22
23 larCoherentNoisefractionMonAlg = helper.addAlgorithm(algoinstance,'larCoherentNoisefractionMonAlg')
24
25 #set all groups to monitor, if the empty list is passed
26 allGroups=["tot","top","bot","left","right","q1","q2","q3","q4","qs11","qs22","qs3","qs4"]
27 groupsNChan=[128,64,64,64,64,32,32,32,32,32,32,32,32]
28 allMonitor=[True,True,True,True,True,True,True,True,True,True,True,True,True]
29
30 #from AthenaCommon.Constants import DEBUG
31 #larCoherentNoisefractionMonAlg.OutputLevel = DEBUG
32 try:
33 larCoherentNoisefractionMonAlg.IsCalibrationRun = inputFlags.LArMon.calibRun
34 except AttributeError:
35 larCoherentNoisefractionMonAlg.IsCalibrationRun = False
36 try:
37 larCoherentNoisefractionMonAlg.LArDigitContainerKey = inputFlags.LArMon.LArDigitKey
38 except AttributeError:
39 larCoherentNoisefractionMonAlg.LArDigitContainerKey = 'FREE'
40 larCoherentNoisefractionMonAlg.ListOfGroupNames = allGroups
41 larCoherentNoisefractionMonAlg.GroupNchan = groupsNChan
42 if len(groupsToMonitor) == 0:
43 customGroupstoMonitor = allMonitor
44 else:
45 if len(customGroupstoMonitor) != len(allMonitor):
46 from AthenaCommon.Logging import logging
47 logging.getLogger().warning("Wrong list of groups to monitor, setting all !")
48 customGroupstoMonitor = allMonitor
49 else:
50 customGroupstoMonitor = groupsToMonitor
51 larCoherentNoisefractionMonAlg.GroupsToMonitor = customGroupstoMonitor
52 log.info("GroupsToMonitor: ",customGroupstoMonitor)
53
54 try:
55 customFEBStoMonitor = inputFlags.LArMon.customFEBsToMonitor
56 except AttributeError:
57 customFEBStoMonitor = ["endcapAft19slot12","endcapAft19slot09","endcapAft20slot09"]
58
59 #correct custom FEBs for upper-lower cases or single-digit ft and slot numbers (e.g. 3 instead of 03)
60 from ROOT import LArStrHelper
61 larStrHelp=LArStrHelper()
62 customFEBStoMonitor=[larStrHelp.fixFEBname(nm) for nm in customFEBStoMonitor]
63
64
65 larCoherentNoisefractionMonAlg.TriggerChain = "HLT_noalg_zb_L1ZB, HLT_noalg_cosmiccalo_L1RD1_EMPTY" #turn off for calibration run
66
67
68 setCustomFEBS=set(customFEBStoMonitor)
69 febsToMonitorBarrelA=list(setCustomFEBS.intersection(lArDQGlobals.febsBarrelA))
70 febsToMonitorEndcapA=list(setCustomFEBS.intersection(lArDQGlobals.febsEndcapA))
71 febsToMonitorBarrelC=list(setCustomFEBS.intersection(lArDQGlobals.febsBarrelC))
72 febsToMonitorEndcapC=list(setCustomFEBS.intersection(lArDQGlobals.febsEndcapC))
73
74 if len(febsToMonitorBarrelA)==0 and len(febsToMonitorEndcapA)==0 and len(febsToMonitorBarrelC)==0 and len(febsToMonitorEndcapC)==0:
75 log.warning(" None of the following FEBs were recognised, no plot will be produced")
76 log.warning(customFEBStoMonitor)
77 larCoherentNoisefractionMonAlg.PlotsOFF=True #lets protect ourselves against poor writing
78 larCoherentNoisefractionMonAlg.PlotCustomFEBSset=False
79 larCoherentNoisefractionMonAlg.FEBlist=[]
80 else:
81 #pass to algorithm
82 larCoherentNoisefractionMonAlg.PlotCustomFEBSset=True
83 larCoherentNoisefractionMonAlg.FEBlist=febsToMonitorBarrelA+febsToMonitorBarrelC+febsToMonitorEndcapA+febsToMonitorEndcapC
84 pass
85
86 #prepare the monitoring groups
87 for grp in range(0,len(allGroups)):
88 if not customGroupstoMonitor[grp]: continue
89
90
91 cnfArray = helper.addArray([larCoherentNoisefractionMonAlg.FEBlist],larCoherentNoisefractionMonAlg,allGroups[grp])
92
93 hist_path='/LAr/CNF/'
94
95 tot_plot_name=allGroups[grp]+"_cnf_tot"
96 tot_var_and_name="SumDev;"+tot_plot_name
97 cnfArray.defineHistogram(tot_var_and_name,
98 title=tot_plot_name,
99 type='TH1F',
100 path=hist_path+'BarrelA',
101 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
102 pattern=febsToMonitorBarrelA)
103
104 cnfArray.defineHistogram(tot_var_and_name,
105 title=tot_plot_name,
106 type='TH1F',
107 path=hist_path+'BarrelC',
108 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
109 pattern=febsToMonitorBarrelC)
110
111 cnfArray.defineHistogram(tot_var_and_name,
112 title=tot_plot_name,
113 type='TH1F',
114 path=hist_path+'EndcapA',
115 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
116 pattern=febsToMonitorEndcapA)
117
118
119 cnfArray.defineHistogram(tot_var_and_name,
120 title=tot_plot_name,
121 type='TH1F',
122 path=hist_path+'EndcapC',
123 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
124 pattern=febsToMonitorEndcapC)
125
126
127 noncoh_plot_name=allGroups[grp]+"_cnf_noncoh"
128 noncoh_var_and_name="Dev;"+noncoh_plot_name
129
130 cnfArray.defineHistogram(noncoh_var_and_name,
131 title=noncoh_plot_name,
132 type='TH1F',
133 path=hist_path+'BarrelA',
134 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
135 pattern=febsToMonitorBarrelA)
136
137 cnfArray.defineHistogram(noncoh_var_and_name,
138 title=noncoh_plot_name,
139 type='TH1F',
140 path=hist_path+'BarrelC',
141 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
142 pattern=febsToMonitorBarrelC)
143
144 cnfArray.defineHistogram(noncoh_var_and_name,
145 title=noncoh_plot_name,
146 type='TH1F',
147 path=hist_path+'EndcapA',
148 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
149 pattern=febsToMonitorEndcapA)
150
151 cnfArray.defineHistogram(noncoh_var_and_name,
152 title=noncoh_plot_name,
153 type='TH1F',
154 path=hist_path+'EndcapC',
155 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
156 pattern=febsToMonitorEndcapC)
157
158 log.info(cnfArray.toolList())
159
160 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
161 cfg=ComponentAccumulator()
162 cfg.merge(helper.result())
163 return cfg
164
165
Helper class to manipulate strings for LArOnlineID names.
STL class.

Variable Documentation

◆ aff_acc

LArCoherentNoisefractionAlg.aff_acc = LArCoherentNoisefractionConfig(flags,feblist)

Definition at line 211 of file LArCoherentNoisefractionAlg.py.

◆ calibRun

LArCoherentNoisefractionAlg.calibRun

Definition at line 183 of file LArCoherentNoisefractionAlg.py.

◆ cfg

LArCoherentNoisefractionAlg.cfg = ComponentAccumulator()

Definition at line 193 of file LArCoherentNoisefractionAlg.py.

◆ enableLumiAccess

LArCoherentNoisefractionAlg.enableLumiAccess

Definition at line 185 of file LArCoherentNoisefractionAlg.py.

◆ f

LArCoherentNoisefractionAlg.f = open("LArCNFMon.pkl","wb")

Definition at line 218 of file LArCoherentNoisefractionAlg.py.

◆ feblist

list LArCoherentNoisefractionAlg.feblist = []

Definition at line 204 of file LArCoherentNoisefractionAlg.py.

◆ Files

LArCoherentNoisefractionAlg.Files

Definition at line 181 of file LArCoherentNoisefractionAlg.py.

◆ flags

LArCoherentNoisefractionAlg.flags = initConfigFlags()

Definition at line 173 of file LArCoherentNoisefractionAlg.py.

◆ HISTFileName

LArCoherentNoisefractionAlg.HISTFileName

Definition at line 184 of file LArCoherentNoisefractionAlg.py.

◆ Type

LArCoherentNoisefractionAlg.Type

Definition at line 189 of file LArCoherentNoisefractionAlg.py.

◆ useTrigger

LArCoherentNoisefractionAlg.useTrigger

Definition at line 186 of file LArCoherentNoisefractionAlg.py.