ATLAS Offline Software
MMMonitorAlgorithm.py
Go to the documentation of this file.
1 #
2 #Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 from MMRawDataMonitoring.MMMonUtils import getMMLabel, getMMLabelY
7 
8 def MMMonitoringConfig(inputFlags):
9  '''Function to configures some algorithms in the monitoring system.'''
10 
11 
14  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
15  result = ComponentAccumulator()
16  # Make sure muon geometry is configured
17  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
18 
19  result.merge(MuonGeoModelCfg(inputFlags))
20 
21  # The following class will make a sequence, configure algorithms, and link
22  # them to GenericMonitoringTools
23 
24  from AthenaMonitoring import AthMonitorCfgHelper
25  helper = AthMonitorCfgHelper(inputFlags,'MMAthMonitorCfg')
26 
27  # Adding an algorithm to the helper.
28 
29  mmMonAlg = helper.addAlgorithm(CompFactory.MMRawDataMonAlg,'MMMonAlg')
30  mmMonAlg.DoMMESD = True
31  mmMonAlg.do_stereoCorrection=False
32  mmMonAlg.cut_pt = 0
33  mmMonAlg.doDetailedHists = False
34 
35  mmGroup = helper.addGroup(mmMonAlg,'mmMonitor','Muon/MuonRawDataMonitoring/MM/')
36 
37  side = ["CSide","ASide"]
38  phimax=16
39 
40  # Configure histograms
41  mmTriggerGroup=helper.addGroup(mmMonAlg, "mmTrigger", "Muon/MuonRawDataMonitoring/MM")
42  mmTriggerGroup.defineHistogram('lb_tri,trig_sector;trigger_sector_vs_lumiblock', type='TH2F', title='TriggerSector_vs_lumiblock; lb; sector', path='MMTrigger', xbins=100, xmin=-0.5, xmax=99.5, ybins=33, ymin=-16.5, ymax=16.5, opt='kAddBinsDynamically,kAlwaysCreate')
43  mmTriggerGroup.defineHistogram('trig_sector,art_channel;art_channel_vs_sector', type='TH2F', title='ART_channels; sector; art_channel', path='MMTrigger', xbins=33, xmin=-16.5, xmax=16.5, ybins=8192, ymin=0, ymax=8192,opt='kAlwaysCreate')
44  layerLabelx=getMMLabelY("x_layer_in_sector_tri")
45  mmTriggerGroup.defineHistogram('art_sector_layer,art_channel;art_channel_vs_layer', type='TH2F', title='ART_channels_vs_layer; ; art_channel', path='MMTrigger', xbins=257, xmin=-128, xmax=129, ybins=8192, ymin=0, ymax=8192, xlabels=layerLabelx,opt='kAlwaysCreate')
46  mmTriggerGroup.defineHistogram('trig_sector,art_deltaBC;art_bcid_vs_sector', type='TH2F', title='ART_BCID_vs_sector; sector_layer; art_deltaBCID', path='MMTrigger', xbins=33, xmin=-16.5, xmax=16.5, ybins=40, ymin=-20, ymax=20,opt='kAlwaysCreate')
47  mmTriggerGroup.defineHistogram('art_sector_layer,art_deltaBC;art_layer_vs_Dbcid', type='TH2F', title='ART_BCID_vs_layer; sector_layer; art_deltaBCID', path='MMTrigger', xbins=260, xmin=-130, xmax=130, ybins=40, ymin=-20, ymax=20, xlabels=layerLabelx,opt='kAlwaysCreate')
48  mmTriggerGroup.defineHistogram('lb_tri,art_sector_layer;art_layer_vs_lumiblock', type='TH2F', title='ART_layer_vs_lumiblock; lb; ', path='MMTrigger', xbins=100, xmin=-0.5, xmax=99.5, ybins=260, ymin=-130, ymax=130,opt='kAddBinsDynamically,kAlwaysCreate', ylabels=layerLabelx)
49  mmTriggerGroup.defineHistogram('art_bc,bcid;art_bcid_vs_bc', type='TH2F', title='ART_BCID; art_bcid; BCID', path='MMTrigger', xbins=5000, xmin=0, xmax=5000, ybins=5000, ymin=0, ymax=5000,opt='kAlwaysCreate')
50  mmTriggerGroup.defineHistogram('art_deltaBC,bcid;art_Dbcid_vs_bc', type='TH2F', title='ART_BCID; art_Dbcid; BCID', path='MMTrigger', xbins=5000, xmin=-2500, xmax=2500, ybins=5000, ymin=0, ymax=5000,opt='kAlwaysCreate')
51 
52  mmTriggerGroup_roi=helper.addGroup(mmMonAlg, "mmTrigger_roi", "Muon/MuonRawDataMonitoring/MM")
53  mmTriggerGroup_roi.defineHistogram('deltaBC;Delta_BC', type='TH1F', title='Delta_BC; deltaBC; events', path='MMTrigger', xbins=40, xmin=-20, xmax=20,opt='kAlwaysCreate')
54  mmTriggerGroup_roi.defineHistogram('phiid;phi', type='TH1F', title='phi; phi; events', path='MMTrigger', xbins=70, xmin=-35, xmax=35,opt='kAlwaysCreate')
55 
56  mmTriggerGroup_roi.defineHistogram('trig_sector,phi_mu;sector_vs_phimu', type='TH2F', title='sector_vs_phimu; sector; phimu ', path='MMTrigger', xbins=40, xmin=-20, xmax=20, ybins=100, ymin=-3.2, ymax=3.2,opt='kAlwaysCreate')
57  mmTriggerGroup_roi.defineHistogram('phi_roi,phi_mu;phiroi_vs_phimu', type='TH2F', title='phiroi_vs_phimu; phi_roi; phimu ', path='MMTrigger', xbins=100, xmin=-3.2, xmax=3.2, ybins=100, ymin=-3.2, ymax=3.2,opt='kAlwaysCreate')
58  mmTriggerGroup_roi.defineHistogram('eta_roi,eta_mu;etaroi_vs_etamu', type='TH2F', title='etaroi_vs_etamu; eta_roi; etamu ', path='MMTrigger', xbins=100, xmin=-3., xmax=3., ybins=100, ymin=-3., ymax=3.,opt='kAlwaysCreate')
59  mmTriggerGroup_roi.defineHistogram('x_roi_sideA,y_roi_sideA;roi_x_vs_y_sideA', type='TH2F', title='roix_vs_roiy_sideA; x_roi; y_roi ', path='MMTrigger', xbins=200, xmin=-5000., xmax=5000., ybins=200, ymin=-5000., ymax=5000.,opt='kAlwaysCreate')
60  mmTriggerGroup_roi.defineHistogram('x_roi_sideC,y_roi_sideC;roi_x_vs_y_sideC', type='TH2F', title='roix_vs_roiy_sideC; x_roi; y_roi ', path='MMTrigger', xbins=200, xmin=-5000., xmax=5000., ybins=200, ymin=-5000., ymax=5000.,opt='kAlwaysCreate')
61  mmTriggerGroup_roi.defineHistogram('lb_tri,trig_sector;sector_roi_vs_lb', type='TH2F', title='sector_roi_vs_lb; lb; sector_roi ', path='MMTrigger', xbins=100, xmin=-0.5, xmax=99.5, ybins=33, ymin=-16.5, ymax=16.5, opt='kAddBinsDynamically,kAlwaysCreate')
62  mmTriggerGroup_roi.defineHistogram('trig_sector,deltaBC;deltaBC_vs_sector_roi', type='TH2F', title='deltaBC_vs_sector_ROI; sector; dBC_roi ', path='MMTrigger', xbins=33, xmin=-16.5, xmax=16.5, ybins=40, ymin=-20, ymax=20,opt='kAlwaysCreate')
63  mmTriggerGroup_roi.defineHistogram('trig_sector,nROIPerBC;nROIPerBC_vs_sector', type='TH2F', title='N ROI per BC per Sector; sector; nROIPerBC ', path='MMTrigger', xbins=33, xmin=-16.5, xmax=16.5, ybins=10, ymin=0, ymax=10, opt='kAlwaysCreate')
64 
65  for iside in side:
66  for phi in range(1, phimax+1):
67  title_ROI=f'rID_vs_phiID ROI {iside} Sector {phi}; PhiID ; RID'
68  var=f'phiid_{iside}_s{phi},rid_{iside}_s{phi};rID_vs_phiID_ROI_{iside}_Sector{phi}'
69  mmTriggerGroup_roi.defineHistogram(var, type='TH2F', title=title_ROI, path='MMTrigger/ROIPerSector', xbins=70, xmin=-35, xmax=35, ybins=255, ymin=0, ymax=255,opt='kAlwaysCreate')
70  title_art_dbc=f'ART_DeltaBC vs lumiblock {iside} Sector {phi}; lb ; DeltaBC'
71  var_dbc_art=f'lb_tri,art_deltaBC_{iside}_s{phi};art_DeltaBC_vs_lb_art_{iside}_Sector{phi}'
72  mmTriggerGroup.defineHistogram(var_dbc_art, type='TH2F', title=title_art_dbc, path='MMTrigger/BCvsLBPerSector', xbins=100, xmin=-0.5, xmax=99.5, ybins=40, ymin=-20, ymax=20, opt='kAddBinsDynamically,kAlwaysCreate')
73  title_roi_dbc=f'ROI DeltaBC vs lumiblock {iside} Sector {phi}; lb ; DeltaBC'
74  var_dbc_roi=f'lb_tri,deltaBC_{iside}_s{phi};DeltaBC_vs_lb_ROI_{iside}_Sector{phi}'
75  mmTriggerGroup_roi.defineHistogram(var_dbc_roi, type='TH2F', title=title_roi_dbc, path='MMTrigger/BCvsLBPerSector', xbins=100, xmin=-0.5, xmax=99.5, ybins=40, ymin=-20, ymax=20, opt='kAddBinsDynamically,kAlwaysCreate')
76 
77 
78  # Overview histogram
79  mmGroup.defineHistogram('nseg;nseg', type='TH1F', title='Number_of_segments; Number_of_segments; Number of Entries', path='Overview', xbins=100, xmin=0, xmax=100., opt='kAlwaysCreate')
80  mmGroup.defineHistogram('ntrk;ntrk', type='TH1F', title='Number_of_tracks; Number_of_tracks; Number of Entries', path='Overview', xbins=100, xmin=0, xmax=100., opt='kAlwaysCreate')
81  mmGroup.defineHistogram('pt_trk;pt', type='TH1F', title='pt; pt[GeV]; Number of Entries', path='Overview', xbins=200, xmin=0, xmax=400., opt='kAlwaysCreate')
82  mmGroup.defineHistogram('residual;Residuals', type='TH1F', title='Residuals; res[mm]; Number of Entries', path='Overview', xbins=200, xmin=-10, xmax=10., opt='kAlwaysCreate')
83  mmGroup.defineHistogram('residual,eta_trk;Res_vs_eta', type='TH2F', title="Residuals vs Eta; Residuals [mm]; Eta;", path='Overview',xbins=100, xmin=-10, xmax=10., ybins=100, ymin=-3.,ymax=3., opt='kAlwaysCreate')
84  mmGroup.defineHistogram('residual,phi_trk;Res_vs_phi', type='TH2F', title="Residuals vs Eta; Residuals [mm]; Phi;", path='Overview',xbins=100, xmin=-10, xmax=10., ybins=16, ymin=-3.14,ymax=3.14, opt='kAlwaysCreate')
85  mmGroup.defineHistogram('residual,stPhi_mon;Res_vs_stPhi', type='TH2F', title="Residuals vs station Phi; Res; stPhi;", path='Overview', xbins=100, xmin=-10, xmax=10., ybins=16, ymin=.5,ymax=16.5, opt='kAlwaysCreate')
86  mmGroup.defineHistogram('charge_all;Charge', type='TH1F', title='Charge; Charge[fC]; Number of Entries', path='Overview', xbins=200, xmin=0., xmax=800., opt='kAlwaysCreate')
87  mmGroup.defineHistogram('x_mon, y_mon;Posy_vs_Posx', type='TH2F', title="Posy vs Posx; MM-GlobalX [mm]; MM-GlobalY [mm];", path='Overview', xbins=500, xmin=-5000, xmax=5000., ybins=500, ymin=-5000., ymax=5000., opt='kAlwaysCreate')
88  mmGroup.defineHistogram('R_mon, z_mon;Posz_vs_R', type='TH2F', title="Posz vs R; MM-GlobalR [mm]; MM-GlobalZ [mm];", path='Overview', xbins=500, xmin=0, xmax=5000., ybins=1000, ymin=-8000 ,ymax=8000, opt='kAlwaysCreate')
89  mmGroup.defineHistogram('numberofstrips_percluster;Nstrips_percluster', type='TH1F', title='Number of strips per cluster; Number of strips; Number of Entries', path='Overview', xbins=20, xmin=0., xmax=20., opt='kAlwaysCreate')
90  mmGroup.defineHistogram('strip_times;strip_time', type='TH1F', title='strip time; time [ns]; Number of Entries', path='Overview', xbins=800, xmin=-100., xmax=700., opt='kAlwaysCreate')
91  mmGroup.defineHistogram('cluster_times;cluster_time', type='TH1F', title='cluster time; time [ns]; Number of Entries', path='Overview', xbins=700, xmin=-200., xmax=500., opt='kAlwaysCreate')
92  mmGroup.defineHistogram('statEta_strip, strip_number;Strip_Number_vs_StationEta', type='TH2F', title='Strip Numbers vs Station Eta; ; Strip Number;', path='Overview', xbins=5, xmin=-2, xmax=3., xlabels=['#eta-2','#eta-1','','#eta1','#eta2'], ybins=5120, ymin=0., ymax=5120., opt='kAlwaysCreate')
93  mmGroup.defineHistogram('nstrips_ontrack;Nstrips_percluster_ontrack', type='TH1F', title='Number of strips per cluster on track; Number of strips; Number of Entries', path='Overview', xbins=20, xmin=0., xmax=20., opt='kAlwaysCreate')
94  mmGroup.defineHistogram('charge_ontrack;Charge_ontrack', type='TH1F', title='Charge on track; Charge [fC]; Number of Entries', path='Overview', xbins=200, xmin=0, xmax=800., opt='kAlwaysCreate')
95  mmGroup.defineHistogram('strip_time_on_track', type='TH1F', title='strip time on track; time [ns]; Number of Entries', path='Overview', xbins=800, xmin=-100., xmax=700., opt='kAlwaysCreate')
96  mmGroup.defineHistogram('cluster_time_on_track', type='TH1F', title='cluster time on track; time [ns]; Number of Entries', path='Overview', xbins=700, xmin=-200, xmax=500., opt='kAlwaysCreate')
97 
98 
99 
100  mmGroup.defineHistogram('cluster_size_onseg;Nstrips_percluster_onseg', type='TH1F', title='Number of strips per cluster on segments; Number of strips; Number of Entries', path='Overview', xbins=20, xmin=0., xmax=20., opt='kAlwaysCreate')
101  mmGroup.defineHistogram('charge_onseg;Charge_onseg', type='TH1F', title='Charge on segments; Charge[fC]; Number of Entries', path='Overview', xbins=200, xmin=0., xmax=800., opt='kAlwaysCreate')
102  mmGroup.defineHistogram('strp_time_onseg;strip_time_onseg', type='TH1F', title='strip time on segments; time [ns]; Number of Entries', path='Overview', xbins=800, xmin=-100, xmax=700., opt='kAlwaysCreate')
103 
104 
105  occLabelx=getMMLabelY("x_lab_occ")
106  mmGroup.defineHistogram('sector_CSide,stationPhi_CSide;Occupancy_CSide_PCB', type='TH2F', title='Occupancy EC; ; Sector;', path='Occupancy', xbins=64, xmin=0, xmax=128., ybins=16, ymin=.5, ymax=16.5, xlabels=occLabelx, opt='kAlwaysCreate')
107  mmGroup.defineHistogram('sector_ASide,stationPhi_ASide;Occupancy_ASide_PCB', type='TH2F', title='Occupancy EA; ; Sector;', path='Occupancy', xbins=64, xmin=0, xmax=128., ybins=16, ymin=.5, ymax=16.5, xlabels=occLabelx, opt='kAlwaysCreate')
108  mmGroup.defineHistogram('sector_CSide_ontrack,stationPhi_CSide_ontrack;Occupancy_CSide_PCB_ontrack', type='TH2F', title='Occupancy EC ontrack; ; Sector;', path='Occupancy', xbins=64, xmin=0, xmax=128., ybins=16, ymin=.5, ymax=16.5, xlabels=occLabelx, opt='kAlwaysCreate')
109  mmGroup.defineHistogram('sector_ASide_ontrack,stationPhi_ASide_ontrack;Occupancy_ASide_PCB_ontrack', type='TH2F', title='Occupancy EA ontrack; ; Sector;', path='Occupancy', xbins=64, xmin=0, xmax=128., ybins=16, ymin=.5, ymax=16.5, xlabels=occLabelx, opt='kAlwaysCreate')
110  mmGroup.defineHistogram('sector_CSide_onseg,stationPhi_CSide_onseg;Occupancy_CSide_PCB_onseg', type='TH2F', title='Occupancy EC onseg; ; Sector;', path='Occupancy', xbins=64, xmin=0, xmax=128., ybins=16, ymin=.5, ymax=16.5, xlabels=occLabelx, opt='kAlwaysCreate')
111  mmGroup.defineHistogram('sector_ASide_onseg,stationPhi_ASide_onseg;Occupancy_ASide_PCB_onseg', type='TH2F', title='Occupancy EA onseg; ; Sector;', path='Occupancy', xbins=64, xmin=0, xmax=128., ybins=16, ymin=.5, ymax=16.5, xlabels=occLabelx, opt='kAlwaysCreate')
112 
113 
114 
115  etasector = ["1","2"]
116  for iside in side:
117 
118  if iside=="ASide":
119  thisLabelx11,thisLabely11=getMMLabel("x_lab_occ_ASide","y_lab_occ_ASide")
120  if iside=="CSide":
121  thisLabelx11,thisLabely11=getMMLabel("x_lab_occ_CSide","y_lab_occ_CSide")
122 
123  MM_SideGroup="MM_sideGroup{0}".format(iside)
124  mmSideGroup=helper.addGroup(mmMonAlg, MM_SideGroup, "Muon/MuonRawDataMonitoring/MM/"+iside)
125 
126  # Histograms for each sector
127 
128  multipletmin=1
129  multipletmax=2
130 
131 
132  for eta in etasector:
133  var_layer=f'hitcut,{iside}_eta{eta}'
134  title_eff_layer=f'Efficiency_per_layer_Eta{eta}_{iside}; layer Sector = int(layer/8) ; Efficiency;'
135  #occLabelx=getMMLabelY("x_layer_in_sector")
136  mmSideGroup.defineHistogram(var_layer, type='TEfficiency', title=title_eff_layer, path='Efficiency_perLayer', xbins=128, xmin=0, xmax=128, opt='kAlwaysCreate')
137 
138  for phi in range(1, phimax+1):
139  title_MMSummary=f'Number of strips per cluster E{iside} stPhi {phi}; ; Strip Number'
140  var=f'sector_strip_{iside}_phi{phi},strip_number_{iside}_phi{phi};Strip_number_pergap_{iside}_stPhi{phi}'
141  mmSideGroup.defineHistogram(var, type='TH2F', title=title_MMSummary, path='Number_of_strips_percluster_perPhiSector', xbins=16, xmin=0, xmax=16, xlabels=thisLabelx11, ybins=5120, ymin=0., ymax=5120., opt='kAlwaysCreate')
142 
143  thisLabely=getMMLabelY("x_lab_occ")
144  mmSideGroup.defineHistogram(f'lb_mon,sector_lb_{iside}_phi{phi};Occupancy_lb_{iside}_phi{phi}', type='TH2F', title=f'Occupancy wrt lb sector {phi}; LB; PCB FEB', path='Occupancy', xbins=100, xmin=-0.5, xmax=99.5, opt='kAddBinsDynamically,kAlwaysCreate', ybins=128, ymin=0., ymax=128, ylabels=thisLabely, merge='merge')
145  mmSideGroup.defineHistogram(f'lb_ontrack,sector_lb_{iside}_phi{phi}_ontrack;Occupancy_lb_{iside}_phi{phi}_ontrack', type='TH2F', title=f'Occupancy wrt lb sector {phi} ontrack ; LB; PCB FEB', path='Occupancy', xbins=100, xmin=-0.5, xmax=99.5, opt='kAddBinsDynamically,kAlwaysCreate', ybins=128, ymin=0., ymax=128, ylabels=thisLabely, merge='merge')
146  mmSideGroup.defineHistogram(f'lb_onseg,sector_lb_{iside}_phi{phi}_onseg;Occupancy_lb_{iside}_phi{phi}_onseg', type='TH2F', title=f'Occupancy wrt lb sector {phi} onSegms; LB; PCB FEB', path='Segments/Occupancy', xbins=100, xmin=-0.5, xmax=99.5, opt='kAddBinsDynamically,kAlwaysCreate', ybins=128, ymin=0., ymax=128, ylabels=thisLabely, merge='merge')
147 
148  for multi in range(multipletmin, multipletmax+1):
149  for gas_gap in range(1,5):
150  layer = gas_gap
151  if (multi == 2):
152  layer=gas_gap+4
153  if mmMonAlg.doDetailedHists:
154  title_MMSummary_charge=f'Charge {iside} stPhi{phi} multiplet{multi} layer{layer}; Charge [fC]; Number of Entries'
155  var1=f'charge_perlayer_{iside}_phi{phi}_ml{multi}_gap{gas_gap};Charge_perlayer_{iside}_phi{phi}_ml{multi}_gap{gas_gap}'
156  mmSideGroup.defineHistogram(var1, type='TH1F', title=title_MMSummary_charge, path='Charge_perLayer', xbins=200, xmin=0., xmax=600., opt='kAlwaysCreate')
157 
158  title_MMSummary_charge_ontrack=f'Charge_ontrack_perlayer_{iside}_phi{phi}_ml{multi}_gap{gas_gap}; Charge [fC]; Number of Entries'
159  var2=f'charge_perlayer_ontrack_{iside}_phi{phi}_ml{multi}_gap{gas_gap};Charge_ontrack_perlayer_{iside}_phi{phi}_ml{multi}_gap{gas_gap}'
160  mmSideGroup.defineHistogram(var2, type='TH1F', title=title_MMSummary_charge_ontrack, path='Charge_perLayer', xbins=200, xmin=0., xmax=600., opt='kAlwaysCreate')
161 
162  title_cl_size_layer=f'Cluster size {iside} phi{phi} mult{multi} layer{layer}; cluster size; Entries'
163  var_clus_size_layer=f'cluster_size_perlayer_{iside}_phi{phi}_ml{multi}_gap{gas_gap};Cluster_size_{iside}_phi{phi}_ml{multi}_gap{gas_gap}'
164  mmSideGroup.defineHistogram(var_clus_size_layer, type='TH1F', title=title_cl_size_layer, path="Cluster_size_perLayer", xbins=20, xmin=0, xmax=20, opt='kAlwaysCreate')
165  title2_cl_size_layer=f'Cluster size ontrack {iside} phi{phi} mult{multi} layer{layer}; cluster size; Entries'
166  var2_clus_size_layer=f'cluster_size_perlayer_ontrack_{iside}_phi{phi}_ml{multi}_gap{gas_gap};Cluster_size_ontrack_{iside}_phi{phi}_ml{multi}_gap{gas_gap}'
167  mmSideGroup.defineHistogram(var2_clus_size_layer, type='TH1F', title=title2_cl_size_layer, path="Cluster_size_perLayer", xbins=20, xmin=0, xmax=20, opt='kAlwaysCreate')
168 
169  var_residual_layer=f'residuals_{iside}_phi{phi}_layer{layer}'
170  title_residual_layer =f'residuals{iside} stPhi{phi} layer{layer}; res [mm]; Number of Entries'
171  mmSideGroup.defineHistogram(var_residual_layer, type='TH1F', title=title_residual_layer, path='Residuals_perLayer', xbins=200, xmin=-10, xmax=10, opt='kAlwaysCreate')
172 
173 
174  for eta in etasector:
175  maxpcb=5
176  if(eta == "2"):
177  maxpcb=3
178 
179  for gas_gap in range(1,5):
180  #efficiency per pcb
181  if mmMonAlg.doDetailedHists:
182  title_eff=f'Efficiency_per_PCB_Eta{eta}_{iside}_phi{phi-1}_multiplet{multi}_gas_gap{gas_gap}; pcb; Efficiency Eta{eta}'
183  var_pcb=f'hitcut,pcb_eta{eta}_{iside}_phi{phi-1}_multiplet{multi}_gas_gap{gas_gap}'
184  mmSideGroup.defineHistogram(var_pcb, type='TEfficiency', title=title_eff, path='Efficiency', xbins=maxpcb, xmin=0, xmax=maxpcb, opt='kAlwaysCreate')
185 
186  var_residual=f'residuals_{iside}_phi{phi}_stationEta{eta}_multiplet{multi}_gas_gap{gas_gap}'
187  title_residual =f'residuals{iside} stPhi{phi} stEta{eta} multiplet{multi} gap{gas_gap}; res [mm]; Number of Entries'
188  mmSideGroup.defineHistogram(var_residual, type='TH1F', title=title_residual, path='Residuals', xbins=200, xmin=-10, xmax=10, opt='kAlwaysCreate')
189 
190  var_clus_size=f'pcb_mon_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},cluster_size_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Cluster_size_vs_PCB_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
191  title_cl_size=f'Cluster size {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap}; PCB; cluster size'
192  mmSideGroup.defineHistogram(var_clus_size, type='TH2F', title=title_cl_size, path="Cluster_size_perPCB", xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=20, ymin=0, ymax=20, opt='kAlwaysCreate')
193 
194  var_strip_time=f'pcb_strip_mon_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},strp_time_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Strip_time_vs_PCB_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
195  var_clus_time=f'pcb_mon_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},cluster_time_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Cluster_time_vs_PCB_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
196  title_strp_time=f'Strip time {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap}; PCB; strip time [ns]'
197  title_clus_time=f'Cluster time {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap}; PCB; cluster time [ns]'
198  mmSideGroup.defineHistogram(var_strip_time, type='TH2F', title=title_strp_time, path='Strip_time_perPCB', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=800, ymin=-100, ymax=700, opt='kAlwaysCreate')
199  mmSideGroup.defineHistogram(var_clus_time, type='TH2F', title=title_clus_time, path='Cluster_time_perPCB', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=700, ymin=-200, ymax=500, opt='kAlwaysCreate')
200 
201  var_charge_perPCB=f'pcb_mon_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},charge_perPCB_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Charge_vs_PCB_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
202  title_charge_perPCB=f'Charge {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap}; PCB; charge [fC]'
203  mmSideGroup.defineHistogram(var_charge_perPCB, type='TH2F', title=title_charge_perPCB, path='Charge_perPCB', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=200, ymin=0, ymax=800, opt='kAlwaysCreate')
204 
205  var_clus_size_ontrack=f'pcb_mon_ontrack_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},cluster_size_ontrack_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Cluster_size_vs_PCB_ontrack_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
206  title_clus_size_ontrack=f'Cluster size {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap} on track; PCB; cluster size'
207  mmSideGroup.defineHistogram(var_clus_size_ontrack, type='TH2F', title=title_clus_size_ontrack, path='Cluster_size_ontrack', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=20, ymin=0, ymax=20, opt='kAlwaysCreate')
208 
209  var_strip_time_ontrack=f'pcb_strip_mon_ontrack_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},strp_time_ontrack_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Strip_time_ontrack_vs_PCB_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
210  var_clus_time_ontrack=f'pcb_mon_ontrack_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},cluster_time_ontrack_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Cluster_time_ontrack_vs_PCB_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
211  title_strp_time_ontrack=f'Strip time {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap} on track; PCB; strip time [ns]'
212  title_clus_time_ontrack=f'Cluster time {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap} on track; PCB; cluster time [ns]'
213  mmSideGroup.defineHistogram(var_strip_time_ontrack, type='TH2F', title=title_strp_time_ontrack, path='Strip_time_ontrack', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=800, ymin=-100, ymax=700, opt='kAlwaysCreate')
214  mmSideGroup.defineHistogram(var_clus_time_ontrack, type='TH2F', title=title_clus_time_ontrack, path='Cluster_time_ontrack', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=700, ymin=-200, ymax=500, opt='kAlwaysCreate')
215 
216  var_charge_perPCB_ontrack=f'pcb_mon_ontrack_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},charge_perPCB_ontrack_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Charge_vs_PCB_ontrack_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
217  title_charge_perPCB_ontrack=f'Charge {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap} on track; PCB; charge [fC]'
218  mmSideGroup.defineHistogram(var_charge_perPCB_ontrack, type='TH2F', title=title_charge_perPCB_ontrack, path='Charge_ontrack', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=200, ymin=0, ymax=800, opt='kAlwaysCreate')
219 
220  var_clus_size_onseg=f'pcb_mon_onseg_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},cluster_size_onseg_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Cluster_size_vs_PCB_onseg_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
221  title_clus_size_onseg=f'Cluster size {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap} on segms; PCB; cluster size'
222  mmSideGroup.defineHistogram(var_clus_size_onseg, type='TH2F', title=title_clus_size_onseg, path='Segments/Cluster_size_onseg', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=20, ymin=0, ymax=20, opt='kAlwaysCreate')
223  var_strip_time_onseg=f'pcb_strip_mon_onseg_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},strp_time_onseg_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Strip_time_onseg_vs_PCB_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
224  title_strp_time_onseg=f'Strip time {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap} on segms; PCB; strip time [ns]'
225  mmSideGroup.defineHistogram(var_strip_time_onseg, type='TH2F', title=title_strp_time_onseg, path='Segments/Strip_time_onseg', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=800, ymin=-100, ymax=700, opt='kAlwaysCreate')
226  title_clus_time_onseg=f'Cluster time {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap} on segms; PCB; cluster time [ns]'
227  var_clus_time_onseg=f'pcb_mon_onseg_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},cluster_time_onseg_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Cluster_time_onseg_vs_PCB_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
228  mmSideGroup.defineHistogram(var_clus_time_onseg, type='TH2F', title=title_clus_time_onseg, path='Segments/Cluster_time_onseg', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=700, ymin=-200, ymax=500, opt='kAlwaysCreate')
229  var_charge_perPCB_onseg=f'pcb_mon_onseg_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap},charge_perPCB_onseg_{iside}_phi{phi}_eta{eta}_ml{multi}_gap{gas_gap};Charge_vs_PCB_onseg_{iside}_eta{eta}_phi{phi}_ml{multi}_gap{gas_gap}'
230  title_charge_perPCB_onseg=f'Charge {iside} eta{eta} phi{phi} mult{multi} gasgap{gas_gap} on seg; PCB; charge [fC]'
231  mmSideGroup.defineHistogram(var_charge_perPCB_onseg, type='TH2F', title=title_charge_perPCB_onseg, path='Segments/Charge_onseg', xbins=maxpcb, xmin=.5, xmax=maxpcb+.5, ybins=200, ymin=0, ymax=800, opt='kAlwaysCreate')
232 
233 
234  for gas1 in range(1, 5):
235  for multi1 in range(1, 3):
236  title_ontrack=f'Posy vs Posx E{iside} multiplet{multi1} gap{gas1} ontrack; MM-GlobalX [mm]; MM-GlobalY [mm]'
237  var_ontrack=f'x_{iside}_multiplet{multi1}_gas_gap_{gas1}_ontrack,y_{iside}_multiplet{multi1}_gas_gap_{gas1}_ontrack;Posy_vs_Posx_{iside}_multiplet{multi1}_gas_gap_{gas1}_ontrack'
238  mmSideGroup.defineHistogram(var_ontrack, type='TH2F', title=title_ontrack, path='PosY_vs_Posx_perLayer_ontrack',xbins=500, xmin=-5000, xmax=5000., ybins=500, ymin=-5000.,ymax=5000., opt='kAlwaysCreate')
239 
240  acc = helper.result()
241  result.merge(acc)
242  return result
243 
244 if __name__=='__main__':
245  from AthenaCommon.Constants import DEBUG
246 
247  # Set the Athena configuration flags
248  from AthenaConfiguration.AllConfigFlags import initConfigFlags
249  flags = initConfigFlags()
250 
251  flags.Input.Files =[
252  "/eos/atlas/atlastier0/rucio/data23_hi/express_express/00463414/data23_hi.00463414.express_express.recon.ESD.x798/data23_hi.00463414.express_express.recon.ESD.x798._lb0501._SFO-ALL._0001.1",
253  ]
254  flags.Output.HISTFileName = 'monitor.root'
255 
256  flags.Detector.GeometryMM=True
257  flags.DQ.useTrigger=False
258  flags.Input.isMC = False
259  if not flags.Input.isMC:
260  flags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2022-10"
261 
262 
263  flags.lock()
264  flags.dump()
265  # Initialize configuration object, add accumulator, merge, and run.
266  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
267  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
268  cfg = MainServicesCfg(flags)
269  cfg.merge(PoolReadCfg(flags))
270 
271  mmMonitorAcc = MMMonitoringConfig(flags)
272  mmMonitorAcc.OutputLevel=DEBUG
273  cfg.merge(mmMonitorAcc)
274  #cfg.printConfig(withDetails=True, summariseProps = True)
275  # number of events selected in the ESD
276  cfg.run(1000)
MMMonitorAlgorithm.MMMonitoringConfig
def MMMonitoringConfig(inputFlags)
Definition: MMMonitorAlgorithm.py:8
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
vtune_athena.format
format
Definition: vtune_athena.py:14
MMMonUtils.getMMLabel
def getMMLabel(x, y)
Definition: MMMonUtils.py:8
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
Constants
some useful constants -------------------------------------------------—
MMMonUtils.getMMLabelY
def getMMLabelY(y)
Definition: MMMonUtils.py:13
python.MuonGeometryConfig.MuonGeoModelCfg
def MuonGeoModelCfg(flags)
Definition: MuonGeometryConfig.py:28
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69