5 from AthenaMonitoring
import AthMonitorCfgHelper
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaConfiguration.Enums
import LHCPeriod
8 helper = AthMonitorCfgHelper(flags,
'DQTGlobalWZFinderAlgCfg')
10 algConfObj = CompFactory.DQTGlobalWZFinderAlg
11 muonSelectionTool = CompFactory.CP.MuonSelectionTool(
"DQTMuonSelectionTool")
12 r3MatchingTool = CompFactory.Trig.R3MatchingTool(
"R3MatchingTool")
13 truthClassifier = CompFactory.MCTruthClassifier(
"MCTruthClassifier")
16 muonSelectionTool.MuQuality=1
17 muonSelectionTool.MaxEta=2.4
18 muonSelectionTool.IsRun3Geo=(flags.GeoModel.Run == LHCPeriod.Run3)
19 muonSelectionTool.TurnOffMomCorr=
True
21 monAlg = helper.addAlgorithm(algConfObj,
'DQTGlobalWZFinderAlg',
22 MuonSelectionTool = muonSelectionTool,
23 R3MatchingTool = r3MatchingTool,
24 MCTruthClassifier = truthClassifier)
26 monAlg.doTrigger = flags.DQ.useTrigger
28 monAlg.electronEtCut = 27
31 monAlg.zCutHigh = 116.0
32 monAlg.muonMaxEta = muonSelectionTool.MaxEta
33 monAlg.Z_ee_trigger = [
"HLT_e26_lhtight_ivarloose_L1eEM26M",
"HLT_e60_lhmedium_L1eEM26M",
"HLT_e140_lhloose_L1eEM26M",
"HLT_e300_etcut_L1eEM26M"]
34 monAlg.Z_mm_trigger = [
"HLT_mu24_ivarmedium_L1MU14FCH",
"HLT_mu50_L1MU14FCH"]
45 optData =
'kAlwaysCreate'
48 optMC =
'kAlwaysCreate'
50 group = helper.addGroup(monAlg,
'default',
'GLOBAL/DQTGlobalWZFinder',
'run')
52 elegroup = helper.addGroup(monAlg,
'electron',
'GLOBAL/DQTGlobalWZFinder',
'run')
53 muongroup = helper.addGroup(monAlg,
'muon',
'GLOBAL/DQTGlobalWZFinder',
'run')
55 group_Zee = helper.addGroup(monAlg,
'Zee',
'GLOBAL/DQTGlobalWZFinder',
'run')
56 group_Zmumu = helper.addGroup(monAlg,
'Zmumu',
'GLOBAL/DQTGlobalWZFinder',
'run')
58 group_EleTP = helper.addGroup(monAlg,
'EleTP',
'GLOBAL/DQTGlobalWZFinder',
'run')
59 group_EleContainerTP = helper.addGroup(monAlg,
'EleContainerTP',
'GLOBAL/DQTGlobalWZFinder',
'run')
60 group_EleTrigTP = helper.addGroup(monAlg,
'EleTrigTP',
'GLOBAL/DQTGlobalWZFinder',
'run')
62 group_MuonTruthEff = helper.addGroup(monAlg,
'MuonTruthEff',
'GLOBAL/DQTGlobalWZFinder',
'run')
63 group_MuonTriggerTP = helper.addGroup(monAlg,
'MuonTriggerTP',
'GLOBAL/DQTGlobalWZFinder',
'run')
64 group_MuonLooseTP = helper.addGroup(monAlg,
'MuonLooseTP',
'GLOBAL/DQTGlobalWZFinder',
'run')
65 group_MuonInDetTP = helper.addGroup(monAlg,
'MuonInDetTP',
'GLOBAL/DQTGlobalWZFinder',
'run')
67 group.defineHistogram(
'LB,avgLiveFrac',
79 group.defineHistogram(
'LB,duration',
90 group.defineHistogram(
'LB,avgIntPerXing',
100 elegroup.defineHistogram(
'ele_Et',
101 title=
'Selected Electron E_{T}',
108 elegroup.defineHistogram(
'ele_Eta',
109 title=
'Selected Electron #eta',
116 elegroup.defineHistogram(
'ele_Phi',
117 title=
'Selected Electron #phi',
124 muongroup.defineHistogram(
'muon_Pt',
125 title=
'Selected Muon p_{T}',
132 muongroup.defineHistogram(
'muon_Eta',
133 title=
'Selected Muon #eta',
140 muongroup.defineHistogram(
'muon_Phi',
141 title=
'Selected Muon #phi',
149 m_zCutHigh = 116000.0
150 nzbins =
int( m_zCutHigh*0.001 - m_zCutLow*0.001 )
152 m_zCutLow_elTP = 66000.0
153 m_zCutHigh_elTP = 250000.0
154 nzbins_elTP =
int( m_zCutHigh_elTP*0.001 - m_zCutLow_elTP*0.001 )
156 group_Zee.defineHistogram(
'Zeecharge;m_Z_Q_ele',
157 title=
'Z#rightarrowee Charge',
165 group_Zee.defineHistogram(
'mass;m_Z_mass_opsele',
166 title=
'Z#rightarrowee (op. sign) Mass',
176 group_Zee.defineHistogram(
'LB;m_Z_Counter_el_os',
177 title=
'Z#rightarrowee count per Lumi Block',
188 group_Zee.defineHistogram(
'LB;m_Z_Counter_el_ss',
189 title=
'Z#rightarrowee count per Lumi Block',
200 group_Zee.defineHistogram(
'mass;m_Z_mass_ssele',
201 title=
'Z#rightarrowee (same sign) Mass',
211 group_Zee.defineHistogram(
'pT1;m_leadingele_pt',
212 title=
'Leading e p_{T}',
221 group_Zee.defineHistogram(
'pT2;m_subleadingele_pt',
222 title=
'Subleading e p_{T}',
231 group_Zee.defineHistogram(
'eta1;m_leadingele_eta',
232 title=
'Leading e #eta',
241 group_Zee.defineHistogram(
'eta2;m_subleadingele_eta',
242 title=
'Subleading e #eta',
251 group_Zee.defineHistogram(
'phi1;m_leadingele_phi',
252 title=
'Leading e #phi',
261 group_Zee.defineHistogram(
'phi2;m_subleadingele_phi',
262 title=
'Subleading e #phi',
271 group_Zmumu.defineHistogram(
'Zmumucharge;m_Z_Q_mu',
272 title=
'Z#rightarrow#mu#mu Charge',
280 group_Zmumu.defineHistogram(
'mass;m_Z_mass_opsmu',
281 title=
'Z#rightarrow#mu#mu (op. sign) Mass',
291 group_Zmumu.defineHistogram(
'LB;m_Z_Counter_mu',
292 title=
'Z#rightarrow#mu#mu count per Lumi Block',
303 group_Zmumu.defineHistogram(
'mass;m_Z_mass_ssmu',
304 title=
'Z#rightarrow#mu#mu (same sign) Mass',
314 group_Zmumu.defineHistogram(
'pT1;m_leadingmu_pt',
315 title=
'Leading #mu p_{T}',
324 group_Zmumu.defineHistogram(
'pT2;m_subleadingmu_pt',
325 title=
'Subleading #mu p_{T}',
334 group_Zmumu.defineHistogram(
'eta1;m_leadingmu_eta',
335 title=
'Leading #mu #eta',
344 group_Zmumu.defineHistogram(
'eta2;m_subleadingmu_eta',
345 title=
'Subleading #mu #eta',
354 group_Zmumu.defineHistogram(
'phi1;m_leadingmu_phi',
355 title=
'Leading #mu #phi',
364 group_Zmumu.defineHistogram(
'phi2;m_subleadingmu_phi',
365 title=
'Subleading #mu #phi',
374 group_Zmumu.defineTree(
'pT1, pT2, phi1, phi2, eta1, eta2, mass, evtWeight, isTruth, LB, eventNumber, runNumber;muontree',
376 treedef=
'pT1/F:pT2/F:phi1/F:phi2/F:eta1/F:eta2/F:mass/F:evtWeight/F:isTruth/O:LB/I:eventNumber/l:runNumber/I',
377 cutmask=
'writeTTrees',
381 group_EleTP.defineHistogram(
'mass;m_ele_tight_bad_os',
385 xmax=m_zCutHigh_elTP,
391 group_EleTP.defineHistogram(
'mass;m_ele_tight_bad_ss',
395 xmax=m_zCutHigh_elTP,
401 group_EleTP.defineHistogram(
'mass;m_ele_tight_good_os',
405 xmax=m_zCutHigh_elTP,
411 group_EleTP.defineHistogram(
'mass;m_ele_tight_good_ss',
415 xmax=m_zCutHigh_elTP,
421 group_EleTP.defineHistogram(
'mass;m_ele_template_os',
425 xmax=m_zCutHigh_elTP,
426 cutmask=
'template_os',
431 group_EleTP.defineHistogram(
'mass;m_ele_template_ss',
435 xmax=m_zCutHigh_elTP,
436 cutmask=
'template_ss',
441 group_EleContainerTP.defineHistogram(
'mass;m_elContainertp_nomatch',
445 xmax=m_zCutHigh_elTP,
446 cutmask=
'container_nomatch',
451 group_EleContainerTP.defineHistogram(
'mass;m_ele_tight_passkine',
455 xmax=m_zCutHigh_elTP,
461 group_EleTP.defineTree(
'pT, phi, eta, mass, isTruth, runNumber, LB, eventNumber, mtype, weight;electron_reco_tptree',
462 title=
'electron_reco_tp_tree',
463 treedef=
'pT/F:phi/F:eta/F:mass/F:runNumber/I:LB/I:eventNumber/l:mtype/I:weight/F',
467 group_EleTrigTP.defineHistogram(
'matched;m_eltrigtp_matches_os',
468 title=
'Electron trigger TP stats',
478 group_EleTrigTP.defineHistogram(
'matched;m_eltrigtp_matches_ss',
479 title=
'Electron trigger TP stats',
489 group_EleTrigTP.defineTree(
'pT, phi, eta, mass, runNumber, LB, eventNumber, mtype, weight;electron_trig_tptree',
490 title=
'electron_trig_tptree',
491 treedef=
'pT/F:phi/F:eta/F:mass/F:runNumber/I:LB/I:eventNumber/l:mtype/I:weight/F',
495 group_MuonTruthEff.defineHistogram(
'match;mcmatch',
496 title=
'Muon matching to truth in acceptance',
504 group_MuonTriggerTP.defineHistogram(
'matched;m_mutrigtp_matches',
505 title=
'Muon Trigger TP stats',
514 group_MuonTriggerTP.defineTree(
'matched, isOS;m_bcid_mu_trigtp',
515 title=
'm_bcid_mu_trigtp',
516 treedef=
'nTrig_matches/I:isOS/O',
521 group_MuonTriggerTP.defineTree(
'pT, eta, phi, mass, isTruth, runNumber, LB, eventNumber, mtype, weight;muon_trig_tptree',
522 title=
'muon_trig_tptree',
523 treedef=
'pT/F:phi/F:eta/F:mass/F:isTruth/O:runNumber/I:LB/I:eventNumber/l:mtype/I:weight/F',
527 group_MuonLooseTP.defineHistogram(
'mass;m_muloosetp_match_os',
528 title=
'Muon loose TP match OS',
537 group_MuonLooseTP.defineHistogram(
'mass;m_muloosetp_match_ss',
538 title=
'Muon loose TP match SS',
547 group_MuonLooseTP.defineHistogram(
'mass;m_muloosetp_nomatch_os',
548 title=
'Muon loose TP nomatch OS',
557 group_MuonLooseTP.defineHistogram(
'mass;m_muloosetp_nomatch_ss',
558 title=
'Muon loose TP nomatch SS',
567 group_MuonLooseTP.defineTree(
'pT, phi, eta, mass, isTruth, runNumber, LB, eventNumber, mtype, weight;muon_reco_tptree',
568 title=
'muon_reco_tptree',
569 treedef=
'pT/F:phi/F:eta/F:mass/F:isTruth/O:runNumber/I:LB/I:eventNumber/l:mtype/I:weight/F',
573 group_MuonInDetTP.defineHistogram(
'mass;m_mu_InDet_tp_match_os',
574 title=
'Muon inner detector TP match OS',
583 group_MuonInDetTP.defineHistogram(
'mass;m_mu_InDet_tp_match_ss',
584 title=
'Muon inner detector TP match SS',
593 group_MuonInDetTP.defineHistogram(
'mass;m_mu_InDet_tp_nomatch_os',
594 title=
'Muon inner detector TP nomatch OS',
603 group_MuonInDetTP.defineHistogram(
'mass;m_mu_InDet_tp_nomatch_ss',
604 title=
'Muon inner detector TP nomatch SS',
613 group_MuonInDetTP.defineTree(
'pT, eta, phi, mass, isTruth, runNumber, LB, eventNumber, mtype, weight;muon_indet_tptree',
614 title=
'muon_indet_tptree',
615 treedef=
'pT/F:phi/F:eta/F:mass/F:isTruth/O:runNumber/I:LB/I:eventNumber/l:mtype/I:weight/F',
619 result = helper.result()