/[PAMELA software]/quicklook/tracker/flight/macros/FTrkScanQLook_EXPERT.cxx
ViewVC logotype

Diff of /quicklook/tracker/flight/macros/FTrkScanQLook_EXPERT.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by pam-fi, Mon Jun 5 08:37:53 2006 UTC revision 1.6 by pam-fi, Sun Jul 2 17:41:15 2006 UTC
# Line 2  Line 2 
2   *  FTrkScanQlook_EXPERT.cxx   *  FTrkScanQlook_EXPERT.cxx
3   *   *
4   * autor: D.Fedele   * autor: D.Fedele
5   * version 2.0   * version v1r05
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
# Line 19  Line 19 
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>
# Line 116  trkword datadecode(int word){ Line 117  trkword datadecode(int word){
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();    Int_t dwpos = file.Last('/');
127    Int_t dwpos = filepath.rfind("/");    Int_t dwpos1 = file.Last('.');
   Int_t dwpos1 = filepath.find(".root");  
   TString fpath=(filepath.c_str());  
128    TString base,ffile ;    TString base,ffile ;
129    stringcopy(ffile,fpath,dwpos+1,dwpos1);    ffile=file(dwpos+1,dwpos1-(dwpos+1));
130    stringcopy(base,fpath,0,dwpos);    if(dwpos>0) base=file(0,dwpos);
   if(dwpos>0) base+="/";  
131    
132    TString out;    TString out;
133    if(outdir.Length()==0){    if(outdir.Length()==0){
# Line 148  void FTrkScanQLook_EXPERT(TString file, Line 135  void FTrkScanQLook_EXPERT(TString file,
135    }else{    }else{
136      out = outdir;      out = outdir;
137    }    }
138      if(out.Last('/')+1<out.Length()) out+="/";
139            
140    pamela::tracker::TrackerEvent *trk=0;    pamela::tracker::TrackerEvent *trk=0;
141    pamela::EventHeader *eh=0,*eH=0;    pamela::EventHeader *eh=0,*eH=0;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23