82 |
#include "TGaxis.h" |
#include "TGaxis.h" |
83 |
#include "EventHeader.h" |
#include "EventHeader.h" |
84 |
#include "PscuHeader.h" |
#include "PscuHeader.h" |
85 |
|
#include "RunHeaderEvent.h" |
86 |
|
#include "TPaveText.h" |
87 |
|
|
88 |
using namespace std; |
using namespace std; |
89 |
|
|
90 |
void HeaderScan(TString base, TString outDir, TString format) |
void HeaderScan(TString base, TString outDir, TString format) |
91 |
{ |
{ |
92 |
|
|
93 |
|
|
94 |
//------------------- Variables initilization -------------------------// |
//------------------- Variables initilization -------------------------// |
95 |
Long64_t nevents=0; |
Long64_t nevents=0, runnevents; |
96 |
ULong_t lastime, firstime, primotempo, ultimotempo, primoffset=500000000, ultimoffset=100000000; |
ULong_t lastime, firstime, primotempo, ultimotempo, primoffset=500000000, ultimoffset; |
97 |
double obmin=0.; |
double obmin=0., time=0.; |
98 |
double obmax=0.; |
double obmax=0.; |
99 |
stringstream oss, oss1, oss2, oss3, noentries, stringa; |
stringstream oss, oss1, oss2, oss3, noentries, stringa; |
100 |
//------- load root file -------------- |
//------- load root file -------------- |
111 |
pamela::PscuHeader *ph = 0; |
pamela::PscuHeader *ph = 0; |
112 |
|
|
113 |
PhysicsTr->SetBranchAddress("Header", &eh); |
PhysicsTr->SetBranchAddress("Header", &eh); |
|
|
|
114 |
nevents = headBr->GetEntries(); |
nevents = headBr->GetEntries(); |
115 |
|
|
116 |
|
TTree *RunHeadTr = (TTree*)file->Get("RunHeader"); ///run header tree |
117 |
|
pamela::EventHeader *eH=0; |
118 |
|
pamela::RunHeaderEvent *reh=0; |
119 |
|
|
120 |
|
RunHeadTr->SetBranchAddress("Header",&eH); |
121 |
|
RunHeadTr->SetBranchAddress("RunHeader",&reh); |
122 |
|
runnevents = RunHeadTr->GetEntries(); |
123 |
|
|
124 |
|
|
125 |
TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString(); |
TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString(); |
126 |
filename = ((TObjString*)filename.Tokenize('.')->First())->GetString(); |
filename = ((TObjString*)filename.Tokenize('.')->First())->GetString(); |
164 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
165 |
firstime = ph->GetOrbitalTime(); |
firstime = ph->GetOrbitalTime(); |
166 |
|
|
167 |
for (Int_t i = 0; i < nevents; i++){ |
int iii =0; |
168 |
headBr->GetEntry(i); |
while(iii < nevents){ |
169 |
ph = eh->GetPscuHeader(); |
headBr->GetEntry(iii); |
170 |
if((ph->GetOrbitalTime()) <= firstime) firstime=ph->GetOrbitalTime(); |
ph = eh->GetPscuHeader(); |
171 |
if((ph->GetOrbitalTime()) >= lastime) lastime=ph->GetOrbitalTime(); |
if((ph->GetOrbitalTime()) <= firstime) firstime=ph->GetOrbitalTime(); |
172 |
} |
if((ph->GetOrbitalTime()) >= lastime) lastime=ph->GetOrbitalTime(); |
173 |
|
iii++; |
174 |
|
} |
175 |
|
|
176 |
//------------------------ First histogram -----------------------------------// |
//------------------------ First histogram -----------------------------------// |
177 |
|
|
178 |
obmin=firstime; |
obmin=firstime; |
179 |
obmax=lastime; |
obmax=lastime; |
180 |
|
|
181 |
oss1.str(""); |
oss1.str(""); |
182 |
oss1 << filename.Data() <<": Physics Packet per minute. Start time = " << obmin << ", End time = "<< obmax <<" ms"; |
oss1 << filename.Data() <<": Physics Packet per minute. Start time = " << obmin << ", End time = "<< obmax <<" ms"; |
183 |
Int_t nbin = (lastime-firstime)/60000; |
Int_t nbin = (lastime-firstime)/60000; |
184 |
TH1F *h1 = new TH1F ("histo1", oss1.str().c_str(), nbin, obmin, obmax); |
//TH1F *h1 = new TH1F ("histo1", oss1.str().c_str(), nbin, obmin, obmax); |
185 |
|
TH1F *h1 = new TH1F ("histo1", "" , nbin, obmin, obmax); |
186 |
|
|
187 |
oss2.str(""); |
oss2.str(""); |
188 |
oss2 << filename.Data() <<": Lenght of Physic packets"; |
oss2 << filename.Data() <<": Lenght of Physic packets"; |
189 |
Int_t nbin2 =(lastime-firstime); |
Int_t nbin2 =(lastime-firstime); |
190 |
TH1F *packetLength = new TH1F ("packetLength", oss2.str().c_str(), nbin2, obmin, obmax); |
//TH1F *packetLength = new TH1F ("packetLength", oss2.str().c_str(), nbin2, obmin, obmax); |
191 |
|
TH1F *packetLength = new TH1F ("packetLength", "", nbin2, obmin, obmax); |
192 |
|
|
193 |
oss3.str(""); |
oss3.str(""); |
194 |
oss3 << filename.Data() <<": Physics Counter"; |
oss3 << filename.Data() <<": Physics Counter vs. OBT"; |
195 |
TH1F *packeCounter = new TH1F ("packeCounter", oss3.str().c_str(), nbin2, obmin, obmax); |
// TH1F *packeCounter = new TH1F ("packeCounter", oss3.str().c_str(), nbin2, obmin, obmax); |
196 |
|
TH1F *packeCounter = new TH1F ("packeCounter", "", nbin2, obmin, obmax); |
197 |
//---------------------------------------------------- |
//---------------------------------------------------- |
198 |
TCanvas *finalCanv1 = new TCanvas("Header_1", base, 1280, 1150); |
TCanvas *finalCanv = new TCanvas("Header", base, 1200, 1600); |
199 |
finalCanv1->Divide(1,3); |
finalCanv->Divide(1,5); |
200 |
finalCanv1->SetFillColor(10); |
finalCanv->SetFillColor(10); |
201 |
|
|
202 |
TPad *all2= new TPad ("","", 0, 0, 1, 1); |
TPad *all2= new TPad ("","", 0, 0, 1, 1); |
203 |
all2->SetFillColor(10); |
all2->SetFillColor(10); |
204 |
TPad *all3= new TPad ("","", 0, 0, 1, 1); |
TPad *all3= new TPad ("","", 0, 0, 1, 1); |
205 |
all3->SetFillColor(10); |
all3->SetFillColor(10); |
206 |
TPad *all4= new TPad ("","", 0, 0, 1, 1); |
TPad *all4= new TPad ("","", 0, 0, 1, 1); |
207 |
all4->SetFillColor(10); |
all4->SetFillColor(10); |
|
//---------------------------------------------------- |
|
|
TCanvas *finalCanv2 = new TCanvas("Header_2", base, 1280, 1150); |
|
|
finalCanv2->Divide(1,2); |
|
|
finalCanv2->SetFillColor(10); |
|
|
|
|
|
TMultiGraph *mg1 = new TMultiGraph(); |
|
|
oss1.str(""); |
|
|
oss1 << filename.Data() <<": PscuCounter vs FileOffset."; |
|
|
mg1->SetTitle(oss1.str().c_str()); |
|
|
|
|
|
TMultiGraph *mg2 = new TMultiGraph(); |
|
|
|
|
208 |
TPad *all= new TPad ("","", 0, 0, 1, 1); |
TPad *all= new TPad ("","", 0, 0, 1, 1); |
209 |
all->SetFillColor(10); |
all->SetFillColor(10); |
210 |
TPad *all1= new TPad ("","", 0, 0, 1, 1); |
TPad *all1= new TPad ("","", 0, 0, 1, 1); |
211 |
all1->SetFillColor(10); |
all1->SetFillColor(10); |
212 |
TPad *pad = new TPad("pad","pad", .80,.50,.90,.80); |
TPad *pad = new TPad("pad","pad", .80,.50,.90,.80); |
213 |
pad->SetFillColor(10); |
pad->SetFillColor(10); |
214 |
|
//---------------------------------------------------- |
215 |
|
|
216 |
|
TMultiGraph *mg1 = new TMultiGraph(); |
217 |
|
|
218 |
|
|
219 |
|
TMultiGraph *mg2 = new TMultiGraph(); |
220 |
|
|
221 |
|
|
222 |
//-------------------------------------------------------------------------- |
//-------------------------------------------------------------------------- |
223 |
for (Int_t l = 0; l < nevents; l++){ |
for (Int_t l = 0; l < nevents; l++){ |
224 |
headBr->GetEntry(l); |
headBr->GetEntry(l); |
225 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
226 |
h1->Fill(ph->GetOrbitalTime()); |
h1->Fill(ph->GetOrbitalTime()); |
227 |
packetLength->Fill(ph->GetOrbitalTime(),ph->GetPacketLenght()); |
packetLength->Fill(ph->GetOrbitalTime(),ph->GetPacketLenght()); |
228 |
packeCounter->Fill(ph->GetOrbitalTime(),ph->GetCounter()); |
packeCounter->Fill(ph->GetOrbitalTime(),ph->GetCounter()); |
229 |
} |
} |
230 |
|
|
231 |
//------------ First Canvas ---------------------// |
//------------ First Canvas ---------------------// |
232 |
|
TLine li; |
233 |
finalCanv1->cd(1); |
li.SetLineStyle(4); |
234 |
|
li.SetLineWidth(2); |
235 |
|
|
236 |
|
finalCanv->cd(1); |
237 |
all2->Draw(); |
all2->Draw(); |
238 |
all2->cd(); |
all2->cd(); |
239 |
|
|
240 |
h1->SetStats(kFALSE); |
h1->SetStats(kFALSE); |
241 |
h1->GetXaxis()->SetTitle("OBT (ms)"); |
h1->GetXaxis()->SetTitle("OBT (ms)"); |
242 |
h1->GetXaxis()->CenterTitle(); |
h1->GetXaxis()->CenterTitle(); |
243 |
h1->GetXaxis()->SetLabelSize(0.04); |
h1->GetXaxis()->SetLabelSize(0.04); |
244 |
h1->GetYaxis()->SetTitle("Number of events "); |
h1->GetYaxis()->SetTitle("Number of events "); |
245 |
h1->GetYaxis()->CenterTitle(); |
h1->GetYaxis()->CenterTitle(); |
246 |
|
h1->GetYaxis()->SetLabelSize(0.06); |
247 |
h1->GetYaxis()->SetTitleSize(0.06); |
h1->GetYaxis()->SetTitleSize(0.06); |
248 |
h1->GetYaxis()->SetTitleOffset(0.8); |
h1->GetYaxis()->SetTitleOffset(0.6); |
249 |
h1->Draw(); |
h1->Draw(); |
250 |
|
for (Int_t l = 0; l < runnevents; l++){ |
251 |
|
RunHeadTr->GetEntry(l); |
252 |
|
ph = eH->GetPscuHeader(); |
253 |
|
int ws= reh->RM_ACQ_SETTING_MODE; |
254 |
|
int id = ph->GetPacketId1(); |
255 |
|
Int_t obt = ph->GetOrbitalTime(); |
256 |
|
if (ws==1){ |
257 |
|
li.SetLineColor(3); |
258 |
|
li.DrawLine(obt,0,obt,h1->GetMaximum()); |
259 |
|
} |
260 |
|
else if (ws==2){ |
261 |
|
li.SetLineColor(4); |
262 |
|
li.DrawLine(obt,0,obt,h1->GetMaximum()); |
263 |
|
} |
264 |
|
} |
265 |
|
|
266 |
|
finalCanv->cd(1); |
267 |
|
stringstream ws1, ws2; |
268 |
|
ws1.str(""); |
269 |
|
ws2.str(""); |
270 |
|
ws1<<"ACQ_SETTING_MODE = 1"; |
271 |
|
ws2<<"ACQ_SETTING_MODE = 2"; |
272 |
|
TPaveText *pt=0; |
273 |
|
pt = new TPaveText (.60,.92,.76,.98); |
274 |
|
pt->AddText(ws1.str().c_str()); |
275 |
|
pt->SetTextColor(3); |
276 |
|
pt->SetFillColor(10); |
277 |
|
pt->SetBorderSize(0); |
278 |
|
pt->Draw(); |
279 |
|
TPaveText *pt1=0; |
280 |
|
pt1 = new TPaveText (.76,.92,.92,.98); |
281 |
|
pt1->AddText(ws2.str().c_str()); |
282 |
|
pt1->SetTextColor(4); |
283 |
|
pt1->SetFillColor(10); |
284 |
|
pt1->SetBorderSize(0); |
285 |
|
pt1->Draw(); |
286 |
|
// TPaveText *pt1=0; |
287 |
|
pt1 = new TPaveText (.05,.91,.6,1); |
288 |
|
pt1->AddText(oss1.str().c_str()); |
289 |
|
pt1->SetTextColor(1); |
290 |
|
pt1->SetFillColor(10); |
291 |
|
pt1->SetBorderSize(0); |
292 |
|
pt1->Draw(); |
293 |
|
|
294 |
finalCanv1->cd(2); |
finalCanv->cd(2); |
295 |
all3->Draw(); |
all3->Draw(); |
296 |
all3->cd(); |
all3->cd(); |
297 |
packetLength->SetStats(kFALSE); |
packetLength->SetStats(kFALSE); |
300 |
packetLength->SetMarkerStyle(21); |
packetLength->SetMarkerStyle(21); |
301 |
packetLength->GetXaxis()->SetTitle("OBT (ms)"); |
packetLength->GetXaxis()->SetTitle("OBT (ms)"); |
302 |
packetLength->GetXaxis()->CenterTitle(); |
packetLength->GetXaxis()->CenterTitle(); |
303 |
packetLength->GetXaxis()->SetLabelSize(0.04); |
packetLength->GetXaxis()->SetLabelSize(0.05); |
304 |
packetLength->GetYaxis()->SetTitle("Lenght (byte)"); |
packetLength->GetYaxis()->SetTitle("Lenght (byte)"); |
305 |
packetLength->GetYaxis()->CenterTitle(); |
packetLength->GetYaxis()->CenterTitle(); |
306 |
packetLength->GetYaxis()->SetLabelSize(0.04); |
packetLength->GetYaxis()->SetLabelSize(0.05); |
307 |
packetLength->GetYaxis()->SetTitleSize(0.06); |
packetLength->GetYaxis()->SetTitleSize(0.06); |
308 |
packetLength->GetYaxis()->SetTitleOffset(0.8); |
packetLength->GetYaxis()->SetTitleOffset(0.6); |
309 |
packetLength->Draw("9p"); |
packetLength->Draw("9p"); |
310 |
|
finalCanv->cd(2); |
311 |
|
//TPaveText *pt=0; |
312 |
|
pt = new TPaveText (.6,.91,.90,1); |
313 |
|
pt->AddText(oss2.str().c_str()); |
314 |
|
pt->SetTextColor(2); |
315 |
|
pt->SetFillColor(10); |
316 |
|
pt->SetBorderSize(0); |
317 |
|
pt->Draw(); |
318 |
|
|
319 |
finalCanv1->cd(3); |
finalCanv->cd(3); |
320 |
all4->Draw(); |
all4->Draw(); |
321 |
all4->cd(); |
all4->cd(); |
322 |
|
packeCounter->GetTitle(); |
323 |
packeCounter->SetStats(kFALSE); |
packeCounter->SetStats(kFALSE); |
324 |
packeCounter->SetMarkerColor(4); |
packeCounter->SetMarkerColor(4); |
325 |
packeCounter->SetMarkerSize(.5); |
packeCounter->SetMarkerSize(.2); |
326 |
packeCounter->SetMarkerStyle(21); |
packeCounter->SetMarkerStyle(21); |
327 |
packeCounter->GetXaxis()->SetTitle("OBT (ms)"); |
packeCounter->GetXaxis()->SetTitle("OBT (ms)"); |
328 |
packeCounter->GetXaxis()->SetTitleSize(0.05); |
packeCounter->GetXaxis()->SetTitleSize(0.05); |
329 |
packeCounter->GetXaxis()->CenterTitle(); |
packeCounter->GetXaxis()->CenterTitle(); |
330 |
packeCounter->GetXaxis()->SetLabelSize(0.04); |
packeCounter->GetXaxis()->SetLabelSize(0.05); |
331 |
packeCounter->GetYaxis()->SetTitle("Counter"); |
packeCounter->GetYaxis()->SetTitle("Counter"); |
332 |
packeCounter->GetYaxis()->SetTitleSize(0.05); |
packeCounter->GetYaxis()->SetTitleSize(0.05); |
333 |
packeCounter->GetYaxis()->CenterTitle(); |
packeCounter->GetYaxis()->CenterTitle(); |
334 |
packeCounter->GetYaxis()->SetLabelSize(0.04); |
packeCounter->GetYaxis()->SetLabelSize(0.05); |
335 |
packeCounter->GetYaxis()->SetTitleSize(0.06); |
packeCounter->GetYaxis()->SetTitleSize(0.06); |
336 |
packeCounter->GetYaxis()->SetTitleOffset(0.8); |
packeCounter->GetYaxis()->SetTitleOffset(0.6); |
337 |
Double_t min = 500000000.; |
Double_t min = 500000000.; |
338 |
for (Int_t l = 0; l < nevents; l++){ |
for (Int_t l = 0; l < nevents; l++){ |
339 |
if((packeCounter->GetBinContent(l))<= min && (packeCounter->GetBinContent(l))!= 0) min = packeCounter->GetBinContent(l); |
if((packeCounter->GetBinContent(l))<= min && (packeCounter->GetBinContent(l))!= 0) min = packeCounter->GetBinContent(l); |
340 |
} |
} |
341 |
packeCounter->SetMinimum(min); |
packeCounter->SetMinimum(min); |
342 |
packeCounter->Draw("9p"); |
packeCounter->Draw("9p"); |
343 |
|
finalCanv->cd(3); |
344 |
|
TPaveText *pt2=0; |
345 |
|
pt2 = new TPaveText (.6,.91,.90,1); |
346 |
|
pt2->AddText(oss3.str().c_str()); |
347 |
|
pt2->SetTextColor(4); |
348 |
|
pt2->SetFillColor(10); |
349 |
|
pt2->SetBorderSize(0); |
350 |
|
pt2->Draw(); |
351 |
|
|
|
oss.str(""); |
|
|
oss << outDir.Data() << filename.Data(); |
|
|
oss << "_HeaderScan_1." << format.Data(); |
|
|
finalCanv1->SaveAs(oss.str().c_str()); |
|
352 |
|
|
353 |
//------------------------------------------------- |
//------------------------------------------------- |
354 |
TList *list = new TList; |
TList *list = new TList; |
359 |
Long64_t nevntskey=0; |
Long64_t nevntskey=0; |
360 |
list = file->GetListOfKeys(); |
list = file->GetListOfKeys(); |
361 |
numkey = file->GetNkeys(); |
numkey = file->GetNkeys(); |
362 |
|
int ll=0; |
363 |
const Int_t size1 = 10000; |
int kk=0; |
364 |
Int_t ev1=0; |
|
|
Double_t PscuCounter1[size1], FileOffset1[size1], tempo1[size1], salto[size1]; |
|
|
Int_t pag1=0; |
|
|
Int_t m1=0; |
|
|
Int_t ll=0; |
|
|
|
|
365 |
for (Int_t i=0; i<numkey; i++){ |
for (Int_t i=0; i<numkey; i++){ |
366 |
key = list->At(i); |
key = list->At(i); |
367 |
name=(char *)(key->GetName()); |
name=(char *)(key->GetName()); |
370 |
tr->SetBranchAddress("Header", &eh); |
tr->SetBranchAddress("Header", &eh); |
371 |
TBranch *Br = tr->GetBranch("Header"); |
TBranch *Br = tr->GetBranch("Header"); |
372 |
nevntskey = tr->GetEntries(); |
nevntskey = tr->GetEntries(); |
|
m1=0; |
|
|
pag1= (nevntskey/10000)+1; |
|
|
/////ciclo sulle pagine//////////////////// |
|
|
for (Int_t interval1=0; interval1<pag1; interval1++){ |
|
373 |
|
|
374 |
for (Int_t l = 0; l < size1; l++){ //ciclo su un sottogruppo |
if(nevntskey !=0){ |
375 |
Br->GetEntry(ev1+l); |
Int_t size1=nevntskey; |
376 |
ph = eh->GetPscuHeader(); |
Double_t *PscuCounter1 = new Double_t[size1]; |
377 |
PscuCounter1[l]= ph->GetCounter(); // = PcktCounter[l] |
Double_t *FileOffset1 = new Double_t[size1]; |
378 |
FileOffset1[l]=ph->GetFileOffset(); |
Double_t *tempo1 = new Double_t[size1]; |
379 |
tempo1[l]=ph->GetOrbitalTime(); |
//Double_t *salto= new Double_t[100]; |
380 |
if(ph->GetFileOffset()<= primoffset){ |
//Double_t *salto1= new Double_t[100]; |
381 |
primoffset =ph->GetFileOffset(); |
|
382 |
primotempo=ph->GetOrbitalTime(); |
int l=0; |
383 |
} |
while(l<nevntskey){ |
384 |
if(ph->GetFileOffset()>= ultimoffset){ |
Br->GetEntry(l); |
385 |
ultimoffset = ph->GetFileOffset(); |
ph = eh->GetPscuHeader(); |
386 |
ultimotempo = ph->GetOrbitalTime(); |
PscuCounter1[l]= ph->GetCounter(); |
387 |
} |
FileOffset1[l]=ph->GetFileOffset(); |
388 |
if(l>0){ |
tempo1[l]=ph->GetOrbitalTime(); |
389 |
if(tempo1[l] < tempo1[l-1]){ |
if(ph->GetFileOffset()<= primoffset){ |
390 |
salto[ll]= ph->GetOrbitalTime(); |
primoffset =ph->GetFileOffset(); |
391 |
ll=ll+1; |
primotempo=ph->GetOrbitalTime(); |
392 |
|
} |
393 |
|
if(ph->GetFileOffset()>= ultimoffset){ |
394 |
|
ultimoffset = ph->GetFileOffset(); |
395 |
|
ultimotempo = ph->GetOrbitalTime(); |
396 |
} |
} |
397 |
|
/*if(l>0){ |
398 |
|
if(tempo1[l] < tempo1[l-1]){ |
399 |
|
salto1[kk] =(const Double_t*)tempo1[l-1]; |
400 |
|
salto[ll]= ph->GetOrbitalTime(); |
401 |
|
ll=ll+1; |
402 |
|
kk=kk+1; |
403 |
|
} |
404 |
|
}*/ |
405 |
|
l++; |
406 |
|
} |
407 |
|
|
408 |
|
TGraph *graph3= new TGraph(nevntskey, (const Double_t*)FileOffset1, (const Double_t*)PscuCounter1); |
409 |
|
graph3->SetMarkerColor(3); |
410 |
|
graph3->SetMarkerSize(.2); |
411 |
|
graph3->SetMarkerStyle(21); |
412 |
|
mg1->Add(graph3); |
413 |
|
|
414 |
|
TGraph *graph4= new TGraph(nevntskey, (const Double_t*)FileOffset1, (const Double_t*)tempo1); |
415 |
|
graph4->SetMarkerColor(kBlue); |
416 |
|
graph4->SetMarkerSize(.2); |
417 |
|
graph4->SetMarkerStyle(21); |
418 |
|
mg2->Add(graph4); |
419 |
} |
} |
|
|
|
|
m1=l; |
|
|
} |
|
|
|
|
|
TGraph *graph3= new TGraph(m1, FileOffset1, PscuCounter1); |
|
|
graph3->SetMarkerColor(3); |
|
|
graph3->SetMarkerSize(.5); |
|
|
graph3->SetMarkerStyle(21); |
|
|
mg1->Add(graph3); |
|
|
|
|
|
TGraph *graph4= new TGraph(m1, FileOffset1, tempo1); |
|
|
graph4->SetMarkerColor(kBlue); |
|
|
graph4->SetMarkerSize(.5); |
|
|
graph4->SetMarkerStyle(21); |
|
|
mg2->Add(graph4); |
|
|
|
|
|
ev1=ev1+10000; |
|
420 |
} |
} |
421 |
} |
|
422 |
|
kk=kk-1; |
423 |
|
ll=ll-1; |
424 |
TLatex *lat = new TLatex(); |
|
425 |
lat->SetTextAlign(12); |
TLatex *lat = new TLatex(); |
426 |
lat->SetTextSize(0.15); |
lat->SetTextAlign(12); |
427 |
lat->SetTextColor(kBlue); |
lat->SetTextSize(0.15); |
428 |
|
lat->SetTextColor(kBlue); |
429 |
|
//------------ Second Canvas ---------------------// |
430 |
//------------ Second Canvas ---------------------// |
finalCanv->cd(4); |
|
finalCanv2->cd(1); |
|
431 |
all1->Draw(); |
all1->Draw(); |
432 |
all1->cd(); |
all1->cd(); |
433 |
|
|
434 |
|
oss1.str(""); |
435 |
|
oss1 << filename.Data() <<": PscuCounter vs FileOffset."; |
436 |
|
//mg1->SetTitle(oss1.str().c_str()); |
437 |
mg1->Draw("AP"); |
mg1->Draw("AP"); |
438 |
mg1->GetXaxis()->SetTitle("File Offset"); |
mg1->GetXaxis()->SetTitle("File Offset"); |
439 |
mg1->GetXaxis()->CenterTitle(); |
mg1->GetXaxis()->CenterTitle(); |
440 |
mg1->GetXaxis()->SetTitleSize(0.05); |
mg1->GetXaxis()->SetTitleSize(0.045); |
441 |
mg1->GetXaxis()->SetLabelSize(0.04); |
mg1->GetXaxis()->SetLabelSize(0.05); |
442 |
mg1->GetYaxis()->SetTitle("Counter"); |
mg1->GetYaxis()->SetTitle("Counter"); |
443 |
mg1->GetYaxis()->CenterTitle(); |
mg1->GetYaxis()->CenterTitle(); |
444 |
mg1->GetYaxis()->SetTitleSize(0.05); |
mg1->GetYaxis()->SetTitleSize(0.05); |
445 |
mg1->GetYaxis()->SetLabelSize(0.03); |
mg1->GetYaxis()->SetLabelSize(0.06); |
446 |
|
mg1->GetYaxis()->SetTitleOffset(0.7); |
447 |
|
finalCanv->cd(4); |
448 |
|
TPaveText *pt3=0; |
449 |
|
pt3 = new TPaveText (.60,.91,.90,1); |
450 |
|
pt3->AddText(oss1.str().c_str()); |
451 |
|
pt3->SetTextColor(3); |
452 |
|
pt3->SetFillColor(10); |
453 |
|
pt3->SetBorderSize(0); |
454 |
|
pt3->Draw(); |
455 |
|
|
456 |
finalCanv2->cd(2); |
|
457 |
|
finalCanv->cd(5); |
458 |
all->Draw(); |
all->Draw(); |
459 |
all->cd(); |
all->cd(); |
460 |
|
|
461 |
oss3.str(""); |
oss3.str(""); |
462 |
oss3 << filename.Data() <<" OBT vs FileOffset. First packet = "<<primotempo <<" ms, Last packet = "<<ultimotempo<<" ms."; |
oss3 << filename.Data() <<" OBT vs FileOffset. First packet = "<<primotempo <<" ms, Last packet = "<<ultimotempo<<" ms."; |
463 |
mg2->SetTitle(oss3.str().c_str()); |
//mg2->SetTitle(oss3.str().c_str()); |
464 |
mg2->Draw("AP"); |
mg2->Draw("AP"); |
465 |
mg2->GetXaxis()->SetTitle("File Offset"); |
mg2->GetXaxis()->SetTitle("File Offset"); |
466 |
mg2->GetXaxis()->CenterTitle(); |
mg2->GetXaxis()->CenterTitle(); |
467 |
mg2->GetXaxis()->SetTitleSize(0.05); |
mg2->GetXaxis()->SetTitleSize(0.045); |
468 |
mg2->GetXaxis()->SetLabelSize(0.04); |
mg2->GetXaxis()->SetLabelSize(0.05); |
469 |
mg2->GetYaxis()->SetTitle("OBT"); |
mg2->GetYaxis()->SetTitle("OBT"); |
470 |
mg2->GetYaxis()->CenterTitle(); |
mg2->GetYaxis()->CenterTitle(); |
471 |
mg2->GetYaxis()->SetTitleSize(0.05); |
mg2->GetYaxis()->SetTitleSize(0.05); |
472 |
mg2->GetYaxis()->SetLabelSize(0.03); |
mg2->GetYaxis()->SetLabelSize(0.055); |
473 |
|
mg2->GetYaxis()->SetTitleOffset(0.6); |
474 |
|
/*pad->Draw(); |
475 |
|
pad->cd(); |
476 |
|
stringa.str(""); |
477 |
|
stringa << "new data from "<< primotempo;//<<" to "<< salto1; |
478 |
|
lat->DrawLatex(0.08, 0.8, stringa.str().c_str()); |
479 |
double min2 = 0.8; |
double min2 = 0.8; |
480 |
if(ll-1 > 0){ |
if(ll > 0){ |
481 |
pad->Draw(); |
pad->Draw(); |
482 |
pad->cd(); |
pad->cd(); |
483 |
stringa.str(""); |
for(Int_t k=0; k <(kk); k++){ |
|
stringa << "jump back at:"; |
|
|
lat->DrawLatex(0.08, min2, stringa.str().c_str()); |
|
|
for(Int_t kk=0; kk <(ll-1); kk++){ |
|
484 |
stringa.str(""); |
stringa.str(""); |
485 |
stringa << salto[kk]; |
stringa << "old data from "<< salto[kk]<< " to "<<salto1[kk+1]; |
486 |
min2=min2-0.1; |
min2=min2-0.1; |
487 |
lat->DrawLatex(0.08, min2,stringa.str().c_str()); |
lat->DrawLatex(0.08, min2,stringa.str().c_str()); |
488 |
//cout<<salto[kk]<<";\n"; |
//cout<<salto[kk]<<";\n"; |
489 |
} |
} |
490 |
} |
}*/ |
|
|
|
|
finalCanv2->Update(); |
|
|
|
|
|
|
|
491 |
|
|
492 |
|
finalCanv->cd(5); |
493 |
|
TPaveText *pt4=0; |
494 |
|
pt4 = new TPaveText (.38 ,.91,.92,1); |
495 |
|
pt4->AddText(oss3.str().c_str()); |
496 |
|
pt4->SetTextColor(kBlue); |
497 |
|
pt4->SetFillColor(10); |
498 |
|
pt4->SetBorderSize(0); |
499 |
|
pt4->Draw(); |
500 |
|
|
501 |
|
// finalCanv->Draw(); |
502 |
|
finalCanv->Update(); |
503 |
|
|
504 |
oss1.str(""); |
oss1.str(""); |
505 |
oss1 << outDir.Data() << filename.Data(); |
oss1 << outDir.Data() << filename.Data(); |
506 |
oss1 << "_HeaderScan_2"<<"." << format.Data(); |
oss1 << "_HeaderScan"<<"." << format.Data(); |
507 |
|
|
508 |
|
finalCanv->SaveAs(oss1.str().c_str()); |
509 |
|
|
|
finalCanv2->SaveAs(oss1.str().c_str()); |
|
510 |
|
|
511 |
|
|
512 |
file->Close(); |
file->Close(); |
513 |
|
|
514 |
} |
} |
556 |
} |
} |
557 |
HeaderScan(argv[1], outDir, format); |
HeaderScan(argv[1], outDir, format); |
558 |
} |
} |
559 |
|
|