ATLAS Offline Software
IDAlignMonGenericTracksAlgCfg.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 """
6 @file IDAlignMonGenericTracksAlgCfg.py
7 @author Per Johansson
8 @date 2021
9 @brief Configuration for Run 3 based on IDAlignMonGenericTracks.cxx
10 """
11 
12 from math import pi as M_PI
13 
14 def IDAlignMonGenericTracksAlgCfg(helper, alg, **kwargs):
15 
16  # values
17  m_pTRange = 100
18  m_NTracksRange = 100
19  m_rangePixHits = 10
20  m_rangeSCTHits = 20
21  m_rangeTRTHits = 60
22  m_etaRange = 2.7
23  m_etaBins = 40
24  m_phiBins = 80
25  m_d0BsNbins = 100
26  m_d0Range = 2
27  m_z0Range = 90.
28  m_d0BsRange = 0.05
29 
30  # Set a folder name from the user options
31  folderName = "ExtendedTracks"
32  if "TrackName" in kwargs:
33  folderName = kwargs["TrackName"]
34 
35  # this creates a "genericTrackGroup" called "alg" which will put its histograms into the subdirectory "GenericTracks"
36  genericTrackGroup = helper.addGroup(alg, 'IDA_Tracks')
37  pathtrack = '/IDAlignMon/'+folderName+'/GenericTracks'
38 
39  # BeamSpot position histos
40  varName = 'm_beamSpotX,m_beamSpotY;YBs_vs_XBs'
41  title = 'BeamSpot Position: y vs x; x_{BS} [mm]; y_{BS} [mm]'
42  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=100, xmin=-0.9, xmax=-0.1, ybins=100, ymin=-0.8, ymax=-0.1)
43 
44  varName = 'm_beamSpotZ,m_beamSpotY;YBs_vs_ZBs'
45  title = 'BeamSpot Position: y vs z; z_{BS} [mm]; y_{BS} [mm]'
46  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=100, xmin= -m_z0Range, xmax= m_z0Range, ybins=100, ymin=-0.8, ymax=-0.1)
47 
48  varName = 'm_beamSpotX,m_beamSpotZ;XBs_vs_ZBs'
49  title = 'BeamSpot Position: x vs z; z_{BS} [mm]; x_{BS} [mm]'
50  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=100, xmin= -m_z0Range, xmax= m_z0Range, ybins=100, ymin=-0.8, ymax=-0.1)
51 
52  varName = 'm_lb,m_beamSpotY;YBs_vs_LumiBlock'
53  title = 'Y BeamSpot position: y vs lumiblock; LumiBlock; y_{BS} [mm]'
54  genericTrackGroup.defineHistogram(varName, type='TProfile', path=pathtrack, title=title, xbins=1024, xmin=-0.5, xmax=1023.5, ybins=100, ymin=-0.8, ymax=-0.1)
55 
56  varName = 'm_lb,m_beamSpotX;XBs_vs_LumiBlock'
57  title = 'X BeamSpot position: x vs lumiblock; LumiBlock; x_{BS} [mm]'
58  genericTrackGroup.defineHistogram(varName, type='TProfile', path=pathtrack, title=title, xbins=1024, xmin=-0.5, xmax=1023.5, ybins=100, ymin=-0.8, ymax=-0.1)
59 
60  # Plots per events
61  varName = 'm_ngTracks;NTracksPerEvent'
62  title = 'Number of good tracks per event; Tracks; Events'
63  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_NTracksRange+1, xmin=-0.5, xmax=m_NTracksRange +0.5)
64 
65  varName = 'm_mu;mu_perEvent'
66  title = '#LT#mu#GT average interactions per crossing;#LT#mu#GT;Events'
67  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=101, xmin=-0.5, xmax= 100.5)
68 
69  varName = 'm_lb;LumiBlock'
70  title = 'Lumiblock of the events;Lumiblock;Events'
71  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=1024, xmin=-0.5, xmax=1023.5)
72 
73  # Plots per lumiblock
74  varName = 'm_lb_track;NTracksPerLumiBlock'
75  title = 'Tracks Per LumiBlock;Lumiblock;Tracks'
76  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=1024, xmin=-0.5, xmax=1023.5)
77 
78  # Start loop on tracks
79 
80  varName = 'm_nhits_per_track;Nhits_per_track'
81  title = 'Number of hits per track;Hits;Tracks'
82  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangePixHits + m_rangeSCTHits + m_rangeTRTHits + 1, xmin=-0.5, xmax=m_rangePixHits + m_rangeSCTHits + m_rangeTRTHits + 0.5)
83 
84  varName = 'm_npixelhits_per_track;Npixhits_per_track'
85  title = 'Number of PIXEL (PIX+IBL) hits per track;Pixel hits (PIX+IBL);Tracks'
86  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangePixHits+1, xmin=-0.5, xmax=m_rangePixHits +0.5)
87 
88  varName = 'm_npixelhits_per_track_barrel;Npixhits_per_track_barrel'
89  title = 'Number of PIXEL (PIX+IBL) hits per track (Barrel);Pixel hits in Barrel (PIX+IBL);Tracks'
90  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangePixHits+1, xmin=-0.5, xmax=m_rangePixHits +0.5)
91 
92  varName = 'm_npixelhits_per_track_eca;Npixhits_per_track_eca'
93  title = 'Number of PIXEL (PIX+IBL) hits per track (ECA);Pixel hits in EndCap A;Tracks'
94  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangePixHits+1, xmin=-0.5, xmax=m_rangePixHits +0.5)
95 
96  varName = 'm_npixelhits_per_track_ecc;Npixhits_per_track_ecc'
97  title = 'Number of PIXEL (PIX+IBL) hits per track (ECC);Pixel hits in EndCap C;Tracks'
98  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangePixHits+1, xmin=-0.5, xmax=m_rangePixHits +0.5)
99 
100  varName = 'm_nscthits_per_track;Nscthits_per_track'
101  title = 'Number of SCT hits per track;SCT hits;Tracks'
102  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangeSCTHits+1, xmin=-0.5, xmax=m_rangeSCTHits +0.5)
103 
104  varName = 'm_nscthits_per_track_barrel;Nscthits_per_track_barrel'
105  title = 'Number of SCT hits per track (Barrel);SCT hits in Barrel;Tracks'
106  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangeSCTHits+1, xmin=-0.5, xmax=m_rangeSCTHits +0.5)
107 
108  varName = 'm_nscthits_per_track_eca;Nscthits_per_track_eca'
109  title = 'Number of SCT hits per track (ECA);SCT hits in EndCap A;Tracks'
110  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangeSCTHits+1, xmin=-0.5, xmax=m_rangeSCTHits +0.5)
111 
112  varName = 'm_nscthits_per_track_ecc;Nscthits_per_track_ecc'
113  title = 'Number of SCT hits per track (ECC);SCT hits in EndCap C;Tracks'
114  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangeSCTHits+1, xmin=-0.5, xmax=m_rangeSCTHits +0.5)
115 
116  varName = 'm_ntrthits_per_track;Ntrthits_per_track'
117  title = 'Number of TRT hits per track;TRT hits;Tracks'
118  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangeTRTHits+1, xmin=-0.5, xmax=m_rangeTRTHits +0.5)
119 
120  varName = 'm_ntrthits_per_track_barrel;Ntrthits_per_track_barrel'
121  title = 'Number of TRT hits per track (Barrel);TRT hits in Barrel;Tracks'
122  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangeTRTHits+1, xmin=-0.5, xmax=m_rangeTRTHits +0.5)
123 
124  varName = 'm_ntrthits_per_track_eca;Ntrthits_per_track_eca'
125  title = 'Number of TRT hits per track (ECA);TRT hits in EndCap A;Tracks'
126  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangeTRTHits+1, xmin=-0.5, xmax=m_rangeTRTHits +0.5)
127 
128  varName = 'm_ntrthits_per_track_ecc;Ntrthits_per_track_ecc'
129  title = 'Number of TRT hits per track (ECC);TRT hits in EndCap C;Tracks'
130  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_rangeTRTHits+1, xmin=-0.5, xmax=m_rangeTRTHits +0.5)
131 
132  # Eta vs Nhits
133  varName = 'm_eta,m_npixelhits_per_track;Npixhits_vs_eta'
134  title = "Number of Pixel hits vs track #eta; Track #eta;Pixel hits (PIX+IBL)"
135  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=m_etaBins, xmin=-m_etaRange, xmax=m_etaRange, ybins=m_rangePixHits+1, ymin=-0.5, ymax=m_rangePixHits +0.5)
136 
137  varName = 'm_eta,m_nscthits_per_track;Nscthits_vs_eta'
138  title = "Number of SCT hits vs track #eta; Track #eta;SCT hits"
139  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=m_etaBins, xmin=-m_etaRange, xmax=m_etaRange, ybins=m_rangeSCTHits+1, ymin=-0.5, ymax=m_rangeSCTHits +0.5)
140 
141  varName = 'm_eta,m_ntrthits_per_track;Ntrthits_vs_eta'
142  title = "Number of TRT hits vs track #eta; Track #eta;TRT hits"
143  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=m_etaBins, xmin=-m_etaRange, xmax=m_etaRange, ybins=m_rangeTRTHits+1, ymin=-0.5, ymax=m_rangeTRTHits +0.5)
144 
145  varName = 'm_chi2oDoF;chi2oDoF'
146  title = 'chi2oDoF;#chi^{2} / NDoF;Tracks'
147  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=50, xmin=0, xmax=5.)
148 
149  # Track params
150  varName = 'm_eta;eta'
151  title = '#eta;Track #eta;Tracks'
152  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_etaBins, xmin=-m_etaRange, xmax=m_etaRange)
153 
154  varName = 'm_errEta;err_Eta'
155  title = 'Track #eta error;Track #eta error;Tracks'
156  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=50, xmin=0, xmax=0.002)
157 
158  varName = 'm_eta;eta_pos'
159  title = '#eta for positive tracks;Track #eta(#plusq);Tracks'
160  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_etaBins, xmin=-m_etaRange, xmax=m_etaRange, cutmask='isTrkPositive')
161 
162  varName = 'm_eta;eta_neg'
163  title = '#eta for negative tracks;Track #eta(#minusq);Tracks'
164  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_etaBins, xmin=-m_etaRange, xmax=m_etaRange, cutmask='isTrkNegative')
165 
166  varName = 'm_phi;phi'
167  title = 'Track #phi_{0};Track #phi_{0} [rad];Tracks'
168  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_phiBins, xmin=0, xmax= 2 * M_PI)
169 
170  varName = 'm_errPhi;err_Phi'
171  title = 'Track #phi_{0} error;Track #phi_{0} error [rad];Tracks'
172  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=50, xmin=0, xmax= 0.002)
173 
174  varName = 'm_z0;z0_origin'
175  title = 'z_{0} (computed vs origin); z_{0} (origin) [mm];Tracks'
176  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_d0BsNbins, xmin=-m_z0Range, xmax=m_z0Range)
177 
178  varName = 'm_errZ0;err_z0'
179  title = 'z_{0} error; z_{0} error [mm];Tracks'
180  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=50, xmin=0, xmax=0.3)
181 
182  varName = 'm_z0_bscorr;z0'
183  title = 'z_{0} (corrected for beamspot);z_{0} (BS) [mm]; Tracks'
184  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_d0BsNbins, xmin=-m_z0Range, xmax=m_z0Range)
185 
186  varName = 'm_z0sintheta;z0sintheta'
187  title = 'z_{0}sin#theta; z_{0}sin#theta [mm];Tracks'
188  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_d0BsNbins, xmin=-m_z0Range, xmax=m_z0Range)
189 
190  varName = 'm_d0;d0_origin'
191  title = 'd_{0} (computed vs origin);d_{0} (origin) [mm];Tracks'
192  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_d0BsNbins, xmin=-m_d0Range, xmax=m_d0Range)
193 
194  varName = 'm_errD0;errD0'
195  title = 'd_{0} error;d_{0} error [mm]; Tracks'
196  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=60, xmin=0, xmax=0.05)
197 
198  varName = 'm_d0_bscorr;d0_bscorr'
199  title = 'd_{0} (corrected for beamspot);d_{0} (BS) [mm]; Tracks'
200  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_d0BsNbins, xmin=-m_d0BsRange, xmax=m_d0BsRange)
201 
202  varName = 'm_pT;pT'
203  title = 'Momentum p_{T};Signed Track p_{T} [GeV];Tracks'
204  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=200, xmin=-m_pTRange, xmax=m_pTRange)
205 
206  varName = 'm_errPt;err_pT'
207  title = 'Momentum p_{T} error;p_{T} error [GeV];Tracks'
208  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=50, xmin=0., xmax=3.)
209 
210  varName = 'm_pT,m_errPt;errpTvspT'
211  title = 'p_{T} error Vs p_{T};Signed Track p_{T} [GeV];p_{T} error [GeV]'
212  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=200, xmin=-m_pTRange, xmax=m_pTRange, ybins=50, ymin=0., ymax=3.)
213 
214  varName = 'm_pT,m_pTRes;pTResVspT'
215  title = 'p_{T} Resolution Vs p_{T};Signed Track p_{T} [GeV];p_{T} Resolution (#sigma(p_{T})/p_{T})'
216  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=200, xmin=-m_pTRange, xmax=m_pTRange, ybins=100, ymin=0, ymax=0.1)
217 
218  varName = 'm_p;P'
219  title = 'Momentum P;Signed Track P [GeV];Tracks'
220  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=200, xmin=-m_pTRange, xmax=m_pTRange)
221 
222  varName = 'm_pTRes;pTResolution'
223  title = 'Momentum p_{T} Resolution;p_{T} Resolution (#sigma(p_{T})/p_{T});Tracks'
224  genericTrackGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=100, xmin=0, xmax=0.1)
225 
226  varName = 'm_eta,m_d0_bscorr;D0bsVsEta'
227  title = 'd_{0} (BS) Vs #eta;Track #eta;d_{0} (BS) [mm]'
228  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=m_etaBins, xmin=-m_etaRange, xmax=m_etaRange, ybins=m_d0BsNbins, ymin=-m_d0BsRange, ymax=m_d0BsRange)
229 
230  varName = 'm_pT,m_d0_bscorr;D0bsVsPt'
231  title = 'd_{0} (BS) Vs p_{T};Signed track p_{T} [GeV];d_{0} (BS) [mm]'
232  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=200, xmin=-m_pTRange, xmax=m_pTRange, ybins=m_d0BsNbins, ymin=-m_d0BsRange, ymax=m_d0BsRange)
233 
234  varName = 'm_phi,m_d0_bscorr;D0bsVsPhi0'
235  title = 'd_{0} (BS) Vs #phi_{0};Track #phi_{0} [rad];d_{0} (BS) [mm]'
236  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=m_phiBins, xmin=0, xmax= 2 * M_PI, ybins=m_d0BsNbins, ymin=-m_d0BsRange, ymax=m_d0BsRange)
237 
238  varName = 'm_phi,m_d0_bscorr;D0bsVsPhi0_Barrel'
239  title = 'd_{0} (BS) Vs #phi_{0} (Barrel);Track #phi_{0} [rad];d_{0} (BS) [mm]'
240  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=m_phiBins, xmin=0, xmax= 2 * M_PI, ybins=m_d0BsNbins, ymin=-m_d0BsRange, ymax=m_d0BsRange, cutmask='isTrackBarrel')
241 
242  varName = 'm_phi,m_d0_bscorr;D0bsVsPhi0_ECA'
243  title = 'd_{0} (BS) Vs #phi_{0} (ECA);Track #phi_{0} [rad];d_{0} (BS) [mm]'
244  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=m_phiBins, xmin=0, xmax= 2 * M_PI, ybins=m_d0BsNbins, ymin=-m_d0BsRange, ymax=m_d0BsRange, cutmask='isTrackECA')
245 
246  varName = 'm_phi,m_d0_bscorr;D0bsVsPhi0_ECC'
247  title = 'd_{0} (BS) Vs #phi_{0} (ECC);Track #phi_{0} [rad];d_{0} (BS) [mm]'
248  genericTrackGroup.defineHistogram(varName, type='TH2F', path=pathtrack, title=title, xbins=m_phiBins, xmin=0, xmax= 2 * M_PI, ybins=m_d0BsNbins, ymin=-m_d0BsRange, ymax=m_d0BsRange, cutmask='isTrackECC')
249 
250  # end histograms
251 
252 
IDAlignMonGenericTracksAlgCfg.IDAlignMonGenericTracksAlgCfg
def IDAlignMonGenericTracksAlgCfg(helper, alg, **kwargs)
Definition: IDAlignMonGenericTracksAlgCfg.py:14