5117 TFile *datafile =
new TFile(
argv[2]);
5118 if (datafile->IsZombie())
5120 cout <<
"ERROR! INPUT FILE DOES NOT EXIST!" << endl;
5125 if (datafile->FindKey(
"TRT_Ar_all"))
5128 cout <<
" This run contains straws with Argon" << endl;
5130 if (!datafile->FindKey(
"Chip_Artuple"))
5133 cout <<
" This run contains does not have Argon ntuples" << endl;
5139 bool useref =
false;
5143 refdatafile =
new TFile(
argv[4]);
5144 if (refdatafile->IsZombie())
5146 cout <<
"INPUT REFERENCE FILE DOES NOT EXIST! RUNNING WITHOUT IT!" << endl;
5150 cout <<
"INPUT REFERENCE FILE OK!" << endl;
5154 cout <<
"MAKING FirstPage" << endl;
5166 cout <<
"MAKING Settings" << endl;
5171 cout <<
"MAKING TracktupleInfo" << endl;
5184 cout <<
"MAKING HitStatistics" << endl;
5190 cout <<
"MAKING Ar HitStatistics" << endl;
5195 cout <<
"MAKING TRTPlots" << endl;
5218 cout <<
"MAKING ResidualPlots" << endl;
5240 cout <<
"MAKING T0CalibTypeXY" << endl;
5247 cout <<
"MAKING XYMaps(nt0)" << endl;
5249 XYMaps *nhitsAr =
nullptr;
5253 cout <<
"MAKING XYMaps(res)" << endl;
5255 XYMaps *resxy0Ar =
nullptr;
5259 cout <<
"MAKING XYMaps(resmean)" << endl;
5261 XYMaps *resxyAr =
nullptr;
5263 resxyAr =
new XYMaps(
argv[2],
"abs(resMean)",
true);
5265 cout <<
"MAKING XYMaps(t0)" << endl;
5267 XYMaps *xymapAr =
nullptr;
5271 cout <<
"MAKING XYMaps(oldt0)" << endl;
5273 XYMaps *oldt0Ar =
nullptr;
5275 oldt0Ar =
new XYMaps(
argv[2],
"oldt0",
true);
5277 cout <<
"MAKING XYMaps(t0-oldt0)" << endl;
5279 XYMaps *oldt01Ar =
nullptr;
5281 oldt01Ar =
new XYMaps(
argv[2],
"abs(t0-oldt0)",
true);
5283 cout <<
"MAKING XYMaps(tresMean)" << endl;
5285 XYMaps *oldt0111Ar =
nullptr;
5287 oldt0111Ar =
new XYMaps(
argv[2],
"abs(tresMean)",
true);
5289 cout <<
"MAKING XYMaps(tres)" << endl;
5291 XYMaps *oldt011Ar =
nullptr;
5293 oldt011Ar =
new XYMaps(
argv[2],
"(tres)",
true);
5298 if (datafile->FindKey(
"TRT_all"))
5300 cout <<
"MAKING ChipVariations" << endl;
5312 cout <<
"MAKING BoardVariationsOldT0" << endl;
5315 refboardgraphA->SetLineColor(2);
5316 refboardgraphC->SetLineColor(2);
5317 cout <<
"MAKING BoardVariationsDiff" << endl;
5322 cout <<
"MAKING BoardVariations" << endl;
5326 cout <<
"MAKING BoardVariationsRes" << endl;
5330 cout <<
"MAKING BoardVariationsTRes" << endl;
5334 cout <<
"MAKING BoardVariationsTRes1" << endl;
5339 RtGraphs *rtrelation_bar =
nullptr;
5349 if (datafile->FindKey(
"TRT_all"))
5351 cout <<
"MAKING RtGraphs" << endl;
5352 TDirectory *trt = (TDirectory *)datafile->FindKey(
"TRT_all")->ReadObj();
5354 if (trt->FindKey(
"WholeBarrel_1"))
5358 rtrelation_bar =
new RtGraphs(
argv[2],
"WholeBarrel_1");
5365 if (trt->FindKey(
"Detector_-1"))
5376 if (trt->FindKey(
"Detector_1"))
5387 if (trt->FindKey(
"Detector_-2"))
5398 if (trt->FindKey(
"Detector_2"))
5410 cout <<
"MAKING Rt binning" << endl;
5418 cout <<
"MAKING Rt binning for Detector_-2" << endl;
5419 rtbinning3 =
new RtBinning(trt,
"Detector_-2");
5420 cout <<
"MAKING Rt binning for Detector_2" << endl;
5421 rtbinning4 =
new RtBinning(trt,
"Detector_2");
5436 cout <<
"MAKING Binned Residual" << endl;
5446 cout <<
"MAKING Binned Residual for Detector_-2" << endl;
5447 binres3 =
new RresTbin(datafile,
"Detector_-2", -2);
5449 cout <<
"MAKING Binned Residual for Detector_2" << endl;
5450 binres4 =
new RresTbin(datafile,
"Detector_2", 2);
5460 cout <<
"MAKING RtColor" << endl;
5462 if (datafile->FindKey(
"TRT_all"))
5464 cout <<
" found TRT_all " << endl;
5469 TDirectory *trt = (TDirectory *)datafile->FindKey(
"TRT_all")->ReadObj();
5493 if (trt->FindKey(
"Detector_-2"))
5495 cout <<
" MAKING RtColor Detector_-2" << endl;
5506 if (trt->FindKey(
"Detector_2"))
5508 cout <<
" MAKING RtColor Detector_2" << endl;
5611 cout <<
"MAKING RT Binned Residual for Ar" << endl;
5613 TDirectory *trtAr = (TDirectory *)datafile->FindKey(
"TRT_Ar_all")->ReadObj();
5624 cout <<
"MAKING RT Binned Abs Residual for Ar" << endl;
5652 if (trtAr->FindKey(
"Detector_Ar_-1"))
5654 cout <<
" MAKING AR RtColor det -1" << endl;
5657 rtArcol2 =
new RtColor(
argv[2],
"Detector_Ar_-1",
true);
5664 if (trtAr->FindKey(
"Detector_Ar_1"))
5666 cout <<
" MAKING AR RtColor det 1" << endl;
5669 rtArcol3 =
new RtColor(
argv[2],
"Detector_Ar_1",
true);
5676 if (trtAr->FindKey(
"Detector_Ar_-2"))
5678 cout <<
" MAKING AR RtColor det -2" << endl;
5681 rtArcol4 =
new RtColor(
argv[2],
"Detector_Ar_-2",
true);
5688 if (trtAr->FindKey(
"Detector_Ar_2"))
5690 cout <<
" MAKING AR RtColor det 2" << endl;
5693 rtArcol5 =
new RtColor(
argv[2],
"Detector_Ar_2",
true);
5707 cout <<
"MAKING BoardVariationsOldT0 for Ar" << endl;
5710 cout <<
"MAKING BoardVariationsDiff Ar" << endl;
5713 boarddiffECgraphA->SetLineColor(2);
5714 boarddiffECgraphC->SetLineColor(2);
5717 cout <<
"MAKING BoardVariations Ar" << endl;
5721 cout <<
"MAKING BoardVariationsRes Ar" << endl;
5725 cout <<
"MAKING BoardVariationsTRes Ar" << endl;
5729 cout <<
"MAKING BoardVariationsTRes1" << endl;
5733 cout <<
" Start printing itersum.ps" << endl;
5737 TCanvas *
c1 =
new TCanvas();
5738 c1->Print(
"itersum.ps[");
5742 firstpage->Print(
"itersum.ps");
5745 settings->Print(
"itersum.ps");
5748 tracktupleinfo->Print(
"itersum.ps");
5751 hitstat->Print(
"itersum.ps");
5754 hitstatAr->Print(
"itersum.ps");
5757 gStyle->SetOptStat(0);
5759 resplots->Print(
"itersum.ps");
5762 resplotsAr->Print(
"itersum.ps");
5765 textpage =
new TextPage(
" BARREL PLOTS ");
5766 textpage->Print(
"itersum.ps");
5769 hitstatxy->Print(
"itersum.ps");
5772 hitstatxyAr->Print(
"itersum.ps");
5774 nhits->Print(
"itersum.ps");
5777 nhitsAr->Print(
"itersum.ps");
5779 resxy0->Print(
"itersum.ps");
5782 resxy0Ar->Print(
"itersum.ps");
5784 resxy->Print(
"itersum.ps");
5787 resxyAr->Print(
"itersum.ps");
5789 xymap->Print(
"itersum.ps");
5792 xymapAr->Print(
"itersum.ps");
5796 oldt0->Print(
"itersum.ps");
5799 oldt0Ar->Print(
"itersum.ps");
5802 oldt01->Print(
"itersum.ps");
5805 oldt01Ar->Print(
"itersum.ps");
5809 oldt0111->Print(
"itersum.ps");
5812 oldt0111Ar->Print(
"itersum.ps");
5815 oldt011->Print(
"itersum.ps");
5818 oldt011Ar->Print(
"itersum.ps");
5823 double lowe = -3.5, upe = 3.5;
5825 if (chipgraphA && chipgraphC)
5827 chipgraphA->GetYaxis()->SetRangeUser(lowe, upe);
5828 chipgraphC->GetYaxis()->SetRangeUser(lowe, upe);
5830 c1->Divide(1, 2, 0.01, 0.01);
5837 c1->Print(
"itersum.ps");
5842 c1->Divide(1, 2, 0.01, 0.01);
5844 boardgraphA->Draw(
"apl");
5847 refboardgraphA->Draw(
"pl");
5848 TLegend *
leg =
new TLegend(0.8, 0.8, 0.98, 0.95);
5849 leg->AddEntry(boardgraphA,
"data",
"l");
5851 leg->AddEntry(refboardgraphA,
"ref (input to 1st it)",
"l");
5852 leg->SetTextSize(0.03);
5855 boardgraphC->Draw(
"apl");
5858 refboardgraphC->Draw(
"pl");
5859 c1->Print(
"itersum.ps");
5866 c1->Divide(1, 2, 0.01, 0.01);
5868 boarddiffgraphA->Draw(
"ap");
5872 boarddiffgraphC->Draw(
"ap");
5875 c1->Print(
"itersum.ps");
5880 c1->Divide(1, 2, 0.01, 0.01);
5882 boardgraphA1->Draw(
"apl");
5885 boardgraphC1->Draw(
"apl");
5887 c1->Print(
"itersum.ps");
5891 c1->Divide(1, 2, 0.01, 0.01);
5893 boardgraphA2->Draw(
"apl");
5896 boardgraphC2->Draw(
"apl");
5898 c1->Print(
"itersum.ps");
5902 c1->Divide(1, 2, 0.01, 0.01);
5904 boardgraphA3->Draw(
"apl");
5907 boardgraphC3->Draw(
"apl");
5909 c1->Print(
"itersum.ps");
5915 textpage =
new TextPage(
"ENDCAP PLOTS");
5916 textpage->Print(
"itersum.ps");
5919 cout <<
"MAKING PLOTS FOR ENDCAPS" << endl;
5923 ntypeEC->Print(
"itersum.ps");
5928 ntypeECAr->Print(
"itersum.ps");
5933 nhitsEC->Print(
"itersum.ps");
5938 nhitsECAr->Print(
"itersum.ps");
5942 resxy0EC->Print(
"itersum.ps");
5947 resxy0ECAr->Print(
"itersum.ps");
5951 resxyM0EC->Print(
"itersum.ps");
5955 resxyM0ECAr =
new XYMapsEC(
argv[2],
"abs(resMean)",
true);
5956 resxyM0ECAr->Print(
"itersum.ps");
5961 xymapEC->Print(
"itersum.ps");
5966 xymapECAr->Print(
"itersum.ps");
5974 oldt0EC->Print(
"itersum.ps");
5981 oldt0ECAr->Print(
"itersum.ps");
5987 oldt01EC->Print(
"itersum.ps");
5991 oldt01ECAr =
new XYMapsEC(
argv[2],
"abs(t0-oldt0)",
true);
5992 oldt01ECAr->Print(
"itersum.ps");
6001 oldt0111EC->Print(
"itersum.ps");
6007 oldt0111ECAr =
new XYMapsEC(
argv[2],
"abs(tresMean)",
true);
6008 oldt0111ECAr->Print(
"itersum.ps");
6013 oldt011EC->Print(
"itersum.ps");
6018 oldt011ECAr->Print(
"itersum.ps");
6023 c1->Divide(1, 2, 0.01, 0.01);
6025 boardECgraphA->Draw(
"apl");
6027 if (refboardECgraphA)
6028 refboardECgraphA->Draw(
"pl");
6029 TLegend *legAr =
new TLegend(0.8, 0.8, 0.98, 0.95);
6030 legAr->AddEntry(boardECgraphA,
"data",
"l");
6031 if (refboardECgraphA)
6032 leg->AddEntry(refboardECgraphA,
"ref (input to 1st it)",
"l");
6033 legAr->SetTextSize(0.03);
6036 boardECgraphC->Draw(
"apl");
6038 if (refboardECgraphC)
6039 refboardECgraphC->Draw(
"pl");
6040 c1->Print(
"itersum.ps");
6047 c1->Divide(1, 2, 0.01, 0.01);
6049 boarddiffECgraphA->Draw(
"ap");
6052 boarddiffECgraphC->Draw(
"ap");
6055 c1->Print(
"itersum.ps");
6060 c1->Divide(1, 2, 0.01, 0.01);
6062 boardECgraphA1->Draw(
"apl");
6065 boardECgraphC1->Draw(
"apl");
6067 c1->Print(
"itersum.ps");
6071 c1->Divide(1, 2, 0.01, 0.01);
6073 boardECgraphA2->Draw(
"apl");
6076 boardECgraphC2->Draw(
"apl");
6078 c1->Print(
"itersum.ps");
6082 c1->Divide(1, 2, 0.01, 0.01);
6084 boardECgraphA3->Draw(
"apl");
6087 boardECgraphC3->Draw(
"apl");
6089 c1->Print(
"itersum.ps");
6094 textpage =
new TextPage(
" RT PLOTS ");
6095 textpage->Print(
"itersum.ps");
6098 gStyle->SetOptStat(1);
6099 gStyle->SetOptFit(0);
6102 rtrelation_bar->Print(
"itersum.ps");
6106 rtbinning_bar->Print(
"itersum.ps");
6110 rtrelation21->Print(
"itersum.ps");
6114 rtbinning1->Print(
"itersum.ps");
6118 rtrelation31->Print(
"itersum.ps");
6122 rtbinning2->Print(
"itersum.ps");
6126 rtrelation41->Print(
"itersum.ps");
6130 rtbinning3->Print(
"itersum.ps");
6134 rtrelation51->Print(
"itersum.ps");
6138 rtbinning4->Print(
"itersum.ps");
6143 binres_bar->Print(
"itersum.ps");
6147 tbinnedres_bar->Print(
"itersum.ps");
6151 binres1->Print(
"itersum.ps");
6155 tbinnedres1->Print(
"itersum.ps");
6159 binres2->Print(
"itersum.ps");
6163 tbinnedres2->Print(
"itersum.ps");
6166 binres3->Print(
"itersum.ps");
6170 tbinnedres3->Print(
"itersum.ps");
6173 binres4->Print(
"itersum.ps");
6177 tbinnedres4->Print(
"itersum.ps");
6180 gStyle->SetOptStat(0);
6183 rtcol->Print(
"itersum.ps");
6187 rtcol1->Print(
"itersum.ps");
6190 rtcol2->Print(
"itersum.ps");
6192 if (isAr && rtArcol2)
6193 rtArcol2->Print(
"itersum.ps");
6196 rtcol3->Print(
"itersum.ps");
6198 if (isAr && rtArcol3)
6199 rtArcol3->Print(
"itersum.ps");
6202 rtcol4->Print(
"itersum.ps");
6204 if (isAr && rtArcol4)
6205 rtArcol4->Print(
"itersum.ps");
6208 rtcol5->Print(
"itersum.ps");
6210 if (isAr && rtArcol5)
6211 rtArcol5->Print(
"itersum.ps");
6216 DGraph *dgraph0 =
nullptr;
6217 DGraph *dgraph1 =
nullptr;
6218 DGraph *dgraph2 =
nullptr;
6219 DGraph *dgraph3 =
nullptr;
6220 DGraph *dgraph4 =
nullptr;
6221 DGraph *dgraph5 =
nullptr;
6222 bool isinverted =
false;
6223 if (datafile->FindKey(
"TRT_all"))
6225 TDirectory *trt = (TDirectory *)datafile->FindKey(
"TRT_all")->ReadObj();
6226 cout <<
"MAKING DGraphs" << endl;
6229 dgraph0 =
new DGraph(
argv[2],
"-2,-1",
"", -2, -1, isinverted);
6230 if (trt->FindKey(
"WholeBarrel_1"))
6232 dgraph5 =
new DGraph(
argv[2],
"-2,-1",
"WholeBarrel_1", -1, -1, isinverted);
6236 cout <<
" did not find WholeBarrel_1" << endl;
6237 if (trt->FindKey(
"Detector_1"))
6238 dgraph1 =
new DGraph(
argv[2],
"-2,-1",
"Detector_1", 1, -1, isinverted);
6239 if (trt->FindKey(
"Detector_-1"))
6240 dgraph2 =
new DGraph(
argv[2],
"-2,-1",
"Detector_-1", 1, -1, isinverted);
6242 if (trt->FindKey(
"Detector_2"))
6243 dgraph3 =
new DGraph(
argv[2],
"-2,-1",
"Detector_2", 1, -1, isinverted);
6244 if (trt->FindKey(
"Detector_-2"))
6245 dgraph4 =
new DGraph(
argv[2],
"-2,-1",
"Detector_-2", 1, -1, isinverted);
6248 TLegend *
leg =
new TLegend(0.8, 0.8, 0.98, 0.95);
6249 if (dgraph0 !=
nullptr)
6251 dgraph0->GetXaxis()->SetRangeUser(-5, 45);
6252 cout <<
" found TRT_all" << endl;
6253 dgraph0->SetLineWidth(3);
6254 dgraph0->SetLineColor(1);
6255 dgraph0->SetTitle(
"r(t)");
6257 dgraph0->GetXaxis()->SetTitle(
"t/ns");
6259 dgraph0->GetYaxis()->SetTitle(
"R / (mm)");
6262 dgraph0->Draw(
"apl");
6264 leg->AddEntry(dgraph0,
"Whole TRT",
"l");
6266 if (dgraph1 !=
nullptr)
6268 cout <<
" found Detector_1" << endl;
6269 dgraph1->SetLineWidth(3);
6270 dgraph1->SetLineColor(3);
6272 dgraph1->Draw(
"pl");
6274 leg->AddEntry(dgraph1,
"Barrel C Side",
"l");
6277 if (dgraph2 !=
nullptr)
6279 cout <<
" found Detector_-1" << endl;
6280 dgraph2->SetLineWidth(3);
6281 dgraph2->SetLineColor(2);
6283 dgraph2->Draw(
"pl");
6285 leg->AddEntry(dgraph2,
"Barrel A Side",
"l");
6288 if (dgraph3 !=
nullptr)
6290 dgraph3->SetLineWidth(3);
6291 cout <<
" found Detector_2" << endl;
6292 dgraph3->SetLineColor(6);
6294 dgraph3->Draw(
"pl");
6296 leg->AddEntry(dgraph3,
"Endcap C side",
"l");
6299 if (dgraph4 !=
nullptr)
6301 cout <<
" found Detector_-2" << endl;
6302 dgraph4->SetLineWidth(3);
6303 dgraph4->SetLineColor(7);
6305 dgraph4->Draw(
"pl");
6307 leg->AddEntry(dgraph4,
"Endcap A side",
"l");
6309 if (dgraph5 !=
nullptr)
6311 cout <<
" found WholeBarrel_1" << endl;
6312 dgraph5->SetLineWidth(3);
6313 dgraph5->SetLineColor(8);
6315 dgraph5->Draw(
"pl");
6317 leg->AddEntry(dgraph5,
"Whole Barrel",
"l");
6320 leg->SetTextSize(0.03);
6322 c1->Print(
"itersum.ps");
6336 if (datafile->FindKey(
"TRT_all"))
6338 cout <<
" do_expert: found TRT_all" << endl;
6339 TDirectory *trt = (TDirectory *)datafile->FindKey(
"TRT_all")->ReadObj();
6340 cout <<
"MAKING DvGraphs" << endl;
6343 dvgraph0 =
new DvGraph(
argv[2],
"-2,-1",
"", -2, -1, isinverted);
6344 if (trt->FindKey(
"WholeBarrel_1"))
6345 dvgraph5 =
new DvGraph(
argv[2],
"-2,-1",
"WholeBarrel_1", -1, -1, isinverted);
6348 if (trt->FindKey(
"Detector_1"))
6349 dvgraph1 =
new DvGraph(
argv[2],
"-2,-1",
"Detector_1", 1, -1, isinverted);
6350 if (trt->FindKey(
"Detector_-1"))
6351 dvgraph2 =
new DvGraph(
argv[2],
"-2,-1",
"Detector_-1", 1, -1, isinverted);
6353 if (trt->FindKey(
"Detector_2"))
6354 dvgraph3 =
new DvGraph(
argv[2],
"-2,-1",
"Detector_2", 1, -1, isinverted);
6355 if (trt->FindKey(
"Detector_-2"))
6356 dvgraph4 =
new DvGraph(
argv[2],
"-2,-1",
"Detector_-2", 1, -1, isinverted);
6359 TLegend *
leg =
new TLegend(0.8, 0.8, 0.98, 0.95);
6360 if (dvgraph0 !=
nullptr)
6362 dvgraph0->GetXaxis()->SetRangeUser(0, 2);
6363 cout <<
" do_expert: found -2-1" << endl;
6364 dvgraph0->SetLineWidth(3);
6365 dvgraph0->SetLineColor(1);
6367 dvgraph0->SetTitle(
"dt/dr");
6369 dvgraph0->SetTitle(
"dr/dt");
6370 dvgraph0->GetXaxis()->SetTitle(
"r/mm");
6372 dvgraph0->GetYaxis()->SetTitle(
"dt/dr / (ns/mm)");
6374 dvgraph0->GetYaxis()->SetTitle(
"dr/dt / (mm/ns)");
6376 dvgraph0->Draw(
"apl");
6378 leg->AddEntry(dvgraph0,
"Whole TRT",
"l");
6380 if (dvgraph1 !=
nullptr)
6382 cout <<
" do_expert: found Detector_1" << endl;
6383 dvgraph1->SetLineWidth(3);
6384 dvgraph1->SetLineColor(3);
6386 dvgraph1->Draw(
"pl");
6388 leg->AddEntry(dvgraph1,
"Barrel C Side",
"l");
6391 if (dvgraph2 !=
nullptr)
6393 dvgraph2->SetLineWidth(3);
6394 dvgraph2->SetLineColor(2);
6396 dvgraph2->Draw(
"pl");
6398 leg->AddEntry(dvgraph2,
"Barrel A Side",
"l");
6401 if (dvgraph3 !=
nullptr)
6403 dvgraph3->SetLineWidth(3);
6404 dvgraph3->SetLineColor(6);
6406 dvgraph3->Draw(
"pl");
6408 leg->AddEntry(dvgraph3,
"Endcap C side",
"l");
6411 if (dvgraph4 !=
nullptr)
6413 dvgraph4->SetLineWidth(3);
6414 dvgraph4->SetLineColor(7);
6416 dvgraph4->Draw(
"pl");
6418 leg->AddEntry(dvgraph4,
"Endcap A side",
"l");
6420 if (dvgraph5 !=
nullptr)
6422 dvgraph5->SetLineWidth(3);
6423 dvgraph5->SetLineColor(8);
6425 dvgraph5->Draw(
"pl");
6427 leg->AddEntry(dvgraph5,
"Whole Barrel",
"l");
6430 leg->SetTextSize(0.03);
6432 c1->Print(
"itersum.ps");
6439 textpage =
new TextPage(
"Track plots: Only for Experts!!!");
6440 textpage->Print(
"itersum.ps");
6443 bool istracktuple =
false;
6444 TNtuple *Tracktuple =
nullptr;
6445 if (datafile->FindKey(
"tracktuple"))
6447 Tracktuple = (TNtuple *)datafile->Get(
"tracktuple");
6448 istracktuple =
true;
6451 cout <<
"MAKING TRACK PLOTS" << endl;
6456 if (Tracktuple->GetListOfBranches()->FindObject(
"trackres"))
6459 c1->Divide(2, 1, 0.01, 0.01);
6461 Tracktuple->Draw(
"trackres>>histRes(100,0,1.5)");
6462 TH1F *histRes = (
TH1F *)gPad->GetPrimitive(
"histRes");
6463 histRes->SetTitle(
"Residual on track");
6464 histRes->GetXaxis()->SetTitle(
"Residual (mm)");
6468 Tracktuple->Draw(
"trackres:t-ttrack-t0>>histRes2d(100,-12,12,100,0,1)",
"",
"colz");
6469 TH2F *histRes2d = (
TH2F *)gPad->GetPrimitive(
"histRes2d");
6470 histRes2d->SetTitle(
"Track time residual VS track residual");
6471 histRes2d->GetXaxis()->SetTitle(
"Time residual (ns)");
6472 histRes2d->GetYaxis()->SetTitle(
"Track Residual (mm)");
6473 histRes2d->Draw(
"colz");
6474 TProfile *res2d = histRes2d->ProfileX();
6475 res2d->Draw(
"same");
6477 c1->Print(
"itersum.ps");
6482 if (Tracktuple->GetListOfBranches()->FindObject(
"pt"))
6485 c1->Divide(2, 1, 0.01, 0.01);
6487 Tracktuple->Draw(
"pt/1000>>histPt(100,0,20)");
6488 TH1F *histPt = (
TH1F *)gPad->GetPrimitive(
"histPt");
6489 histPt->SetTitle(
"Transverse momentum on track");
6490 histPt->GetXaxis()->SetTitle(
"Pt (GeV)");
6494 Tracktuple->Draw(
"trackres:pt/1000>>histPt2d(100,0,20,100,0,1.5)",
"",
"colz");
6495 TH2F *histPt2d = (
TH2F *)gPad->GetPrimitive(
"histPt2d");
6496 histPt2d->SetTitle(
"Transverse momentum on track VS track residual");
6497 histPt2d->GetXaxis()->SetTitle(
"Pt (GeV)");
6498 histPt2d->GetYaxis()->SetTitle(
"Track Residual (mm)");
6499 histPt2d->Draw(
"COLZ");
6500 TProfile *pt2d = histPt2d->ProfileX();
6502 c1->Print(
"itersum.ps");
6506 if (Tracktuple->GetListOfBranches()->FindObject(
"theta"))
6509 c1->Divide(2, 1, 0.01, 0.01);
6511 Tracktuple->Draw(
"theta>>histTheta(100,0,4)");
6512 TH1F *histTheta = (
TH1F *)gPad->GetPrimitive(
"histTheta");
6513 histTheta->SetTitle(
"Theta distribution on track");
6514 histTheta->GetXaxis()->SetTitle(
"Theta (rad)");
6518 Tracktuple->Draw(
"trackres:theta>>histTheta2d(100,0,4,100,0,1.5)",
"",
"colz");
6519 TH2F *histTheta2d = (
TH2F *)gPad->GetPrimitive(
"histTheta2d");
6520 histTheta2d->SetTitle(
"Theta distrib. on track VS track residual");
6521 histTheta2d->GetXaxis()->SetTitle(
"Theta (rad)");
6522 histTheta2d->GetYaxis()->SetTitle(
"Track Residual (mm)");
6523 histTheta2d->Draw(
"COLZ");
6524 TProfile *theta2d = histTheta2d->ProfileX();
6525 theta2d->Draw(
"same");
6526 c1->Print(
"itersum.ps");
6530 if (Tracktuple->GetListOfBranches()->FindObject(
"phi"))
6533 c1->Divide(2, 1, 0.01, 0.01);
6535 Tracktuple->Draw(
"phi>>histPhi(100,-3.5,0)");
6536 TH1F *histPhi = (
TH1F *)gPad->GetPrimitive(
"histPhi");
6537 histPhi->SetTitle(
"Phi distribution on track");
6538 histPhi->GetXaxis()->SetTitle(
"Phi (rad)");
6542 Tracktuple->Draw(
"trackres:phi>>histPhi2d(100,-3.5,0,100,0,1.5)",
"",
"colz");
6543 TH2F *histPhi2d = (
TH2F *)gPad->GetPrimitive(
"histPhi2d");
6544 histPhi2d->SetTitle(
"Phi distrib. on track VS track residual");
6545 histPhi2d->GetXaxis()->SetTitle(
"Phi (rad)");
6546 histPhi2d->GetYaxis()->SetTitle(
"Track Residual (mm)");
6547 histPhi2d->Draw(
"COLZ");
6548 TProfile *phi2d = histPhi2d->ProfileX();
6549 phi2d->Draw(
"same");
6550 c1->Print(
"itersum.ps");
6554 if (Tracktuple->GetListOfBranches()->FindObject(
"d0"))
6557 c1->Divide(2, 1, 0.01, 0.01);
6559 Tracktuple->Draw(
"d0>>histD0(100,-5,5)");
6560 TH1F *histD0 = (
TH1F *)gPad->GetPrimitive(
"histD0");
6561 histD0->SetTitle(
"D0 distribution on track");
6562 histD0->GetXaxis()->SetTitle(
"D0 (mm)");
6566 Tracktuple->Draw(
"trackres:d0>>histD02d(100,-5,5,100,0,1.5)",
"",
"colz");
6567 TH2F *histD02d = (
TH2F *)gPad->GetPrimitive(
"histD02d");
6568 histD02d->SetTitle(
"D0 distrib. on track VS track residual");
6569 histD02d->GetXaxis()->SetTitle(
"D0 (rad)");
6570 histD02d->GetYaxis()->SetTitle(
"Track Residual (mm)");
6571 histD02d->Draw(
"COLZ");
6572 TProfile *d02d = histD02d->ProfileX();
6574 c1->Print(
"itersum.ps");
6582 cout <<
" Skipping plots for Pulls and Errors " << endl;
6623 cout <<
" Skipping plots for ToT and HT " << endl;
6636 textpage =
new TextPage(
" ToT Corrections and HT corrections: ");
6637 textpage->Print(
"itersum.pdf");
6640 cout <<
"Making ToT / HT Plots" << endl;
6746 refdatafile->Close();
6772 if (settings && firstpage)
6774 string fixfloat, fieldonoff;
6775 if (settings->
set[
"UsePol0"].find(
"True") != string::npos)
6776 fixfloat =
" - floating";
6778 fixfloat =
" - fixed";
6779 if (settings->
set[
"RtRelation"].find(
"binned") != string::npos)
6781 if (settings->
set[
"Solenoid"].find(
"True") != string::npos)
6787 string(
"/Helvetica-Bold findfont 36 scalefont setfont 40 2190 moveto (Run:) show ") +
6788 string(Form(
"/Helvetica findfont 36 scalefont setfont 240 2190 moveto (%i) show ", (
int)firstpage->
runnumber)) +
6790 string(
"/Helvetica-Bold findfont 36 scalefont setfont 40 2150 moveto (Iteration:) show ") +
6791 string(Form(
"/Helvetica findfont 36 scalefont setfont 240 2150 moveto (%02i) show ", firstpage->
iter)) +
6793 string(
"/Helvetica-Bold findfont 36 scalefont setfont 40 2110 moveto (Rt relation:) show ") +
6794 string(Form(
"/Helvetica findfont 36 scalefont setfont 240 2110 moveto (%s%s) show ", settings->
set[
"RtRelation"].data(), fixfloat.data())) +
6796 string(
"/Helvetica-Bold findfont 36 scalefont setfont 540 2190 moveto (Rt binning:) show ") +
6797 string(Form(
"/Helvetica findfont 36 scalefont setfont 740 2190 moveto (%s) show ", settings->
set[
"RtBinning"].data())) +
6799 string(
"/Helvetica-Bold findfont 36 scalefont setfont 540 2150 moveto (Rt level:) show ") +
6801 string(
"/Helvetica-Bold findfont 36 scalefont setfont 540 2110 moveto (T0 level:) show ") +
6803 string(
"/Helvetica-Bold findfont 36 scalefont setfont 1040 2190 moveto (Solenoid:) show ") +
6804 string(Form(
"/Helvetica findfont 36 scalefont setfont 1260 2190 moveto (%s) show ", fieldonoff.data())) +
6806 string(
"/Helvetica-Bold findfont 36 scalefont setfont 1040 2150 moveto (SW release:) show ") +
6807 string(Form(
"/Helvetica findfont 36 scalefont setfont 1260 2150 moveto (%s) show ", settings->
set[
"ReleaseRec"].data())) +
6809 string(
"/Helvetica-Bold findfont 36 scalefont setfont 1040 2110 moveto (T0 Offset:) show ") +
6810 string(Form(
"/Helvetica findfont 36 scalefont setfont 1260 2110 moveto (%s) show ", settings->
set[
"T0Offset"].data())) +
6812 string(
"/Helvetica-Bold findfont 30 scalefont setfont 40 2060 moveto (Data:) show ") +
6813 string(Form(
"/Helvetica findfont 30 scalefont setfont 240 2060 moveto (%s) show ", settings->
set[
"Inputdir"].data())) +
6815 string(
"/Helvetica-Bold findfont 30 scalefont setfont 40 2020 moveto (Start const:) show ") +
6816 string(Form(
"/Helvetica findfont 30 scalefont setfont 240 2020 moveto (%s) show ", settings->
set[
"StartConst"].data()));
6817 system((
string(
"sed -i 's?showpage?" + pmarking +
"showpage?g' itersum.ps")).
data());
6821 datafile =
new TFile(
argv[2],
"UPDATE");
6823 if (datafile->FindKey(
"analysis"))
6824 datafile->rmdir(
"analysis");
6825 TDirectory *adir = datafile->mkdir(
"analysis",
"analysis");
6828 chipgraphA->Write();
6830 chipgraphC->Write();
6831 boardgraphA->Write();
6832 boardgraphC->Write();
6834 refboardgraphA->Write();
6836 refboardgraphC->Write();