2 |
* FTrkCalibQLook_BASIC.cxx |
* FTrkCalibQLook_BASIC.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version 2.0 |
* version v1r09 |
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]; |
54 |
{ |
{ |
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(); |
Int_t dwpos = file.Last('/'); |
58 |
Int_t dwpos = filepath.rfind("/"); |
Int_t dwpos1 = file.Last('.'); |
59 |
Int_t dwpos1 = filepath.rfind(".root"); |
TString base,ffile ; |
60 |
TString fpath=(filepath.c_str()); |
ffile=file(dwpos+1,dwpos1-(dwpos+1)); |
61 |
TString base,ffile; |
if(dwpos>0) base=file(0,dwpos); |
|
stringcopy(base,fpath,0,dwpos); |
|
|
stringcopy(ffile,fpath,dwpos+1,dwpos1); |
|
|
if(dwpos>0) base+="/"; |
|
62 |
|
|
63 |
TString out; |
TString out; |
64 |
if(outdir.Length()==0){ |
if(outdir.Length()==0){ |
66 |
}else{ |
}else{ |
67 |
out = outdir; |
out = outdir; |
68 |
}; |
}; |
69 |
|
if(out.Last('/')+1<out.Length()) out+="/"; |
70 |
|
|
71 |
// |
// |
72 |
// inizialise the variables and open the file |
// inizialise the variables and open the file |
73 |
struct caltrk_def ctrk; |
struct caltrk_def ctrk; |
163 |
} else if (toevent > nevents) { |
} else if (toevent > nevents) { |
164 |
maxevent = nevents; |
maxevent = nevents; |
165 |
} else { |
} else { |
166 |
maxevent = fromevent; |
maxevent = nevents; |
167 |
}; |
}; |
168 |
}; |
}; |
169 |
|
|