/[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.9 by pam-fi, Sun Jul 2 17:41:14 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 v1r05
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();    Int_t dwpos = file.Last('/');
38    Int_t dwpos = filepath.rfind("/");    Int_t dwpos1 = file.Last('.');
   Int_t dwpos1 = filepath.find(".root");  
   TString fpath=(filepath.c_str());  
39    TString base,ffile ;    TString base,ffile ;
40    stringcopy(ffile,fpath,dwpos+1,dwpos1);    ffile=file(dwpos+1,dwpos1-(dwpos+1));
41    stringcopy(base,fpath,0,dwpos);    if(dwpos>0) base=file(0,dwpos);
   if(dwpos>0) base+="/";  
42    
43    TString out;    TString out;
44    if(outdir.Length()==0){    if(outdir.Length()==0){
# Line 60  void FTrkQLook_BASIC(TString file,Int_t Line 46  void FTrkQLook_BASIC(TString file,Int_t
46    }else{    }else{
47      out = outdir;      out = outdir;
48    }    }
49      if(out.Last('/')+1<out.Length()) out+="/";
50        
51    //    //
52    // inizialise the variables and open the file    // inizialise the variables and open the file
# Line 387  void FTrkQLook_BASIC(TString file,Int_t Line 374  void FTrkQLook_BASIC(TString file,Int_t
374        else dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4000);        else dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4000);
375        dataletime[i][ii]->SetMarkerStyle(21);        dataletime[i][ii]->SetMarkerStyle(21);
376        if((maxev-minev)<50) dataletime[i][ii]->SetMarkerSize(0.5);        if((maxev-minev)<50) dataletime[i][ii]->SetMarkerSize(0.5);
377        else dataletime[i][ii]->SetMarkerSize(0.3);        else dataletime[i][ii]->SetMarkerSize(0.1);
378        dataletime[i][ii]->SetMarkerColor(4);        dataletime[i][ii]->SetMarkerColor(4);
379        dataletime[i][ii]->Draw("ap");        dataletime[i][ii]->Draw("ap");
380    
# Line 396  void FTrkQLook_BASIC(TString file,Int_t Line 383  void FTrkQLook_BASIC(TString file,Int_t
383          dataletime1[i][ii]= new TGraph(countbad[i],xb,yb);          dataletime1[i][ii]= new TGraph(countbad[i],xb,yb);
384          dataletime1[i][ii]->SetMarkerStyle(21);          dataletime1[i][ii]->SetMarkerStyle(21);
385          if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5);          if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5);
386          else dataletime1[i][ii]->SetMarkerSize(0.3);          else dataletime1[i][ii]->SetMarkerSize(0.1);
387          dataletime1[i][ii]->SetMarkerColor(2);          dataletime1[i][ii]->SetMarkerColor(2);
388          dataletime1[i][ii]->Draw("psame");          dataletime1[i][ii]->Draw("psame");
389        }        }
# Line 404  void FTrkQLook_BASIC(TString file,Int_t Line 391  void FTrkQLook_BASIC(TString file,Int_t
391          dataletime1[i][ii]= new TGraph(countbad[i],xb,yb);          dataletime1[i][ii]= new TGraph(countbad[i],xb,yb);
392          dataletime1[i][ii]->SetMarkerStyle(21);          dataletime1[i][ii]->SetMarkerStyle(21);
393          if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5);          if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5);
394          else dataletime1[i][ii]->SetMarkerSize(0.3);          else dataletime1[i][ii]->SetMarkerSize(0.1);
395          dataletime1[i][ii]->SetMarkerColor(2);          dataletime1[i][ii]->SetMarkerColor(2);
396          dataletime1[i][ii]->Draw("psame");          dataletime1[i][ii]->Draw("psame");
397        }        }

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

  ViewVC Help
Powered by ViewVC 1.1.23