| 2 |
* FTrkCalibQLook_BASIC.cxx |
* FTrkCalibQLook_BASIC.cxx |
| 3 |
* |
* |
| 4 |
* autor: D.Fedele |
* autor: D.Fedele |
| 5 |
* version 2.0 |
* version v1r04 |
| 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 |
| 15 |
#include <TLatex.h> |
#include <TLatex.h> |
| 16 |
#include <TCanvas.h> |
#include <TCanvas.h> |
| 17 |
#include <TGraph.h> |
#include <TGraph.h> |
| 18 |
|
#include <TFile.h> |
| 19 |
#include <TTree.h> |
#include <TTree.h> |
| 20 |
#include <TStyle.h> |
#include <TStyle.h> |
| 21 |
#include <TString.h> |
#include <TString.h> |
| 26 |
#include <CalibTrk2Event.h> |
#include <CalibTrk2Event.h> |
| 27 |
// |
// |
| 28 |
|
|
| 29 |
void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ |
typedef struct caltrk_def{ |
|
if ( to == 0 ){ |
|
|
Int_t t2length = s2.Length(); |
|
|
s1 = ""; |
|
|
to = t2length; |
|
|
}; |
|
|
for (Int_t i = from; i<to; i++){ |
|
|
s1.Append(s2[i],1); |
|
|
}; |
|
|
}; |
|
|
|
|
|
typedef struct caltrk_def{ |
|
| 30 |
Int_t good0[2]; |
Int_t good0[2]; |
| 31 |
Int_t daqmode[12]; |
Int_t daqmode[12]; |
| 32 |
Int_t dspnum[12]; |
Int_t dspnum[12]; |
| 55 |
// |
// |
| 56 |
// obtain information about the data file and select the output dir |
// obtain information about the data file and select the output dir |
| 57 |
const string filepath=file.Data(); |
const string filepath=file.Data(); |
| 58 |
Int_t dwpos = filepath.rfind("/"); |
Int_t dwpos = file.Last('/'); |
| 59 |
Int_t dwpos1 = filepath.rfind(".root"); |
Int_t dwpos1 = file.Last('.'); |
| 60 |
TString fpath=(filepath.c_str()); |
TString base,ffile ; |
| 61 |
TString base,ffile; |
ffile=file(dwpos+1,dwpos1-(dwpos+1)); |
| 62 |
stringcopy(base,fpath,0,dwpos); |
if(dwpos>0) base=file(0,dwpos); |
|
stringcopy(ffile,fpath,dwpos+1,dwpos1); |
|
|
if(dwpos>0) base+="/"; |
|
| 63 |
|
|
| 64 |
TString out; |
TString out; |
| 65 |
if(outdir.Length()==0){ |
if(outdir.Length()==0){ |
| 67 |
}else{ |
}else{ |
| 68 |
out = outdir; |
out = outdir; |
| 69 |
}; |
}; |
| 70 |
|
if(out.Last('/')+1<out.Length()) out+="/"; |
| 71 |
|
|
| 72 |
// |
// |
| 73 |
// inizialise the variables and open the file |
// inizialise the variables and open the file |
| 74 |
struct caltrk_def ctrk; |
struct caltrk_def ctrk; |