| 2 | *  FTrkScanQlook_EXPERT.cxx | *  FTrkScanQlook_EXPERT.cxx | 
| 3 | * | * | 
| 4 | * autor: D.Fedele | * autor: D.Fedele | 
| 5 | * version 3.0 | * version v1r04 | 
| 6 | * Parameters: | * Parameters: | 
| 7 | *      file - the path to the root file to analyze | *      file - the path to the root file to analyze | 
| 8 | *      outdir - total path of output file | *      outdir - total path of output file | 
| 19 | #include <TLatex.h> | #include <TLatex.h> | 
| 20 | #include <TCanvas.h> | #include <TCanvas.h> | 
| 21 | #include <TGraph.h> | #include <TGraph.h> | 
| 22 |  | #include <TFile.h> | 
| 23 | #include <TTree.h> | #include <TTree.h> | 
| 24 | #include <TStyle.h> | #include <TStyle.h> | 
| 25 | #include <TString.h> | #include <TString.h> | 
| 117 | } | } | 
| 118 | } | } | 
| 119 |  |  | 
|  | 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); |  | 
|  | } |  | 
|  | } |  | 
|  |  |  | 
| 120 |  |  | 
| 121 | void FTrkScanQLook_EXPERT(TString file, TString outdir,Int_t event, Int_t DSPprint, TString outfile) | void FTrkScanQLook_EXPERT(TString file, TString outdir,Int_t event, Int_t DSPprint, TString outfile) | 
| 122 | { | { | 
| 123 |  |  | 
| 124 | // | // | 
| 125 | //   obtain information about the data file and select the output file | //   obtain information about the data file and select the output file | 
| 126 | const string filepath=file.Data(); | const string filepath=file.Data(); | 
| 127 | Int_t dwpos = filepath.rfind("/"); | Int_t dwpos = file.Last('/'); | 
| 128 | Int_t dwpos1 = filepath.find(".root"); | Int_t dwpos1 = file.Last('.'); | 
|  | TString fpath=(filepath.c_str()); |  | 
| 129 | TString base,ffile ; | TString base,ffile ; | 
| 130 | stringcopy(ffile,fpath,dwpos+1,dwpos1); | ffile=file(dwpos+1,dwpos1-(dwpos+1)); | 
| 131 | stringcopy(base,fpath,0,dwpos); | if(dwpos>0) base=file(0,dwpos); | 
|  | if(dwpos>0) base+="/"; |  | 
| 132 |  |  | 
| 133 | TString out; | TString out; | 
| 134 | if(outdir.Length()==0){ | if(outdir.Length()==0){ | 
| 136 | }else{ | }else{ | 
| 137 | out = outdir; | out = outdir; | 
| 138 | } | } | 
| 139 |  | if(out.Last('/')+1<out.Length()) out+="/"; | 
| 140 |  |  | 
| 141 | pamela::tracker::TrackerEvent *trk=0; | pamela::tracker::TrackerEvent *trk=0; | 
| 142 | pamela::EventHeader *eh=0,*eH=0; | pamela::EventHeader *eh=0,*eH=0; |