| 1 |
/** |
/** |
| 2 |
* FTrkQLook_BASIC.cpp |
* FTrkQLook_BASIC.cxx |
| 3 |
* |
* |
| 4 |
* autor: D.Fedele |
* autor: D.Fedele |
| 5 |
* version 3.0 |
* version v1r05 |
| 6 |
* Parameters: |
* Parameters: |
| 7 |
* file - the data file to analyze |
* file - the data file to analyze |
| 8 |
* fromevent - first event to analyze |
* fromevent - first event to analyze |
| 17 |
#include <TCanvas.h> |
#include <TCanvas.h> |
| 18 |
#include <TGraph.h> |
#include <TGraph.h> |
| 19 |
#include <TStyle.h> |
#include <TStyle.h> |
| 20 |
|
#include <TFile.h> |
| 21 |
#include <TTree.h> |
#include <TTree.h> |
| 22 |
#include <TArrow.h> |
#include <TArrow.h> |
| 23 |
// |
// |
| 30 |
// |
// |
| 31 |
#define MAXSTORAGE 50000 |
#define MAXSTORAGE 50000 |
| 32 |
|
|
|
void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ |
|
|
if ( to == 0 ){ |
|
|
Int_t t2length = s2.Length(); |
|
|
s1 = ""; |
|
|
to = t2length; |
|
|
}; |
|
|
for (Int_t i = from; i<to; i++){ |
|
|
s1.Append(s2[i],1); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
| 33 |
void FTrkQLook_BASIC(TString file,Int_t fromevent,Int_t toevent, TString outdir,TString outfile) |
void FTrkQLook_BASIC(TString file,Int_t fromevent,Int_t toevent, TString outdir,TString outfile) |
| 34 |
{ |
{ |
| 35 |
// |
// |
| 36 |
// obtain information about the data file and select the output dir |
// obtain information about the data file and select the output dir |
| 37 |
const string filepath=file.Data(); |
Int_t dwpos = file.Last('/'); |
| 38 |
Int_t dwpos = filepath.rfind("/"); |
Int_t dwpos1 = file.Last('.'); |
|
Int_t dwpos1 = filepath.find(".root"); |
|
|
TString fpath=(filepath.c_str()); |
|
| 39 |
TString base,ffile ; |
TString base,ffile ; |
| 40 |
stringcopy(ffile,fpath,dwpos+1,dwpos1); |
ffile=file(dwpos+1,dwpos1-(dwpos+1)); |
| 41 |
stringcopy(base,fpath,0,dwpos); |
if(dwpos>0) base=file(0,dwpos); |
|
if(dwpos>0) base+="/"; |
|
| 42 |
|
|
| 43 |
TString out; |
TString out; |
| 44 |
if(outdir.Length()==0){ |
if(outdir.Length()==0){ |
| 46 |
}else{ |
}else{ |
| 47 |
out = outdir; |
out = outdir; |
| 48 |
} |
} |
| 49 |
|
if(out.Last('/')+1<out.Length()) out+="/"; |
| 50 |
|
|
| 51 |
// |
// |
| 52 |
// inizialise the variables and open the file |
// inizialise the variables and open the file |
| 374 |
else dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4000); |
else dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4000); |
| 375 |
dataletime[i][ii]->SetMarkerStyle(21); |
dataletime[i][ii]->SetMarkerStyle(21); |
| 376 |
if((maxev-minev)<50) dataletime[i][ii]->SetMarkerSize(0.5); |
if((maxev-minev)<50) dataletime[i][ii]->SetMarkerSize(0.5); |
| 377 |
else dataletime[i][ii]->SetMarkerSize(0.3); |
else dataletime[i][ii]->SetMarkerSize(0.1); |
| 378 |
dataletime[i][ii]->SetMarkerColor(4); |
dataletime[i][ii]->SetMarkerColor(4); |
| 379 |
dataletime[i][ii]->Draw("ap"); |
dataletime[i][ii]->Draw("ap"); |
| 380 |
|
|
| 383 |
dataletime1[i][ii]= new TGraph(countbad[i],xb,yb); |
dataletime1[i][ii]= new TGraph(countbad[i],xb,yb); |
| 384 |
dataletime1[i][ii]->SetMarkerStyle(21); |
dataletime1[i][ii]->SetMarkerStyle(21); |
| 385 |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
| 386 |
else dataletime1[i][ii]->SetMarkerSize(0.3); |
else dataletime1[i][ii]->SetMarkerSize(0.1); |
| 387 |
dataletime1[i][ii]->SetMarkerColor(2); |
dataletime1[i][ii]->SetMarkerColor(2); |
| 388 |
dataletime1[i][ii]->Draw("psame"); |
dataletime1[i][ii]->Draw("psame"); |
| 389 |
} |
} |
| 391 |
dataletime1[i][ii]= new TGraph(countbad[i],xb,yb); |
dataletime1[i][ii]= new TGraph(countbad[i],xb,yb); |
| 392 |
dataletime1[i][ii]->SetMarkerStyle(21); |
dataletime1[i][ii]->SetMarkerStyle(21); |
| 393 |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
| 394 |
else dataletime1[i][ii]->SetMarkerSize(0.3); |
else dataletime1[i][ii]->SetMarkerSize(0.1); |
| 395 |
dataletime1[i][ii]->SetMarkerColor(2); |
dataletime1[i][ii]->SetMarkerColor(2); |
| 396 |
dataletime1[i][ii]->Draw("psame"); |
dataletime1[i][ii]->Draw("psame"); |
| 397 |
} |
} |