4 for(
int i=1;i<=24;i++) plSwap(i);
7 plSwap(
float n6=15,
int set=20) {
9 TString tscore=
"BTOW tower";
12 if(set==10) fname=
"sum-swapPnTn.hist.root";
13 if(set==12) fname=
"sum-swapTyPy.hist.root";
15 if(set==20) fname=
"sumD43-70.hist.root";
18 fd=
new TFile(fname); assert(fd->IsOpen());
19 printf(
"Work with %s\n", fd->GetName());
20 gStyle->SetOptStat(0);
21 gStyle->SetPalette(1,0);
36 TH1I *idealMap=
new TH1I(
"Map11",
"ideal map 1:1",4800,0.5,4800.5);
37 for(
int i=1;i<=4800;i++) idealMap->SetBinContent(i,i);
38 idealMap->SetLineStyle(3); idealMap->SetLineColor(kBlack);
44 sprintf(txt,
"%s softID=[%d,%d], with Jan's swaps",tscore.Data(),x1,x2);
48 cM=
new TCanvas(tscore+
" MAP",tscore+
" MAP",480,480);
50 hMap->SetAxisRange(x1,x2,
"x");
51 hMap->SetAxisRange(x1,x2,
"y");
53 hMap ->SetMinimum(20);
54 float yMax= hMap->GetMaximum();
55 if(yMax>20) hMap ->SetMaximum(0.8*yMax);
56 idealMap->Draw(
"same");
60 c=
new TCanvas(txt,txt,1300,400);
63 c->cd(1); hr->Draw(
"colz"); gPad->SetLogz();
64 hr->SetAxisRange(x1,x2);
65 hr->SetAxisRange(y1,y2,
"y");
68 TString tt=
"Raw BPRS spectra, pedestal subtracted, Rory's & Jan's swaps used";
69 if(!isBprs)tt=
"Raw BTOW spectra, pedestal subtracted, Jan's swaps used";
70 tx=
new TText(x1+80,y2+7,tt); tx->Draw(); tx->SetTextColor(55);
75 c->cd(2); hm->Draw(
"colz") ;
76 if(!isBprs) hm->Rebin2D(1,2);
77 hm->SetAxisRange(x1,x2);
78 hm->SetAxisRange(-10,50,
"y");
81 drawPMBoxes(x1,-10.5 );
82 TString tt=
"BPRS spectra, gated with TPC MIP tracks, Rory's & Jan's swaps used";
83 if(!isBprs)tt=
"BTOW spectra, gated with TPC MIP tracks, Jan's swaps used";
84 tx=
new TText(x1+82,53,tt); tx->Draw(); tx->SetTextColor(55);
89 sprintf(txt,
"ps/btowAdc%04d.ps",x1);
96 void markPM1(
float id1,
float y11) {
97 float y=y11-10, yH=100;
98 for(
int i=0;i<4;i++) {
101 ln=
new TLine(x1,y+10,x2,y+10); ln->Draw();
102 ln->SetLineColor(kRed); ln->SetLineWidth(2.);
103 ln=
new TLine(x1,y,x1,yH); ln->Draw();
104 ln->SetLineColor(kRed);
105 for(
int j=0;j<5;j++) {
109 ln=
new TLine(x2+d,y,x2+d,yH); ln->Draw();
110 ln->SetLineColor(iCol); ln->SetLineStyle(3);
113 TString tt=c; tt+=
"-";tt+=j+1;
114 tx=
new TText(x1+.5+d,y+4,tt); tx->Draw(); tx->SetTextColor(iCol);
115 tx->SetTextSize(0.04);
126 for(
int k=0;k<10;k++) {
128 ln=
new TLine(x,y1,x,y2); ln->Draw(); ln->SetLineColor(kMagenta);
130 ln=
new TLine(x,y1,x,y2); ln->Draw(); ln->SetLineColor(kMagenta); ln->SetLineStyle(2);
134 drawPMBoxes(
int x1,
float y11) {
138 for(
int k=0;k<30;k++) {
140 float id=zid%2400 +1+0.5;
142 int pmtid=1+(zpmt+30-k)%30;
144 ln=
new TLine(
id,y1,
id,y2);
145 ln->Draw(); ln->SetLineColor(kMagenta);
146 TString tt=
"PMT-"; tt+=pmtid;
147 tx=
new TText(
id+30,y2-8,tt); tx->Draw(); tx->SetTextColor(kMagenta);
152 for(
int k=0;k<30;k++) {
154 float id=zid%2400 +2400+0.5;
156 int pmtid=31+(zpmt+k)%30;
158 ln=
new TLine(
id,y1,
id,y2);
159 ln->Draw(); ln->SetLineColor(kMagenta);
160 TString tt=
"PMT-"; tt+=pmtid;
161 tx=
new TText(
id+30,y2-8,tt); tx->Draw(); tx->SetTextColor(kMagenta);