/[PAMELA software]/calo/flight/FUTILITIES/macros/FCaloFUNCTIONS.cxx
ViewVC logotype

Diff of /calo/flight/FUTILITIES/macros/FCaloFUNCTIONS.cxx

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

revision 1.2 by mocchiut, Fri Jun 30 12:08:14 2006 UTC revision 1.3 by mocchiut, Mon Sep 22 20:18:45 2008 UTC
# Line 33  Line 33 
33  #include <TKey.h>  #include <TKey.h>
34  #include <TClassTable.h>  #include <TClassTable.h>
35  #include <TThread.h>  #include <TThread.h>
36    #include <TMath.h>
37  //  //
38  #include <PamelaRun.h>  #include <PamelaRun.h>
39  #include <physics/calorimeter/CalorimeterEvent.h>  #include <physics/calorimeter/CalorimeterEvent.h>
# Line 304  int CaloPede(TString filename, Int_t s, Line 305  int CaloPede(TString filename, Int_t s,
305  }  }
306    
307  TString getFilename(const TString filename){  TString getFilename(const TString filename){
308      const string fil = (const char*)filename;    //
309      Int_t posiz = fil.find("dw_");    const string fil = gSystem->BaseName(filename.Data());
310      if ( posiz == -1 ) posiz = fil.find("DW_");    Int_t posiz = fil.find(".root");
311      if ( posiz == -1 ) return 0;    //
312      Int_t posiz2 = posiz+13;    TString file2;
313      TString file2;    if ( posiz == -1 ){
314      stringcopy(file2,filename,posiz,posiz2);      file2 = gSystem->BaseName(filename.Data());
315      TString pdat(".dat");    } else {
316      stringappend(file2,pdat);      Int_t posiz2 = 0;
317      return file2;      stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz);
318        TString pdat(".pam");
319        stringappend(file2,pdat);  
320      };
321      return file2;
322  }  }
323    // TString getFilename(const TString filename){
324    //     const string fil = (const char*)filename;
325    //     Int_t posiz = fil.find("dw_");
326    //     if ( posiz == -1 ) posiz = fil.find("DW_");
327    //     if ( posiz == -1 ) return 0;
328    //     Int_t posiz2 = posiz+13;
329    //     TString file2;
330    //     stringcopy(file2,filename,posiz,posiz2);
331    //     TString pdat(".dat");
332    //     stringappend(file2,pdat);
333    //     return file2;
334    // }
335    
336  Int_t fetchpreviousfile(TString ffile, Int_t s){  Int_t fetchpreviousfile(TString ffile, Int_t s){
337      const char *file = ffile;      const char *file = ffile;
# Line 1323  Int_t WhatToDo(int& i, int& doflag, int& Line 1340  Int_t WhatToDo(int& i, int& doflag, int&
1340  }  }
1341    
1342  void PrintFigure(TString filename, TString outDir, TString figty, TString saveas, TCanvas& figure) {  void PrintFigure(TString filename, TString outDir, TString figty, TString saveas, TCanvas& figure) {
1343      const string fil = (const char*)filename;    //
1344      Int_t posiz = fil.find("dw_");    const string fil = gSystem->BaseName(filename.Data());
1345      if ( posiz == -1 ) posiz = fil.find("DW_");    Int_t posiz = fil.find(".root");
1346      Int_t posiz2 = posiz+13;    //
1347      TString file2;    TString file2;
1348      stringcopy(file2,filename,posiz,posiz2);    if ( posiz == -1 ){
1349      //      file2 = gSystem->BaseName(filename.Data());
1350      const char *figrec = file2;    } else {
1351      stringstream figsave;      Int_t posiz2 = 0;
1352      figsave.str("");      stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz);
1353      figsave << outDir.Data() << "/";    };
1354      figsave << figrec << "_";  //     const string fil = (const char*)filename;
1355      figsave << figty.Data() << ".";  //     Int_t posiz = fil.find("dw_");
1356      figsave << saveas.Data();  //     if ( posiz == -1 ) posiz = fil.find("DW_");
1357      figure.SaveAs(figsave.str().c_str());  //     Int_t posiz2 = posiz+13;
1358      return;  //     TString file2;
1359    //     stringcopy(file2,filename,posiz,posiz2);
1360      //
1361      const char *figrec = file2;
1362      stringstream figsave;
1363      figsave.str("");
1364      figsave << outDir.Data() << "/";
1365      figsave << figrec << "_";
1366      figsave << figty.Data() << ".";
1367      figsave << saveas.Data();
1368      figure.SaveAs(figsave.str().c_str());
1369      return;
1370  }  }
1371    
1372  Double_t langaufun(Double_t *x, Double_t *par) {  Double_t langaufun(Double_t *x, Double_t *par) {

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

  ViewVC Help
Powered by ViewVC 1.1.23