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

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

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

revision 1.7 by pam-fi, Thu Jun 8 17:03:57 2006 UTC revision 1.8 by pam-fi, Thu Jun 29 11:11:59 2006 UTC
# Line 1  Line 1 
1  /**  /**
2   * FTrkQLook_BASIC.cpp   * FTrkQLook_BASIC.cxx
3   *   *
4   * autor: D.Fedele   * autor: D.Fedele
5   * version 3.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
# Line 17  Line 17 
17  #include <TCanvas.h>  #include <TCanvas.h>
18  #include <TGraph.h>  #include <TGraph.h>
19  #include <TStyle.h>  #include <TStyle.h>
20    #include <TFile.h>
21  #include <TTree.h>  #include <TTree.h>
22  #include <TArrow.h>  #include <TArrow.h>
23  //  //
# Line 29  Line 30 
30  //  //
31  #define MAXSTORAGE 50000  #define MAXSTORAGE 50000
32    
 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);  
     };  
 };  
   
   
33  void FTrkQLook_BASIC(TString file,Int_t fromevent,Int_t toevent, TString outdir,TString outfile)  void FTrkQLook_BASIC(TString file,Int_t fromevent,Int_t toevent, TString outdir,TString outfile)
34  {    {  
35    //    //
36    //   obtain information about the data file and select the output dir    //   obtain information about the data file and select the output dir
37    const string filepath=file.Data();    const string filepath=file.Data();
38    Int_t dwpos = filepath.rfind("/");    Int_t dwpos = file.Last('/');
39    Int_t dwpos1 = filepath.find(".root");    Int_t dwpos1 = file.Last('.');
   TString fpath=(filepath.c_str());  
40    TString base,ffile ;    TString base,ffile ;
41    stringcopy(ffile,fpath,dwpos+1,dwpos1);    ffile=file(dwpos+1,dwpos1-(dwpos+1));
42    stringcopy(base,fpath,0,dwpos);    if(dwpos>0) base=file(0,dwpos);
   if(dwpos>0) base+="/";  
43    
44    TString out;    TString out;
45    if(outdir.Length()==0){    if(outdir.Length()==0){
# Line 60  void FTrkQLook_BASIC(TString file,Int_t Line 47  void FTrkQLook_BASIC(TString file,Int_t
47    }else{    }else{
48      out = outdir;      out = outdir;
49    }    }
50      if(out.Last('/')+1<out.Length()) out+="/";
51        
52    //    //
53    // inizialise the variables and open the file    // inizialise the variables and open the file
# Line 387  void FTrkQLook_BASIC(TString file,Int_t Line 375  void FTrkQLook_BASIC(TString file,Int_t
375        else dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4000);        else dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4000);
376        dataletime[i][ii]->SetMarkerStyle(21);        dataletime[i][ii]->SetMarkerStyle(21);
377        if((maxev-minev)<50) dataletime[i][ii]->SetMarkerSize(0.5);        if((maxev-minev)<50) dataletime[i][ii]->SetMarkerSize(0.5);
378        else dataletime[i][ii]->SetMarkerSize(0.3);        else dataletime[i][ii]->SetMarkerSize(0.1);
379        dataletime[i][ii]->SetMarkerColor(4);        dataletime[i][ii]->SetMarkerColor(4);
380        dataletime[i][ii]->Draw("ap");        dataletime[i][ii]->Draw("ap");
381    
# Line 396  void FTrkQLook_BASIC(TString file,Int_t Line 384  void FTrkQLook_BASIC(TString file,Int_t
384          dataletime1[i][ii]= new TGraph(countbad[i],xb,yb);          dataletime1[i][ii]= new TGraph(countbad[i],xb,yb);
385          dataletime1[i][ii]->SetMarkerStyle(21);          dataletime1[i][ii]->SetMarkerStyle(21);
386          if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5);          if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5);
387          else dataletime1[i][ii]->SetMarkerSize(0.3);          else dataletime1[i][ii]->SetMarkerSize(0.1);
388          dataletime1[i][ii]->SetMarkerColor(2);          dataletime1[i][ii]->SetMarkerColor(2);
389          dataletime1[i][ii]->Draw("psame");          dataletime1[i][ii]->Draw("psame");
390        }        }
# Line 404  void FTrkQLook_BASIC(TString file,Int_t Line 392  void FTrkQLook_BASIC(TString file,Int_t
392          dataletime1[i][ii]= new TGraph(countbad[i],xb,yb);          dataletime1[i][ii]= new TGraph(countbad[i],xb,yb);
393          dataletime1[i][ii]->SetMarkerStyle(21);          dataletime1[i][ii]->SetMarkerStyle(21);
394          if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5);          if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5);
395          else dataletime1[i][ii]->SetMarkerSize(0.3);          else dataletime1[i][ii]->SetMarkerSize(0.1);
396          dataletime1[i][ii]->SetMarkerColor(2);          dataletime1[i][ii]->SetMarkerColor(2);
397          dataletime1[i][ii]->Draw("psame");          dataletime1[i][ii]->Draw("psame");
398        }        }

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

  ViewVC Help
Powered by ViewVC 1.1.23