18def LArCoherentNoisefractionConfigCore(helper, algoinstance, inputFlags, groupsToMonitor):
19 from LArMonitoring.GlobalVariables import lArDQGlobals
20
21 larCoherentNoisefractionMonAlg = helper.addAlgorithm(algoinstance,'larCoherentNoisefractionMonAlg')
22
23
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
29
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
57 from ROOT import LArStrHelper
59 customFEBStoMonitor=[larStrHelp.fixFEBname(nm) for nm in customFEBStoMonitor]
60
61
62
63 larCoherentNoisefractionMonAlg.TriggerChain = "HLT_noalg_zb_L1ZB, HLT_noalg_cosmiccalo_L1RD1_EMPTY"
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
76 larCoherentNoisefractionMonAlg.PlotCustomFEBSset=False
77 larCoherentNoisefractionMonAlg.FEBlist=[]
78 else:
79
80 larCoherentNoisefractionMonAlg.PlotCustomFEBSset=True
81 larCoherentNoisefractionMonAlg.FEBlist=febsToMonitorBarrelA+febsToMonitorBarrelC+febsToMonitorEndcapA+febsToMonitorEndcapC
82 pass
83
84
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.