4091{
4092 m_errors = (TDirectory *)
file->FindKey(
"Errors")->ReadObj();
4094 throw(string("No errors folder!!!!!!!!!!!!!!!"));
4096 {
4097 this->Divide(2, 3, 0.01, 0.01);
4098
4099 TH2F *residual_trt = (
TH2F *)
m_errors->FindKey(
"residual_allhits")->ReadObj();
4104
4105
4106
4107
4108
4114 TH2F *residual_trtP = (
TH2F *)
m_errors->FindKey(
"residual_trtP")->ReadObj();
4119 TH2F *tresidual_trtP = (
TH2F *)
m_errors->FindKey(
"tresidual_trtP")->ReadObj();
4120 TH2F *tresidual_baP = (
TH2F *)
m_errors->FindKey(
"tresidual_baP")->ReadObj();
4121 TH2F *tresidual_bcP = (
TH2F *)
m_errors->FindKey(
"tresidual_bcP")->ReadObj();
4122 TH2F *tresidual_eaP = (
TH2F *)
m_errors->FindKey(
"tresidual_eaP")->ReadObj();
4123 TH2F *tresidual_ecP = (
TH2F *)
m_errors->FindKey(
"tresidual_ecP")->ReadObj();
4124 TH2F *trackerrors_trt = (
TH2F *)
m_errors->FindKey(
"trackerrors_trt")->ReadObj();
4125 TH2F *trackerrors_ba = (
TH2F *)
m_errors->FindKey(
"trackerrors_ba")->ReadObj();
4126 TH2F *trackerrors_bc = (
TH2F *)
m_errors->FindKey(
"trackerrors_bc")->ReadObj();
4127 TH2F *trackerrors_ea = (
TH2F *)
m_errors->FindKey(
"trackerrors_ea")->ReadObj();
4128 TH2F *trackerrors_ec = (
TH2F *)
m_errors->FindKey(
"trackerrors_ec")->ReadObj();
4129
4131
4132 TGraphErrors *tresTRT =
GetMean(tresidual_trtP);
4133 TGraphErrors *tresBA =
GetMean(tresidual_baP);
4134 tresBA->SetLineColor(kRed);
4135 tresBA->SetMarkerColor(kRed);
4136 TGraphErrors *tresBC =
GetMean(tresidual_bcP);
4137 tresBC->SetLineColor(kBlue);
4138 tresBC->SetMarkerColor(kBlue);
4139 TGraphErrors *tresEA =
GetMean(tresidual_eaP);
4140 tresEA->SetLineColor(kGreen);
4141 tresEA->SetMarkerColor(kGreen);
4142 TGraphErrors *tresEC =
GetMean(tresidual_ecP);
4143 tresEC->SetLineColor(kYellow);
4144 tresEC->SetMarkerColor(kYellow);
4145
4146 tresTRT->SetTitle("Time Residual Mean VS PT");
4147 tresTRT->GetXaxis()->SetTitle("Pt (GeV)");
4148 tresTRT->GetYaxis()->SetTitle("ns");
4149 tresTRT->GetYaxis()->SetRangeUser(-0.8, 0.4);
4150 tresTRT->Draw("ALP");
4151 tresBA->Draw("LP");
4152 tresBC->Draw("LP");
4153 tresEA->Draw("LP");
4154 tresEC->Draw("LP");
4155
4157
4158
4159 TGraphErrors *tresTRTw =
GetWidth(tresidual_trtP);
4160 TGraphErrors *tresBAw =
GetWidth(tresidual_baP);
4161 tresBAw->SetLineColor(kRed);
4162 tresBAw->SetMarkerColor(kRed);
4163 TGraphErrors *tresBCw =
GetWidth(tresidual_bcP);
4164 tresBCw->SetLineColor(kBlue);
4165 tresBCw->SetMarkerColor(kBlue);
4166 TGraphErrors *tresEAw =
GetWidth(tresidual_eaP);
4167 tresEAw->SetLineColor(kGreen);
4168 tresEAw->SetMarkerColor(kGreen);
4169 TGraphErrors *tresECw =
GetWidth(tresidual_ecP);
4170 tresECw->SetLineColor(kYellow);
4171 tresECw->SetMarkerColor(kYellow);
4172
4173 tresTRTw->SetTitle("Time Residual Width VS PT");
4174 tresTRTw->GetXaxis()->SetTitle("Pt (GeV)");
4175 tresTRTw->GetYaxis()->SetTitle("ns");
4176 tresTRTw->GetYaxis()->SetRangeUser(2.9, 4.0);
4177 tresTRTw->Draw("ALP");
4178 tresBAw->Draw("LP");
4179 tresBCw->Draw("LP");
4180 tresEAw->Draw("LP");
4181 tresECw->Draw("LP");
4183
4184
4185 TGraphErrors *resTRTw =
GetWidth(residual_trtP);
4186 TGraphErrors *resBAw =
GetWidth(residual_baP);
4187 resBAw->SetLineColor(kRed);
4188 resBAw->SetMarkerColor(kRed);
4189 TGraphErrors *resBCw =
GetWidth(residual_bcP);
4190 resBCw->SetLineColor(kBlue);
4191 resBCw->SetMarkerColor(kBlue);
4192 TGraphErrors *resEAw =
GetWidth(residual_eaP);
4193 resEAw->SetLineColor(kGreen);
4194 resEAw->SetMarkerColor(kGreen);
4195 TGraphErrors *resECw =
GetWidth(residual_ecP);
4196 resECw->SetLineColor(kYellow);
4197 resECw->SetMarkerColor(kYellow);
4198
4199 resTRTw->SetTitle("Residual Width VS PT");
4200 resTRTw->GetXaxis()->SetTitle("Pt (GeV)");
4201 resTRTw->GetYaxis()->SetTitle("mm");
4202 resTRTw->GetYaxis()->SetRangeUser(0.11, 0.18);
4203 resTRTw->Draw("ALP");
4204 resBAw->Draw("LP");
4205 resBCw->Draw("LP");
4206 resEAw->Draw("LP");
4207 resECw->Draw("LP");
4208
4210
4211 TGraphErrors *pullTRTw =
GetPWidth(pull_trtP);
4212 TGraphErrors *pullBAw =
GetPWidth(pull_baP);
4213 pullBAw->SetLineColor(kRed);
4214 pullBAw->SetMarkerColor(kRed);
4215 TGraphErrors *pullBCw =
GetPWidth(pull_bcP);
4216 pullBCw->SetLineColor(kBlue);
4217 pullBCw->SetMarkerColor(kBlue);
4218 TGraphErrors *pullEAw =
GetPWidth(pull_eaP);
4219 pullEAw->SetLineColor(kGreen);
4220 pullEAw->SetMarkerColor(kGreen);
4221 TGraphErrors *pullECw =
GetPWidth(pull_ecP);
4222 pullECw->SetLineColor(kYellow);
4223 pullECw->SetMarkerColor(kYellow);
4224
4225 pullTRTw->SetTitle("Pull Width VS PT");
4226 pullTRTw->GetXaxis()->SetTitle("Pt (GeV)");
4227 pullTRTw->GetYaxis()->SetTitle(" ");
4228 pullTRTw->GetYaxis()->SetRangeUser(0.7, 1.3);
4229 pullTRTw->Draw("ALP");
4230 pullBAw->Draw("LP");
4231 pullBCw->Draw("LP");
4232 pullEAw->Draw("LP");
4233 pullECw->Draw("LP");
4234
4236
4237 TGraphErrors *trkTRTw =
GetMean(trackerrors_trt);
4238 TGraphErrors *trkBAw =
GetMean(trackerrors_ba);
4239 trkBAw->SetLineColor(kRed);
4240 trkBAw->SetMarkerColor(kRed);
4241 TGraphErrors *trkBCw =
GetMean(trackerrors_bc);
4242 trkBCw->SetLineColor(kBlue);
4243 trkBCw->SetMarkerColor(kBlue);
4244 TGraphErrors *trkEAw =
GetMean(trackerrors_ea);
4245 trkEAw->SetLineColor(kGreen);
4246 trkEAw->SetMarkerColor(kGreen);
4247 TGraphErrors *trkECw =
GetMean(trackerrors_ec);
4248 trkECw->SetLineColor(kYellow);
4249 trkECw->SetMarkerColor(kYellow);
4250
4251 trkTRTw->SetTitle("Trk error Mean Width VS PT");
4252 trkTRTw->GetXaxis()->SetTitle("Pt (GeV)");
4253 trkTRTw->GetYaxis()->SetTitle("mm");
4254 trkTRTw->GetYaxis()->SetRangeUser(0.0, 0.07);
4255 trkTRTw->Draw("ALP");
4256 trkBAw->Draw("LP");
4257 trkBCw->Draw("LP");
4258 trkEAw->Draw("LP");
4259 trkECw->Draw("LP");
4260
4262
4263
4264 TGraphErrors *presTRTw =
GetWidth(residual_trt);
4265 TGraphErrors *presBAw =
GetWidth(residual_ba);
4266 presBAw->SetLineColor(kRed);
4267 presBAw->SetMarkerColor(kRed);
4268 TGraphErrors *presBCw =
GetWidth(residual_bc);
4269 presBCw->SetLineColor(kBlue);
4270 presBCw->SetMarkerColor(kBlue);
4271 TGraphErrors *presEAw =
GetWidth(residual_ea);
4272 presEAw->SetLineColor(kGreen);
4273 presEAw->SetMarkerColor(kGreen);
4274 TGraphErrors *presECw =
GetWidth(residual_ec);
4275 presECw->SetLineColor(kYellow);
4276 presECw->SetMarkerColor(kYellow);
4277
4278 presTRTw->SetTitle("Residual Width all hits VS PT");
4279 presTRTw->GetXaxis()->SetTitle("Pt (GeV)");
4280 presTRTw->GetYaxis()->SetTitle("mm");
4281 presTRTw->GetYaxis()->SetRangeUser(0.11, 0.18);
4282 presTRTw->Draw("ALP");
4283 presBAw->Draw("LP");
4284 presBCw->Draw("LP");
4285 presEAw->Draw("LP");
4286 presECw->Draw("LP");
4287 }
4288 else
4289 {
4290 cout << " Not enough keys in Errors directory for Pt dependence plots " << endl;
4291 }
4292}
TGraphErrors * GetWidth(TH2F *histo)
TGraphErrors * GetMean(TH2F *histo)
TGraphErrors * GetPWidth(TH2F *histo)
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)