43 |
* There is no default value, without this input the program will not run |
* There is no default value, without this input the program will not run |
44 |
* TString outDir - the path where to save the output image (Default = ./) |
* TString outDir - the path where to save the output image (Default = ./) |
45 |
* TString format - the format which will be used fo rsave the produced images (Default = "jpg") |
* TString format - the format which will be used fo rsave the produced images (Default = "jpg") |
46 |
|
* |
47 |
|
* |
48 |
|
* Version 1.7 |
49 |
|
* Date 16 June 2006 - Malvezzi |
50 |
|
* |
51 |
|
* Description of changes: |
52 |
|
* Implementation of case: numebr of events are <= 0. |
53 |
|
* Remove of the graph "grPcktId1"; see PacketScan for the same information. |
54 |
|
* Fixed bugs: for a large namber of events is not possible to have vectors, so all graphs have been converted in histograms |
55 |
|
* |
56 |
*/ |
*/ |
57 |
|
|
58 |
|
|
59 |
|
#include <fstream> |
60 |
|
#include <math.h> |
61 |
|
#include "TLatex.h" |
62 |
|
#include "TF1.h" |
63 |
|
#include "TPaveText.h" |
64 |
|
#include "TMultiGraph.h" |
65 |
#include <sstream> |
#include <sstream> |
66 |
#include <iostream> |
#include <iostream> |
67 |
#include "TString.h" |
#include "TString.h" |
77 |
#include "EventHeader.h" |
#include "EventHeader.h" |
78 |
#include "PscuHeader.h" |
#include "PscuHeader.h" |
79 |
|
|
|
|
|
80 |
using namespace std; |
using namespace std; |
81 |
|
|
82 |
void HeaderScan(TString base, TString outDir, TString format) |
void HeaderScan(TString base, TString outDir, TString format) |
83 |
{ |
{ |
84 |
|
|
85 |
|
//------------------- Variables initilization -------------------------// |
86 |
|
|
87 |
TList *list = new TList; |
TList *list = new TList; |
88 |
Int_t numkey; |
Int_t numkey; |
89 |
TObject *key = new TObject; |
TObject *key = new TObject; |
90 |
const char *name; |
const char *name; |
91 |
TTree* tr = new TTree; |
//TTree* tr = new TTree; |
92 |
Long64_t totevents=0, totphysevents=0; |
//TTree* tr1 = new TTree; |
93 |
Float_t id; |
Long64_t nevents=0; // ev=0, events=0; |
94 |
Long64_t nevents=0; |
ULong_t lastime, firstime; |
95 |
|
double obmin=0.; |
96 |
|
double obmax=0.; |
97 |
|
double obt; |
98 |
|
ULong_t maxoffset, minoffset; |
99 |
|
Float_t pcktLenght =0., pcktCounter=0., offset=0., allCounter=0.; |
100 |
|
stringstream oss, oss1, oss2, oss3, noentries; |
101 |
//------- load root file -------------- |
//------- load root file -------------- |
|
|
|
102 |
TFile *file = new TFile(base.Data()); |
TFile *file = new TFile(base.Data()); |
|
|
|
103 |
if (!file){ |
if (!file){ |
104 |
printf("No such file in the directory has been found"); |
printf("No such file in the directory has been found"); |
105 |
return; |
return; |
106 |
} |
} |
107 |
if (outDir == "" ) outDir = "."; |
if (outDir == "" ) outDir = "."; |
108 |
|
list = file->GetListOfKeys(); //get list of trees in the file |
109 |
|
numkey = file->GetNkeys(); //get number of trees in the file |
110 |
|
|
111 |
list = file->GetListOfKeys(); |
TTree *PhysicsTr = (TTree*)file->Get("Physics"); |
112 |
|
TBranch *headBr = PhysicsTr->GetBranch("Header"); |
113 |
numkey = file->GetNkeys(); |
|
114 |
|
pamela::EventHeader *eh = 0; |
115 |
pamela::EventHeader *eh=0; |
pamela::PscuHeader *ph = 0; |
116 |
pamela::PscuHeader *ph=0; |
|
117 |
|
PhysicsTr->SetBranchAddress("Header", &eh); |
118 |
///-----to know the total number f events end of physics events----////// |
|
119 |
|
nevents = headBr->GetEntries(); |
120 |
|
const Int_t sizetot = nevents; |
121 |
|
|
122 |
|
TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString(); |
123 |
|
filename = ((TObjString*)filename.Tokenize('.')->First())->GetString(); |
124 |
|
|
125 |
|
//----------- If nevents < = 0 ---------------------------------/ |
126 |
|
if (nevents<=0) { |
127 |
|
printf("nevents = %i \n", nevents); |
128 |
|
printf(" \n"); |
129 |
|
|
130 |
|
TCanvas *canv = new TCanvas("No entries", "No entries ", 400, 200); |
131 |
|
canv->SetFillColor(10); |
132 |
|
canv->cd(); |
133 |
|
|
134 |
|
TLatex *l = new TLatex(); |
135 |
|
l->SetTextAlign(12); |
136 |
|
l->SetTextSize(0.15); |
137 |
|
l->SetTextColor(2); |
138 |
|
noentries.str(""); |
139 |
|
noentries<< "HeaderScan_QL:"; |
140 |
|
l->DrawLatex(0.05, 0.7, noentries.str().c_str()); |
141 |
|
noentries.str(""); |
142 |
|
noentries<< "No Physics entries for this files"; |
143 |
|
l->DrawLatex(0.05, 0.5, noentries.str().c_str()); |
144 |
|
|
145 |
|
if (outDir == "./") { |
146 |
|
oss.str(""); |
147 |
|
oss << filename.Data() << "_HeaderScan_QL." << format.Data(); |
148 |
|
} else { |
149 |
|
oss.str(""); |
150 |
|
oss << outDir.Data() << filename.Data() << "_HeaderScan_QL." << format.Data(); |
151 |
|
} |
152 |
|
|
153 |
for (Int_t i=0; i<numkey; i++){ |
canv->Update(); |
154 |
|
canv->SaveAs(oss.str().c_str()); |
155 |
|
|
156 |
|
return; |
157 |
|
} |
158 |
|
|
159 |
|
|
160 |
|
///-------------- to know the max and min File Offset ----------------------------// |
161 |
|
/*for (Int_t i=0; i<numkey; i++){ |
162 |
key = list->At(i); |
key = list->At(i); |
163 |
name=(key->GetName()); |
name=(key->GetName()); |
|
//cout<<name<<"\n"; |
|
164 |
tr = (TTree*)file->Get(name); |
tr = (TTree*)file->Get(name); |
165 |
if (tr->IsZombie()) continue; |
if (tr->IsZombie()) continue; |
166 |
nevents = tr->GetEntries(); |
events = tr->GetEntries(); |
|
totevents+=nevents; |
|
167 |
tr->SetBranchAddress("Header", &eh); |
tr->SetBranchAddress("Header", &eh); |
168 |
for (Int_t j = 0; j < nevents; j++){ |
for (Int_t j = 0; j < events; j++){ |
169 |
tr->GetEntry(j); |
tr->GetEntry(j); |
170 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
171 |
if(ph->GetPacketId1() == 0x10) ++totphysevents; |
ph->GetFileOffset(); |
172 |
} |
if(ph->GetFileOffset() <= minoffset) minoffset=ph->GetFileOffset(); |
173 |
|
if(ph->GetFileOffset() >= maxoffset) maxoffset=ph->GetFileOffset(); |
174 |
|
} |
175 |
|
}*/ |
176 |
|
//*************************** Histograms ************************************************************// |
177 |
|
//------------------------ First histogram -----------------------------------// |
178 |
|
headBr->GetEntry(0); |
179 |
|
ph = eh->GetPscuHeader(); |
180 |
|
firstime = ph->GetOrbitalTime(); |
181 |
|
headBr->GetEntry(nevents-1); |
182 |
|
ph = eh->GetPscuHeader(); |
183 |
|
lastime = ph->GetOrbitalTime(); |
184 |
|
obmin=firstime; |
185 |
|
obmax=lastime; |
186 |
|
oss1.str(""); |
187 |
|
oss1 << filename.Data() << ": Physics Packet per minute;" <<" start @ " << firstime << ", end @ "<< lastime <<"ms"; |
188 |
|
Int_t nbin = (lastime-firstime)/60000; |
189 |
|
TH1F *h1 = new TH1F ("histo1", oss1.str().c_str(), nbin, obmin, obmax); |
190 |
|
|
191 |
|
//------------------------ Second histogram -----------------------------------// |
192 |
|
oss2.str(""); |
193 |
|
oss2 << filename.Data() << ": Lenght of Physic packets;"; |
194 |
|
Int_t nint = (lastime-firstime); |
195 |
|
TH1F *PcktLenght = new TH1F ("histo2", oss2.str().c_str(), nint, obmin, obmax); |
196 |
|
|
197 |
|
//------------------------ Third histogram -----------------------------------// |
198 |
|
oss3.str(""); |
199 |
|
oss3 << filename.Data() << ": Physics Counter"; |
200 |
|
TH1F *PcktCounter = new TH1F ("histo3", oss3.str().c_str(), nint, obmin, obmax); |
201 |
|
|
202 |
|
//------------------------ Fourth histogram -----------------------------------// |
203 |
|
/*oss3.str(""); |
204 |
|
oss3 << filename.Data() << ": Packet Counter"; |
205 |
|
Int_t nintoffset = (maxoffset-minoffset)/10; |
206 |
|
TH1F *FileOffset = new TH1F ("histo4", oss3.str().c_str(), nintoffset, minoffset, maxoffset); |
207 |
|
*/ |
208 |
|
//**************************************************************************************************// |
209 |
|
//------- fill histograms ---------// |
210 |
|
|
211 |
|
for (Int_t i = 0; i < nevents; i++){ |
212 |
|
headBr->GetEntry(i); |
213 |
|
ph = eh->GetPscuHeader(); |
214 |
|
obt = ph->GetOrbitalTime(); |
215 |
|
pcktLenght=ph->GetPacketLenght(); |
216 |
|
pcktCounter=ph->GetCounter(); |
217 |
|
h1->Fill(obt); |
218 |
|
PcktLenght->Fill(obt,pcktLenght); |
219 |
|
PcktCounter->Fill(obt,pcktCounter); |
220 |
} |
} |
221 |
|
|
222 |
const Long64_t totalevents=totevents; |
/*for (Int_t i=0; i<numkey; i++){ |
|
const Long64_t totalphysevents=totphysevents; |
|
|
|
|
|
///////////////////////////////////////////////// |
|
|
|
|
|
TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString(); |
|
|
filename = ((TObjString*)filename.Tokenize('.')->First())->GetString(); |
|
|
stringstream oss; |
|
|
oss.str(""); |
|
|
oss << filename.Data(); |
|
|
|
|
|
Float_t obt[totalevents], pcktId[totalevents], pcktLenght[totalphysevents], pcktCounter[totalphysevents], offset[totalevents], allCounter[totalevents]; |
|
|
Float_t obtphysevents=0; |
|
|
|
|
|
|
|
|
totphysevents=0; |
|
|
totevents=0; |
|
|
for (Int_t i=0; i<numkey; i++){ |
|
223 |
key = list->At(i); |
key = list->At(i); |
224 |
name=(char *)(key->GetName()); |
name=(char *)(key->GetName()); |
225 |
tr = (TTree*)file->Get(name); |
tr1 = (TTree*)file->Get(name); |
226 |
if (tr->IsZombie()) continue; |
if (tr1->IsZombie()) continue; |
227 |
tr->SetBranchAddress("Header", &eh); |
tr1->SetBranchAddress("Header", &eh); |
228 |
nevents = tr->GetEntries(); |
ev = tr1->GetEntries(); |
229 |
for (Int_t j = 0; j < nevents; j++){ |
for (Int_t j = 0; j < ev; j++){ |
230 |
tr->GetEntry(j); |
tr1->GetEntry(j); |
231 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
232 |
obt[j+totevents]=ph->GetOrbitalTime() ; |
offset=ph->GetFileOffset(); |
233 |
pcktId[j+totevents]=ph->GetPacketId1(); |
allCounter= ph->GetCounter(); |
234 |
offset[j+totevents]=ph->GetFileOffset(); |
FileOffset->Fill(offset,allCounter); |
|
if(pcktId[j+totevents]==16){ |
|
|
pcktLenght[totphysevents]=ph->GetPacketLenght(); |
|
|
pcktCounter[totphysevents]=ph->GetCounter(); |
|
|
totphysevents=totphysevents+1; |
|
|
} |
|
|
offset[j+totevents]=ph->GetFileOffset(); |
|
|
allCounter[j+totevents]= ph->GetCounter(); |
|
235 |
} |
} |
236 |
totevents=totevents+nevents; |
}*/ |
237 |
} |
|
238 |
|
//****************************** Canvases *******************************// |
239 |
|
//TGaxis::SetMaxDigits(4); |
240 |
Float_t mintime=obt[0], maxtime=obt[0], minlen=pcktLenght[0], maxlen=pcktLenght[0], mincount=pcktCounter[0], maxcount=pcktCounter[0]; |
//------------------- First Canvas --------------------------------// |
|
|
|
|
|
|
|
for (Int_t t=0; t<totalevents; t++){ |
|
|
if(obt[t]<mintime) mintime=obt[t]; |
|
|
if(obt[t]>maxtime) maxtime=obt[t]; |
|
|
} |
|
|
for (Int_t t=0; t<totalphysevents; t++){ |
|
|
if(pcktLenght[t]<=minlen) minlen=pcktLenght[t]; |
|
|
if(pcktLenght[t]>=maxlen) maxlen=pcktLenght[t]; |
|
|
if(pcktCounter[t]<=mincount) mincount=pcktCounter[t]; |
|
|
if(pcktCounter[t]>=maxcount) maxcount=pcktCounter[t]; |
|
|
} |
|
|
|
|
|
|
|
|
Float_t nbintime = (maxtime-mintime)/1000; |
|
|
Float_t nbinlen = (maxlen-minlen)/100; |
|
|
Float_t nbincount = (maxcount-mincount)/100; |
|
|
|
|
|
|
|
|
///---------------------------TO GRAPH---------------------------------------------/// |
|
241 |
TCanvas *finalCanv1 = new TCanvas("Header_1", base, 1280, 1024); |
TCanvas *finalCanv1 = new TCanvas("Header_1", base, 1280, 1024); |
242 |
TCanvas *finalCanv2 = new TCanvas("Header_2", base, 1280, 1024); |
finalCanv1->Divide(1,3); |
|
finalCanv1->Divide(3); |
|
243 |
finalCanv1->SetFillColor(10); |
finalCanv1->SetFillColor(10); |
|
finalCanv2->Divide(2); |
|
|
finalCanv2->SetFillColor(10); |
|
|
|
|
|
|
|
|
TGraph *grPcktId1 = new TGraph(totalevents, obt, pcktId); |
|
|
TGraph *grPcktLenght = new TGraph(totalevents, obt, pcktLenght); |
|
|
TGraph *grPcktCounter = new TGraph(totalevents, obt, pcktCounter); |
|
|
TGraph *grFileOffset = new TGraph(totalevents, offset, allCounter); |
|
|
|
|
|
TGaxis::SetMaxDigits(3); |
|
244 |
|
|
|
//-----canvas 1-------------------------------/// |
|
245 |
finalCanv1->cd(1); |
finalCanv1->cd(1); |
246 |
|
h1->SetStats(kFALSE); |
247 |
stringstream oss1; |
h1->GetXaxis()->SetTitle("OBT (ms)"); |
|
oss1.str(""); |
|
|
oss1 << "OBT (ms) with t0 = " << mintime << "ms"; |
|
|
|
|
|
gStyle->SetTitleH(0.06); |
|
|
grPcktId1->SetTitle(oss.str().c_str()); |
|
|
grPcktId1->GetXaxis()->SetTitle(oss1.str().c_str()); |
|
|
grPcktId1->GetXaxis()->CenterTitle(); |
|
|
grPcktId1->GetXaxis()->SetLabelSize(0.03); |
|
|
grPcktId1->GetYaxis()->SetTitle("Packet ID"); |
|
|
grPcktId1->GetYaxis()->CenterTitle(); |
|
|
grPcktId1->SetMarkerSize(4); |
|
|
grPcktId1->Draw("AP"); |
|
|
|
|
|
|
|
|
finalCanv1->cd(2); |
|
|
oss1.str(""); |
|
|
oss1 << "OBT (min) with t0 = " << mintime << "ms"; |
|
|
|
|
|
TH1F *h1 = new TH1F ("h1", oss.str().c_str(), (int)(nbintime/60), mintime, maxtime); |
|
|
|
|
|
for (Int_t i=0; i<numkey; i++){ |
|
|
key = list->At(i); |
|
|
name=(char *)(key->GetName()); |
|
|
tr = (TTree*)file->Get(name); |
|
|
if (tr->IsZombie()) continue; |
|
|
tr->SetBranchAddress("Header", &eh); |
|
|
nevents = tr->GetEntries(); |
|
|
for (Int_t j = 0; j < nevents; j++){ |
|
|
tr->GetEntry(j); |
|
|
ph = eh->GetPscuHeader(); |
|
|
if((ph->GetPacketId1()) == 16){ |
|
|
obtphysevents=ph->GetOrbitalTime(); |
|
|
h1->Fill(obtphysevents); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
h1->SetMarkerStyle(6); |
|
|
h1->GetXaxis()->SetTitle(oss1.str().c_str()); |
|
248 |
h1->GetXaxis()->CenterTitle(); |
h1->GetXaxis()->CenterTitle(); |
249 |
h1->GetXaxis()->SetLabelSize(0.03); |
h1->GetXaxis()->SetLabelSize(0.04); |
250 |
h1->GetYaxis()->SetTitle("number of Physic packets"); |
h1->GetYaxis()->SetTitle("Number of events "); |
251 |
h1->GetYaxis()->CenterTitle(); |
h1->GetYaxis()->CenterTitle(); |
252 |
|
h1->GetYaxis()->SetTitleSize(0.06); |
253 |
|
h1->GetYaxis()->SetTitleOffset(0.8); |
254 |
h1->Draw(); |
h1->Draw(); |
255 |
|
|
|
|
|
|
finalCanv1->cd(3); |
|
|
oss1.str(""); |
|
|
oss1 << "OBT (ms) with t0 = " << mintime << "ms"; |
|
|
|
|
|
grPcktLenght->SetTitle(oss.str().c_str()); |
|
|
grPcktLenght->GetXaxis()->SetTitle(oss1.str().c_str()); |
|
|
grPcktLenght->GetXaxis()->CenterTitle(); |
|
|
grPcktLenght->GetXaxis()->SetLabelSize(0.03); |
|
|
grPcktLenght->GetYaxis()->SetTitle("Lenght of Physic packets (byte)"); |
|
|
grPcktLenght->GetYaxis()->CenterTitle(); |
|
|
grPcktLenght->GetYaxis()->SetLabelSize(0.03); |
|
|
grPcktLenght->SetMarkerSize(4); |
|
|
grPcktLenght->Draw("AP"); |
|
|
|
|
|
|
|
256 |
finalCanv1->cd(2); |
finalCanv1->cd(2); |
257 |
h1->Draw(); |
PcktLenght->SetStats(kFALSE); |
258 |
|
PcktLenght->GetXaxis()->SetTitle("OBT (ms)"); |
259 |
finalCanv1->Update(); |
PcktLenght->GetXaxis()->CenterTitle(); |
260 |
|
PcktLenght->GetXaxis()->SetLabelSize(0.04); |
261 |
|
PcktLenght->GetYaxis()->SetTitle("Lenght (byte)"); |
262 |
///---------canvas 2-----------------------------// |
PcktLenght->GetYaxis()->CenterTitle(); |
263 |
|
PcktLenght->GetYaxis()->SetLabelSize(0.04); |
264 |
|
PcktLenght->GetYaxis()->SetTitleSize(0.06); |
265 |
|
PcktLenght->GetYaxis()->SetTitleOffset(0.8); |
266 |
|
PcktLenght->SetMarkerColor(2); |
267 |
|
PcktLenght->SetMarkerSize(.5); |
268 |
|
PcktLenght->SetMarkerStyle(21); |
269 |
|
PcktLenght->Draw("9p"); |
270 |
|
|
271 |
|
finalCanv1->cd(3); |
272 |
|
PcktCounter->SetStats(kFALSE); |
273 |
|
PcktCounter->GetXaxis()->SetTitle("OBT (ms)"); |
274 |
|
PcktCounter->GetXaxis()->SetTitleSize(0.05); |
275 |
|
PcktCounter->GetXaxis()->CenterTitle(); |
276 |
|
PcktCounter->GetXaxis()->SetLabelSize(0.04); |
277 |
|
PcktCounter->GetYaxis()->SetTitle("Counter"); |
278 |
|
PcktCounter->GetYaxis()->SetTitleSize(0.05); |
279 |
|
PcktCounter->GetYaxis()->CenterTitle(); |
280 |
|
PcktCounter->GetYaxis()->SetLabelSize(0.04); |
281 |
|
PcktCounter->GetYaxis()->SetTitleSize(0.06); |
282 |
|
PcktCounter->GetYaxis()->SetTitleOffset(0.8); |
283 |
|
PcktCounter->SetMarkerColor(4); |
284 |
|
PcktCounter->SetMarkerSize(.5); |
285 |
|
PcktCounter->SetMarkerStyle(21); |
286 |
|
PcktCounter->Draw("9p"); |
287 |
|
//--------- Second Canvas -----------------------------// |
288 |
|
/*TCanvas *finalCanv2 = new TCanvas("Header_2", base, 1280, 1024); |
289 |
|
finalCanv2->Divide(1,2); |
290 |
|
finalCanv2->SetFillColor(10); |
291 |
|
|
292 |
finalCanv2->cd(1); |
finalCanv2->cd(1); |
293 |
|
PcktCounter->SetStats(kFALSE); |
294 |
grPcktCounter->SetTitle(oss.str().c_str()); |
PcktCounter->GetXaxis()->SetTitle("OBT (ms)"); |
295 |
grPcktCounter->GetXaxis()->SetTitle(oss1.str().c_str()); |
PcktCounter->GetXaxis()->SetTitleSize(0.05); |
296 |
grPcktCounter->GetXaxis()->SetTitleSize(0.04); |
PcktCounter->GetXaxis()->CenterTitle(); |
297 |
grPcktCounter->GetXaxis()->CenterTitle(); |
PcktCounter->GetXaxis()->SetLabelSize(0.04); |
298 |
grPcktCounter->GetXaxis()->SetLabelSize(0.03); |
PcktCounter->GetYaxis()->SetTitle("Counter"); |
299 |
grPcktCounter->GetYaxis()->SetTitle("PacketCounter of Physic packets"); |
PcktCounter->GetYaxis()->SetTitleSize(0.05); |
300 |
grPcktCounter->GetYaxis()->SetTitleSize(0.04); |
PcktCounter->GetYaxis()->CenterTitle(); |
301 |
grPcktCounter->GetYaxis()->CenterTitle(); |
PcktCounter->GetYaxis()->SetLabelSize(0.04); |
302 |
grPcktCounter->GetYaxis()->SetLabelSize(0.03); |
PcktCounter->SetMarkerColor(4); |
303 |
grPcktCounter->SetMarkerSize(4); |
PcktCounter->SetMarkerSize(.5); |
304 |
grPcktCounter->SetMinimum(mincount); |
PcktCounter->SetMarkerStyle(21); |
305 |
grPcktCounter->SetMaximum(maxcount); |
PcktCounter->Draw("9p"); |
|
grPcktCounter->Draw("AP"); |
|
306 |
|
|
307 |
finalCanv2->cd(2); |
finalCanv2->cd(2); |
308 |
|
FileOffset->SetStats(kFALSE); |
309 |
grFileOffset->SetTitle(oss.str().c_str()); |
FileOffset->GetXaxis()->SetTitle("File Offset"); |
310 |
grFileOffset->GetXaxis()->SetTitle("File Offset"); |
FileOffset->GetXaxis()->CenterTitle(); |
311 |
grFileOffset->GetXaxis()->CenterTitle(); |
FileOffset->GetXaxis()->SetTitleSize(0.05); |
312 |
grFileOffset->GetXaxis()->SetTitleSize(0.04); |
FileOffset->GetXaxis()->SetLabelSize(0.04); |
313 |
grFileOffset->GetXaxis()->SetLabelSize(0.03); |
FileOffset->GetYaxis()->SetTitle("Counter"); |
314 |
grFileOffset->GetYaxis()->SetTitle("Packet counter"); |
FileOffset->GetYaxis()->CenterTitle(); |
315 |
grFileOffset->GetYaxis()->CenterTitle(); |
FileOffset->GetYaxis()->SetTitleSize(0.05); |
316 |
grFileOffset->GetYaxis()->SetTitleSize(0.04); |
FileOffset->GetYaxis()->SetLabelSize(0.04); |
317 |
grFileOffset->GetYaxis()->SetLabelSize(0.03); |
FileOffset->SetMarkerColor(3); |
318 |
grFileOffset->SetMarkerSize(4); |
FileOffset->SetMarkerSize(.5); |
319 |
grFileOffset->Draw("AP"); |
FileOffset->SetMarkerStyle(21); |
320 |
|
FileOffset->Draw("9p");*/ |
|
finalCanv1->Update(); |
|
|
|
|
321 |
|
|
322 |
//-------to save---------------------------/// |
//-------to save---------------------------/// |
323 |
oss.str(""); |
oss.str(""); |
330 |
oss1 << "_HeaderScan_2." << format.Data(); |
oss1 << "_HeaderScan_2." << format.Data(); |
331 |
|
|
332 |
finalCanv1->SaveAs(oss.str().c_str()); |
finalCanv1->SaveAs(oss.str().c_str()); |
333 |
finalCanv2->SaveAs(oss1.str().c_str()); |
//finalCanv2->SaveAs(oss1.str().c_str()); |
|
|
|
334 |
|
|
335 |
file->Close(); |
file->Close(); |
336 |
|
|
342 |
TString path; |
TString path; |
343 |
TString outDir = "./"; |
TString outDir = "./"; |
344 |
TString format = "jpg"; |
TString format = "jpg"; |
|
|
|
345 |
if (argc < 2){ |
if (argc < 2){ |
346 |
printf("You have to insert at least the file to analyze \n"); |
printf("You have to insert at least the file to analyze \n"); |
347 |
printf("Try '--help' for more information. \n"); |
printf("Try '--help' for more information. \n"); |
348 |
exit(1); |
exit(1); |
349 |
} |
} |
|
|
|
350 |
if (!strcmp(argv[1], "--help")){ |
if (!strcmp(argv[1], "--help")){ |
351 |
printf( "Usage: HeaderScan FILE [OPTION] \n"); |
printf( "Usage: HeaderScan FILE [OPTION] \n"); |
352 |
printf( "\t --help Print this help and exit \n"); |
printf( "\t --help Print this help and exit \n"); |
354 |
printf( "\t -format[jpg|ps|gif] Format for output files [default 'jpg'] \n"); |
printf( "\t -format[jpg|ps|gif] Format for output files [default 'jpg'] \n"); |
355 |
exit(1); |
exit(1); |
356 |
} |
} |
|
|
|
|
|
|
357 |
path=argv[1]; |
path=argv[1]; |
358 |
|
for (int i = 2; i < argc; i++){ |
|
for (int i = 2; i < argc; i++){ |
|
|
|
|
359 |
if (!strcmp(argv[i], "-outDir")){ |
if (!strcmp(argv[i], "-outDir")){ |
360 |
if (++i >= argc){ |
if (++i >= argc){ |
361 |
printf( "-outDir needs arguments. \n"); |
printf( "-outDir needs arguments. \n"); |
366 |
outDir = argv[i]; |
outDir = argv[i]; |
367 |
continue; |
continue; |
368 |
} |
} |
369 |
} |
} |
|
|
|
370 |
if (!strcmp(argv[i], "-format")){ |
if (!strcmp(argv[i], "-format")){ |
371 |
if (++i >= argc){ |
if (++i >= argc){ |
372 |
printf( "-format needs arguments. \n"); |
printf( "-format needs arguments. \n"); |
378 |
continue; |
continue; |
379 |
} |
} |
380 |
} |
} |
|
|
|
|
|
|
381 |
} |
} |
|
|
|
382 |
HeaderScan(argv[1], outDir, format); |
HeaderScan(argv[1], outDir, format); |
|
|
|
383 |
} |
} |