2 #ifndef RICH_CbmRichDraw
3 #define RICH_CbmRichDraw
9 #include <RtypesCore.h>
21 static void DrawPmtH2(TH2*
h, TCanvas* c, Bool_t usePmtBins =
false) {
22 if (c ==
nullptr)
return;
25 TH2D* hUp = (TH2D*)
h->Clone();
29 hUp->GetYaxis()->SetRange(yPmtBins.size() / 2 + 1, yPmtBins.size());
31 hUp->GetYaxis()->SetRangeUser(120, 210);
33 hUp->GetYaxis()->SetTitleOffset(0.75);
34 hUp->GetZaxis()->SetTitleOffset(0.87);
35 gPad->SetLeftMargin(0.1);
36 gPad->SetRightMargin(0.15);
38 TH2D* hDown = (TH2D*)
h->Clone();
41 hDown->GetYaxis()->SetRange(0, yPmtBins.size() / 2 - 1);
43 hDown->GetYaxis()->SetRangeUser(-210, -120);
46 hDown->GetYaxis()->SetTitleOffset(0.75);
47 hDown->GetZaxis()->SetTitleOffset(0.87);
48 gPad->SetLeftMargin(0.1);
49 gPad->SetRightMargin(0.15);
53 if (c ==
nullptr)
return;
57 gUp->GetYaxis()->SetTitleOffset(0.75);
58 gUp->GetZaxis()->SetTitleOffset(0.87);
59 gPad->SetLeftMargin(0.1);
60 gPad->SetRightMargin(0.15);
63 gDown->GetYaxis()->SetTitleOffset(0.75);
64 gDown->GetZaxis()->SetTitleOffset(0.87);
65 gPad->SetLeftMargin(0.1);
66 gPad->SetRightMargin(0.15);
79 std::vector<Double_t> initVec;
81 for (Int_t pmtId : pmts) {
84 TVector3 inPos(pmtData->
fX, pmtData->
fY, pmtData->
fZ);
88 initVec.push_back(outPos.X() - 0.5 * pmtData->
fWidth);
89 initVec.push_back(outPos.X() + 0.5 * pmtData->
fWidth);
91 initVec.push_back(outPos.Y() - 0.5 * pmtData->
fHeight);
92 initVec.push_back(outPos.Y() + 0.5 * pmtData->
fHeight);
95 sort(initVec.begin(), initVec.end());
97 std::vector<Double_t> uniVec;
98 for (
unsigned int i = 0;
i < initVec.size();
i++) {
99 if (
i == 0) uniVec.push_back(initVec[
i]);
100 if (initVec[
i] - uniVec[uniVec.size() - 1] > 0.000001)
101 uniVec.push_back(initVec[
i]);