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

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

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

revision 1.3 by pam-fi, Thu Jun 8 17:03:57 2006 UTC revision 1.7 by pam-fi, Mon Sep 18 15:01:56 2006 UTC
# Line 2  Line 2 
2   * FTrkCalibQLook_BASIC.cxx   * FTrkCalibQLook_BASIC.cxx
3   *   *
4   * autor: D.Fedele   * autor: D.Fedele
5   * version 3.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
# Line 15  Line 15 
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>
# Line 25  Line 26 
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];
# Line 64  void FTrkCalibQLook_BASIC(TString file,I Line 54  void FTrkCalibQLook_BASIC(TString file,I
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){
# Line 79  void FTrkCalibQLook_BASIC(TString file,I Line 66  void FTrkCalibQLook_BASIC(TString file,I
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;
# Line 175  void FTrkCalibQLook_BASIC(TString file,I Line 163  void FTrkCalibQLook_BASIC(TString file,I
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    

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

  ViewVC Help
Powered by ViewVC 1.1.23