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 |
//------------------- Variables initilization -------------------------// |
//------------------- Variables initilization -------------------------// |
93 |
Long64_t nevents=0, runnevents; |
Long64_t nevents=0, runnevents; |
94 |
ULong_t lastime, firstime, primotempo, ultimotempo, primoffset=500000000, ultimoffset; |
ULong_t lastime, firstime, primotempo, ultimotempo, primoffset=500000000, ultimoffset; |
95 |
double obmin=0., time=0.; |
double obmin=0.; |
96 |
double obmax=0.; |
double obmax=0.; |
97 |
stringstream oss, oss1, oss2, oss3, noentries, stringa; |
stringstream oss, oss1, oss2, oss3, noentries, stringa; |
98 |
//------- load root file -------------- |
|
99 |
|
//-------------- Load root file, tree and branch -------------------// |
100 |
TFile *file = new TFile(base.Data()); |
TFile *file = new TFile(base.Data()); |
101 |
if (!file){ |
if (!file){ |
102 |
printf("No such file in the directory has been found"); |
printf("No such file in the directory has been found"); |
103 |
return; |
return; |
104 |
} |
} |
105 |
|
|
106 |
TTree *PhysicsTr = (TTree*)file->Get("Physics"); |
TTree *PhysicsTr = (TTree*)file->Get("Physics"); |
107 |
TBranch *headBr = PhysicsTr->GetBranch("Header"); |
TBranch *headBr = PhysicsTr->GetBranch("Header"); |
108 |
|
|
110 |
pamela::PscuHeader *ph = 0; |
pamela::PscuHeader *ph = 0; |
111 |
|
|
112 |
PhysicsTr->SetBranchAddress("Header", &eh); |
PhysicsTr->SetBranchAddress("Header", &eh); |
113 |
nevents = headBr->GetEntries(); |
nevents = PhysicsTr->GetEntries(); |
114 |
|
const Int_t size = nevents; |
115 |
|
|
116 |
TTree *RunHeadTr = (TTree*)file->Get("RunHeader"); ///run header tree |
TTree *RunHeadTr = (TTree*)file->Get("RunHeader"); ///run header tree |
117 |
pamela::EventHeader *eH=0; |
pamela::EventHeader *eH=0; |
121 |
RunHeadTr->SetBranchAddress("RunHeader",&reh); |
RunHeadTr->SetBranchAddress("RunHeader",&reh); |
122 |
runnevents = RunHeadTr->GetEntries(); |
runnevents = RunHeadTr->GetEntries(); |
123 |
|
|
|
|
|
124 |
TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString(); |
TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString(); |
125 |
filename = ((TObjString*)filename.Tokenize('.')->First())->GetString(); |
filename = ((TObjString*)filename.Tokenize('.')->First())->GetString(); |
126 |
|
|
128 |
if (nevents<=0) { |
if (nevents<=0) { |
129 |
printf("nevents = %i \n", nevents); |
printf("nevents = %i \n", nevents); |
130 |
printf(" \n"); |
printf(" \n"); |
|
|
|
131 |
TCanvas *canv = new TCanvas("No entries", "No entries ", 400, 200); |
TCanvas *canv = new TCanvas("No entries", "No entries ", 400, 200); |
132 |
canv->SetFillColor(10); |
canv->SetFillColor(10); |
133 |
canv->cd(); |
canv->cd(); |
|
|
|
134 |
TLatex *l = new TLatex(); |
TLatex *l = new TLatex(); |
135 |
l->SetTextAlign(12); |
l->SetTextAlign(12); |
136 |
l->SetTextSize(0.15); |
l->SetTextSize(0.15); |
141 |
noentries.str(""); |
noentries.str(""); |
142 |
noentries<< "No Physics entries for this files"; |
noentries<< "No Physics entries for this files"; |
143 |
l->DrawLatex(0.05, 0.5, noentries.str().c_str()); |
l->DrawLatex(0.05, 0.5, noentries.str().c_str()); |
|
|
|
144 |
if (outDir == "./") { |
if (outDir == "./") { |
145 |
oss.str(""); |
oss.str(""); |
146 |
oss << filename.Data() << "_HeaderScan_QL." << format.Data(); |
oss << filename.Data() << "_HeaderScan_QL." << format.Data(); |
147 |
} else { |
} else { |
148 |
oss.str(""); |
oss.str(""); |
149 |
oss << outDir.Data() << filename.Data() << "_HeaderScan_QL." << format.Data(); |
oss << outDir.Data() << filename.Data() << "_HeaderScan_QL." << format.Data(); |
150 |
} |
} |
|
|
|
151 |
canv->Update(); |
canv->Update(); |
152 |
canv->SaveAs(oss.str().c_str()); |
canv->SaveAs(oss.str().c_str()); |
|
|
|
153 |
return; |
return; |
154 |
} |
} |
|
|
|
155 |
//-------------- to know the max and min OBT ----------------------------// |
//-------------- to know the max and min OBT ----------------------------// |
156 |
headBr->GetEntry(0); |
headBr->GetEntry(0); |
157 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
158 |
firstime = ph->GetOrbitalTime(); |
firstime = ph->GetOrbitalTime(); |
159 |
|
headBr->GetEntry(nevents); |
160 |
int iii =0; |
ph = eh->GetPscuHeader(); |
161 |
while(iii < nevents){ |
lastime = ph->GetOrbitalTime(); |
162 |
headBr->GetEntry(iii); |
int i =0; |
163 |
|
while(i < nevents){ |
164 |
|
headBr->GetEntry(i); |
165 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
166 |
if((ph->GetOrbitalTime()) <= firstime) firstime=ph->GetOrbitalTime(); |
if((ph->GetOrbitalTime()) <= firstime) firstime=ph->GetOrbitalTime(); |
167 |
if((ph->GetOrbitalTime()) >= lastime) lastime=ph->GetOrbitalTime(); |
if((ph->GetOrbitalTime()) >= lastime) lastime=ph->GetOrbitalTime(); |
168 |
iii++; |
i++; |
169 |
} |
} |
170 |
|
|
171 |
//------------------------ First histogram -----------------------------------// |
//------------------------ First histogram -----------------------------------// |
|
|
|
172 |
obmin=firstime; |
obmin=firstime; |
173 |
obmax=lastime; |
obmax=lastime; |
|
|
|
|
oss1.str(""); |
|
|
oss1 << filename.Data() <<": Physics Packet per minute. Start time = " << obmin << ", End time = "<< obmax <<" ms"; |
|
174 |
Int_t nbin = (lastime-firstime)/60000; |
Int_t nbin = (lastime-firstime)/60000; |
|
//TH1F *h1 = new TH1F ("histo1", oss1.str().c_str(), nbin, obmin, obmax); |
|
175 |
TH1F *h1 = new TH1F ("histo1", "" , nbin, obmin, obmax); |
TH1F *h1 = new TH1F ("histo1", "" , nbin, obmin, obmax); |
176 |
|
|
177 |
|
//------------------- fill vectors and histogram -----------------------------// |
178 |
|
Double_t *PscuCounter = new Double_t[size]; |
179 |
|
Double_t *PacketLenght = new Double_t[size]; |
180 |
|
Double_t *OBTime = new Double_t[size]; |
181 |
|
Double_t *Eventsperminute= new Double_t[nbin]; |
182 |
|
Double_t *Minute= new Double_t[nbin]; |
183 |
|
Int_t max=0; |
184 |
|
for (Int_t k = 0; k < nevents; k++){ |
185 |
|
headBr->GetEntry(k); |
186 |
|
ph = eh->GetPscuHeader(); |
187 |
|
h1->Fill(ph->GetOrbitalTime()); |
188 |
|
PscuCounter[k]= ph->GetCounter(); |
189 |
|
PacketLenght[k]=ph->GetPacketLenght(); |
190 |
|
OBTime[k]=ph->GetOrbitalTime(); |
191 |
|
} |
192 |
|
int l=0; |
193 |
|
while(l<nbin){ |
194 |
|
Eventsperminute[l]=h1->GetBinContent(l); |
195 |
|
Minute[l]=firstime+l*60000; |
196 |
|
if(h1->GetBinContent(l) >= max)max =(Int_t)h1->GetBinContent(l); |
197 |
|
l++; |
198 |
|
} |
199 |
|
|
200 |
|
//----------- Graph and MultiGraph -----------------------------------------------// |
201 |
|
TMultiGraph *rate = new TMultiGraph(); |
202 |
|
TMultiGraph *packetLength = new TMultiGraph(); |
203 |
|
TMultiGraph *packeCounter = new TMultiGraph(); |
204 |
|
|
205 |
|
oss1.str(""); |
206 |
|
oss1 << filename.Data() <<": Physics Packet per minute. Start time = " << obmin << ", End time = "<< obmax <<" ms"; |
207 |
|
TGraph *rate1= new TGraph(nbin, (const Double_t*)Minute, (const Double_t*)Eventsperminute); |
208 |
|
rate1->SetMarkerColor(kBlack); |
209 |
|
rate1->SetMarkerSize(.1); |
210 |
|
rate1->SetMarkerStyle(21); |
211 |
|
rate->Add(rate1); |
212 |
|
|
213 |
|
TGraph *packetLength1= new TGraph(nevents, (const Double_t*)OBTime, (const Double_t*)PacketLenght); |
214 |
oss2.str(""); |
oss2.str(""); |
215 |
oss2 << filename.Data() <<": Lenght of Physic packets"; |
oss2 << filename.Data() <<": Lenght of Physic packets"; |
216 |
Int_t nbin2 =(lastime-firstime); |
packetLength1->SetMarkerColor(2); |
217 |
//TH1F *packetLength = new TH1F ("packetLength", oss2.str().c_str(), nbin2, obmin, obmax); |
packetLength1->SetMarkerSize(.5); |
218 |
TH1F *packetLength = new TH1F ("packetLength", "", nbin2, obmin, obmax); |
packetLength1->SetMarkerStyle(21); |
219 |
|
packetLength->Add(packetLength1); |
220 |
|
|
221 |
|
TGraph *packeCounter1= new TGraph(nevents, (const Double_t*)OBTime, (const Double_t*)PscuCounter); |
222 |
oss3.str(""); |
oss3.str(""); |
223 |
oss3 << filename.Data() <<": Physics Counter vs. OBT"; |
oss3 << filename.Data() <<": Physics Counter vs. OBT"; |
224 |
// TH1F *packeCounter = new TH1F ("packeCounter", oss3.str().c_str(), nbin2, obmin, obmax); |
packeCounter1->SetMarkerColor(4); |
225 |
TH1F *packeCounter = new TH1F ("packeCounter", "", nbin2, obmin, obmax); |
packeCounter1->SetMarkerSize(.2); |
226 |
//---------------------------------------------------- |
packeCounter1->SetMarkerStyle(21); |
227 |
|
packeCounter->Add(packeCounter1); |
228 |
|
|
229 |
|
//------------ Create and Draw Canvas ---------------------// |
230 |
TCanvas *finalCanv = new TCanvas("Header", base, 1200, 1600); |
TCanvas *finalCanv = new TCanvas("Header", base, 1200, 1600); |
231 |
finalCanv->Divide(1,5); |
finalCanv->Divide(1,5); |
232 |
finalCanv->SetFillColor(10); |
finalCanv->SetFillColor(10); |
233 |
|
|
234 |
TPad *all2= new TPad ("","", 0, 0, 1, 1); |
TPad *all2= new TPad ("","", 0, 0, 1, 1); |
235 |
all2->SetFillColor(10); |
all2->SetFillColor(10); |
236 |
TPad *all3= new TPad ("","", 0, 0, 1, 1); |
TPad *all3= new TPad ("","", 0, 0, 1, 1); |
241 |
all->SetFillColor(10); |
all->SetFillColor(10); |
242 |
TPad *all1= new TPad ("","", 0, 0, 1, 1); |
TPad *all1= new TPad ("","", 0, 0, 1, 1); |
243 |
all1->SetFillColor(10); |
all1->SetFillColor(10); |
244 |
TPad *pad = new TPad("pad","pad", .80,.50,.90,.80); |
TPad *pad = new TPad("pad","pad", .80,.45,.90,.75); |
245 |
pad->SetFillColor(10); |
pad->SetFillColor(10); |
|
//---------------------------------------------------- |
|
|
|
|
|
TMultiGraph *mg1 = new TMultiGraph(); |
|
|
|
|
246 |
|
|
|
TMultiGraph *mg2 = new TMultiGraph(); |
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------- |
|
|
for (Int_t l = 0; l < nevents; l++){ |
|
|
headBr->GetEntry(l); |
|
|
ph = eh->GetPscuHeader(); |
|
|
h1->Fill(ph->GetOrbitalTime()); |
|
|
packetLength->Fill(ph->GetOrbitalTime(),ph->GetPacketLenght()); |
|
|
packeCounter->Fill(ph->GetOrbitalTime(),ph->GetCounter()); |
|
|
} |
|
|
|
|
|
//------------ First Canvas ---------------------// |
|
247 |
TLine li; |
TLine li; |
248 |
li.SetLineStyle(4); |
li.SetLineStyle(4); |
249 |
li.SetLineWidth(2); |
li.SetLineWidth(2); |
250 |
|
|
251 |
|
//----------- First PAD -------------------------------// |
252 |
finalCanv->cd(1); |
finalCanv->cd(1); |
253 |
all2->Draw(); |
all2->Draw(); |
254 |
all2->cd(); |
all2->cd(); |
255 |
|
rate->Draw("ALP"); |
256 |
h1->SetStats(kFALSE); |
rate->GetXaxis()->SetTitle("OBT (ms)"); |
257 |
h1->GetXaxis()->SetTitle("OBT (ms)"); |
rate->GetXaxis()->SetTitleSize(0.05); |
258 |
h1->GetXaxis()->CenterTitle(); |
rate->GetXaxis()->CenterTitle(); |
259 |
h1->GetXaxis()->SetLabelSize(0.04); |
rate->GetXaxis()->SetLabelSize(0.05); |
260 |
h1->GetYaxis()->SetTitle("Number of events "); |
rate->GetYaxis()->SetTitle("Number of events "); |
261 |
h1->GetYaxis()->CenterTitle(); |
rate->GetYaxis()->CenterTitle(); |
262 |
h1->GetYaxis()->SetLabelSize(0.06); |
rate->GetYaxis()->SetLabelSize(0.05); |
263 |
h1->GetYaxis()->SetTitleSize(0.06); |
rate->GetYaxis()->SetTitleSize(0.06); |
264 |
h1->GetYaxis()->SetTitleOffset(0.6); |
rate->GetYaxis()->SetTitleOffset(0.6); |
|
h1->Draw(); |
|
265 |
for (Int_t l = 0; l < runnevents; l++){ |
for (Int_t l = 0; l < runnevents; l++){ |
266 |
RunHeadTr->GetEntry(l); |
RunHeadTr->GetEntry(l); |
267 |
ph = eH->GetPscuHeader(); |
ph = eH->GetPscuHeader(); |
270 |
Int_t obt = ph->GetOrbitalTime(); |
Int_t obt = ph->GetOrbitalTime(); |
271 |
if (ws==1){ |
if (ws==1){ |
272 |
li.SetLineColor(3); |
li.SetLineColor(3); |
273 |
li.DrawLine(obt,0,obt,h1->GetMaximum()); |
li.DrawLine(obt,0,obt,max); |
274 |
} |
} |
275 |
else if (ws==2){ |
else if (ws==2){ |
276 |
li.SetLineColor(4); |
li.SetLineColor(4); |
277 |
li.DrawLine(obt,0,obt,h1->GetMaximum()); |
li.DrawLine(obt,0,obt,max); |
278 |
} |
} |
279 |
} |
} |
280 |
|
|
281 |
finalCanv->cd(1); |
finalCanv->cd(1); |
282 |
stringstream ws1, ws2; |
stringstream ws1, ws2; |
283 |
ws1.str(""); |
ws1.str(""); |
298 |
pt1->SetFillColor(10); |
pt1->SetFillColor(10); |
299 |
pt1->SetBorderSize(0); |
pt1->SetBorderSize(0); |
300 |
pt1->Draw(); |
pt1->Draw(); |
|
// TPaveText *pt1=0; |
|
301 |
pt1 = new TPaveText (.05,.91,.6,1); |
pt1 = new TPaveText (.05,.91,.6,1); |
302 |
pt1->AddText(oss1.str().c_str()); |
pt1->AddText(oss1.str().c_str()); |
303 |
pt1->SetTextColor(1); |
pt1->SetTextColor(1); |
305 |
pt1->SetBorderSize(0); |
pt1->SetBorderSize(0); |
306 |
pt1->Draw(); |
pt1->Draw(); |
307 |
|
|
308 |
|
//----------- Second PAD -------------------------------// |
309 |
finalCanv->cd(2); |
finalCanv->cd(2); |
310 |
all3->Draw(); |
all3->Draw(); |
311 |
all3->cd(); |
all3->cd(); |
312 |
packetLength->SetStats(kFALSE); |
packetLength->Draw("AP"); |
|
packetLength->SetMarkerColor(2); |
|
|
packetLength->SetMarkerSize(.5); |
|
|
packetLength->SetMarkerStyle(21); |
|
313 |
packetLength->GetXaxis()->SetTitle("OBT (ms)"); |
packetLength->GetXaxis()->SetTitle("OBT (ms)"); |
314 |
|
packetLength->GetXaxis()->SetTitleSize(0.05); |
315 |
packetLength->GetXaxis()->CenterTitle(); |
packetLength->GetXaxis()->CenterTitle(); |
316 |
packetLength->GetXaxis()->SetLabelSize(0.05); |
packetLength->GetXaxis()->SetLabelSize(0.05); |
317 |
packetLength->GetYaxis()->SetTitle("Lenght (byte)"); |
packetLength->GetYaxis()->SetTitle("Lenght (byte)"); |
319 |
packetLength->GetYaxis()->SetLabelSize(0.05); |
packetLength->GetYaxis()->SetLabelSize(0.05); |
320 |
packetLength->GetYaxis()->SetTitleSize(0.06); |
packetLength->GetYaxis()->SetTitleSize(0.06); |
321 |
packetLength->GetYaxis()->SetTitleOffset(0.6); |
packetLength->GetYaxis()->SetTitleOffset(0.6); |
322 |
packetLength->Draw("9p"); |
|
323 |
|
|
324 |
finalCanv->cd(2); |
finalCanv->cd(2); |
|
//TPaveText *pt=0; |
|
325 |
pt = new TPaveText (.6,.91,.90,1); |
pt = new TPaveText (.6,.91,.90,1); |
326 |
pt->AddText(oss2.str().c_str()); |
pt->AddText(oss2.str().c_str()); |
327 |
pt->SetTextColor(2); |
pt->SetTextColor(2); |
329 |
pt->SetBorderSize(0); |
pt->SetBorderSize(0); |
330 |
pt->Draw(); |
pt->Draw(); |
331 |
|
|
332 |
|
//----------- Third PAD -------------------------------// |
333 |
finalCanv->cd(3); |
finalCanv->cd(3); |
334 |
all4->Draw(); |
all4->Draw(); |
335 |
all4->cd(); |
all4->cd(); |
336 |
packeCounter->GetTitle(); |
packeCounter->Draw("AP"); |
|
packeCounter->SetStats(kFALSE); |
|
|
packeCounter->SetMarkerColor(4); |
|
|
packeCounter->SetMarkerSize(.2); |
|
|
packeCounter->SetMarkerStyle(21); |
|
337 |
packeCounter->GetXaxis()->SetTitle("OBT (ms)"); |
packeCounter->GetXaxis()->SetTitle("OBT (ms)"); |
338 |
packeCounter->GetXaxis()->SetTitleSize(0.05); |
packeCounter->GetXaxis()->SetTitleSize(0.05); |
339 |
packeCounter->GetXaxis()->CenterTitle(); |
packeCounter->GetXaxis()->CenterTitle(); |
344 |
packeCounter->GetYaxis()->SetLabelSize(0.05); |
packeCounter->GetYaxis()->SetLabelSize(0.05); |
345 |
packeCounter->GetYaxis()->SetTitleSize(0.06); |
packeCounter->GetYaxis()->SetTitleSize(0.06); |
346 |
packeCounter->GetYaxis()->SetTitleOffset(0.6); |
packeCounter->GetYaxis()->SetTitleOffset(0.6); |
347 |
Double_t min = 500000000.; |
|
348 |
for (Int_t l = 0; l < nevents; l++){ |
|
|
if((packeCounter->GetBinContent(l))<= min && (packeCounter->GetBinContent(l))!= 0) min = packeCounter->GetBinContent(l); |
|
|
} |
|
|
packeCounter->SetMinimum(min); |
|
|
packeCounter->Draw("9p"); |
|
349 |
finalCanv->cd(3); |
finalCanv->cd(3); |
350 |
TPaveText *pt2=0; |
TPaveText *pt2=0; |
351 |
pt2 = new TPaveText (.6,.91,.90,1); |
pt2 = new TPaveText (.6,.91,.90,1); |
353 |
pt2->SetTextColor(4); |
pt2->SetTextColor(4); |
354 |
pt2->SetFillColor(10); |
pt2->SetFillColor(10); |
355 |
pt2->SetBorderSize(0); |
pt2->SetBorderSize(0); |
356 |
pt2->Draw(); |
pt2->Draw(); |
357 |
|
|
358 |
|
/**********************************************************************************************/ |
359 |
//------------------------------------------------- |
|
360 |
|
TMultiGraph *mg1 = new TMultiGraph(); |
361 |
|
TMultiGraph *mg2 = new TMultiGraph(); |
362 |
|
//---------------------- fill vectors and histogram --------------------------------------------------// |
363 |
TList *list = new TList; |
TList *list = new TList; |
364 |
Int_t numkey; |
Int_t numkey; |
365 |
TObject *key = new TObject; |
TObject *key = new TObject; |
368 |
Long64_t nevntskey=0; |
Long64_t nevntskey=0; |
369 |
list = file->GetListOfKeys(); |
list = file->GetListOfKeys(); |
370 |
numkey = file->GetNkeys(); |
numkey = file->GetNkeys(); |
371 |
int ll=0; |
Double_t salto; |
372 |
int kk=0; |
for (Int_t m=0; m<numkey; m++){ |
373 |
|
key = list->At(m); |
|
for (Int_t i=0; i<numkey; i++){ |
|
|
key = list->At(i); |
|
374 |
name=(char *)(key->GetName()); |
name=(char *)(key->GetName()); |
375 |
tr = (TTree*)file->Get(name); |
tr = (TTree*)file->Get(name); |
376 |
if (tr->IsZombie()) continue; |
if (tr->IsZombie()) continue; |
383 |
Double_t *PscuCounter1 = new Double_t[size1]; |
Double_t *PscuCounter1 = new Double_t[size1]; |
384 |
Double_t *FileOffset1 = new Double_t[size1]; |
Double_t *FileOffset1 = new Double_t[size1]; |
385 |
Double_t *tempo1 = new Double_t[size1]; |
Double_t *tempo1 = new Double_t[size1]; |
386 |
//Double_t *salto= new Double_t[100]; |
|
387 |
//Double_t *salto1= new Double_t[100]; |
int n=0; |
388 |
|
while(n<nevntskey){ |
389 |
int l=0; |
Br->GetEntry(n); |
|
while(l<nevntskey){ |
|
|
Br->GetEntry(l); |
|
390 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
391 |
PscuCounter1[l]= ph->GetCounter(); |
PscuCounter1[n]= ph->GetCounter(); |
392 |
FileOffset1[l]=ph->GetFileOffset(); |
FileOffset1[n]=ph->GetFileOffset(); |
393 |
tempo1[l]=ph->GetOrbitalTime(); |
tempo1[n]=ph->GetOrbitalTime(); |
394 |
|
if((m==0) && (n==0)){ |
395 |
|
primotempo=ph->GetOrbitalTime(); |
396 |
|
salto=ph->GetOrbitalTime(); |
397 |
|
} |
398 |
|
if(salto > ph->GetOrbitalTime())salto=ph->GetOrbitalTime(); |
399 |
if(ph->GetFileOffset()<= primoffset){ |
if(ph->GetFileOffset()<= primoffset){ |
400 |
primoffset =ph->GetFileOffset(); |
primoffset=ph->GetFileOffset(); |
401 |
primotempo=ph->GetOrbitalTime(); |
primotempo=ph->GetOrbitalTime(); |
402 |
} |
} |
403 |
if(ph->GetFileOffset()>= ultimoffset){ |
if(ph->GetFileOffset()>=ultimoffset){ |
404 |
ultimoffset = ph->GetFileOffset(); |
ultimotempo=ph->GetOrbitalTime(); |
405 |
ultimotempo = ph->GetOrbitalTime(); |
ultimoffset=ph->GetFileOffset(); |
406 |
} |
} |
407 |
/*if(l>0){ |
n++; |
|
if(tempo1[l] < tempo1[l-1]){ |
|
|
salto1[kk] =(const Double_t*)tempo1[l-1]; |
|
|
salto[ll]= ph->GetOrbitalTime(); |
|
|
ll=ll+1; |
|
|
kk=kk+1; |
|
|
} |
|
|
}*/ |
|
|
l++; |
|
408 |
} |
} |
|
|
|
409 |
TGraph *graph3= new TGraph(nevntskey, (const Double_t*)FileOffset1, (const Double_t*)PscuCounter1); |
TGraph *graph3= new TGraph(nevntskey, (const Double_t*)FileOffset1, (const Double_t*)PscuCounter1); |
410 |
graph3->SetMarkerColor(3); |
graph3->SetMarkerColor(3); |
411 |
graph3->SetMarkerSize(.2); |
graph3->SetMarkerSize(.2); |
419 |
mg2->Add(graph4); |
mg2->Add(graph4); |
420 |
} |
} |
421 |
} |
} |
|
|
|
|
kk=kk-1; |
|
|
ll=ll-1; |
|
422 |
|
|
423 |
TLatex *lat = new TLatex(); |
TLatex *lat = new TLatex(); |
424 |
lat->SetTextAlign(12); |
lat->SetTextAlign(12); |
425 |
lat->SetTextSize(0.15); |
lat->SetTextSize(0.15); |
426 |
lat->SetTextColor(kBlue); |
lat->SetTextColor(kBlue); |
427 |
//------------ Second Canvas ---------------------// |
|
428 |
|
//------------ Fourth PAD ---------------------// |
429 |
finalCanv->cd(4); |
finalCanv->cd(4); |
430 |
all1->Draw(); |
all1->Draw(); |
431 |
all1->cd(); |
all1->cd(); |
432 |
|
|
433 |
oss1.str(""); |
oss1.str(""); |
434 |
oss1 << filename.Data() <<": PscuCounter vs FileOffset."; |
oss1 << filename.Data() <<": PscuCounter vs FileOffset."; |
|
//mg1->SetTitle(oss1.str().c_str()); |
|
435 |
mg1->Draw("AP"); |
mg1->Draw("AP"); |
436 |
mg1->GetXaxis()->SetTitle("File Offset"); |
mg1->GetXaxis()->SetTitle("File Offset"); |
437 |
mg1->GetXaxis()->CenterTitle(); |
mg1->GetXaxis()->CenterTitle(); |
438 |
mg1->GetXaxis()->SetTitleSize(0.045); |
mg1->GetXaxis()->SetTitleOffset(0.8); |
439 |
|
mg1->GetXaxis()->SetTitleSize(0.05); |
440 |
mg1->GetXaxis()->SetLabelSize(0.05); |
mg1->GetXaxis()->SetLabelSize(0.05); |
441 |
mg1->GetYaxis()->SetTitle("Counter"); |
mg1->GetYaxis()->SetTitle("Counter"); |
442 |
mg1->GetYaxis()->CenterTitle(); |
mg1->GetYaxis()->CenterTitle(); |
443 |
mg1->GetYaxis()->SetTitleSize(0.05); |
mg1->GetYaxis()->SetTitleSize(0.06); |
444 |
mg1->GetYaxis()->SetLabelSize(0.06); |
mg1->GetYaxis()->SetLabelSize(0.06); |
445 |
mg1->GetYaxis()->SetTitleOffset(0.7); |
mg1->GetYaxis()->SetTitleOffset(0.6); |
446 |
finalCanv->cd(4); |
finalCanv->cd(4); |
447 |
TPaveText *pt3=0; |
TPaveText *pt3=0; |
448 |
pt3 = new TPaveText (.60,.91,.90,1); |
pt3 = new TPaveText (.60,.91,.90,1); |
452 |
pt3->SetBorderSize(0); |
pt3->SetBorderSize(0); |
453 |
pt3->Draw(); |
pt3->Draw(); |
454 |
|
|
455 |
|
//------------ Fifth PAD ---------------------// |
456 |
finalCanv->cd(5); |
finalCanv->cd(5); |
457 |
all->Draw(); |
all->Draw(); |
458 |
all->cd(); |
all->cd(); |
459 |
|
|
460 |
oss3.str(""); |
oss3.str(""); |
461 |
oss3 << filename.Data() <<" OBT vs FileOffset. First packet = "<<primotempo <<" ms, Last packet = "<<ultimotempo<<" ms."; |
oss3 << filename.Data() <<" OBT vs FileOffset. First packet at "<<primotempo <<" ms, last packet at "<<ultimotempo<<" ms."; |
|
//mg2->SetTitle(oss3.str().c_str()); |
|
462 |
mg2->Draw("AP"); |
mg2->Draw("AP"); |
463 |
mg2->GetXaxis()->SetTitle("File Offset"); |
mg2->GetXaxis()->SetTitle("File Offset"); |
464 |
mg2->GetXaxis()->CenterTitle(); |
mg2->GetXaxis()->CenterTitle(); |
465 |
mg2->GetXaxis()->SetTitleSize(0.045); |
mg2->GetXaxis()->SetTitleSize(0.05); |
466 |
mg2->GetXaxis()->SetLabelSize(0.05); |
mg2->GetXaxis()->SetLabelSize(0.05); |
467 |
mg2->GetYaxis()->SetTitle("OBT"); |
mg2->GetYaxis()->SetTitle("OBT"); |
468 |
mg2->GetYaxis()->CenterTitle(); |
mg2->GetYaxis()->CenterTitle(); |
469 |
mg2->GetYaxis()->SetTitleSize(0.05); |
mg2->GetYaxis()->SetTitleSize(0.06); |
470 |
mg2->GetYaxis()->SetLabelSize(0.055); |
mg2->GetYaxis()->SetLabelSize(0.05); |
471 |
mg2->GetYaxis()->SetTitleOffset(0.6); |
mg2->GetYaxis()->SetTitleOffset(0.6); |
|
/*pad->Draw(); |
|
|
pad->cd(); |
|
|
stringa.str(""); |
|
|
stringa << "new data from "<< primotempo;//<<" to "<< salto1; |
|
|
lat->DrawLatex(0.08, 0.8, stringa.str().c_str()); |
|
|
double min2 = 0.8; |
|
|
if(ll > 0){ |
|
472 |
pad->Draw(); |
pad->Draw(); |
473 |
pad->cd(); |
pad->cd(); |
474 |
for(Int_t k=0; k <(kk); k++){ |
stringa.str(""); |
475 |
stringa.str(""); |
stringa << "jump at: "<<salto<<" ms \n"; |
476 |
stringa << "old data from "<< salto[kk]<< " to "<<salto1[kk+1]; |
if(salto != primotempo) lat->DrawLatex(0.08, 0.8,stringa.str().c_str()); |
|
min2=min2-0.1; |
|
|
lat->DrawLatex(0.08, min2,stringa.str().c_str()); |
|
|
//cout<<salto[kk]<<";\n"; |
|
|
} |
|
|
}*/ |
|
477 |
|
|
478 |
finalCanv->cd(5); |
finalCanv->cd(5); |
479 |
TPaveText *pt4=0; |
TPaveText *pt4=0; |
484 |
pt4->SetBorderSize(0); |
pt4->SetBorderSize(0); |
485 |
pt4->Draw(); |
pt4->Draw(); |
486 |
|
|
|
// finalCanv->Draw(); |
|
487 |
finalCanv->Update(); |
finalCanv->Update(); |
488 |
|
|
489 |
oss1.str(""); |
oss1.str(""); |
492 |
|
|
493 |
finalCanv->SaveAs(oss1.str().c_str()); |
finalCanv->SaveAs(oss1.str().c_str()); |
494 |
|
|
|
|
|
|
|
|
495 |
file->Close(); |
file->Close(); |
496 |
|
|
497 |
} |
} |