230 myfile.open(
"hits_per_asic.txt", std::fstream::out);
232 myfile <<
"## TRD data per ASIC" << endl;
235 myfile <<
"#--------------------------" << endl;
242 gStyle->SetNumberContours(99);
253 printf(
"Introduction:\n");
259 Double_t ZRangeL = 1;
260 Double_t ZRangeU = 1e05;
261 Double_t mm2bin = 2.5;
267 TFile* oldFile = gFile;
268 TDirectory* oldDir = gDirectory;
270 tFile =
new TFile(
"CbmTrdHitRateFastQa.root",
"RECREATE",
" ROOT file with histograms");
276 size_t buf_size = 50;
277 Char_t name[buf_size];
278 Char_t title[buf_size];
283 snprintf(title, buf_size - 1,
"Data_per_Asic");
288 const Int_t anbins = 100;
290 Double_t axmax = 2000;
291 Double_t alogxmin = TMath::Log10(axmin);
292 Double_t alogxmax = TMath::Log10(axmax);
293 Double_t abinwidth = (alogxmax - alogxmin) / anbins;
294 Double_t axbins[anbins + 1];
296 for (Int_t i = 1; i <= anbins; i++) {
297 axbins[i] = axmin + TMath::Power(10, alogxmin + i * abinwidth);
299 TH1F* h1HitAsic =
new TH1F(name, title, anbins, axbins);
301 if (
fBitPerHit == 1.) h1HitAsic->SetXTitle(
"Hits/Asic [Hz]");
303 h1HitAsic->SetXTitle(
"Data/32ch Asic [Mbit/s]");
304 h1HitAsic->SetYTitle(
"count");
309 snprintf(title, buf_size - 1,
"Data_per_Module");
314 const Int_t bnbins = 100;
316 Double_t bxmax = 100 * 2000;
317 Double_t blogxmin = TMath::Log10(bxmin);
318 Double_t blogxmax = TMath::Log10(bxmax);
319 Double_t bbinwidth = (blogxmax - blogxmin) / bnbins;
320 Double_t bxbins[bnbins + 1];
322 for (Int_t i = 1; i <= bnbins; i++) {
323 bxbins[i] = bxmin + TMath::Power(10, blogxmin + i * bbinwidth);
335 snprintf(title, buf_size - 1,
"5_Gbps_optical_links_per_Module");
341 TH1F* h1HitPad = NULL;
342 TH2F* h2Layer = NULL;
343 TH2F* h2Topview[3] = {NULL, NULL, NULL};
349 c0 =
new TCanvas(
"c0",
"c0", 1800, 450);
352 const Int_t z_cave = 12000;
354 new TH2F(
"TopView",
"TopView",
int(2 *
winsize / mm2bin), -
winsize,
winsize,
int(z_cave / mm2bin), 0, z_cave);
355 h2Topview[0]->SetXTitle(
"x-Coordinate [mm]");
356 h2Topview[0]->SetYTitle(
"z-Coordinate [mm]");
357 h2Topview[0]->SetZTitle(
"#");
360 h2Topview[1]->SetXTitle(
"x-Coordinate [mm]");
361 h2Topview[1]->SetYTitle(
"y-Coordinate [mm]");
362 h2Topview[1]->SetZTitle(
"#");
364 new TH2F(
"SideView",
"SideView",
int(z_cave / mm2bin), 0, z_cave,
int(2 *
winsize / mm2bin), -
winsize,
winsize);
365 h2Topview[2]->SetXTitle(
"z-Coordinate [mm]");
366 h2Topview[2]->SetYTitle(
"y-Coordinate [mm]");
367 h2Topview[2]->SetZTitle(
"#");
368 for (Int_t i = 0; i < 3; i++) {
369 h2Topview[i]->SetContour(99);
370 h2Topview[i]->SetStats(kFALSE);
371 h2Topview[i]->GetXaxis()->SetLabelSize(0.02);
372 h2Topview[i]->GetYaxis()->SetLabelSize(0.02);
373 h2Topview[i]->GetZaxis()->SetLabelSize(0.02);
374 h2Topview[i]->GetXaxis()->SetTitleSize(0.02);
375 h2Topview[i]->GetXaxis()->SetTitleOffset(1.5);
376 h2Topview[i]->GetYaxis()->SetTitleSize(0.02);
377 h2Topview[i]->GetYaxis()->SetTitleOffset(2);
378 h2Topview[i]->GetZaxis()->SetTitleSize(0.02);
379 h2Topview[i]->GetZaxis()->SetTitleOffset(-2);
382 h2Topview[i]->Draw(
"colz");
394 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
395 fColors.push_back(TColor::GetColorPalette(i));
396 fZLevel.push_back(ZRangeL + TMath::Power(10, TMath::Log10(ZRangeU) / TColor::GetNumberOfColors() * i));
421 for (Int_t i = 0; i < NofModules; i++) {
436 if (
fPlane == 0) Plane01.push_back(ModuleID);
437 if (
fPlane == 1) Plane02.push_back(ModuleID);
438 if (
fPlane == 2) Plane03.push_back(ModuleID);
439 if (
fPlane == 3) Plane04.push_back(ModuleID);
440 if (
fPlane == 4) Plane05.push_back(ModuleID);
441 if (
fPlane == 5) Plane06.push_back(ModuleID);
442 if (
fPlane == 6) Plane07.push_back(ModuleID);
443 if (
fPlane == 7) Plane08.push_back(ModuleID);
444 if (
fPlane == 8) Plane09.push_back(ModuleID);
445 if (
fPlane == 9) Plane10.push_back(ModuleID);
448 vector<vector<int>> LiSi;
455 LiSi.push_back(Plane01);
456 LiSi.push_back(Plane02);
457 LiSi.push_back(Plane03);
458 LiSi.push_back(Plane04);
459 LiSi.push_back(Plane05);
460 LiSi.push_back(Plane06);
461 LiSi.push_back(Plane07);
462 LiSi.push_back(Plane08);
463 LiSi.push_back(Plane09);
464 LiSi.push_back(Plane10);
472 TLine* MaxHitRatePerPad =
new TLine(1e05, 0, 1e05, 1e04);
473 MaxHitRatePerPad->SetLineColor(2);
474 MaxHitRatePerPad->SetLineWidth(8);
484 if ((Int_t) LiSi.size() > 0)
485 for (vector<vector<Int_t>>::size_type j = 0; j < LiSi.size(); j++) {
487 UInt_t nModulesInThisLayer = LiSi[j].size();
488 if (nModulesInThisLayer == 0)
break;
493 printf(
"Station: %i Layer: %i nModules: %i\n",
fStation,
fLayer, nModulesInThisLayer);
495 h2Topview[0]->Reset();
496 h2Topview[1]->Reset();
497 h2Topview[2]->Reset();
499 OutFile1.Form(
"pics/HitRateLayerPadView_S%d_L%d.png",
fStation,
fLayer);
500 OutFile2.Form(
"pics/HitRateLayerSpectrum_S%d_L%d.png",
fStation,
fLayer);
502 HistoInit(c1, c2, c3, h2Layer, h1HitPad, ZRangeL, ZRangeU, mm2bin);
506 MaxHitRatePerPad->Draw(
"same");
512 if (nModulesInThisLayer > 0)
513 for (vector<int>::size_type i = 0; i < nModulesInThisLayer; i++) {
514 printf(
" ModuleAddress: %i\n", LiSi[j][i]);
515 myfile <<
"# ModuleAddress: " << LiSi[j][i] << endl;
534 Outimage1 = TImage::Create();
535 Outimage1->FromPad(c1);
536 Outimage1->WriteImage(OutFile1);
537 OutFile1.ReplaceAll(
"png",
"pdf");
538 c1->SaveAs(OutFile1);
539 OutFile1.ReplaceAll(
"Pad",
"ASIC");
541 c3->SaveAs(OutFile1);
542 OutFile1.ReplaceAll(
"pdf",
"png");
543 c3->SaveAs(OutFile1);
547 h1HitPad->Draw(
"same");
551 h1HitAsic->Write(
"", TObject::kOverwrite);
553 TLine* MaxDataRatePerUplink =
new TLine(500, 0.7 * gPad->GetUymax(), 500,
556 MaxDataRatePerUplink->SetLineColor(2);
557 MaxDataRatePerUplink->SetLineWidth(8);
558 MaxDataRatePerUplink->Draw(
"same");
565 TLine* MaxDataRatePerOptLink =
new TLine(5000, 0.7 * gPad->GetUymax(), 5000,
568 MaxDataRatePerOptLink->SetLineColor(2);
569 MaxDataRatePerOptLink->SetLineWidth(8);
570 MaxDataRatePerOptLink->Draw(
"same");
576 Outimage2 = TImage::Create();
577 Outimage2->FromPad(c2);
578 Outimage2->WriteImage(OutFile2);
579 OutFile1.ReplaceAll(
"png",
"pdf");
580 c2->SaveAs(OutFile2);
581 OutFile1.ReplaceAll(
"Pad",
"ASIC");
582 c2->SaveAs(OutFile2);
589 if (Outimage1)
delete Outimage1;
590 if (Outimage2)
delete Outimage2;
592 if (h2Layer)
delete h2Layer;
593 if (h1HitPad)
delete h1HitPad;
594 if (
fDraw) c0->Update();
596 if (
fDraw) c0->Update();
597 h1HitAsic->Write(
"", TObject::kOverwrite);
599 printf(
" --------------------------\n");
600 printf(
" total number of ASICs : %d\n",
nTotalAsics);
603 printf(
" --------------------------\n");
604 printf(
" --------------------------\n");
607 myfile <<
"#--------------------------" << endl;
608 myfile <<
"#--------------------------" << endl;
617 Double_t ratePerModule = 0;
623 gGeoManager->FindNode(fModuleGeo->
GetX(), fModuleGeo->
GetY(), fModuleGeo->
GetZ());
629 std::vector<Int_t> AsicAddresses;
632 printf(
" NofAsics: %3i\n", nofAsics);
633 myfile <<
"# NofAsics : " << nofAsics << endl;
634 myfile <<
"# moduleAddress / Asic ID / hits per 32ch Asic per second" << endl;
636 std::map<Int_t, Double_t> ratePerAsicMap;
637 for (Int_t iAsic = 0; iAsic < nofAsics; iAsic++) {
638 ratePerAsicMap[AsicAddresses[iAsic]] = 0.;
641 for (Int_t s = 0; s < nSec; s++) {
644 for (Int_t r = 0; r < nRow; r++) {
645 for (Int_t c = 0; c < nCol; c++) {
650 Double_t local_min[3] = {padPos[0] - 0.5 * padSize[0], padPos[1] - 0.5 * padSize[1], padPos[2]};
651 Double_t local_max[3] = {padPos[0] + 0.5 * padSize[0], padPos[1] + 0.5 * padSize[1], padPos[2]};
659 local_min[0] = padPos[0] - 0.5 * padSize[1];
660 local_min[1] = padPos[1] - 0.5 * padSize[0];
661 local_max[0] = padPos[0] + 0.5 * padSize[1];
662 local_max[1] = padPos[1] + 0.5 * padSize[0];
670 for (Int_t i = 0; i < 3; i++) {
677 Double_t rate =
CalcHitRatePad(local_min[0], local_max[0], local_min[1], local_max[1], local_max[2]);
679 ratePerModule += rate;
682 TBox* pad =
new TBox(local_min[0], local_min[1], local_max[0], local_max[1]);
684 pad->SetLineColor(0);
685 pad->SetLineWidth(0);
694 if (j >=
fZLevel.size() || rate > 1E05) pad->SetFillColor(12);
700 LOG(error) <<
"CbmTrdHitRateFastQa::ScanModulePlane: Channel address:" << channelAddress
701 <<
" is not initialized in module " << moduleAddress <<
"(s:" << s <<
", r:" << r <<
", c:" << c
703 ratePerAsicMap[AsicAddress] += rate;
710 TBox* module =
new TBox(
713 module->SetFillStyle(0);
714 module->Draw("same");
717 module->Draw("same");
723 for (Int_t iAsic = 0; iAsic < nofAsics; iAsic++) {
724 Asic = fModuleAsic->
GetAsicPar(AsicAddresses[iAsic]);
726 Double_t local_min[3];
727 Double_t local_max[3];
728 Double_t master_min[3];
729 Double_t master_max[3];
732 local_min[2] = fModuleGeo->
GetZ();
735 local_max[2] = fModuleGeo->
GetZ();
736 gGeoManager->LocalToMaster(local_min, master_min);
737 gGeoManager->LocalToMaster(local_max, master_max);
739 asic =
new TBox(10. * master_min[0], 10. * master_min[1], 10. * master_max[0], 10. * master_max[1]);
741 if (ratePerAsicMap[AsicAddresses[iAsic]] > 4e6) asic->SetFillColor(kBlack);
743 asic->SetFillColor(utils->
GetColorCode(ratePerAsicMap[AsicAddresses[iAsic]]));
746 myfile << moduleAddress <<
" " << setfill(
'0') << setw(2) << iAsic <<
" " << setiosflags(ios::fixed)
747 << setprecision(0) << setfill(
' ') << setw(8) << ratePerAsicMap[AsicAddresses[iAsic]] << endl;
749 Double_t dataPerAsic = ratePerAsicMap[AsicAddresses[iAsic]] * 3 * 1e-6 *
fBitPerHit;
750 HitAsic->Fill(dataPerAsic);
755 Double_t dataPerModule = ratePerModule * 3 * 1e-6 *
fBitPerHit;
756 Int_t nOptLinks = 1 + dataPerModule / 4000.;
764 printf(
" data rate: %11.4f (Gbit/s)\n", dataPerModule * 1e-3);
765 printf(
" opt links: %6i\n", nOptLinks);
766 printf(
" --------------------------\n");
768 myfile <<
"#--------------------------" << endl;
773 Double_t ZRangeL, Double_t ZRangeU, Double_t mm2bin)
775 size_t buf_size = 50;
776 Char_t name[buf_size];
777 Char_t title[buf_size];
781 snprintf(title, buf_size - 1,
"HitPad_Station %d, Layer %d",
fStation,
fLayer);
784 const Int_t cnbins = 200;
785 Double_t cxmin = 1e2;
786 Double_t cxmax = 1e6;
787 Double_t clogxmin = TMath::Log10(cxmin);
788 Double_t clogxmax = TMath::Log10(cxmax);
789 Double_t cbinwidth = (clogxmax - clogxmin) / cnbins;
790 Double_t cxbins[cnbins + 1];
792 for (Int_t i = 1; i <= cnbins; i++) {
793 cxbins[i] = cxmin + TMath::Power(10, clogxmin + i * cbinwidth);
795 HitPad =
new TH1F(name, title, cnbins, cxbins);
798 HitPad->SetXTitle(
"Hits/Pad [Hz]");
799 HitPad->SetYTitle(
"count");
800 HitPad->GetYaxis()->SetRangeUser(1, 1e04);
803 snprintf(title, buf_size - 1,
"c2 Station %d, Layer %d",
fStation,
fLayer);
805 c2 =
new TCanvas(name, title, 1600, 900);
807 c2->cd(1)->SetLogx(1);
808 c2->cd(1)->SetLogy(1);
809 c2->cd(1)->SetGridx(1);
810 c2->cd(1)->SetGridy(1);
814 c2->cd(2)->SetLogx(1);
815 c2->cd(2)->SetLogy(0);
816 c2->cd(2)->SetGridx(1);
817 c2->cd(2)->SetGridy(1);
820 c2->cd(3)->SetLogx(1);
821 c2->cd(3)->SetLogy(0);
822 c2->cd(3)->SetGridx(1);
823 c2->cd(3)->SetGridy(1);
826 c2->cd(4)->SetLogx(0);
827 c2->cd(4)->SetLogy(0);
828 c2->cd(4)->SetGridx(1);
829 c2->cd(4)->SetGridy(1);
833 snprintf(title, buf_size - 1,
"Station %d, Layer %d",
fStation,
fLayer);
834 printf(
"%s\n", title);
838 Layer->SetContour(99);
839 Layer->SetXTitle(
"x-Coordinate [mm]");
840 Layer->SetYTitle(
"y-Coordinate [mm]");
841 Layer->SetZTitle(
"Hits/Pad [Hz]");
842 Layer->SetStats(kFALSE);
843 Layer->GetXaxis()->SetLabelSize(0.02);
844 Layer->GetYaxis()->SetLabelSize(0.02);
845 Layer->GetZaxis()->SetLabelSize(0.02);
846 Layer->GetXaxis()->SetTitleSize(0.02);
847 Layer->GetXaxis()->SetTitleOffset(1.5);
848 Layer->GetYaxis()->SetTitleSize(0.02);
849 Layer->GetYaxis()->SetTitleOffset(2);
850 Layer->GetZaxis()->SetTitleSize(0.02);
851 Layer->GetZaxis()->SetTitleOffset(-2);
852 Layer->GetZaxis()->SetRangeUser(ZRangeL, ZRangeU);
853 Layer->Fill(0., 0., 0.);
856 snprintf(title, buf_size - 1,
"c1 Station %d, Layer %d",
fStation,
fLayer);
858 c1 =
new TCanvas(name, title, 1000, 900);
860 c1->cd(1)->SetLogz(1);
861 Layer->DrawCopy(
"colz");
863 snprintf(title, buf_size - 1,
"c3 Station %d, Layer %d",
fStation,
fLayer);
864 c3 =
new TCanvas(name, title, 1000, 900);
866 c3->cd(1)->SetLogz(1);
867 Layer->GetZaxis()->SetRangeUser(1., 4e6);
868 Layer->SetZTitle(
"Hits/Asic [Hz]");
869 Layer->DrawCopy(
"colz");
927 Int_t VolumeID, TH2F* Layer, TCanvas* c1, TH1F* HitPad,
928 TCanvas* c2, TH2F* Topview[3], TCanvas* c0, Double_t mm2bin)
938 if (fModuleInfo != NULL) {
949 GeoPara->
mPos[0] = fModuleGeo->
GetX() * 10;
950 GeoPara->
mPos[1] = fModuleGeo->
GetY() * 10;
951 GeoPara->
mPos[2] = fModuleGeo->
GetZ() * 10;
955 GeoPara->
mSize[2] = 0;
960 for (Int_t s = 0; s < GeoPara->
nSec; s++)
962 GeoPara->
sCol[s] = 0;
963 GeoPara->
sRow[s] = 0;
965 fModuleInfo->
GetPosition( s, 0, 0, padPos, padSize);
966 GeoPara->
pSize[s][2] = 0;
968 for (Int_t i = 0; i < 2; i++)
970 GeoPara->
pSize[s][i] = padSize[i] * 10;
975 if (GeoPara->
sSize[s][i] < 2 * GeoPara->
mSize[i])
977 GeoPara->
sCol[s] = round(GeoPara->
sSize[s][i] / GeoPara->
pSize[s][i]);
982 GeoPara->
sCol[s] = round(GeoPara->
sSize[s][i] / GeoPara->
pSize[s][i]);
984 GeoPara->
sCol[s] = 0;
992 if (GeoPara->
sSize[s][i] < 2 * GeoPara->
mSize[i])
994 GeoPara->
sRow[s] = round(GeoPara->
sSize[s][i] / GeoPara->
pSize[s][i]);
999 GeoPara->
sRow[s] = round(GeoPara->
sSize[s][i] / GeoPara->
pSize[s][i]);
1001 GeoPara->
sRow[s] = 0;
1014 itemp = GeoPara->
nRow;
1016 GeoPara->
nCol = itemp;
1018 for (Int_t s = 0; s < GeoPara->
nSec; s++)
1020 dtemp = GeoPara->
sRow[s];
1021 GeoPara->
sRow[s] = GeoPara->
sCol[s];
1022 GeoPara->
sCol[s] = dtemp;
1024 dtemp = GeoPara->
sSize[s][0];
1026 GeoPara->
sSize[s][1] = dtemp;
1028 dtemp = GeoPara->
pSize[s][0];
1030 GeoPara->
pSize[s][1] = dtemp;
1032 cout <<
"swapped x and y" << endl;
1036 fModuleInfo->
GetPosition( 0, 0, 0, padPos, padSize);
1037 GeoPara->
vOrigin[0] = padPos[0] * 10;
1038 GeoPara->
vOrigin[1] = padPos[1] * 10;
1039 GeoPara->
vOrigin[2] = padPos[2] * 10;
1042 fModuleInfo->
GetPosition( 0, 1, 0, padPos, padSize);
1043 GeoPara->
vX[0] = padPos[0] * 10 - GeoPara->
vOrigin[0];
1044 GeoPara->
vX[1] = padPos[1] * 10 - GeoPara->
vOrigin[1];
1045 GeoPara->
vX[2] = padPos[2] * 10 - GeoPara->
vOrigin[2];
1049 fModuleInfo->
GetPosition( 1, 0, 0, padPos, padSize);
1050 GeoPara->
vY[0] = padPos[0] * 10 - GeoPara->
vOrigin[0];
1051 GeoPara->
vY[1] = padPos[1] * 10 - GeoPara->
vOrigin[1];
1052 GeoPara->
vY[2] = padPos[2] * 10 - GeoPara->
vOrigin[2];
1055 GeoPara->
vN[0] = GeoPara->
vX[1] * GeoPara->
vY[2] - GeoPara->
vX[2] * GeoPara->
vY[1];
1056 GeoPara->
vN[1] = GeoPara->
vX[2] * GeoPara->
vY[0] - GeoPara->
vX[0] * GeoPara->
vY[2];
1057 GeoPara->
vN[2] = GeoPara->
vX[0] * GeoPara->
vY[1] - GeoPara->
vX[1] * GeoPara->
vY[0];
1061 + GeoPara->
vOrigin[2] * GeoPara->
vN[2]);
1064 GeoPara->
cosX = (GeoPara->
vX[0] * 1 + GeoPara->
vX[1] * 0 + GeoPara->
vX[2] * 0)
1065 /
sqrt(pow(GeoPara->
vX[0], 2) + pow(GeoPara->
vX[1], 2) + pow(GeoPara->
vX[2], 2));
1067 GeoPara->
cosY = (GeoPara->
vY[0] * 0 + GeoPara->
vY[1] * 1 + GeoPara->
vY[2] * 0)
1068 /
sqrt(pow(GeoPara->
vY[0], 2) + pow(GeoPara->
vY[1], 2) + pow(GeoPara->
vY[2], 2));
1073 if (GeoPara->
cosX > 1) GeoPara->
cosX = 1;
1074 if (GeoPara->
cosX < -1) GeoPara->
cosX = -1;
1075 if (GeoPara->
cosY > 1) GeoPara->
cosY = 1;
1076 if (GeoPara->
cosY < -1) GeoPara->
cosY = -1;
1080 if (GeoPara->
vX[0] != 0)
1082 fabs(GeoPara->
vX[0]) / (GeoPara->
vX[0]);
1085 -fabs(GeoPara->
vX[1]) / (GeoPara->
vX[1]);
1087 if (GeoPara->
vY[1] != 0)
1089 fabs(GeoPara->
vY[1]) / (GeoPara->
vY[1]);
1092 -fabs(GeoPara->
vY[0]) / (GeoPara->
vY[0]);
1097 for (Int_t i = 0; i < 3; i++)
1099 Mpos[i] = GeoPara->
mPos[i];
1100 Msize[i] = GeoPara->
mSize[i];
1103 cout.setf(ios::fixed);
1106 cout <<
"pos " << setw(6) << Mpos[0] << setw(6) << Mpos[1] << setw(6) << Mpos[2] <<
" size " << setw(6)
1107 << Msize[0] << setw(6) << Msize[1] << setw(6) << Msize[2] << endl;
1112 Double_t Ssize[3 * nSec];
1113 Double_t Psize[3 * nSec];
1114 for (Int_t iSec = 0; iSec < nSec; iSec++)
1116 Ssize[0 + iSec * nSec] = GeoPara->
sSize[iSec][0];
1117 Ssize[1 + iSec * nSec] = GeoPara->
sSize[iSec][1];
1118 Ssize[2 + iSec * nSec] = 0;
1120 Psize[0 + iSec * nSec] = GeoPara->
pSize[iSec][0];
1121 Psize[1 + iSec * nSec] = GeoPara->
pSize[iSec][1];
1122 Psize[2 + iSec * nSec] = 0;
1126 cout <<
"sec " << setw(10) << Ssize[0] << setw(10) << Ssize[1] << setw(10) << Ssize[3] << setw(10) << Ssize[4]
1127 << setw(10) << Ssize[6] << setw(10) << Ssize[7] << endl;
1131 cout <<
"pad " << setw(10) << Psize[0] << setw(10) << Psize[1] << setw(10) << Psize[3] << setw(10) << Psize[4]
1132 << setw(10) << Psize[6] << setw(10) << Psize[7] << endl;
1135 Int_t nCol = GeoPara->
nCol;
1136 Int_t nRow = GeoPara->
nRow;
1139 const Int_t mRow = fModuleInfo->
GetNofRows();
1142 cout <<
"col0 " << setw(10) << GeoPara->
sCol[0] <<
" row0 " << setw(10) << GeoPara->
sRow[0] << endl;
1143 cout <<
"col1 " << setw(10) << GeoPara->
sCol[1] <<
" row1 " << setw(10) << GeoPara->
sRow[1] << endl;
1144 cout <<
"col2 " << setw(10) << GeoPara->
sCol[2] <<
" row2 " << setw(10) << GeoPara->
sRow[2] << endl;
1145 cout <<
"col " << setw(10) << nCol <<
" row " << setw(10) << nRow << endl;
1147 cout <<
"mcol " << setw(10) << mCol <<
" mrow " << setw(10) << mRow << endl;
1186 cout <<
"vX0 " << setw(10) << GeoPara->
vX[0] << endl;
1187 cout <<
"vX1 " << setw(10) << GeoPara->
vX[1] << endl;
1188 cout <<
"vY0 " << setw(10) << GeoPara->
vY[0] << endl;
1189 cout <<
"vY1 " << setw(10) << GeoPara->
vY[1] << endl;
1191 cout <<
"cos " << setw(10) << GeoPara->
cosX << setw(10) << GeoPara->
cosY << endl;
1192 cout <<
"v00xy " << setw(10) << GeoPara->
mPos[0] - GeoPara->
vOrigin[0] << setw(10)
1193 << GeoPara->
mPos[1] - GeoPara->
vOrigin[1] << endl;
1231 if (Lines) cout <<
"------------------------------------------------------" << endl;
1233 Topview[0]->Fill(GeoPara->
mPos[0], GeoPara->
mPos[2]);
1234 Topview[1]->Fill(GeoPara->
mPos[0], GeoPara->
mPos[1]);
1235 Topview[2]->Fill(GeoPara->
mPos[2], GeoPara->
mPos[1]);
1242 Histo(GeoPara, Fast, Layer, c1, HitPad, c2, Topview, c0, mm2bin);
1246 for (Int_t s = 0; s < GeoPara->
nSec; s++)
1248 fModuleInfo->
GetPosition( s, 0, 0, padPos, padSize);
1250 TPolyMarker* start =
new TPolyMarker(1);
1251 start->SetPoint(0, padPos(0) * 10, padPos(1) * 10);
1252 start->SetMarkerStyle(22);
1253 start->SetMarkerSize(.8);
1257 start->Draw(
"same");
1260 fModuleInfo->
GetPosition( s, GeoPara->
sCol[0] - 1, GeoPara->
sRow[s] - 1, padPos, padSize);
1262 TPolyMarker* end =
new TPolyMarker(1);
1263 end->SetPoint(0, padPos(0) * 10, padPos(1) * 10);
1264 end->SetMarkerStyle(20);
1265 end->SetMarkerSize(.8);
1275 printf(
"fModuleInfo == NULL\n");
1354 TCanvas* , TH2F* Topview[3], TCanvas* c0, Double_t mm2bin)
1356 Double_t ZRangeL = 1e00;
1357 Double_t ZRangeU = 1e05;
1361 name.Form(
"ModuleID %5d", GeoPara->
moduleId);
1363 cout <<
" " << name <<
"\n" << flush;
1365 name.Form(
"Module%05d", GeoPara->
moduleId);
1367 if (GeoPara->
mSize[0] < 500)
1368 h2Module =
new TH2F(name, name, 600 / mm2bin + 1, -300.5, 300.5, 600 / mm2bin + 1, -300.5,
1371 h2Module =
new TH2F(name, name, 1000 / mm2bin + 1, -500.5, 500.5, 1000 / mm2bin + 1, -500.5,
1374 h2Module->GetZaxis()->SetRangeUser(ZRangeL, ZRangeU);
1376 name.Form(
"Module%05dHitPad", GeoPara->
moduleId);
1377 TH1F* h1HitPadModule =
new TH1F(name, name, 1200, 0, 120000);
1385 Double_t HiteRate = 0;
1390 Double_t planeStartX = GeoPara->
mPos[0] - GeoPara->
mSize[0];
1391 Double_t planeStopX = planeStartX + GeoPara->
pSize[iSecX][0];
1393 Double_t planeStartY = GeoPara->
mPos[1] - GeoPara->
mSize[1];
1394 Double_t planeStopY = planeStartY + GeoPara->
pSize[iSecY][1];
1396 Double_t StartX = GeoPara->
vOrigin[0]
1397 + 0.5 * GeoPara->
pSize[iSecX][0] * GeoPara->
cosX;
1398 Double_t StopX = StartX + GeoPara->
pSize[iSecX][0] * GeoPara->
cosX;
1400 Double_t StartY = GeoPara->
vOrigin[1] + 0.5 * GeoPara->
pSize[iSecY][1] * GeoPara->
cosY;
1401 Double_t StopY = StartY + GeoPara->
pSize[iSecY][1] * GeoPara->
cosY;
1417 for (Int_t iR = 0; iR < GeoPara->
nRow; iR++)
1419 StartX = GeoPara->
vOrigin[0] + 0.5 * GeoPara->
pSize[iSecX][0] * GeoPara->
cosX;
1420 StopX = StartX + GeoPara->
pSize[iSecX][0] * GeoPara->
cosX;
1421 planeStartX = GeoPara->
mPos[0] - GeoPara->
mSize[0];
1422 planeStopX = planeStartX + GeoPara->
pSize[iSecX][0];
1424 for (Int_t iC = 0; iC < GeoPara->
nCol; iC++)
1426 xSteps = GeoPara->
pSize[iSecX][0] - 1;
1427 ySteps = GeoPara->
pSize[iSecY][1] - 1;
1432 if (GeoPara->
mPos[0] < 1 && GeoPara->
mPos[1] < 1)
1434 HiteRate =
CalcHitRate(GeoPara, StartX, StopX, xSteps, StartY, StopY, ySteps, GeoPara->
mPos, Topview, c0);
1435 h1HitPad->Fill(HiteRate, 4);
1441 HiteRate =
CalcHitRate(GeoPara, StartX, StopX, xSteps, StartY, StopY, ySteps, GeoPara->
mPos, Topview, c0);
1442 h1HitPad->Fill(HiteRate);
1443 h1HitPadModule->Fill(HiteRate);
1448 Int_t mStepX = Int_t((planeStartX - GeoPara->
mPos[0]));
1449 Int_t mStepY = Int_t((planeStartY - GeoPara->
mPos[1]));
1451 for (Int_t stepY =
int(planeStartY / mm2bin); stepY < int(planeStopY / mm2bin); stepY++) {
1454 for (Int_t stepX =
int(planeStartX / mm2bin); stepX < int(planeStopX / mm2bin); stepX++) {
1459 if (GeoPara->
mPos[0] < 1 && GeoPara->
mPos[1] < 1) {
1461 h2Layer->SetBinContent(stepX +
int(
winsize / mm2bin), stepY +
int(
winsize / mm2bin),
1463 h2Layer->SetBinContent(-1 * stepX +
int(
winsize / mm2bin), stepY +
int(
winsize / mm2bin),
1465 h2Layer->SetBinContent(stepX +
int(
winsize / mm2bin), -1 * stepY +
int(
winsize / mm2bin),
1467 h2Layer->SetBinContent(-1 * stepX +
int(
winsize / mm2bin), -1 * stepY +
int(
winsize / mm2bin),
1472 h2Module->Fill(mStepX, mStepY,
1481 h2Layer->SetBinContent(stepX +
int(
winsize / mm2bin), stepY +
int(
winsize / mm2bin),
1487 cout <<
"filling 5 " << mStepX <<
" " << mStepY <<
" " << HiteRate << endl;
1488 h2Module->Fill(mStepX, mStepY,
1503 if (iC == GeoPara->
sCol[iSecX]) {
1520 if (iR == GeoPara->
sRow[iSecY]) {
1537 for (Int_t i = 0; i < 3; i++)
1538 Topview[i]->Write(
"", TObject::kOverwrite);
1540 h2Layer->Write(
"", TObject::kOverwrite);
1541 h1HitPad->Write(
"", TObject::kOverwrite);
1543 h2Module->Write(
"", TObject::kOverwrite);
1544 h1HitPadModule->Write(
"", TObject::kOverwrite);
1545 if (h2Module)
delete h2Module;
1546 if (h1HitPadModule)
delete h1HitPadModule;