54 |
* Fixed bugs: for a large namber of events is not possible to have vectors, so I have subsituted graphs with histograms |
* Fixed bugs: for a large namber of events is not possible to have vectors, so I have subsituted graphs with histograms |
55 |
* or divided the graphs in more than one canvas. |
* or divided the graphs in more than one canvas. |
56 |
* |
* |
57 |
|
* Version 1.8 |
58 |
|
* Date 8 August 2006 - Malvezzi |
59 |
|
* |
60 |
|
* Description: changed the scale in the second and third graph of the first canvas; added a pad of text in the second canvas |
61 |
|
* |
62 |
*/ |
*/ |
63 |
|
|
64 |
|
|
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,obt;// offset, lastoffset, firstoffset; |
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; |
stringstream oss, oss1, oss2, oss3, noentries, stringa; |
100 |
//------- load root file -------------- |
//------- load root file -------------- |
101 |
TFile *file = new TFile(base.Data()); |
TFile *file = new TFile(base.Data()); |
102 |
if (!file){ |
if (!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(); |
160 |
} |
} |
161 |
|
|
162 |
//-------------- to know the max and min OBT ----------------------------// |
//-------------- to know the max and min OBT ----------------------------// |
|
for (Int_t i = 0; i < nevents; i++){ |
|
|
headBr->GetEntry(i); |
|
|
ph = eh->GetPscuHeader(); |
|
|
obt = ph->GetOrbitalTime(); |
|
|
//if(obt <= firstime) firstime=obt; |
|
|
if(obt >= lastime) lastime=obt; |
|
|
} |
|
|
|
|
|
//------------------------ First histogram -----------------------------------// |
|
163 |
headBr->GetEntry(0); |
headBr->GetEntry(0); |
164 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
165 |
firstime = ph->GetOrbitalTime(); |
firstime = ph->GetOrbitalTime(); |
166 |
obmin=firstime; |
|
167 |
obmax=lastime; |
int iii =0; |
168 |
|
while(iii < nevents){ |
169 |
|
headBr->GetEntry(iii); |
170 |
|
ph = eh->GetPscuHeader(); |
171 |
|
if((ph->GetOrbitalTime()) <= firstime) firstime=ph->GetOrbitalTime(); |
172 |
|
if((ph->GetOrbitalTime()) >= lastime) lastime=ph->GetOrbitalTime(); |
173 |
|
iii++; |
174 |
|
} |
175 |
|
|
176 |
|
//------------------------ First histogram -----------------------------------// |
177 |
|
|
178 |
|
obmin=firstime; |
179 |
|
obmax=lastime; |
180 |
|
|
181 |
oss1.str(""); |
oss1.str(""); |
182 |
oss1 <<"File name= "<< filename.Data() <<". Start time= " << obmin << ", end time= "<< obmax <<" ms"<<". Physics Packet per minute"; |
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 |
|
|
|
//------------- Graph PscuCounter vs FileOffset --------------------------------- |
|
|
const Int_t size = 10000; |
|
|
Int_t ev=0; |
|
|
Double_t PscuCounter[size], FileOffset[size], tempo[size], PcktLenght[size]; |
|
|
Int_t m=0; |
|
|
Int_t pag= (nevents/10000)+1; |
|
|
|
|
|
TMultiGraph *mg1 = new TMultiGraph(); |
|
|
oss1.str(""); |
|
|
oss1 << filename.Data() <<": PscuCounter vs FileOffset."; |
|
|
mg1->SetTitle(oss1.str().c_str()); |
|
|
|
|
|
TMultiGraph *mg2 = new TMultiGraph(); |
|
|
oss1.str(""); |
|
|
oss1 << filename.Data() <<": OBT vs FileOffset."; |
|
|
mg2->SetTitle(oss1.str().c_str()); |
|
|
|
|
|
TMultiGraph *mg3 = new TMultiGraph(); |
|
187 |
oss2.str(""); |
oss2.str(""); |
188 |
oss2 << filename.Data() <<": Lenght of Physic packets"; |
oss2 << filename.Data() <<": Lenght of Physic packets"; |
189 |
mg3->SetTitle(oss2.str().c_str()); |
Int_t nbin2 =(lastime-firstime); |
190 |
|
//TH1F *packetLength = new TH1F ("packetLength", oss2.str().c_str(), nbin2, obmin, obmax); |
191 |
|
TH1F *packetLength = new TH1F ("packetLength", "", nbin2, obmin, obmax); |
192 |
|
|
|
TMultiGraph *mg4 = new TMultiGraph(); |
|
193 |
oss3.str(""); |
oss3.str(""); |
194 |
oss3 << filename.Data() <<": Physics Counter"; |
oss3 << filename.Data() <<": Physics Counter vs. OBT"; |
195 |
mg4->SetTitle(oss3.str().c_str()); |
// TH1F *packeCounter = new TH1F ("packeCounter", oss3.str().c_str(), nbin2, obmin, obmax); |
196 |
|
TH1F *packeCounter = new TH1F ("packeCounter", "", nbin2, obmin, obmax); |
197 |
|
//---------------------------------------------------- |
198 |
|
TCanvas *finalCanv = new TCanvas("Header", base, 1200, 1600); |
199 |
|
finalCanv->Divide(1,5); |
200 |
|
finalCanv->SetFillColor(10); |
201 |
|
|
202 |
|
TPad *all2= new TPad ("","", 0, 0, 1, 1); |
203 |
|
all2->SetFillColor(10); |
204 |
|
TPad *all3= new TPad ("","", 0, 0, 1, 1); |
205 |
|
all3->SetFillColor(10); |
206 |
|
TPad *all4= new TPad ("","", 0, 0, 1, 1); |
207 |
|
all4->SetFillColor(10); |
208 |
|
TPad *all= new TPad ("","", 0, 0, 1, 1); |
209 |
|
all->SetFillColor(10); |
210 |
|
TPad *all1= new TPad ("","", 0, 0, 1, 1); |
211 |
|
all1->SetFillColor(10); |
212 |
|
TPad *pad = new TPad("pad","pad", .80,.50,.90,.80); |
213 |
|
pad->SetFillColor(10); |
214 |
|
//---------------------------------------------------- |
215 |
|
|
216 |
TCanvas *finalCanv1 = new TCanvas("Header_1", base, 1280, 1024); |
TMultiGraph *mg1 = new TMultiGraph(); |
217 |
finalCanv1->Divide(1,3); |
|
|
finalCanv1->SetFillColor(10); |
|
|
|
|
|
TCanvas *finalCanv2 = new TCanvas("Header_2", base, 1280, 1024); |
|
|
finalCanv2->Divide(1,2); |
|
|
finalCanv2->SetFillColor(10); |
|
218 |
|
|
219 |
/////ciclo sulle pagine//////////////////// |
TMultiGraph *mg2 = new TMultiGraph(); |
|
for (Int_t interval=0; interval<pag; interval++){ |
|
220 |
|
|
221 |
for (Int_t l = 0; l < size; l++){ //ciclo su un sottogruppo |
|
222 |
headBr->GetEntry(ev+l); |
//-------------------------------------------------------------------------- |
223 |
|
for (Int_t l = 0; l < nevents; l++){ |
224 |
|
headBr->GetEntry(l); |
225 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
226 |
PscuCounter[l]= ph->GetCounter(); // = PcktCounter[l] |
h1->Fill(ph->GetOrbitalTime()); |
227 |
FileOffset[l]=ph->GetFileOffset(); |
packetLength->Fill(ph->GetOrbitalTime(),ph->GetPacketLenght()); |
228 |
tempo[l]=ph->GetOrbitalTime(); |
packeCounter->Fill(ph->GetOrbitalTime(),ph->GetCounter()); |
229 |
PcktLenght[l]=ph->GetPacketLenght(); |
} |
|
h1->Fill(ph->GetOrbitalTime()); |
|
|
m=l; |
|
|
} |
|
|
|
|
|
TGraph *graph1= new TGraph(m, tempo, PcktLenght); |
|
|
graph1->SetMarkerColor(2); |
|
|
graph1->SetMarkerSize(.5); |
|
|
graph1->SetMarkerStyle(21); |
|
|
mg3->Add(graph1); |
|
|
|
|
|
TGraph *graph2= new TGraph(m, tempo, PscuCounter); |
|
|
graph2->SetMarkerColor(4); |
|
|
graph2->SetMarkerSize(.5); |
|
|
graph2->SetMarkerStyle(21); |
|
|
mg4->Add(graph2); |
|
|
|
|
|
TGraph *graph3= new TGraph(m, FileOffset, PscuCounter); |
|
|
graph3->SetMarkerColor(3); |
|
|
graph3->SetMarkerSize(.5); |
|
|
graph3->SetMarkerStyle(21); |
|
|
mg1->Add(graph3); |
|
|
|
|
|
TGraph *graph4= new TGraph(m, FileOffset, tempo); |
|
|
graph4->SetMarkerColor(kBlue); |
|
|
graph4->SetMarkerSize(.5); |
|
|
graph4->SetMarkerStyle(21); |
|
|
mg2->Add(graph4); |
|
230 |
|
|
|
ev=ev+10000; |
|
|
} |
|
231 |
//------------ First Canvas ---------------------// |
//------------ First Canvas ---------------------// |
232 |
|
TLine li; |
233 |
|
li.SetLineStyle(4); |
234 |
|
li.SetLineWidth(2); |
235 |
|
|
236 |
|
finalCanv->cd(1); |
237 |
|
all2->Draw(); |
238 |
|
all2->cd(); |
239 |
|
|
|
finalCanv1->cd(1); |
|
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 |
|
finalCanv->cd(2); |
295 |
|
all3->Draw(); |
296 |
|
all3->cd(); |
297 |
|
packetLength->SetStats(kFALSE); |
298 |
|
packetLength->SetMarkerColor(2); |
299 |
|
packetLength->SetMarkerSize(.5); |
300 |
|
packetLength->SetMarkerStyle(21); |
301 |
|
packetLength->GetXaxis()->SetTitle("OBT (ms)"); |
302 |
|
packetLength->GetXaxis()->CenterTitle(); |
303 |
|
packetLength->GetXaxis()->SetLabelSize(0.05); |
304 |
|
packetLength->GetYaxis()->SetTitle("Lenght (byte)"); |
305 |
|
packetLength->GetYaxis()->CenterTitle(); |
306 |
|
packetLength->GetYaxis()->SetLabelSize(0.05); |
307 |
|
packetLength->GetYaxis()->SetTitleSize(0.06); |
308 |
|
packetLength->GetYaxis()->SetTitleOffset(0.6); |
309 |
|
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 |
|
finalCanv->cd(3); |
320 |
|
all4->Draw(); |
321 |
|
all4->cd(); |
322 |
|
packeCounter->GetTitle(); |
323 |
|
packeCounter->SetStats(kFALSE); |
324 |
|
packeCounter->SetMarkerColor(4); |
325 |
|
packeCounter->SetMarkerSize(.2); |
326 |
|
packeCounter->SetMarkerStyle(21); |
327 |
|
packeCounter->GetXaxis()->SetTitle("OBT (ms)"); |
328 |
|
packeCounter->GetXaxis()->SetTitleSize(0.05); |
329 |
|
packeCounter->GetXaxis()->CenterTitle(); |
330 |
|
packeCounter->GetXaxis()->SetLabelSize(0.05); |
331 |
|
packeCounter->GetYaxis()->SetTitle("Counter"); |
332 |
|
packeCounter->GetYaxis()->SetTitleSize(0.05); |
333 |
|
packeCounter->GetYaxis()->CenterTitle(); |
334 |
|
packeCounter->GetYaxis()->SetLabelSize(0.05); |
335 |
|
packeCounter->GetYaxis()->SetTitleSize(0.06); |
336 |
|
packeCounter->GetYaxis()->SetTitleOffset(0.6); |
337 |
|
Double_t min = 500000000.; |
338 |
|
for (Int_t l = 0; l < nevents; l++){ |
339 |
|
if((packeCounter->GetBinContent(l))<= min && (packeCounter->GetBinContent(l))!= 0) min = packeCounter->GetBinContent(l); |
340 |
|
} |
341 |
|
packeCounter->SetMinimum(min); |
342 |
|
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 |
|
|
|
finalCanv1->cd(2); |
|
|
mg3->Draw("AP"); |
|
|
mg3->GetXaxis()->SetTitle("OBT (ms)"); |
|
|
mg3->GetXaxis()->CenterTitle(); |
|
|
mg3->GetXaxis()->SetLabelSize(0.04); |
|
|
mg3->GetYaxis()->SetTitle("Lenght (byte)"); |
|
|
mg3->GetYaxis()->CenterTitle(); |
|
|
mg3->GetYaxis()->SetLabelSize(0.04); |
|
|
mg3->GetYaxis()->SetTitleSize(0.06); |
|
|
mg3->GetYaxis()->SetTitleOffset(0.8); |
|
|
|
|
|
|
|
|
finalCanv1->cd(3); |
|
|
mg4->Draw("AP"); |
|
|
mg4->GetXaxis()->SetTitle("OBT (ms)"); |
|
|
mg4->GetXaxis()->SetTitleSize(0.05); |
|
|
mg4->GetXaxis()->CenterTitle(); |
|
|
mg4->GetXaxis()->SetLabelSize(0.04); |
|
|
mg4->GetYaxis()->SetTitle("Counter"); |
|
|
mg4->GetYaxis()->SetTitleSize(0.05); |
|
|
mg4->GetYaxis()->CenterTitle(); |
|
|
mg4->GetYaxis()->SetLabelSize(0.04); |
|
|
mg4->GetYaxis()->SetTitleSize(0.06); |
|
|
mg4->GetYaxis()->SetTitleOffset(0.8); |
|
|
|
|
|
finalCanv1->Update(); |
|
|
|
|
|
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; |
355 |
|
Int_t numkey; |
356 |
|
TObject *key = new TObject; |
357 |
|
const char *name; |
358 |
|
TTree* tr = new TTree; |
359 |
|
Long64_t nevntskey=0; |
360 |
|
list = file->GetListOfKeys(); |
361 |
|
numkey = file->GetNkeys(); |
362 |
|
int ll=0; |
363 |
|
int kk=0; |
364 |
|
|
365 |
|
for (Int_t i=0; i<numkey; i++){ |
366 |
|
key = list->At(i); |
367 |
|
name=(char *)(key->GetName()); |
368 |
|
tr = (TTree*)file->Get(name); |
369 |
|
if (tr->IsZombie()) continue; |
370 |
|
tr->SetBranchAddress("Header", &eh); |
371 |
|
TBranch *Br = tr->GetBranch("Header"); |
372 |
|
nevntskey = tr->GetEntries(); |
373 |
|
|
374 |
|
if(nevntskey !=0){ |
375 |
|
Int_t size1=nevntskey; |
376 |
|
Double_t *PscuCounter1 = new Double_t[size1]; |
377 |
|
Double_t *FileOffset1 = new Double_t[size1]; |
378 |
|
Double_t *tempo1 = new Double_t[size1]; |
379 |
|
//Double_t *salto= new Double_t[100]; |
380 |
|
//Double_t *salto1= new Double_t[100]; |
381 |
|
|
382 |
|
int l=0; |
383 |
|
while(l<nevntskey){ |
384 |
|
Br->GetEntry(l); |
385 |
|
ph = eh->GetPscuHeader(); |
386 |
|
PscuCounter1[l]= ph->GetCounter(); |
387 |
|
FileOffset1[l]=ph->GetFileOffset(); |
388 |
|
tempo1[l]=ph->GetOrbitalTime(); |
389 |
|
if(ph->GetFileOffset()<= primoffset){ |
390 |
|
primoffset =ph->GetFileOffset(); |
391 |
|
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 |
|
} |
420 |
|
} |
421 |
|
|
422 |
|
kk=kk-1; |
423 |
|
ll=ll-1; |
424 |
|
|
425 |
|
TLatex *lat = new TLatex(); |
426 |
|
lat->SetTextAlign(12); |
427 |
|
lat->SetTextSize(0.15); |
428 |
|
lat->SetTextColor(kBlue); |
429 |
|
//------------ Second Canvas ---------------------// |
430 |
|
finalCanv->cd(4); |
431 |
|
all1->Draw(); |
432 |
|
all1->cd(); |
433 |
|
|
434 |
|
oss1.str(""); |
435 |
//------------ Second Canvas ---------------------// |
oss1 << filename.Data() <<": PscuCounter vs FileOffset."; |
436 |
finalCanv2->cd(1); |
//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.04); |
mg1->GetYaxis()->SetLabelSize(0.06); |
446 |
|
mg1->GetYaxis()->SetTitleOffset(0.7); |
447 |
finalCanv2->cd(2); |
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 |
|
|
457 |
|
finalCanv->cd(5); |
458 |
|
all->Draw(); |
459 |
|
all->cd(); |
460 |
|
|
461 |
|
oss3.str(""); |
462 |
|
oss3 << filename.Data() <<" OBT vs FileOffset. First packet = "<<primotempo <<" ms, Last packet = "<<ultimotempo<<" ms."; |
463 |
|
//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.04); |
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; |
480 |
|
if(ll > 0){ |
481 |
|
pad->Draw(); |
482 |
|
pad->cd(); |
483 |
|
for(Int_t k=0; k <(kk); k++){ |
484 |
|
stringa.str(""); |
485 |
|
stringa << "old data from "<< salto[kk]<< " to "<<salto1[kk+1]; |
486 |
|
min2=min2-0.1; |
487 |
|
lat->DrawLatex(0.08, min2,stringa.str().c_str()); |
488 |
|
//cout<<salto[kk]<<";\n"; |
489 |
|
} |
490 |
|
}*/ |
491 |
|
|
492 |
finalCanv2->Update(); |
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 |
|
|