6 from geometry
import check_components
7 from analysisDQM
import add_analysis_dqm, add_mirabelle_dqm
10 def add_common_dqm(path, components=None, dqm_environment="expressreco", dqm_mode="dont_care", create_hlt_unit_histograms=False):
12 This function adds DQMs which are common for Cosmic runs and Collion runs
14 @param components: A list of the detector components which are available in this
16 @param dqm_environment: The environment the DQM modules are running in
17 "expressreco" (default) if running on the ExpressReco system
18 "hlt" if running on the HLT online reconstructon nodes
19 If running on the hlt, you may want to output less or other DQM plots
20 due to the limited bandwith of the HLT nodes.
21 @param dqm_mode: How to split up the path for online/HLT.
22 For dqm_mode == "dont_care" all the DQM modules should be added.
23 For dqm_mode == "all_events" only the DQM modules which should run on all events
24 (filtered and dismissed) should be added
25 For dqm_mode == "before_reco" only the DQM modules which should run before
27 For dqm_mode == "filtered" only the DQM modules which should run on filtered
28 events should be added
29 For dqm_mode == "l1_passthrough" only the DQM modules which should run on the
30 L1 passthrough events should be added
31 @param create_hlt_unit_histograms: Parameter for SoftwareTiggerHLTDQMModule.
32 Should be True only when running on the HLT servers
34 assert dqm_mode
in [
"dont_care",
"all_events",
"filtered",
"before_filter",
"l1_passthrough"]
36 check_components(components)
38 if dqm_environment ==
"expressreco" and (dqm_mode
in [
"dont_care"]):
40 if components
is None or 'PXD' in components:
41 path.add_module(
'PXDDAQDQM', histogramDirectoryName=
'PXDDAQ')
42 path.add_module(
'PXDROIDQM', histogramDirectoryName=
'PXDROI')
43 path.add_module(
'PXDDQMExpressReco', histogramDirectoryName=
'PXDER')
44 path.add_module(
'SetupGenfitExtrapolation')
45 path.add_module(
'PXDROIFinder',
46 recoTrackListName=
'RecoTracks',
47 PXDInterceptListName=
'PXDIntercepts')
50 path.add_module(
'PXDTrackClusterDQM', histogramDirectoryName=
'PXDER')
51 path.add_module(
'PXDInjectionDQM', histogramDirectoryName=
'PXDINJ', eachModule=
True)
53 if components
is None or 'SVD' in components:
55 svdunpackerdqm = b2.register_module(
'SVDUnpackerDQM')
56 path.add_module(svdunpackerdqm)
59 'SVDZeroSuppressionEmulator',
61 ShaperDigits=
'SVDShaperDigits',
62 ShaperDigitsIN=
'SVDShaperDigitsZS5',
65 path.add_module(
'SVDDQMInjection', ShaperDigits=
'SVDShaperDigitsZS5')
67 path.add_module(
'SVDDQMExpressReco',
68 offlineZSShaperDigits=
'SVDShaperDigitsZS5')
70 path.add_module(
'SVDDQMHitTime')
72 path.add_module(
'SetupGenfitExtrapolation')
73 path.add_module(
'SVDROIFinder',
74 recoTrackListName=
'RecoTracks',
75 SVDInterceptListName=
'SVDIntercepts')
76 path.add_module(
'SVDDQMEfficiency')
78 path.add_module(
'SVDDQMClustersOnTrack')
80 add_svd_dqm_dose(path,
'SVDShaperDigitsZS5')
83 if components
is None or 'CDC' in components
or 'ECL' in components
or 'TOP' in components:
84 eventT0DQMmodule = b2.register_module(
'EventT0DQM')
85 path.add_module(eventT0DQMmodule)
87 if dqm_environment ==
"hlt" and (dqm_mode
in [
"dont_care",
"before_filter"]):
89 "SoftwareTriggerHLTDQM",
90 createHLTUnitHistograms=create_hlt_unit_histograms,
91 createTotalResultHistograms=
False,
92 createExpRunEventHistograms=
False,
93 createErrorFlagHistograms=
True,
94 cutResultIdentifiers={},
95 histogramDirectoryName=
"softwaretrigger_before_filter",
96 pathLocation=
"before filter",
97 ).set_name(
"SoftwareTriggerHLTDQM_before_filter")
99 path.add_module(
"StatisticsTimingHLTDQM",
100 createHLTUnitHistograms=create_hlt_unit_histograms,
103 if dqm_environment ==
"hlt" and (dqm_mode
in [
"dont_care",
"filtered"]):
105 hlt_trigger_lines_in_plot = []
106 hlt_skim_lines_in_plot = []
108 hlt_trigger_lines_per_unit_in_plot = [
109 "ge3_loose_tracks_inc_1_tight_not_ee2leg",
110 "Elab_gt_0.5_plus_2_others_with_Elab_gt_0.18_plus_no_clust_with_Ecms_gt_2.0",
112 "Estargt2_GeV_cluster",
114 cutResultIdentifiers = {}
116 from softwaretrigger
import filter_categories, skim_categories
118 filter_cat = [method
for method
in dir(filter_categories)
if method.startswith(
'__')
is False if method
is not 'RESULTS']
119 skim_cat = [method
for method
in dir(skim_categories)
if method.startswith(
'__')
is False]
121 def read_lines(category):
122 return [i.split(
" ", 1)[1].replace(
" ",
"_")
for i
in category]
125 cutResultIdentifiers[i] = {
"filter": read_lines(getattr(filter_categories, i))}
126 hlt_trigger_lines_in_plot += read_lines(getattr(filter_categories, i))
129 cutResultIdentifiers[i] = {
"skim": read_lines(getattr(skim_categories, i))}
130 hlt_skim_lines_in_plot += read_lines(getattr(skim_categories, i))
132 cutResultIdentifiers[
"skim"] = {
"skim": hlt_skim_lines_in_plot}
133 cutResultIdentifiers[
"filter"] = {
"filter": hlt_trigger_lines_in_plot}
135 additionalL1Identifiers = [
170 "SoftwareTriggerHLTDQM",
171 cutResultIdentifiers=cutResultIdentifiers,
172 l1Identifiers=[
"fff",
"ffo",
"lml0",
"ffb",
"fp"],
173 additionalL1Identifiers=additionalL1Identifiers,
174 createHLTUnitHistograms=create_hlt_unit_histograms,
175 cutResultIdentifiersPerUnit=hlt_trigger_lines_per_unit_in_plot,
176 pathLocation=
"after filter",
180 "SoftwareTriggerHLTDQM",
181 cutResultIdentifiers={
182 "skim": {
"skim": hlt_skim_lines_in_plot},
184 cutResultIdentifiersIgnored={
189 createTotalResultHistograms=
False,
190 createExpRunEventHistograms=
False,
191 histogramDirectoryName=
"softwaretrigger_skim_nobhabha",
192 ).set_name(
"SoftwareTriggerHLTDQM_skim_nobhabha")
194 if dqm_environment ==
"hlt" and (dqm_mode
in [
"dont_care",
"filtered"]):
196 if components
is None or 'SVD' in components:
197 svdunpackerdqm = b2.register_module(
'SVDUnpackerDQM')
198 path.add_module(svdunpackerdqm)
201 if (components
is None or 'CDC' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
202 cdcdqm = b2.register_module(
'cdcDQM7')
203 path.add_module(cdcdqm)
205 module_names = [m.name()
for m
in path.modules()]
206 if (
'SoftwareTrigger' in module_names):
207 cdcdedxdqm = b2.register_module(
'CDCDedxDQM')
208 path.add_module(cdcdedxdqm)
210 if dqm_environment ==
"expressreco":
211 path.add_module(
'CDCDQM')
214 if (components
is None or 'ECL' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
215 ecldqm = b2.register_module(
'ECLDQM')
216 path.add_module(ecldqm)
217 ecldqmext = b2.register_module(
'ECLDQMEXTENDED')
218 path.add_module(ecldqmext)
220 if dqm_environment ==
"expressreco":
221 path.add_module(
'ECLDQMInjection', histogramDirectoryName=
'ECLINJ')
224 if (components
is None or 'TOP' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
225 topdqm = b2.register_module(
'TOPDQM')
226 path.add_module(topdqm)
228 if (components
is None or 'KLM' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
229 klmdqm = b2.register_module(
"KLMDQM")
230 path.add_module(klmdqm)
233 if (components
is None or 'TRG' in components)
and (dqm_mode
in [
"dont_care",
"before_filter"]):
235 trgecldqm = b2.register_module(
'TRGECLDQM')
236 path.add_module(trgecldqm)
238 trggdldqm = b2.register_module(
'TRGGDLDQM')
239 trggdldqm.param(
'skim', 0)
240 path.add_module(trggdldqm)
242 trgtopdqm = b2.register_module(
'TRGTOPDQM')
243 trgtopdqm.param(
'skim', 0)
244 path.add_module(trgtopdqm)
246 trggrldqm = b2.register_module(
'TRGGRLDQM')
247 path.add_module(trggrldqm)
249 nmod_tsf = [0, 1, 2, 3, 4, 5, 6]
250 for mod_tsf
in nmod_tsf:
251 path.add_module(
'TRGCDCTSFDQM', TSFMOD=mod_tsf)
253 trgcdct2ddqm = b2.register_module(
'TRGCDCT2DDQM')
254 path.add_module(trgcdct2ddqm)
256 nmod_t3d = [0, 1, 2, 3]
257 for mod_t3d
in nmod_t3d:
258 path.add_module(
'TRGCDCT3DConverter',
259 hitCollectionName=
'FirmCDCTriggerSegmentHits' + str(mod_t3d),
260 addTSToDatastore=
True,
261 EventTimeName=
'FirmBinnedEventT0' + str(mod_t3d),
262 addEventTimeToDatastore=
True,
263 inputCollectionName=
'FirmTRGCDC2DFinderTracks' + str(mod_t3d),
264 add2DFinderToDatastore=
True,
265 outputCollectionName=
'FirmTRGCDC3DFitterTracks' + str(mod_t3d),
266 add3DToDatastore=
True,
268 firmwareResultCollectionName=
'TRGCDCT3DUnpackerStore' + str(mod_t3d),
270 path.add_module(
'TRGCDCT3DDQM', T3DMOD=mod_t3d)
272 path.add_module(
'CDCTriggerNeuroDQM')
274 if (components
is None or 'TRG' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
276 trggdldqm_skim = b2.register_module(
'TRGGDLDQM')
277 trggdldqm_skim.param(
'skim', 1)
278 path.add_module(trggdldqm_skim)
280 trgtopdqm_skim = b2.register_module(
'TRGTOPDQM')
281 trgtopdqm_skim.param(
'skim', 1)
282 path.add_module(trgtopdqm_skim)
285 if (components
is None or 'SVD' in components
or 'PXD' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
286 trackDqm = b2.register_module(
'TrackDQM')
287 path.add_module(trackDqm)
290 if (components
is None or 'ARICH' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
291 path.add_module(
'ARICHDQM')
293 if dqm_mode
in [
"dont_care",
"filtered"]:
295 add_analysis_dqm(path)
296 if dqm_environment ==
"expressreco" and (dqm_mode
in [
"dont_care"]):
297 add_mirabelle_dqm(path)
300 if dqm_mode
in [
"dont_care",
"all_events"]:
302 path.add_module(
'DAQMonitor')