1 |
mocchiut |
1.1 |
// |
2 |
|
|
// Show pulse distributions of the calorimeter PULSE calibration |
3 |
|
|
// |
4 |
|
|
// FCaloPULSE.cxx version 1.00 (2006-03-08) |
5 |
|
|
// |
6 |
|
|
// The only input needed is the path to the directory created by YODA for the data file you want to analyze. |
7 |
|
|
// |
8 |
|
|
// Changelog: |
9 |
|
|
// |
10 |
|
|
// 1.00 - 1.01 : Flight version, read unique YODA file. |
11 |
|
|
// |
12 |
|
|
// 0.00 - 1.00 : clone of CaloPULSE v1r05. |
13 |
|
|
// |
14 |
|
|
#include <fstream> |
15 |
|
|
#include <sstream> |
16 |
|
|
#include <TTree.h> |
17 |
|
|
#include <TClassEdit.h> |
18 |
|
|
#include <TObject.h> |
19 |
|
|
#include <TList.h> |
20 |
|
|
#include <TSystem.h> |
21 |
|
|
#include <TSystemDirectory.h> |
22 |
|
|
#include <TString.h> |
23 |
|
|
#include <TFile.h> |
24 |
|
|
#include <TClass.h> |
25 |
|
|
#include <TCanvas.h> |
26 |
|
|
#include <TH1.h> |
27 |
|
|
#include <TH1F.h> |
28 |
|
|
#include <TH2D.h> |
29 |
|
|
#include <TLatex.h> |
30 |
|
|
#include <TPad.h> |
31 |
|
|
#include <TPaveLabel.h> |
32 |
|
|
#include <TChain.h> |
33 |
|
|
#include <TStyle.h> |
34 |
|
|
// |
35 |
|
|
#include <PamelaRun.h> |
36 |
|
|
#include <physics/calorimeter/CalorimeterEvent.h> |
37 |
|
|
#include <physics/trigger/TriggerEvent.h> |
38 |
|
|
#include <CalibCalPedEvent.h> |
39 |
|
|
#include <CalibCalPulse1Event.h> |
40 |
|
|
#include <CalibCalPulse2Event.h> |
41 |
|
|
#include <varDump/VarDumpEvent.h> |
42 |
|
|
#include <varDump/VarDumpRecord.h> |
43 |
|
|
#include <fcalostructs.h> |
44 |
|
|
// |
45 |
|
|
extern int OLDCaloFindCalibs(TString &, Calib &); |
46 |
|
|
extern bool existfile(TString); |
47 |
|
|
extern TString getFilename(const TString); |
48 |
|
|
extern void PrintFigure(TString, TString, TString, TString, TCanvas&); |
49 |
|
|
extern void ColorMIP(Float_t, int&); |
50 |
|
|
// |
51 |
|
|
using namespace std; |
52 |
|
|
// |
53 |
|
|
void FCaloPULSE(TString filename, TString outDir = "", Int_t tosave = 0, TString saveas = "eps"){ |
54 |
|
|
const char* startingdir = gSystem->WorkingDirectory(); |
55 |
|
|
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
56 |
|
|
// |
57 |
|
|
if ( !existfile(filename) ){ |
58 |
|
|
printf(" %s :no such file or directory \n",filename.Data()); |
59 |
|
|
return; |
60 |
|
|
}; |
61 |
|
|
// |
62 |
|
|
TFile *File = new TFile(filename.Data()); |
63 |
|
|
TTree *tr = (TTree*)File->Get("CalibCalPulse1"); |
64 |
|
|
pamela::CalibCalPulse1Event *ce = 0; |
65 |
|
|
pamela::EventHeader *ceh = new pamela::EventHeader(); |
66 |
|
|
tr->SetBranchAddress("Header", &ceh); |
67 |
|
|
tr->SetBranchAddress("CalibCalPulse1", &ce); |
68 |
|
|
// |
69 |
|
|
TFile *vdFile = new TFile(filename.Data()); |
70 |
|
|
TTree *vdtr = (TTree*)vdFile->Get("VarDump"); |
71 |
|
|
pamela::VarDumpEvent *vde = 0; |
72 |
|
|
pamela::VarDumpRecord *vdr = 0; |
73 |
|
|
vdtr->SetBranchAddress("VarDump", &vde); |
74 |
|
|
Long64_t nevents = vdtr->GetEntries(); |
75 |
|
|
stringstream ptype; |
76 |
|
|
stringstream stno; |
77 |
|
|
Int_t tmpSize; |
78 |
|
|
for (Int_t i = 0; i < nevents ; i++){ |
79 |
|
|
vdtr->GetEntry(i); |
80 |
|
|
tmpSize = vde->Records->GetEntries(); |
81 |
|
|
for (Int_t j = 0; j < tmpSize; j++){ |
82 |
|
|
vdr = (pamela::VarDumpRecord*)vde->Records->At(j); |
83 |
|
|
if ( (int)vdr->VAR_VALUE>32760 && (int)vdr->VAR_VALUE<32790 ){ |
84 |
|
|
printf(" PULSE TYPE = %X ",vdr->VAR_VALUE); |
85 |
|
|
ptype.str(""); |
86 |
|
|
ptype << " PULSE TYPE = "; |
87 |
|
|
ptype << hex << vdr->VAR_VALUE; |
88 |
|
|
vdr = (pamela::VarDumpRecord*)vde->Records->At(j+1); |
89 |
|
|
printf(" STRIP = %X \n",vdr->VAR_VALUE); |
90 |
|
|
stno.str(""); |
91 |
|
|
stno << " STRIP = "; |
92 |
|
|
stno << hex << vdr->VAR_VALUE; |
93 |
|
|
}; |
94 |
|
|
}; |
95 |
|
|
}; |
96 |
|
|
vdFile->Close(); |
97 |
|
|
// |
98 |
|
|
TCanvas *figura2 = new TCanvas("calpulse", "calpulse", 950, 850); |
99 |
|
|
figura2->cd(); |
100 |
|
|
gPad->SetLogy(); |
101 |
|
|
Long64_t ncalibs = tr->GetEntries(); |
102 |
|
|
TH1F *calpulse1; |
103 |
|
|
Int_t workornot = 1; |
104 |
|
|
int stoppa = 0; |
105 |
|
|
for (Int_t ci = 0; ci < ncalibs ; ci++){ |
106 |
|
|
int stoppa = 0; |
107 |
|
|
int per = 0; |
108 |
|
|
tr->GetEntry(ci); |
109 |
|
|
gDirectory->Delete("calpulse"); |
110 |
|
|
calpulse1 = new TH1F("calpulse","",96,-0.5,8000.); |
111 |
|
|
calpulse1->SetBit(TH1F::kCanRebin); |
112 |
|
|
for ( Int_t s=0 ; s<4 ;s++ ){ |
113 |
|
|
if ( ce->unpackError ) { |
114 |
|
|
per = 1; |
115 |
|
|
} else { |
116 |
|
|
per = 0; |
117 |
|
|
for ( Int_t d=0 ; d<11 ;d++ ){ |
118 |
|
|
for ( Int_t j=0; j<96 ;j++){ |
119 |
|
|
calpulse1->Fill(ce->calpuls[s][d][j]); |
120 |
|
|
if ( ce->calpuls[s][d][j] != 0. ) stoppa = 1; |
121 |
|
|
if ( ce->calpuls[s][d][j] < 0. ) workornot = 0; |
122 |
|
|
}; |
123 |
|
|
}; |
124 |
|
|
}; |
125 |
|
|
}; |
126 |
|
|
if ( !per ){ |
127 |
|
|
figura2->cd(); |
128 |
|
|
figura2->SetFillColor(10); |
129 |
|
|
stringstream titolo; |
130 |
|
|
titolo.str(""); |
131 |
|
|
titolo << "Pulse1 " << ptype.str().c_str(); |
132 |
|
|
titolo << " " << stno.str().c_str(); |
133 |
|
|
calpulse1->Draw(); |
134 |
|
|
calpulse1->SetTitle(titolo.str().c_str()); |
135 |
|
|
figura2->Modified(); |
136 |
|
|
figura2->Update(); |
137 |
|
|
stringstream figsave; |
138 |
|
|
figsave.str(""); |
139 |
|
|
figsave << "pulse1_"; |
140 |
|
|
figsave << ci; |
141 |
|
|
if ( tosave ) PrintFigure(filename,outDir,figsave.str().c_str(),saveas,*figura2); |
142 |
|
|
}; |
143 |
|
|
}; |
144 |
|
|
// |
145 |
|
|
tr = new TTree(); |
146 |
|
|
tr = (TTree*)File->Get("CalibCalPulse2"); |
147 |
|
|
ncalibs = tr->GetEntries(); |
148 |
|
|
pamela::CalibCalPulse2Event *cee = 0; |
149 |
|
|
tr->SetBranchAddress("CalibCalPulse2", &cee); |
150 |
|
|
// |
151 |
|
|
figura2 = new TCanvas("calpulse", "calpulse", 950, 850); |
152 |
|
|
figura2->cd(); |
153 |
|
|
gPad->SetLogy(); |
154 |
|
|
ncalibs = tr->GetEntries(); |
155 |
|
|
TH1F *calpulse2; |
156 |
|
|
for (Int_t ci = 0; ci < ncalibs ; ci++){ |
157 |
|
|
stoppa = 0; |
158 |
|
|
int per = 0; |
159 |
|
|
tr->GetEntry(ci); |
160 |
|
|
gDirectory->Delete("calpulse"); |
161 |
|
|
calpulse2 = new TH1F("calpulse","",96,-0.5,8000.); |
162 |
|
|
calpulse2->SetBit(TH1F::kCanRebin); |
163 |
|
|
for ( Int_t s=0 ; s<4 ;s++ ){ |
164 |
|
|
if ( cee->unpackError ){ |
165 |
|
|
per = 1; |
166 |
|
|
} else { |
167 |
|
|
per = 0; |
168 |
|
|
for ( Int_t d=0 ; d<11 ;d++ ){ |
169 |
|
|
for ( Int_t j=0; j<96 ;j++){ |
170 |
|
|
calpulse2->Fill(cee->calpuls[s][d][j]); |
171 |
|
|
if ( cee->calpuls[s][d][j] != 0. ) { |
172 |
|
|
stoppa = 1; |
173 |
|
|
}; |
174 |
|
|
if ( cee->calpuls[s][d][j] < 0. ) workornot = 0; |
175 |
|
|
}; |
176 |
|
|
}; |
177 |
|
|
}; |
178 |
|
|
}; |
179 |
|
|
if ( !per ){ |
180 |
|
|
figura2->cd(); |
181 |
|
|
figura2->SetFillColor(10); |
182 |
|
|
figura2->Range(0,0,100,100); |
183 |
|
|
stringstream titolo; |
184 |
|
|
titolo.str(""); |
185 |
|
|
titolo << "Pulse2 " << ptype.str().c_str(); |
186 |
|
|
titolo << " " << stno.str().c_str(); |
187 |
|
|
calpulse2->SetTitle(titolo.str().c_str()); |
188 |
|
|
calpulse2->Draw(); |
189 |
|
|
figura2->Modified(); |
190 |
|
|
figura2->Update(); |
191 |
|
|
stringstream figsave; |
192 |
|
|
figsave.str(""); |
193 |
|
|
figsave << "pulse2_"; |
194 |
|
|
figsave << ci; |
195 |
|
|
if ( tosave ) PrintFigure(filename,outDir,figsave.str().c_str(),saveas,*figura2); |
196 |
|
|
}; |
197 |
|
|
}; |
198 |
|
|
if ( stoppa ){ |
199 |
|
|
if ( workornot ){ |
200 |
|
|
printf("File %s is ok \n",filename.Data()); |
201 |
|
|
} else { |
202 |
|
|
printf("File %s is NOT OK! \n",filename.Data()); |
203 |
|
|
}; |
204 |
|
|
}; |
205 |
|
|
} |
206 |
|
|
|
207 |
|
|
void FCaloPULSEMATRA(TString filename, TString outDir = "", Int_t tosave = 0, TString saveas = "eps"){ |
208 |
|
|
const char* startingdir = gSystem->WorkingDirectory(); |
209 |
|
|
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
210 |
|
|
// |
211 |
|
|
if ( !existfile(filename) ){ |
212 |
|
|
printf(" %s :no such file or directory \n",filename.Data()); |
213 |
|
|
return; |
214 |
|
|
}; |
215 |
|
|
// |
216 |
|
|
struct Calib calib; |
217 |
|
|
for (Int_t s=0; s<4;s++){ |
218 |
|
|
for (Int_t d = 0; d<50; d++){ |
219 |
|
|
calib.ttime[s][d] = 0 ; |
220 |
|
|
if ( d < 49 ) calib.time[s][d] = 0 ; |
221 |
|
|
}; |
222 |
|
|
}; |
223 |
|
|
// |
224 |
|
|
// first of all find the calibrations in the file |
225 |
|
|
// |
226 |
|
|
OLDCaloFindCalibs(filename, calib); |
227 |
|
|
// |
228 |
|
|
// print on the screen the results: |
229 |
|
|
// |
230 |
|
|
printf(" ---------------------------------------------------------- \n \n"); |
231 |
|
|
Int_t calibex = 0; |
232 |
|
|
for (Int_t s=0; s<4;s++){ |
233 |
|
|
Int_t stop = 0; |
234 |
|
|
for (Int_t d = 0; d<48; d++){ |
235 |
|
|
if ( calib.ttime[s][d] != 0 ) { |
236 |
|
|
calibex++; |
237 |
|
|
}; |
238 |
|
|
if ( calib.time[s][0] != 0 ){ |
239 |
|
|
if ( d == 0 ) printf(" Section %i from time 0 to time %i use calibration at time %i \n",s,calib.time[s][d],calib.ttime[s][d]); |
240 |
|
|
if ( calib.time[s][d+1] != 0 ) { |
241 |
|
|
printf(" Section %i from time %i to time %i use calibration at time %i \n",s,calib.time[s][d],calib.time[s][d+1],calib.ttime[s][d+1]); |
242 |
|
|
} else { |
243 |
|
|
if ( !stop ){ |
244 |
|
|
printf(" Section %i from time %i use calibration at time %i \n",s,calib.time[s][d],calib.ttime[s][d+1]); |
245 |
|
|
stop = 1; |
246 |
|
|
}; |
247 |
|
|
}; |
248 |
|
|
} else { |
249 |
|
|
if ( calib.ttime[s][d] != 0 ) printf(" Section %i from time 0 use calibration at time %i \n",s,calib.ttime[s][d]); |
250 |
|
|
}; |
251 |
|
|
}; |
252 |
|
|
printf("\n"); |
253 |
|
|
}; |
254 |
|
|
Int_t workornot = 1; |
255 |
|
|
// |
256 |
|
|
TFile *vdFile = new TFile(filename.Data()); |
257 |
|
|
TTree *vdtr = (TTree*)vdFile->Get("VarDump"); |
258 |
|
|
pamela::VarDumpEvent *vde = 0; |
259 |
|
|
pamela::VarDumpRecord *vdr = 0; |
260 |
|
|
vdtr->SetBranchAddress("VarDump", &vde); |
261 |
|
|
Long64_t nevents = vdtr->GetEntries(); |
262 |
|
|
// |
263 |
|
|
stringstream ptype; |
264 |
|
|
stringstream stno; |
265 |
|
|
Int_t tmpSize; |
266 |
|
|
for (Int_t i = 0; i < nevents ; i++){ |
267 |
|
|
vdtr->GetEntry(i); |
268 |
|
|
tmpSize = vde->Records->GetEntries(); |
269 |
|
|
for (Int_t j = 0; j < tmpSize; j++){ |
270 |
|
|
vdr = (pamela::VarDumpRecord*)vde->Records->At(j); |
271 |
|
|
if ( (int)vdr->VAR_VALUE>32760 && (int)vdr->VAR_VALUE<32790 ){ |
272 |
|
|
printf(" PULSE TYPE = %X ",vdr->VAR_VALUE); |
273 |
|
|
ptype.str(""); |
274 |
|
|
ptype << " PULSE TYPE = "; |
275 |
|
|
ptype << hex << vdr->VAR_VALUE; |
276 |
|
|
vdr = (pamela::VarDumpRecord*)vde->Records->At(j+1); |
277 |
|
|
printf(" STRIP = %X \n",vdr->VAR_VALUE); |
278 |
|
|
stno.str(""); |
279 |
|
|
stno << " STRIP = "; |
280 |
|
|
stno << hex << vdr->VAR_VALUE; |
281 |
|
|
}; |
282 |
|
|
}; |
283 |
|
|
}; |
284 |
|
|
vdFile->Close(); |
285 |
|
|
|
286 |
|
|
|
287 |
|
|
|
288 |
|
|
TFile *File = new TFile(filename.Data()); |
289 |
|
|
TTree *tr = (TTree*)File->Get("CalibCalPulse1"); |
290 |
|
|
tr->AddFriend("CalibCalPulse2", File); |
291 |
|
|
pamela::CalibCalPulse1Event *cee1 = 0; |
292 |
|
|
pamela::CalibCalPulse2Event *cee = 0; |
293 |
|
|
pamela::EventHeader *ceh = new pamela::EventHeader(); |
294 |
|
|
tr->SetBranchAddress("Header", &ceh); |
295 |
|
|
tr->SetBranchAddress("CalibCalPulse1", &cee1); |
296 |
|
|
tr->SetBranchAddress("CalibCalPulse2", &cee); |
297 |
|
|
// |
298 |
|
|
Long64_t ncalibs = tr->GetEntries(); |
299 |
|
|
// |
300 |
|
|
TCanvas *figura2 = new TCanvas("Calorimeter_tracks", "Calorimeter_tracks", 750, 650); |
301 |
|
|
figura2->SetFillColor(10); |
302 |
|
|
figura2->Range(0,0,100,100); |
303 |
|
|
Int_t ci = 0; |
304 |
|
|
int stoppa = 0; |
305 |
|
|
while ( ci < ncalibs ){ |
306 |
|
|
stoppa = 0; |
307 |
|
|
int per = 0; |
308 |
|
|
figura2->Clear(); |
309 |
|
|
// |
310 |
|
|
// Book the histograms: |
311 |
|
|
// |
312 |
|
|
stringstream xview; |
313 |
|
|
xview.str(""); |
314 |
|
|
xview << "x-view event " << (ci+1); |
315 |
|
|
stringstream yview; |
316 |
|
|
yview.str(""); |
317 |
|
|
yview << "y-view event " << (ci+1); |
318 |
|
|
gDirectory->Delete(xview.str().c_str()); |
319 |
|
|
gDirectory->Delete(yview.str().c_str()); |
320 |
|
|
TH2F *Xview = new TH2F(xview.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
321 |
|
|
TH2F *Yview = new TH2F(yview.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
322 |
|
|
// |
323 |
|
|
// figures: |
324 |
|
|
// |
325 |
|
|
Int_t bgcolor = 10; |
326 |
|
|
TLatex *t=new TLatex(); |
327 |
|
|
t->SetTextFont(32); |
328 |
|
|
t->SetTextColor(1); |
329 |
|
|
t->SetTextSize(0.03); |
330 |
|
|
t->SetTextAlign(12); |
331 |
|
|
// |
332 |
|
|
TPad *pd1 = new TPad("pd1","This is pad1",0.02,0.05,0.88,0.49,bgcolor); |
333 |
|
|
TPad *pd2 = new TPad("pd2","This is pad2",0.02,0.51,0.88,0.95,bgcolor); |
334 |
|
|
TPad *palette = new TPad("palette","This is palette",0.90,0.05,0.98,0.9,bgcolor); |
335 |
|
|
figura2->cd(); |
336 |
|
|
t=new TLatex(); |
337 |
|
|
t->SetTextFont(32); |
338 |
|
|
t->SetTextColor(1); |
339 |
|
|
t->SetTextSize(0.03); |
340 |
|
|
t->SetTextAlign(12); |
341 |
|
|
t->DrawLatex(92.,92.5,"MIP"); |
342 |
|
|
pd1->Range(0,0,100,100); |
343 |
|
|
pd2->Range(0,0,100,100); |
344 |
|
|
palette->Range(0,0,100,100); |
345 |
|
|
pd1->SetTicks(); |
346 |
|
|
pd2->SetTicks(); |
347 |
|
|
pd1->Draw(); |
348 |
|
|
pd2->Draw(); |
349 |
|
|
palette->Draw(); |
350 |
|
|
palette->cd(); |
351 |
|
|
// palette |
352 |
|
|
TPaveLabel *box1 = new TPaveLabel(2,2,98,16.3,"0",""); |
353 |
|
|
box1->SetTextFont(32); |
354 |
|
|
box1->SetTextColor(1); |
355 |
|
|
box1->SetTextSize(0.25); |
356 |
|
|
box1->SetFillColor(10); |
357 |
|
|
box1->Draw(); |
358 |
|
|
TPaveLabel *box2 = new TPaveLabel(2,18.3,98,32.66,"0-2",""); |
359 |
|
|
box2->SetTextFont(32); |
360 |
|
|
box2->SetTextColor(1); |
361 |
|
|
box2->SetTextSize(0.25); |
362 |
|
|
box2->SetFillColor(38); |
363 |
|
|
box2->Draw(); |
364 |
|
|
TPaveLabel *box3 = new TPaveLabel(2,34.66,98,48.96,"2-10",""); |
365 |
|
|
box3->SetTextFont(32); |
366 |
|
|
box3->SetTextColor(1); |
367 |
|
|
box3->SetTextSize(0.25); |
368 |
|
|
box3->SetFillColor(4); |
369 |
|
|
box3->Draw(); |
370 |
|
|
TPaveLabel *box4 = new TPaveLabel(2,50.96,98,65.26,"10-100",""); |
371 |
|
|
box4->SetTextFont(32); |
372 |
|
|
box4->SetTextColor(1); |
373 |
|
|
box4->SetTextSize(0.25); |
374 |
|
|
box4->SetFillColor(3); |
375 |
|
|
box4->Draw(); |
376 |
|
|
TPaveLabel *box5 = new TPaveLabel(2,67.26,98,81.56,"100-500",""); |
377 |
|
|
box5->SetTextFont(32); |
378 |
|
|
box5->SetTextColor(1); |
379 |
|
|
box5->SetTextSize(0.2); |
380 |
|
|
box5->SetFillColor(2); |
381 |
|
|
box5->Draw(); |
382 |
|
|
TPaveLabel *box6 = new TPaveLabel(2,83.56,98,97.86,">500",""); |
383 |
|
|
box6->SetTextFont(32); |
384 |
|
|
box6->SetTextColor(1); |
385 |
|
|
box6->SetTextSize(0.25); |
386 |
|
|
box6->SetFillColor(6); |
387 |
|
|
box6->Draw(); |
388 |
|
|
figura2->cd(); |
389 |
|
|
gStyle->SetOptDate(1); |
390 |
|
|
pd1->cd(); |
391 |
|
|
gStyle->SetOptStat(0); |
392 |
|
|
Xview->SetXTitle("strip"); |
393 |
|
|
Xview->SetYTitle("X - plane"); |
394 |
|
|
Xview->GetYaxis()->SetTitleOffset(0.5); |
395 |
|
|
Xview->SetFillColor(bgcolor); |
396 |
|
|
Xview->Fill(1.,1.,1.); |
397 |
|
|
Xview->Draw("box"); |
398 |
|
|
pd1->Update(); |
399 |
|
|
pd2->cd(); |
400 |
|
|
gStyle->SetOptStat(0); |
401 |
|
|
Yview->SetXTitle("strip"); |
402 |
|
|
Yview->SetYTitle("Y - plane"); |
403 |
|
|
Yview->GetYaxis()->SetTitleOffset(0.5); |
404 |
|
|
Yview->SetFillColor(bgcolor); |
405 |
|
|
Yview->Fill(1.,1.,1.); |
406 |
|
|
Yview->Draw("box"); |
407 |
|
|
pd2->Update(); |
408 |
|
|
// |
409 |
|
|
Int_t m = 0; |
410 |
|
|
Int_t l = 3; |
411 |
|
|
Int_t ss = 0; |
412 |
|
|
Float_t estrip = 0.; |
413 |
|
|
for ( Int_t s=0 ; s<4 ;s++ ){ |
414 |
|
|
tr->GetEntry(ci); |
415 |
|
|
if ( cee->unpackError ){ |
416 |
|
|
per = 1; |
417 |
|
|
} else { |
418 |
|
|
if ( s == 0 ) ss = 0; |
419 |
|
|
if ( s == 1 ) ss = 2; |
420 |
|
|
if ( s == 2 ) ss = 3; |
421 |
|
|
if ( s == 3 ) ss = 1; |
422 |
|
|
per = 0; |
423 |
|
|
for ( Int_t d=0 ; d<11 ;d++ ){ |
424 |
|
|
Int_t pre = -1; |
425 |
|
|
for ( Int_t j=0; j<96 ;j++){ |
426 |
|
|
figura2->cd(); |
427 |
|
|
if ( j%16 == 0 ) pre++; |
428 |
|
|
estrip = 0.; |
429 |
|
|
if ( s == 2 ) m = 2*d+1; |
430 |
|
|
if ( s == 3 ) m = 2*d; |
431 |
|
|
if ( s == 0 ) m = 2*d; |
432 |
|
|
if ( s == 1 ) m = 2*d+1; |
433 |
|
|
if ( s == 3 ) l = 0; |
434 |
|
|
if ( s == 2 ) l = 0; |
435 |
|
|
if ( s == 1 ) l = 1; |
436 |
|
|
if ( s == 0 ) l = 1; |
437 |
|
|
estrip = (cee->calpuls[ss][d][j]-cee1->calpuls[ss][d][j])/26.; |
438 |
|
|
if ( estrip > 0.7 ){ |
439 |
|
|
xview.str(""); |
440 |
|
|
xview << "x-view event " << j; |
441 |
|
|
xview << " " << m; |
442 |
|
|
xview << " " << l; |
443 |
|
|
yview.str(""); |
444 |
|
|
yview << "y-view event " << j; |
445 |
|
|
yview << " " << m; |
446 |
|
|
yview << " " << l; |
447 |
|
|
gDirectory->Delete(xview.str().c_str()); |
448 |
|
|
gDirectory->Delete(yview.str().c_str()); |
449 |
|
|
TH2F *Xview = new TH2F(xview.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
450 |
|
|
TH2F *Yview = new TH2F(yview.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
451 |
|
|
Int_t colo; |
452 |
|
|
ColorMIP(estrip,colo); |
453 |
|
|
Xview->SetFillColor(colo); |
454 |
|
|
Yview->SetFillColor(colo); |
455 |
|
|
if ( l == 0 ) { |
456 |
|
|
Xview->Fill(j,m,1.); |
457 |
|
|
pd1->cd(); |
458 |
|
|
Xview->Draw("box same"); |
459 |
|
|
}; |
460 |
|
|
if ( l == 1 ) { |
461 |
|
|
Yview->Fill(j,m,1.); |
462 |
|
|
pd2->cd(); |
463 |
|
|
Yview->Draw("box same"); |
464 |
|
|
}; |
465 |
|
|
}; |
466 |
|
|
if ( cee->calpuls[s][d][j] != 0. ) { |
467 |
|
|
stoppa = 1; |
468 |
|
|
}; |
469 |
|
|
if ( cee->calpuls[s][d][j] < 0. ) workornot = 0; |
470 |
|
|
}; |
471 |
|
|
}; |
472 |
|
|
}; |
473 |
|
|
ci++; |
474 |
|
|
}; |
475 |
|
|
if ( !per ){ |
476 |
|
|
pd1->Update(); |
477 |
|
|
pd2->Update(); |
478 |
|
|
figura2->Modified(); |
479 |
|
|
figura2->Update(); |
480 |
|
|
stringstream figsave; |
481 |
|
|
figsave.str(""); |
482 |
|
|
figsave << "pulsematra2_"; |
483 |
|
|
figsave << ci; |
484 |
|
|
if ( tosave ) PrintFigure(filename,outDir,figsave.str().c_str(),saveas,*figura2); |
485 |
|
|
}; |
486 |
|
|
}; |
487 |
|
|
if ( stoppa ){ |
488 |
|
|
if ( workornot ){ |
489 |
|
|
printf("File %s is ok \n",filename.Data()); |
490 |
|
|
} else { |
491 |
|
|
printf("File %s is NOT OK! \n",filename.Data()); |
492 |
|
|
}; |
493 |
|
|
}; |
494 |
|
|
} |