13 from svd
import add_svd_create_recodigits
15 from geometry
import check_components
16 from analysisDQM
import add_analysis_dqm, add_mirabelle_dqm
20 def add_common_dqm(path, components=None, dqm_environment="expressreco", dqm_mode="dont_care", create_hlt_unit_histograms=False):
22 This function adds DQMs which are common for Cosmic runs and Collion runs
24 @param components: A list of the detector components which are available in this
26 @param dqm_environment: The environment the DQM modules are running in
27 "expressreco" (default) if running on the ExpressReco system
28 "hlt" if running on the HLT online reconstructon nodes
29 If running on the hlt, you may want to output less or other DQM plots
30 due to the limited bandwith of the HLT nodes.
31 @param dqm_mode: How to split up the path for online/HLT.
32 For dqm_mode == "dont_care" all the DQM modules should be added.
33 For dqm_mode == "all_events" only the DQM modules which should run on all events
34 (filtered and dismissed) should be added
35 For dqm_mode == "before_reco" only the DQM modules which should run before
37 For dqm_mode == "filtered" only the DQM modules which should run on filtered
38 events should be added
39 @param create_hlt_unit_histograms: Parameter for SoftwareTiggerHLTDQMModule.
40 Should be True only when running on the HLT servers
42 assert dqm_mode
in [
"dont_care",
"all_events",
"filtered",
"before_filter"]
44 check_components(components)
46 if dqm_mode
in [
"dont_care",
"filtered"]:
48 path.add_module(
'TTDDQM')
50 if dqm_environment ==
"expressreco" and (dqm_mode
in [
"dont_care"]):
52 if components
is None or 'PXD' in components:
53 path.add_module(
'PXDDAQDQM', histogramDirectoryName=
'PXDDAQ')
54 path.add_module(
'PXDROIDQM', histogramDirectoryName=
'PXDROI')
55 path.add_module(
'PXDDQMExpressReco', histogramDirectoryName=
'PXDER')
56 path.add_module(
'SetupGenfitExtrapolation')
57 path.add_module(
'PXDROIFinder',
58 recoTrackListName=
'RecoTracks',
59 PXDInterceptListName=
'PXDIntercepts')
62 path.add_module(
'PXDTrackClusterDQM', histogramDirectoryName=
'PXDER')
63 path.add_module(
'PXDInjectionDQM', histogramDirectoryName=
'PXDINJ', eachModule=
True)
65 if components
is None or 'SVD' in components:
67 add_svd_create_recodigits(path)
70 svdunpackerdqm = b2.register_module(
'SVDUnpackerDQM')
71 path.add_module(svdunpackerdqm)
74 'SVDZeroSuppressionEmulator',
76 ShaperDigits=
'SVDShaperDigits',
77 ShaperDigitsIN=
'SVDShaperDigitsZS5',
80 path.add_module(
'SVDDQMInjection', ShaperDigits=
'SVDShaperDigitsZS5')
82 path.add_module(
'SVDDQMExpressReco',
83 offlineZSShaperDigits=
'SVDShaperDigitsZS5')
85 path.add_module(
'SVDDQMHitTime')
87 path.add_module(
'SetupGenfitExtrapolation')
88 path.add_module(
'SVDROIFinder',
89 recoTrackListName=
'RecoTracks',
90 SVDInterceptListName=
'SVDIntercepts')
91 path.add_module(
'SVDDQMEfficiency')
93 path.add_module(
'SVDDQMClustersOnTrack')
95 add_svd_dqm_dose(path,
'SVDShaperDigitsZS5')
98 if components
is None or 'CDC' in components
or 'ECL' in components
or 'TOP' in components:
99 eventT0DQMmodule = b2.register_module(
'EventT0DQM')
100 path.add_module(eventT0DQMmodule)
102 if dqm_environment ==
"hlt" and (dqm_mode
in [
"dont_care",
"before_filter"]):
104 "SoftwareTriggerHLTDQM",
105 createHLTUnitHistograms=create_hlt_unit_histograms,
106 createTotalResultHistograms=
False,
107 createExpRunEventHistograms=
False,
108 createErrorFlagHistograms=
True,
109 cutResultIdentifiers={},
110 histogramDirectoryName=
"softwaretrigger_before_filter",
111 pathLocation=
"before filter",
112 ).set_name(
"SoftwareTriggerHLTDQM_before_filter")
116 histogramDirectoryName=
"TrackingAbort_before_filter",
117 ).set_name(
"TrackingAbortDQM_before_filter")
119 path.add_module(
"DetectorOccupanciesDQM", histogramDirectoryName=
"DetectorOccupancies_before_filter").set_name(
120 "DetectorOccupanciesDQM_before_filter")
122 path.add_module(
"StatisticsTimingHLTDQM",
123 createHLTUnitHistograms=create_hlt_unit_histograms,
126 if dqm_environment ==
"hlt" and (dqm_mode
in [
"dont_care",
"filtered"]):
128 hlt_trigger_lines_in_plot = []
129 hlt_skim_lines_in_plot = []
131 hlt_trigger_lines_per_unit_in_plot = [
132 "ge3_loose_tracks_inc_1_tight_not_ee2leg",
133 "Elab_gt_0.5_plus_2_others_with_Elab_gt_0.18_plus_no_clust_with_Ecms_gt_2.0",
135 "Estargt2_GeV_cluster",
137 cutResultIdentifiers = {}
139 from softwaretrigger
import filter_categories, skim_categories
141 filter_cat = [method
for method
in dir(filter_categories)
if method.startswith(
'__')
is False if method !=
'RESULTS']
142 skim_cat = [method
for method
in dir(skim_categories)
if method.startswith(
'__')
is False]
144 def read_lines(category):
145 return [i.split(
" ", 1)[1].replace(
" ",
"_")
for i
in category]
148 cutResultIdentifiers[i] = {
"filter": read_lines(getattr(filter_categories, i))}
149 hlt_trigger_lines_in_plot += read_lines(getattr(filter_categories, i))
152 cutResultIdentifiers[i] = {
"skim": read_lines(getattr(skim_categories, i))}
153 hlt_skim_lines_in_plot += read_lines(getattr(skim_categories, i))
155 cutResultIdentifiers[
"skim"] = {
"skim": hlt_skim_lines_in_plot}
156 cutResultIdentifiers[
"filter"] = {
"filter": hlt_trigger_lines_in_plot}
158 additionalL1Identifiers = [
193 "SoftwareTriggerHLTDQM",
194 cutResultIdentifiers=cutResultIdentifiers,
195 l1Identifiers=[
"fff",
"ffo",
"lml0",
"ffb",
"fp",
"passive_veto"],
196 additionalL1Identifiers=additionalL1Identifiers,
197 createHLTUnitHistograms=create_hlt_unit_histograms,
198 cutResultIdentifiersPerUnit=hlt_trigger_lines_per_unit_in_plot,
199 pathLocation=
"after filter",
202 path.add_module(
"StatisticsTimingHLTDQM",
203 histogramDirectoryName=
"timing_statistics_after_filter"
204 ).set_name(
"StatisticsTimingHLTDQM_after_filter")
206 path.add_module(
"TrackingAbortDQM")
208 path.add_module(
"DetectorOccupanciesDQM")
212 "SoftwareTriggerHLTDQM",
213 cutResultIdentifiers={
214 "skim": {
"skim": hlt_skim_lines_in_plot},
216 cutResultIdentifiersIgnored={
221 createTotalResultHistograms=
False,
222 createExpRunEventHistograms=
False,
223 histogramDirectoryName=
"softwaretrigger_skim_nobhabha",
224 ).set_name(
"SoftwareTriggerHLTDQM_skim_nobhabha")
226 if dqm_environment ==
"hlt" and (dqm_mode
in [
"dont_care",
"filtered"]):
228 if components
is None or 'SVD' in components:
229 svdunpackerdqm = b2.register_module(
'SVDUnpackerDQM')
230 path.add_module(svdunpackerdqm)
233 if (components
is None or 'CDC' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
234 cdcdqm = b2.register_module(
'cdcDQM7')
235 path.add_module(cdcdqm)
237 module_names = [m.name()
for m
in path.modules()]
238 if (
'SoftwareTrigger' in module_names):
239 cdcdedxdqm = b2.register_module(
'CDCDedxDQM')
240 path.add_module(cdcdedxdqm)
242 if dqm_environment ==
"expressreco":
243 path.add_module(
'CDCDQM')
246 if (components
is None or 'ECL' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
247 ecldqm = b2.register_module(
'ECLDQM')
248 path.add_module(ecldqm)
249 ecldqmext = b2.register_module(
'ECLDQMEXTENDED')
250 path.add_module(ecldqmext)
251 path.add_module(
'ECLDQMOutOfTimeDigits')
252 path.add_module(
'ECLDQMConnectedRegions')
254 if dqm_environment ==
"expressreco":
255 path.add_module(
'ECLDQMInjection', histogramDirectoryName=
'ECLINJ')
258 if (components
is None or 'TOP' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
259 topdqm = b2.register_module(
'TOPDQM')
260 path.add_module(topdqm)
263 if (components
is None or 'KLM' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
264 klmdqm = b2.register_module(
"KLMDQM")
265 path.add_module(klmdqm)
268 if (components
is None or 'TRG' in components)
and (dqm_mode
in [
"dont_care",
"before_filter"]):
270 trgecldqm = b2.register_module(
'TRGECLDQM')
271 path.add_module(trgecldqm)
272 trgecltimingdqm = b2.register_module(
'TRGECLEventTimingDQM')
273 path.add_module(trgecltimingdqm)
275 trggdldqm = b2.register_module(
'TRGGDLDQM')
276 trggdldqm.param(
'skim', 0)
277 path.add_module(trggdldqm)
279 trggrldqm = b2.register_module(
'TRGGRLDQM')
280 path.add_module(trggrldqm)
282 nmod_tsf = [0, 1, 2, 3, 4, 5, 6]
283 for mod_tsf
in nmod_tsf:
284 path.add_module(
'TRGCDCTSFDQM', TSFMOD=mod_tsf)
286 trgcdct2ddqm = b2.register_module(
'TRGCDCT2DDQM')
287 path.add_module(trgcdct2ddqm)
289 nmod_t3d = [0, 1, 2, 3]
290 for mod_t3d
in nmod_t3d:
291 path.add_module(
'TRGCDCT3DConverter',
292 hitCollectionName=
'FirmCDCTriggerSegmentHits' + str(mod_t3d),
293 addTSToDatastore=
True,
294 EventTimeName=
'FirmBinnedEventT0' + str(mod_t3d),
295 addEventTimeToDatastore=
True,
296 inputCollectionName=
'FirmTRGCDC2DFinderTracks' + str(mod_t3d),
297 add2DFinderToDatastore=
True,
298 outputCollectionName=
'FirmTRGCDC3DFitterTracks' + str(mod_t3d),
299 add3DToDatastore=
True,
301 firmwareResultCollectionName=
'TRGCDCT3DUnpackerStore' + str(mod_t3d),
303 path.add_module(
'TRGCDCT3DDQM', T3DMOD=mod_t3d)
305 if dqm_environment !=
"expressreco":
307 path.add_module(
'CDCTriggerNeuroDQMOnline', histogramDirectoryName=
"TRGCDCTNN2", useRecoTracks=
False)
308 path.add_module(
'CDCTriggerNeuroDQM')
311 if dqm_environment ==
"expressreco" and (components
is None or 'TRG' in components)
and (dqm_mode
in [
"dont_care"]):
314 path.add_module(
'CDCTriggerRecoMatcher', TrgTrackCollectionName=neurotrigger.hwneurotracks,
315 hitCollectionName=neurotrigger.hwneuroinputsegmenthits, axialOnly=
True)
316 path.add_module(
'CDCTriggerRecoMatcher', TrgTrackCollectionName=neurotrigger.hwsimneurotracks,
317 hitCollectionName=neurotrigger.hwneuroinputsegmenthits, axialOnly=
True)
318 path.add_module(
'CDCTriggerRecoMatcher', TrgTrackCollectionName=neurotrigger.hwneuroinput2dfindertracks,
319 hitCollectionName=neurotrigger.hwneuroinputsegmenthits, axialOnly=
True)
320 path.add_module(
'CDCTriggerNeuroDQMOnline', histogramDirectoryName=
"TRGCDCTNN2", useRecoTracks=
True)
323 if (components
is None or 'TRG' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
325 trggdldqm_skim = b2.register_module(
'TRGGDLDQM')
326 trggdldqm_skim.param(
'skim', 1)
327 path.add_module(trggdldqm_skim)
328 trgeffdqm = b2.register_module(
"TRGEFFDQM")
329 path.add_module(trgeffdqm)
332 if (components
is None or 'SVD' in components
or 'PXD' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
333 if (dqm_environment ==
"hlt"):
334 path.add_module(
'TrackingHLTDQM')
336 path.add_module(
'ParallelTrackFilter', min_d0=-0.5, max_d0=0.5, min_z0=-1, max_z0=1,
337 inputArrayName=
"", outputINArrayName=
"TracksFromIP", outputOUTArrayName=
"TracksNotFromIP")
338 path.add_module(
'TrackingExpressRecoDQM', histogramDirectoryName=
"TrackingERDQM_FromIP",
339 tracksStoreArrayName=
"TracksFromIP", histogramTitleSuffix=
" - Tracks from IP") \
340 .set_name(
"TrackingExpressRecoDQM_FromIP")
341 path.add_module(
'TrackingExpressRecoDQM', histogramDirectoryName=
"TrackingERDQM_NotFromIP",
342 tracksStoreArrayName=
"TracksNotFromIP", histogramTitleSuffix=
" - Tracks not from IP",
343 produce1Dresiduals=
False, produce2Dresiduals=
False, produceTRClusterPlots=
False) \
344 .set_name(
"TrackingExpressRecoDQM_NotFromIP")
347 if (components
is None or 'ARICH' in components)
and (dqm_mode
in [
"dont_care",
"filtered"]):
348 path.add_module(
'ARICHDQM')
350 if dqm_mode
in [
"dont_care",
"filtered"]:
352 add_analysis_dqm(path)
353 if dqm_environment ==
"expressreco" and (dqm_mode
in [
"dont_care"]):
354 add_mirabelle_dqm(path)
357 if (components
is None or (
'KLM' in components
and 'CDC' in components))
and (dqm_mode
in [
"dont_care",
"filtered"]):
358 path.add_module(
"KLMDQM2", MuonListName=
'mu+:KLMDQM',
359 MinimalMatchingDigits=12,
360 MinimalMatchingDigitsOuterLayers=0,
361 MinimalMomentumNoOuterLayers=4.0,
362 SoftwareTriggerName=
"")
365 if dqm_mode
in [
"dont_care",
"all_events"]:
367 path.add_module(
'DAQMonitor')
def add_neurotrigger_hw(path, nntweightfile=None, debug_level=4, debugout=False, **kwargs)