5 from geometry
import check_components
6 from analysisDQM
import add_analysis_dqm, add_mirabelle_dqm
9 def add_common_dqm(path, components=None, dqm_environment="expressreco", dqm_mode="dont_care", create_hlt_unit_histograms=False):
11 This function adds DQMs which are common for Cosmic runs and Collion runs
13 @param components: A list of the detector components which are available in this
15 @param dqm_environment: The environment the DQM modules are running in
16 "expressreco" (default) if running on the ExpressReco system
17 "hlt" if running on the HLT online reconstructon nodes
18 If running on the hlt, you may want to output less or other DQM plots
19 due to the limited bandwith of the HLT nodes.
20 @param dqm_mode: How to split up the path for online/HLT.
21 For dqm_mode == "dont_care" all the DQM modules should be added.
22 For dqm_mode == "all_events" only the DQM modules which should run on all events
23 (filtered and dismissed) should be added
24 For dqm_mode == "before_reco" only the DQM modules which should run before
26 For dqm_mode == "filtered" only the DQM modules which should run on filtered
27 events should be added
28 @param create_hlt_unit_histograms: Parameter for SoftwareTiggerHLTDQMModule.
29 Should be True only when running on the HLT servers
31 assert dqm_mode
in [
"dont_care",
"all_events",
"filtered",
"before_filter"]
33 check_components(components)
35 if dqm_environment ==
"expressreco" and (dqm_mode
in [
"dont_care"]):
37 if components
is None or 'PXD' in components:
38 path.add_module(
'PXDDAQDQM', histogramDirectoryName=
'PXDDAQ')
39 path.add_module(
'PXDROIDQM', histogramDirectoryName=
'PXDROI')
40 path.add_module(
'PXDDQMExpressReco', histogramDirectoryName=
'PXDER')
41 path.add_module(
'SetupGenfitExtrapolation')
42 path.add_module(
'PXDROIFinder',
43 recoTrackListName=
'RecoTracks',
44 PXDInterceptListName=
'PXDIntercepts')
47 path.add_module(
'PXDTrackClusterDQM', histogramDirectoryName=
'PXDER')
48 path.add_module(
'PXDInjectionDQM', histogramDirectoryName=
'PXDINJ', eachModule=
True)
50 if components
is None or 'SVD' in components:
52 svdunpackerdqm = b2.register_module(
'SVDUnpackerDQM')
53 path.add_module(svdunpackerdqm)
56 'SVDZeroSuppressionEmulator',
58 ShaperDigits=
'SVDShaperDigits',
59 ShaperDigitsIN=
'SVDShaperDigitsZS5',
62 path.add_module(
'SVDDQMInjection', ShaperDigits=
'SVDShaperDigitsZS5')
64 path.add_module(
'SVDDQMExpressReco',
65 offlineZSShaperDigits=
'SVDShaperDigitsZS5')
67 path.add_module(
'SVDDQMHitTime')
69 path.add_module(
'SetupGenfitExtrapolation')
70 path.add_module(
'SVDROIFinder',
71 recoTrackListName=
'RecoTracks',
72 SVDInterceptListName=
'SVDIntercepts')
73 path.add_module(
'SVDDQMEfficiency')
75 path.add_module(
'SVDDQMClustersOnTrack')
78 if components
is None or 'CDC' in components
or 'ECL' in components
or 'TOP' in components:
79 eventT0DQMmodule = b2.register_module(
'EventT0DQM')
80 path.add_module(eventT0DQMmodule)
82 if dqm_environment ==
"hlt" and (dqm_mode
in [
"dont_care",
"before_filter"]):
84 "SoftwareTriggerHLTDQM",
85 createHLTUnitHistograms=create_hlt_unit_histograms,
86 createTotalResultHistograms=
False,
87 createExpRunEventHistograms=
False,
88 createErrorFlagHistograms=
True,
89 cutResultIdentifiers={},
90 histogramDirectoryName=
"softwaretrigger_before_filter",
91 ).set_name(
"SoftwareTriggerHLTDQM_before_filter")
92 path.add_module(
"StatisticsTimingHLTDQM",
93 createHLTUnitHistograms=create_hlt_unit_histograms,
96 if dqm_environment ==
"hlt" and (dqm_mode
in [
"dont_care",
"filtered"]):
98 hlt_trigger_lines_in_plot = []
99 hlt_skim_lines_in_plot = []
101 hlt_trigger_lines_per_unit_in_plot = [
102 "ge3_loose_tracks_inc_1_tight_not_ee2leg",
103 "Elab_gt_0.5_plus_2_others_with_Elab_gt_0.18_plus_no_clust_with_Ecms_gt_2.0",
105 "Estargt2_GeV_cluster",
107 cutResultIdentifiers = {}
109 from softwaretrigger
import filter_categories, skim_categories
111 filter_cat = [method
for method
in dir(filter_categories)
if method.startswith(
'__')
is False if method
is not 'RESULTS']
112 skim_cat = [method
for method
in dir(skim_categories)
if method.startswith(
'__')
is False]
114 def read_lines(category):
115 return [i.split(
" ", 1)[1].replace(
" ",
"_")
for i
in category]
118 cutResultIdentifiers[i] = {
"filter": read_lines(getattr(filter_categories, i))}
119 hlt_trigger_lines_in_plot += read_lines(getattr(filter_categories, i))
122 cutResultIdentifiers[i] = {
"skim": read_lines(getattr(skim_categories, i))}
123 hlt_skim_lines_in_plot += read_lines(getattr(skim_categories, i))
125 cutResultIdentifiers[
"skim"] = {
"skim": hlt_skim_lines_in_plot}
126 cutResultIdentifiers[
"filter"] = {
"filter": hlt_trigger_lines_in_plot}
130 "SoftwareTriggerHLTDQM",
131 cutResultIdentifiers=cutResultIdentifiers,
132 l1Identifiers=[
"fff",
"ffo",
"lml0",
"ffb",
"fp"],
133 createHLTUnitHistograms=create_hlt_unit_histograms,
134 cutResultIdentifiersPerUnit=hlt_trigger_lines_per_unit_in_plot,
138 "SoftwareTriggerHLTDQM",
139 cutResultIdentifiers={
140 "skim": {
"skim": hlt_skim_lines_in_plot},
142 cutResultIdentifiersIgnored={
147 createTotalResultHistograms=
False,
148 createExpRunEventHistograms=
False,
149 histogramDirectoryName=
"softwaretrigger_skim_nobhabha",
150 ).set_name(
"SoftwareTriggerHLTDQM_skim_nobhabha")
152 if dqm_environment ==
"hlt" and (dqm_mode
in [
"dont_care",
"filtered"]):
154 if components
is None or 'SVD' in components:
155 svdunpackerdqm = b2.register_module(
'SVDUnpackerDQM')
156 path.add_module(svdunpackerdqm)
159 if (components
is None or 'CDC' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
160 cdcdqm = b2.register_module(
'cdcDQM7')
161 path.add_module(cdcdqm)
163 module_names = [m.name()
for m
in path.modules()]
164 if (
'SoftwareTrigger' in module_names):
165 cdcdedxdqm = b2.register_module(
'CDCDedxDQM')
166 path.add_module(cdcdedxdqm)
168 if dqm_environment ==
"expressreco":
169 path.add_module(
'CDCDQM')
172 if (components
is None or 'ECL' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
173 ecldqm = b2.register_module(
'ECLDQM')
174 path.add_module(ecldqm)
175 ecldqmext = b2.register_module(
'ECLDQMEXTENDED')
176 path.add_module(ecldqmext)
178 if dqm_environment ==
"expressreco":
179 path.add_module(
'ECLDQMInjection', histogramDirectoryName=
'ECLINJ')
181 if (components
is None or 'TOP' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
182 topdqm = b2.register_module(
'TOPDQM')
183 path.add_module(topdqm)
185 if (components
is None or 'KLM' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
186 klmdqm = b2.register_module(
"KLMDQM")
187 path.add_module(klmdqm)
190 if (components
is None or 'TRG' in components)
and (dqm_mode
in [
"dont_care",
"before_filter"]):
192 trgecldqm = b2.register_module(
'TRGECLDQM')
193 path.add_module(trgecldqm)
195 trggdldqm = b2.register_module(
'TRGGDLDQM')
196 trggdldqm.param(
'skim', 0)
197 path.add_module(trggdldqm)
199 trgtopdqm = b2.register_module(
'TRGTOPDQM')
200 trgtopdqm.param(
'skim', 0)
201 path.add_module(trgtopdqm)
203 trggrldqm = b2.register_module(
'TRGGRLDQM')
204 path.add_module(trggrldqm)
206 nmod_tsf = [0, 1, 2, 3, 4, 5, 6]
207 for mod_tsf
in nmod_tsf:
208 path.add_module(
'TRGCDCTSFDQM', TSFMOD=mod_tsf)
210 trgcdct2ddqm = b2.register_module(
'TRGCDCT2DDQM')
211 path.add_module(trgcdct2ddqm)
213 nmod_t3d = [0, 1, 2, 3]
214 for mod_t3d
in nmod_t3d:
215 path.add_module(
'TRGCDCT3DConverter',
216 hitCollectionName=
'FirmCDCTriggerSegmentHits' + str(mod_t3d),
217 addTSToDatastore=
True,
218 EventTimeName=
'FirmBinnedEventT0' + str(mod_t3d),
219 addEventTimeToDatastore=
True,
220 inputCollectionName=
'FirmTRGCDC2DFinderTracks' + str(mod_t3d),
221 add2DFinderToDatastore=
True,
222 outputCollectionName=
'FirmTRGCDC3DFitterTracks' + str(mod_t3d),
223 add3DToDatastore=
True,
225 firmwareResultCollectionName=
'TRGCDCT3DUnpackerStore' + str(mod_t3d),
227 path.add_module(
'TRGCDCT3DDQM', T3DMOD=mod_t3d)
229 path.add_module(
'CDCTriggerNeuroDQM')
231 if (components
is None or 'TRG' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
233 trggdldqm_skim = b2.register_module(
'TRGGDLDQM')
234 trggdldqm_skim.param(
'skim', 1)
235 path.add_module(trggdldqm_skim)
237 trgtopdqm_skim = b2.register_module(
'TRGTOPDQM')
238 trgtopdqm_skim.param(
'skim', 1)
239 path.add_module(trgtopdqm_skim)
242 if (components
is None or 'SVD' in components
or 'PXD' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
243 trackDqm = b2.register_module(
'TrackDQM')
244 path.add_module(trackDqm)
247 if (components
is None or 'ARICH' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
248 path.add_module(
'ARICHDQM')
250 if dqm_mode
in [
"dont_care",
"filtered"]:
252 add_analysis_dqm(path)
253 if dqm_environment ==
"expressreco" and (dqm_mode
in [
"dont_care"]):
254 add_mirabelle_dqm(path)
257 if dqm_mode
in [
"dont_care",
"all_events"]:
259 path.add_module(
'DAQMonitor')