14def Tier0_builder( monTool, mypath, chain, cs ) :
15
16 from TrigIDR4Monitoring.HistUtils import ptbins_mb
17 from TrigIDR4Monitoring.HistUtils import ptbins_default
18
19 if "mb" in chain : ptbins = ptbins_mb
20 else: ptbins = ptbins_default
21
22 from TrigIDR4Monitoring.HistUtils import vnbins_full
23 from TrigIDR4Monitoring.HistUtils import vnbins_short
24
25 vnbins = vnbins_full
26
27
28 from TrigIDR4Monitoring.HistUtils import d0bins_default
29 from TrigIDR4Monitoring.HistUtils import d0bins_lrt
30
31 if "LRT" in chain : d0bins = d0bins_lrt
32 else: d0bins = d0bins_default
33
34
35
36
37
38
39
40 pi = 3.14159275
41
42 binlabels = [ "Nrois", "Nevents", "N ref tracks", "N matched tracks", "N total test tracks" ]
43
44 mypath = mypath + "/Tier0"
45
46 defineHisto( monTool, "Chain", weight="Chain_weight", path=mypath, type="TH1F", title=chain, xlabels=binlabels, xbins=5, xmin=0, xmax=5 )
47
48
49 defineHisto( monTool, "roi_eta", path=mypath, type="TH1F", title="Roi eta", xbins=25, xmin=-2.5, xmax=2.5 )
50
51 if ( "FS_FTF" in cs.tail or "JetSuper_FTF" in cs.tail or "mb" in chain ):
52 defineHisto( monTool, "reftrk_N", path=mypath, type="TH1F", title="Reference tracks", xbins=vnbins )
53 else:
54 defineHisto( monTool, "reftrk_N", path=mypath, type="TH1F", title="Reference tracks", xbins=61, xmin=-0.5, xmax=60.5 )
55
56 defineHisto( monTool, "reftrk_pT", path=mypath, type="TH1F", title="Reference track pT", xbins=ptbins )
57 defineHisto( monTool, "reftrk_phi", path=mypath, type="TH1F", title="Reference track Phi", xbins=25, xmin=-pi, xmax=pi )
58 defineHisto( monTool, "reftrk_eta", path=mypath, type="TH1F", title="Reference track Eta", xbins=25, xmin=-2.5, xmax=2.5 )
59
60 if "LRT" in chain:
61 defineHisto( monTool, "reftrk_d0", path=mypath, type="TH1F", title="Reference track d0", xbins=201, xmin=-100.0, xmax=100.0 )
62 else:
63 defineHisto( monTool, "reftrk_d0", path=mypath, type="TH1F", title="Reference track d0", xbins=201, xmin=-0.5, xmax=0.5 )
64
65 defineHisto( monTool, "reftrk_z0", path=mypath, type="TH1F", title="Reference track z0", xbins=50, xmin=-225., xmax=225. )
66 defineHisto( monTool, "reftrk_dd0", path=mypath, type="TH1F", title="Reference track sigma(d0)", xbins=50, xmin=0, xmax=0.5 )
67 defineHisto( monTool, "reftrk_dz0", path=mypath, type="TH1F", title="Reference track sigma(z0)", xbins=50, xmin=0, xmax=2.5 )
68 defineHisto( monTool, "reftrk_d0sig", path=mypath, type="TH1F", title="Reference track d0 significance", xbins= 101, xmin=-5., xmax=5. )
69
70 if ( "FS_FTF" in cs.tail or "JetSuper_FTF" in cs.tail or "mb" in chain ):
71 defineHisto( monTool, "testtrk_N", path=mypath, type="TH1F", title="Test tracks", xbins=vnbins )
72 else:
73 defineHisto( monTool, "testtrk_N", path=mypath, type="TH1F", title="Test tracks", xbins=61, xmin=-0.5, xmax=60.5 )
74
75 defineHisto( monTool, "testtrk_pT", path=mypath, type="TH1F", title="Test track pT", xbins=ptbins )
76 defineHisto( monTool, "testtrk_phi", path=mypath, type="TH1F", title="Test track Phi", xbins=25, xmin=-pi, xmax=pi )
77 defineHisto( monTool, "testtrk_eta", path=mypath, type="TH1F", title="Test track Eta", xbins=25, xmin=-2.5, xmax=2.5 )
78
79 if "LRT" in chain:
80 defineHisto( monTool, "testtrk_d0", path=mypath, type="TH1F", title="Test track d0", xbins=201, xmin=-100.0, xmax=100.0 )
81 defineHisto( monTool, "reftrk_d0sig", path=mypath, type="TH1F", title="Reference track d0 significance", xbins= 101, xmin=-100., xmax=100. )
82 else:
83 defineHisto( monTool, "testtrk_d0", path=mypath, type="TH1F", title="Test track d0", xbins=201, xmin=-0.5, xmax=0.5 )
84 defineHisto( monTool, "reftrk_d0sig", path=mypath, type="TH1F", title="Reference track d0 significance", xbins= 101, xmin=-5., xmax=5. )
85
86 defineHisto( monTool, "testtrk_z0", path=mypath, type="TH1F", title="Test track z0", xbins=50, xmin=-225., xmax=225. )
87 defineHisto( monTool, "testtrk_dd0", path=mypath, type="TH1F", title="Test track sigma(d0)", xbins=50, xmin=0, xmax=0.5 )
88 defineHisto( monTool, "testtrk_dz0", path=mypath, type="TH1F", title="Test track sigma(z0)", xbins=50, xmin=0, xmax=2.5 )
89 defineHisto( monTool, "testtrk_d0sig", path=mypath, type="TH1F", title="Test track d0 significance", xbins=101, xmin=-5.0, xmax=5.0 )
90
91 defineHisto( monTool, "layer_rec", path=mypath, type="TH1F", title="hit layers", xbins=32, xmin=-0.5, xmax=31.5 )
92 defineHisto( monTool, "layer", path=mypath, type="TH1F", title="hit layers", xbins=32, xmin=-0.5, xmax=31.5 )
93
94 defineHisto( monTool, "residual_pT", path=mypath, type="TH1F", title="track pT residual", xbins=201, xmin=-50.0, xmax=50.0 )
95 defineHisto( monTool, "residual_ipT", path=mypath, type="TH1F", title="track ipT residual", xbins=55, xmin=-1.5, xmax=1.5 )
96
97 if "LRT" in chain:
98 defineHisto( monTool, "residual_phi", path=mypath, type="TH1F", title="track Phi residual", xbins=50, xmin=-0.02, xmax=0.02 )
99 defineHisto( monTool, "residual_eta", path=mypath, type="TH1F", title="track Eta residual", xbins=50, xmin=-0.02, xmax=0.02 )
100 defineHisto( monTool, "residual_d0", path=mypath, type="TH1F", title="track d0 residual ", xbins=251, xmin=-1.0, xmax=1.0 )
101 defineHisto( monTool, "residual_z0", path=mypath, type="TH1F", title="track z0 residual", xbins=401, xmin=-2.5, xmax=2.5 )
102 defineHisto( monTool, "residual_dd0", path=mypath, type="TH1F", title="track sigma d0 residual ", xbins=251, xmin=-0.5, xmax=0.5 )
103 defineHisto( monTool, "residual_dz0", path=mypath, type="TH1F", title="track sigma z0 residual", xbins=401, xmin=-1.0, xmax=1.0 )
104 else:
105 defineHisto( monTool, "residual_phi", path=mypath, type="TH1F", title="track Phi residual", xbins=50, xmin=-0.01, xmax=0.01 )
106 defineHisto( monTool, "residual_eta", path=mypath, type="TH1F", title="track Eta residual", xbins=50, xmin=-0.01, xmax=0.01 )
107 defineHisto( monTool, "residual_d0", path=mypath, type="TH1F", title="track d0 residual ", xbins=251, xmin=-0.6, xmax=0.6 )
108 defineHisto( monTool, "residual_z0", path=mypath, type="TH1F", title="track z0 residual", xbins=401, xmin=-2.0, xmax=2.0 )
109 defineHisto( monTool, "residual_dd0", path=mypath, type="TH1F", title="track sigma d0 residual ", xbins=251, xmin=-0.25, xmax=0.25 )
110 defineHisto( monTool, "residual_dz0", path=mypath, type="TH1F", title="track sigma z0 residual", xbins=401, xmin=-0.5, xmax=0.5 )
111
112 defineHisto( monTool, "npix", path=mypath, type="TH1F", title="npix", xbins=26, xmin=-0.5, xmax=25.5 )
113 defineHisto( monTool, "npix_rec", path=mypath, type="TH1F", title="npix_rec", xbins=26, xmin=-0.5, xmax=25.5 )
114
115 defineHisto( monTool, "nsct", path=mypath, type="TH1F", title="nsct", xbins=31, xmin=-0.5, xmax=30.5 )
116 defineHisto( monTool, "nsct_rec", path=mypath, type="TH1F", title="nsct_rec", xbins=31, xmin=-0.5, xmax=30.5 )
117
118 defineHisto( monTool, "nsiHits", path=mypath, type="TH1F", title="nsiHits", xbins=41, xmin=-0.5, xmax=40.5 )
119 defineHisto( monTool, "nsiHits_rec", path=mypath, type="TH1F", title="nsiHits_rec", xbins=41, xmin=-0.5, xmax=40.5 )
120
121 defineHisto( monTool, "ntrt", path=mypath, type="TH1F", title="ntrt", xbins=91, xmin=-0.5, xmax=91.5 )
122 defineHisto( monTool, "ntrt_rec", path=mypath, type="TH1F", title="ntrt_rec", xbins=91, xmin=-0.5, xmax=91.5 )
123
124 defineHisto( monTool, "chi2dof", path=mypath, type="TH1F", title="chi2dof", xbins=75, xmin=-0, xmax=15 )
125 defineHisto( monTool, "chi2dof_rec", path=mypath, type="TH1F", title="chi2dof_rec", xbins=75, xmin=-0, xmax=15 )
126
127 defineHisto( monTool, "mu", path=mypath, type="TH1F", title="mu;#mu;Entries", xbins=80, xmin=0, xmax=80 )
128
129 defineHisto( monTool, "Eff_overall", path=mypath, type="TProfile", title="total efficiency", xbins=1, xmin=0., xmax=1. )
130
131 defineHisto( monTool, "Eff_pT", path=mypath, type="TProfile", title="pT efficiency", xbins=ptbins )
132 defineHisto( monTool, "Eff_Eta", path=mypath, type="TProfile", title="eta efficiency", xbins=25, xmin=-2.5, xmax=2.5 )
133 defineHisto( monTool, "Eff_Phi", path=mypath, type="TProfile", title="phi efficiency", xbins=25, xmin=-pi, xmax=pi )
134 defineHisto( monTool, "Eff_d0", path=mypath, type="TProfile", title="d0 efficiency", xbins=d0bins )
135 defineHisto( monTool, "Eff_z0", path=mypath, type="TProfile", title="z0 efficiency", xbins=50, xmin=-225., xmax=225. )
136 defineHisto( monTool, "Eff_nVtx", path=mypath, type="TProfile", title="nVtx efficiency", xbins=101, xmin=-0.5, xmax=100.5 )
137 defineHisto( monTool, "Eff_lb", path=mypath, type="TProfile", title="efficiency vs lumiblock", xbins=301, xmin=-0.5, xmax=3009.5 )
138
139 if ( "FS_FTF" in cs.tail or "JetSuper_FTF" in cs.tail or "mb" in chain ):
140 defineHisto( monTool, "Eff_ntrax", path=mypath, type="TProfile", title="ntrack efficiency", xbins=vnbins )
141 else:
142 defineHisto( monTool, "Eff_ntrax", path=mypath, type="TProfile", title="ntrack efficiency", xbins=61, xmin=-0.5, xmax=60.5 )
143
144 defineHisto( monTool, "trkvtx_x_vs_lb", path=mypath, type="TProfile", title="track vertex x vs lumiblock", xbins=301, xmin=-0.5, xmax=3009.5 )
145 defineHisto( monTool, "trkvtx_y_vs_lb", path=mypath, type="TProfile", title="track vertex y vs lumiblock", xbins=301, xmin=-0.5, xmax=3009.5 )
146 defineHisto( monTool, "trkvtx_z_vs_lb", path=mypath, type="TProfile", title="track vertex z vs lumiblock", xbins=3010, xmin=-0.5, xmax=3009.5 )
147
148 defineHisto( monTool, "npix_vs_eta", path=mypath, type="TProfile", title="offline npix vs eta;offline #eta; mean number of offline pixel hits", xbins=30, xmin=-2.5, xmax=2.5 )
149 defineHisto( monTool, "npix_vs_eta_rec", path=mypath, type="TProfile", title="trigger npix vs eta;offline #eta; mean number of trigger pixel hits", xbins=30, xmin=-2.5, xmax=2.5 )
150 defineHisto( monTool, "nsct_vs_eta", path=mypath, type="TProfile", title="offline nsct vs eta;offline #eta; mean number of offline sct hits", xbins=30, xmin=-2.5, xmax=2.5 )
151 defineHisto( monTool, "nsct_vs_eta_rec", path=mypath, type="TProfile", title="trigger nsct vs eta;offline #eta; mean number of trigger sct hits", xbins=30, xmin=-2.5, xmax=2.5 )
152 defineHisto( monTool, "ntrt_vs_eta", path=mypath, type="TProfile", title="offline ntrt vs eta;offline #eta; mean number of offline trt hits", xbins=30, xmin=-2.5, xmax=2.5 )
153 defineHisto( monTool, "ntrt_vs_eta_rec", path=mypath, type="TProfile", title="trigger ntrt vs eta;offline #eta; mean number of trigger trt hits", xbins=30, xmin=-2.5, xmax=2.5 )
154
155 defineHisto( monTool, "npix_vs_phi", path=mypath, type="TProfile", title="offline npix vs phi;offline #phi; mean number of offline pixel hits", xbins=30, xmin=-pi, xmax=pi )
156 defineHisto( monTool, "npix_vs_phi_rec", path=mypath, type="TProfile", title="trigger npix vs phi;offline #phi; mean number of trigger pixel hits", xbins=30, xmin=-pi, xmax=pi )
157 defineHisto( monTool, "nsct_vs_phi", path=mypath, type="TProfile", title="offline nsct vs phi;offline #phi; mean number of offline sct hits", xbins=30, xmin=-pi, xmax=pi )
158 defineHisto( monTool, "nsct_vs_phi_rec", path=mypath, type="TProfile", title="trigger nsct vs phi;offline #phi; mean number of trigger sct hits", xbins=30, xmin=-pi, xmax=pi )
159 defineHisto( monTool, "ntrt_vs_phi", path=mypath, type="TProfile", title="offline ntrt vs phi;offline #phi; mean number of offline trt hits", xbins=30, xmin=-pi, xmax=pi )
160 defineHisto( monTool, "ntrt_vs_phi_rec", path=mypath, type="TProfile", title="trigger ntrt vs phi;offline #phi; mean number of trigger trt hits", xbins=30, xmin=-pi, xmax=pi )
161
162 defineHisto( monTool, "npix_vs_d0", path=mypath, type="TProfile", title="offline npix vs d0;offline #d0; mean number of offline pixel hits", xbins=d0bins )
163 defineHisto( monTool, "npix_vs_d0_rec", path=mypath, type="TProfile", title="trigger npix vs d0;offline #d0; mean number of trigger pixel hits", xbins=d0bins )
164 defineHisto( monTool, "nsct_vs_d0", path=mypath, type="TProfile", title="offline nsct vs d0;offline #d0; mean number of offline sct hits", xbins=d0bins )
165 defineHisto( monTool, "nsct_vs_d0_rec", path=mypath, type="TProfile", title="trigger nsct vs d0;offline #d0; mean number of trigger sct hits", xbins=d0bins )
166 defineHisto( monTool, "npix_vs_pT", path=mypath, type="TProfile", title="offline npix vs pT;offline #p_{T}; mean number of offline pixel hits", xbins=ptbins )
167 defineHisto( monTool, "npix_vs_pT_rec", path=mypath, type="TProfile", title="trigger npix vs pT;offline #p_{T}; mean number of trigger pixel hits", xbins=ptbins )
168 defineHisto( monTool, "nsct_vs_pT", path=mypath, type="TProfile", title="offline nsct vs pT;offline #p_{T} [GeV]; mean number of offline pixel hits", xbins=ptbins )
169 defineHisto( monTool, "nsct_vs_pT_rec", path=mypath, type="TProfile", title="trigger nsct vs pT;offline #p_{T} [GeV]; mean number of trigger pixel hits", xbins=ptbins )
170 defineHisto( monTool, "nsihits_lb", path=mypath, type="TProfile", title="offline n sihits vs lumiblock", xbins=301, xmin=-0.5, xmax=3009.5 )
171 defineHisto( monTool, "nsihits_lb_rec", path=mypath, type="TProfile", title="trigger n sihits vs lumiblock", xbins=301, xmin=-0.5, xmax=3009.5 )
172
173 defineHisto( monTool, "Res_pT", path=mypath, type="TProfile", title="mean pT residual;#eta_{ref};pT_{trig}-pT_{ref} [GeV]", xbins=25, xmin=-2.5, xmax=2.5 )
174 defineHisto( monTool, "Res_ipT", path=mypath, type="TProfile", title="mean ipT residual;#eta_{ref};1/pT_{trig}-1/pT_{ref} [GeV^{-1}]", xbins=25, xmin=-2.5, xmax=2.5 )
175 defineHisto( monTool, "Res_eta", path=mypath, type="TProfile", title="mean Eta residual;#eta_{ref};eta_{trig}-#eta_{ref}", xbins=25, xmin=-2.5, xmax=2.5 )
176 defineHisto( monTool, "Res_phi", path=mypath, type="TProfile", title="mean Phi residual;#eta_{ref};phi_{trig}-#phi_{ref}", xbins=25, xmin=-2.5, xmax=2.5 )
177 defineHisto( monTool, "Res_d0", path=mypath, type="TProfile", title="mean d0 residual;#eta_{ref};Delta d0 [mm]", xbins=25, xmin=-2.5, xmax=2.5 )
178 defineHisto( monTool, "Res_z0", path=mypath, type="TProfile", title="mean z0 residual;#eta_{ref};Delta z0 [mm]", xbins=25, xmin=-2.5, xmax=2.5 )
179
180
181 defineHisto( monTool, "d0_vs_phi_prof", path=mypath, type="TProfile", title="d0 vs phi_prof;#phi;d0 [mm]", xbins=25, xmin=-pi, xmax=pi )
182 defineHisto( monTool, "d0_vs_phi_rec_prof", path=mypath, type="TProfile", title="d0 vs phi_rec_prof;#phi; d0 [mm]", xbins=25, xmin=-pi, xmax=pi )
183
184 if "probe" in cs.extra:
185 if "Jpsi" in chain:
186 defineHisto( monTool, "invmass", path=mypath, type="TH1F", title="invariant mass;mass [GeV]", xbins=50, xmin=0, xmax=10 )
187 defineHisto( monTool, "invmass_obj", path=mypath, type="TH1F", title="invariant mass;mass [GeV]", xbins=50, xmin=0, xmax=10 )
188 else:
189 defineHisto( monTool, "invmass", path=mypath, type="TH1F", title="invariant mass;mass [GeV]", xbins=320, xmin=0, xmax=200 )
190 defineHisto( monTool, "invmass_obj", path=mypath, type="TH1F", title="invariant mass;mass [GeV]", xbins=320, xmin=0, xmax=200 )
191
192
193 if cs.vtx :
194
195 defineHisto( monTool, "vx_nvtx", path=mypath, type="TH1F", title="Offline vertex multiplicity;number of vertices", xbins=101, xmin=-0.5, xmax=100.5 )
196 defineHisto( monTool, "vx_zed", path=mypath, type="TH1F", title="Offline vertex z;vtx z [mm]", xbins=100, xmin=-250, xmax=250 )
197 defineHisto( monTool, "vx_x", path=mypath, type="TH1F", title="Offline vertex x;vtx x [mm]", xbins=200, xmin=-1.2, xmax=1.2 )
198 defineHisto( monTool, "vx_y", path=mypath, type="TH1F", title="Offline vertex y;vtx y [mm]", xbins=200, xmin=-1.2, xmax=1.2 )
199 defineHisto( monTool, "vx_ntrax", path=mypath, type="TH1F", title="Offline vertex track multiplicity;number of tracks", xbins=vnbins )
200
201 defineHisto( monTool, "vx_nvtx_rec", path=mypath, type="TH1F", title="Trigger vertex multiplicity;number of vertices", xbins=101, xmin=-0.5, xmax=100.5 )
202 defineHisto( monTool, "vx_zed_rec", path=mypath, type="TH1F", title="Trigger vertex Z;vtx z [mm]", xbins=100, xmin=-250, xmax=250 )
203 defineHisto( monTool, "vx_x_rec", path=mypath, type="TH1F", title="Trigger vertex X;vtx x [mm]", xbins=200, xmin=-1.2, xmax=1.2 )
204 defineHisto( monTool, "vx_y_rec", path=mypath, type="TH1F", title="Trigger vertex Y;vtx y [mm]", xbins=200, xmin=-1.2, xmax=1.2 )
205 defineHisto( monTool, "vx_ntrax_rec", path=mypath, type="TH1F", title="Trigger vertex track multiplicity;number of tracks", xbins=vnbins )
206
207 defineHisto( monTool, "vx_zed_res", path=mypath, type="TH1F", title="Delta z [mm]", xbins=400, xmin=-1.0, xmax=1.0 )
208 defineHisto( monTool, "vx_x_res", path=mypath, type="TH1F", title="Delta x [mm]", xbins=400, xmin=-0.1, xmax=0.1 )
209 defineHisto( monTool, "vx_y_res", path=mypath, type="TH1F", title="Delta y [mm]", xbins=400, xmin=-0.1, xmax=0.1 )
210
211
212 defineHisto( monTool, "vx_rdz_vs_zed", path=mypath, type="TProfile", title="rdz_vs_zed; vtx z [mm];mean z residual [mm]", xbins=100, xmin=-250, xmax=250 )
213 defineHisto( monTool, "vx_rdz_vs_ntrax", path=mypath, type="TProfile", title="rdz_vs_ntrax;number of tracks;mean z residual [mm]", xbins=vnbins_short )
214 defineHisto( monTool, "vx_rdz_vs_nvtx", path=mypath, type="TProfile", title="rdz_vs_nvtx;number of vertices;mean z residual [mm]", xbins=51, xmin=-0.125, xmax=50.125 )
215
216
217
218 defineHisto( monTool, "vx_zed_eff", path=mypath, type="TProfile", title="Vertex efficicy vs z;efficiency;offline vtx z [mm]", xbins=50, xmin=-250, xmax=250 )
219 defineHisto( monTool, "vx_ntrax_eff", path=mypath, type="TProfile", title="Vertex efficiency vs N tracks;number of tracks;efficiency", xbins=vnbins )
220 defineHisto( monTool, "vx_nvtx_eff", path=mypath, type="TProfile", title="Vertex efficincy vs N vertices;number of vertices;efficiency", xbins=101, xmin=-0.5, xmax=100.5 )
221 defineHisto( monTool, "vx_mu_eff", path=mypath, type="TProfile", title="Vertex efficiency vs mu;<#mu>;efficiency", xbins=101, xmin=-0.5, xmax=100.5 )
222 defineHisto( monTool, "vx_lb_eff", path=mypath, type="TProfile", title="Vertex efficiency vs lumiblock;lumi block;efficiency", xbins=151, xmin=-0.5, xmax=3019.5 )
223
224
225
226 return monTool
227