/[PAMELA software]/calo/flight/FQLOOK/src/FCaloQLOOK.cc
ViewVC logotype

Diff of /calo/flight/FQLOOK/src/FCaloQLOOK.cc

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

revision 1.5 by mocchiut, Fri Aug 4 15:24:03 2006 UTC revision 1.12 by mocchiut, Tue Aug 11 14:20:05 2009 UTC
# Line 10  Line 10 
10  //  //
11  #include <TSystem.h>  #include <TSystem.h>
12  #include <iostream>  #include <iostream>
13    #include <sstream>
14    #include <cstdlib>
15  #include <sys/types.h>  #include <sys/types.h>
16  #include <unistd.h>  #include <unistd.h>
17  #include <stdio.h>  #include <stdio.h>
18  //  //
19  extern void FCaloQLOOK(TString, int, int, TString, TString, Bool_t, Bool_t);  extern void FCaloQLOOK(TString, int, int, TString, TString, Bool_t, Bool_t);
20  extern void info();  extern void info();
21    extern void stringcopy(TString& , const TString& , Int_t , Int_t );
22  using namespace std;  using namespace std;
23  //  //
24  void usage(){  void usage(){
# Line 28  void usage(){ Line 31  void usage(){
31    printf(  " -toev to_event      last event to analyze  [default = 0] \n");    printf(  " -toev to_event      last event to analyze  [default = 0] \n");
32    printf(  " -oudDir output_dir  path of the output directory [default = ./] (with or without final '/') \n");    printf(  " -oudDir output_dir  path of the output directory [default = ./] (with or without final '/') \n");
33    printf(  " -format format      format for output file (without . )[default = png] \n");    printf(  " -format format      format for output file (without . )[default = png] \n");
34      printf(  " -interactive        shows figures on the screen [default = non-interactive] \n");
35      printf(  " -wait               wait for canvas to be closed before going on [default = don't wait] \n");
36    printf("\nExamples: ");    printf("\nExamples: ");
37    printf("\n\nFCaloQLOOK /home/pamela/filesfromyoda/dw_050301_00100.root \n");    printf("\n\nFCaloQLOOK /home/pamela/filesfromyoda/dw_050301_00100.root \n");
38    printf("\nFCaloQLOOK -v -name /home/pamela/filesfromyoda/dw_050301_00100.root \n");    printf("\nFCaloQLOOK -v -name /home/pamela/filesfromyoda/dw_050301_00100.root \n");
# Line 36  void usage(){ Line 41  void usage(){
41    
42  int main(int numinp, char *inps[]){  int main(int numinp, char *inps[]){
43    TString name;    TString name;
44    TString outdir = "";    TString outdir = "./";
45    TString format = "png";    TString format = "png";
46    int fromev = 0;    int fromev = 0;
47    int toev = 0;    int toev = 0;
# Line 109  int main(int numinp, char *inps[]){ Line 114  int main(int numinp, char *inps[]){
114      return(0);          return(0);    
115    };    };
116    //    //
117      stringstream figsave;    
118    if ( !beverbose ){    if ( !beverbose ){
119      //      //
120        const string fil = gSystem->BaseName(name.Data());
121        Int_t posiz = fil.find(".root");
122        //
123        TString file2;
124        if ( posiz == -1 ){
125          file2 = gSystem->BaseName(name.Data());
126        } else {
127          Int_t posiz2 = 0;
128          stringcopy(file2,gSystem->BaseName(name.Data()),posiz2,posiz);
129        };
130        const char *figrec = file2;
131        //
132        const char *outDir = outdir;
133        figsave.str("");
134        figsave << outDir << "/" ;
135        figsave << figrec << "_CaloQLOOK.txt";
136        //
137      // redirect to /dev/null the stdout and stderr      // redirect to /dev/null the stdout and stderr
138      //      //
139      nul = open("/dev/null", O_CREAT | O_RDWR,S_IREAD | S_IWRITE);      nul = open(figsave.str().c_str(), O_CREAT | O_RDWR,S_IREAD | S_IWRITE | S_IRGRP | S_IWGRP | S_IROTH);
140      dup2(nul,1);      dup2(nul,1);
141      dup2(nul,2);      dup2(nul,2);
142    };    };
143    printf("\n Welcome to FCaloQLOOK! \n");    printf("\n Welcome to FCaloQLOOK! v1r23 \n");
144    //    //
145    FCaloQLOOK(name,fromev,toev,outdir,format,iactive,w4i);    FCaloQLOOK(name,fromev,toev,outdir,format,iactive,w4i);
146    //    //

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.23