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

Functions

 LArCoherentNoisefractionConfig (inputFlags, groupsToMonitor=[])
 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 = [] )

Definition at line 10 of file LArCoherentNoisefractionAlg.py.

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

Variable Documentation

◆ aff_acc

LArCoherentNoisefractionAlg.aff_acc = LArCoherentNoisefractionConfig(flags,feblist)

Definition at line 209 of file LArCoherentNoisefractionAlg.py.

◆ calibRun

LArCoherentNoisefractionAlg.calibRun

Definition at line 181 of file LArCoherentNoisefractionAlg.py.

◆ cfg

LArCoherentNoisefractionAlg.cfg = ComponentAccumulator()

Definition at line 191 of file LArCoherentNoisefractionAlg.py.

◆ enableLumiAccess

LArCoherentNoisefractionAlg.enableLumiAccess

Definition at line 183 of file LArCoherentNoisefractionAlg.py.

◆ f

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

Definition at line 216 of file LArCoherentNoisefractionAlg.py.

◆ feblist

list LArCoherentNoisefractionAlg.feblist = []

Definition at line 202 of file LArCoherentNoisefractionAlg.py.

◆ Files

LArCoherentNoisefractionAlg.Files

Definition at line 179 of file LArCoherentNoisefractionAlg.py.

◆ flags

LArCoherentNoisefractionAlg.flags = initConfigFlags()

Definition at line 171 of file LArCoherentNoisefractionAlg.py.

◆ HISTFileName

LArCoherentNoisefractionAlg.HISTFileName

Definition at line 182 of file LArCoherentNoisefractionAlg.py.

◆ Type

LArCoherentNoisefractionAlg.Type

Definition at line 187 of file LArCoherentNoisefractionAlg.py.

◆ useTrigger

LArCoherentNoisefractionAlg.useTrigger

Definition at line 184 of file LArCoherentNoisefractionAlg.py.