/[PAMELA software]/eventviewer/flight/src/FEventViewerCore.cpp
ViewVC logotype

Diff of /eventviewer/flight/src/FEventViewerCore.cpp

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

revision 1.13 by mocchiut, Mon Nov 26 08:29:55 2007 UTC revision 1.19 by mocchiut, Wed Jan 20 05:35:30 2010 UTC
# Line 146  void ShowEvent(TString filename="help", Line 146  void ShowEvent(TString filename="help",
146        TString name =  questo->GetName();        TString name =  questo->GetName();
147        if( name.EndsWith(".so") || name.EndsWith(".o") ){        if( name.EndsWith(".so") || name.EndsWith(".o") ){
148          npl++;          npl++;
149          char *fullpath = gSystem->ConcatFileName(gSystem->DirName(plugindir),gSystem->BaseName(name));                    //      char *fullpath = gSystem->ConcatFileName(gSystem->DirName(plugindir),gSystem->BaseName(name));          
150          gSystem->Load(fullpath);          char *fullpath = gSystem->ConcatFileName(plugindir.Data(),gSystem->BaseName(name));            
151          printf(" %i -> %s plugin loaded \n",npl,name.Data());          if ( !gSystem->Load(fullpath) ) printf(" %i -> %s plugin loaded (%s)\n",npl,name.Data(),fullpath);
152          delete fullpath;          delete fullpath;
153        };        };
154      }      }
155        gSystem->cd(wdir.Data());
156      delete temp;      delete temp;
157      delete datadir;      delete datadir;
158    };    };
159    //    //
160      // Add working directory to file names if no full path is provided
161      //
162      if ( !strcmp(gSystem->BaseName(filename),filename.Data()) ){
163        filename = startingdir+"/"+filename;
164      };
165      if ( !strcmp(gSystem->BaseName(selfile),selfile.Data()) && strcmp(selfile.Data(),"") ){
166        selfile = startingdir+"/"+selfile;
167      };
168      //
169    //  book the canvas    //  book the canvas
170    //    //
171    TCanvas *figure = new TCanvas("PAMELA event viewer", "PAMELA event viewer",(int)winx,(int)winy);    TCanvas *figure = new TCanvas("PAMELA event viewer", "PAMELA event viewer",(int)winx,(int)winy);
# Line 209  void ShowEvent(TString filename="help", Line 219  void ShowEvent(TString filename="help",
219    //    //
220    // check if we have an input filename    // check if we have an input filename
221    //    //
222    if ( filename.Data() == "" || !strcmp(filename.Data(),"help") ){    //  if ( filename.Data() == "" || !strcmp(filename.Data(),"help") ){
223      if ( !strcmp(gSystem->BaseName(filename),"") || filename.Contains("help") ){
224      pamela->var.waitforever = true;      pamela->var.waitforever = true;
225    };    };
226  //   //  //   //
# Line 280  void ShowEvent(TString filename="help", Line 291  void ShowEvent(TString filename="help",
291    //    //
292    if ( firsttime ){    if ( firsttime ){
293      firsttime = false;      firsttime = false;
294      if ( filename == "" ) pamgui->DIALOG(0," Insert the filename and press load to start ");      if ( !strcmp(gSystem->BaseName(filename),"") || filename.Contains("help") ) pamgui->DIALOG(3," - Insert the filename and press load to start \n - To unload selection file clean the line and press the \"Load\" button \n - run with \"-v\" option to have STDOUT on the screen \n - select a detector and press \"Show Data\" to print data event by event on the screen ");
295        //    if ( filename.Contains("help") ) pamgui->DIALOG(3," - Insert the filename and press load to start \n - To unload selection file clean the line and press the \"Load\" button \n - run with \"-v\" option to have STDOUT on the screen \n - select a detector and press \"Show Data\" to print data event by event on the screen ");
296        //        printf(" - %s - %s =\n",gSystem->BaseName(filename),filename.Data());
297    };    };
298    //    //
299    // WAIT for an input filename    // WAIT for an input filename
# Line 289  void ShowEvent(TString filename="help", Line 302  void ShowEvent(TString filename="help",
302      if ( !gROOT->GetListOfCanvases()->FindObject(figure)  ) {      if ( !gROOT->GetListOfCanvases()->FindObject(figure)  ) {
303        pamgui->Terminate();        pamgui->Terminate();
304      };      };
305        pamgui->Refresh();
306      gSystem->ProcessEvents();      gSystem->ProcessEvents();
307      gSystem->Sleep(10);      gSystem->Sleep(10);
308    };    };
# Line 310  void ShowEvent(TString filename="help", Line 324  void ShowEvent(TString filename="help",
324    //    //
325    // LOAD SELECTION FILE    // LOAD SELECTION FILE
326    //        //    
327    if ( selfile == ""  ){    if (  !strcmp(gSystem->BaseName(selfile),"") ){ //selfile == ""  ){
328      //if ( !pamela->var.selex ) pamgui->DIALOG(0," Selection file unloaded ");      //if ( !pamela->var.selex ) pamgui->DIALOG(0," Selection file unloaded ");
329      if ( pamela->var.selex ) pamgui->DIALOG(0," Selection file unloaded ");      if ( pamela->var.selex ) pamgui->DIALOG(0," Selection file unloaded ");
330      pamela->var.selex = false;      pamela->var.selex = false;
# Line 374  void ShowEvent(TString filename="help", Line 388  void ShowEvent(TString filename="help",
388    //  LOAD FILES        //  LOAD FILES    
389    //    //
390    //    //
391  //   if ( headerFile ) headerFile->Close();    //   if ( headerFile ) headerFile->Close();
392  //   if ( otr ) otr->Delete();    //   if ( otr ) otr->Delete();
393  //   if ( L0 ) L0->Delete();    //   if ( L0 ) L0->Delete();
394    
395    //    //
396    // check if user has given as input a correct path    // check if user has given as input a correct path
# Line 611  void ShowEvent(TString filename="help", Line 625  void ShowEvent(TString filename="help",
625        //        //
626        // prepare the string for the figure filename        // prepare the string for the figure filename
627        //        //
628        char *bw;        const char *bw;
629        if ( pamela->var.bw ){        if ( pamela->var.bw ){
630          bw = "_bw";          bw = "_bw";
631        } else {        } else {
# Line 659  void ShowEvent(TString filename="help", Line 673  void ShowEvent(TString filename="help",
673        //        //
674        pamela->var.goon = false;        pamela->var.goon = false;
675        if ( pamela->var.refresh || pamela->var.restart ){        if ( pamela->var.refresh || pamela->var.restart ){
676            //      printf(" qua \n");
677            if ( pamela->GetL2() ) pamela->GetL2()->Clear();
678          if ( pamela->GetL2() ) pamela->GetL2()->Reset();          if ( pamela->GetL2() ) pamela->GetL2()->Reset();
679            if ( pamela->GetL2() ) pamela->GetL2()->Delete();
680            pamela->Reset();
681          if ( pamela->level.file != 2 ) pamela->GetChain()->Delete();          if ( pamela->level.file != 2 ) pamela->GetChain()->Delete();
682          otr = NULL;          otr = NULL;
683          //      if ( headerFile ) headerFile->Close("R");          //      if ( headerFile ) headerFile->Close("R");
684            //      if ( pamela->var.refresh ){
685            //        pamela->var.refresh = false;
686            //        pamela->var.restart = true;
687            //      };
688          if ( pamela->var.refresh ) goto refresh;          if ( pamela->var.refresh ) goto refresh;
689          if ( pamela->var.restart ){          if ( pamela->var.restart ){
690              //      if ( pamela->GetL2() ) pamela->GetL2()->Reset();
691              //      pamela->Reset();
692              //      if ( pamela->level.file != 2 ) pamela->GetChain()->Delete();
693              //      otr = NULL;
694            i = pamela->var.i;            i = pamela->var.i;
695            filename = pamela->var.thefilename.Data();            filename = pamela->var.thefilename.Data();
696            goto restart;            goto restart;
697          };          };
698        };        };
699        //        //
700          //      printf(" que %i \n",i);
701          //      if ( i < 0 ) i = 0; // boh
702        i = pamela->var.i;        i = pamela->var.i;
703        if ( i != pamela->si ) pamela->OOBT = 1000000000;        if ( i != pamela->si ) pamela->OOBT = 1000000000;
704        if ( pamela->maxevent < i ) {        if ( pamela->maxevent < i ) {

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.23