/[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.10 by mocchiut, Tue Jul 17 14:40:13 2007 UTC revision 1.18 by mocchiut, Tue Aug 11 13:03:42 2009 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            char *fullpath = gSystem->ConcatFileName(plugindir.Data(),gSystem->BaseName(name));            
151          gSystem->Load(fullpath);          gSystem->Load(fullpath);
152          printf(" %i -> %s plugin loaded \n",npl,name.Data());          printf(" %i -> %s plugin loaded (%s)\n",npl,name.Data(),fullpath);
153          delete fullpath;          delete fullpath;
154        };        };
155      }      }
# Line 156  void ShowEvent(TString filename="help", Line 157  void ShowEvent(TString filename="help",
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 184  void ShowEvent(TString filename="help", Line 194  void ShowEvent(TString filename="help",
194    TTree *otr8 = 0;    TTree *otr8 = 0;
195    //    //
196    pamela->var.fl0 = false;    pamela->var.fl0 = false;
197      pamela->var.restart = false;
198    Int_t i = 0;    Int_t i = 0;
199    Int_t isOK = 0;    Int_t isOK = 0;
200    //    //
201   restart:   restart:
202    //    //
203      if ( !pamela->var.restart ){
204        if ( i < 0 ){
205          i = -i;
206        } else {
207          i = 0;
208        };
209      };
210      //
211    // set boolean variables    // set boolean variables
212    //    //
   pamela->var.restart = false;  
213    pamela->var.waitforever = false;    pamela->var.waitforever = false;
214    pamela->var.jumprog = true;    pamela->var.jumprog = true;
215    pamela->var.jumpen = false;        pamela->var.jumpen = false;    
# Line 201  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    //  //   //
227    // chek if we are forcing level0  //   // chek if we are forcing level0
228    //  //   //
229    if ( pamela->var.fl0 == true ){  //   if ( pamela->var.fl0 == true ){
230      FORCELEV = 0;  //     FORCELEV = 0;
231    } else {  //   } else {
232      FORCELEV = -1;  //     FORCELEV = -1;
233    };  //   };
234    //    //
235    //  Define some variables    //  Define some variables
236    //    //
# Line 233  void ShowEvent(TString filename="help", Line 252  void ShowEvent(TString filename="help",
252    gStyle->SetNdivisions(1,"X");    gStyle->SetNdivisions(1,"X");
253    gStyle->SetNdivisions(1,"Y");    gStyle->SetNdivisions(1,"Y");
254    //    //
   if ( i < 0 ){  
     i = -i;  
   } else {  
     i = 0;  
   };  
255    isOK = 0;    isOK = 0;
256    //    //
257    // from here to refresh    // from here to refresh
# Line 262  void ShowEvent(TString filename="help", Line 276  void ShowEvent(TString filename="help",
276    };    };
277    //    //
278    //    //
279    //  if ( pamela->var.fl0 == true ) {    if ( pamela->var.fl0 == true ) {
280    //    FORCELEV = 0;      FORCELEV = 0;
281    //  } else {    } else {
282    //    if ( pamela->var.refresh ) FORCELEV = -1;           //<<<<<<<<<<<<<<<<<<<<<<<<<<?????????????????????      if ( pamela->var.refresh ) FORCELEV = -1;           //<<<<<<<<<<<<<<<<<<<<<<<<<<?????????????????????
283    //  };    };
284    //    //
285    // check the detectors to be shown    // check the detectors to be shown
286    //    //
# Line 277  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 286  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    };    };
309    //    //
310    if ( pamela->var.restart ){  //   if ( pamela->var.restart ){
311      filename = pamela->var.thefilename.Data();  //     filename = pamela->var.thefilename.Data();
312      goto restart;  //     goto restart;
313    };  //   };
314    //    //
315    // check if we are forcing level0 data    // check if we are forcing level0 data
316    //    //
# Line 307  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 371  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 424  void ShowEvent(TString filename="help", Line 441  void ShowEvent(TString filename="help",
441      } else {      } else {
442        stringstream dddec;        stringstream dddec;
443        dddec.str("");        dddec.str("");
444        dddec << " +ALL +RUN +CAL1 -TRKh -TRK1 ";        dddec << " +AUTO ";
445        if ( !otr0 ){        //      dddec << " +ALL +RUN +CAL1 -TRKh -TRK1 -TRK0 -CAL0";
446          dddec << " -TRG ";         if ( !otr0 ){
447          pamela->var.TRG = 0;          dddec << " -TRG ";
448          otr0 = otr1;          pamela->var.TRG = 0;
449        };          otr0 = otr1;
450        if ( !otr1 ){         };
451          dddec << " -CAL ";         if ( !otr1 ){
452          pamela->var.CALO = 0;          dddec << " -CAL ";
453          if ( !otr0 ) otr0 = otr2;          pamela->var.CALO = 0;
454        };          if ( !otr0 ) otr0 = otr2;
455        if ( !otr2 ){         };
456          dddec << " -TRK2 -TRK ";         if ( !otr2 ){
457          pamela->var.TRK = 0;          dddec << " -TRK2 -TRK ";
458          if ( !otr0 ) otr0 = otr3;          pamela->var.TRK = 0;
459        };          if ( !otr0 ) otr0 = otr3;
460        if ( !otr3 ){         };
461          dddec << " -ND ";         if ( !otr3 ){
462          pamela->var.ND = 0;          dddec << " -ND ";
463          if ( !otr0 ) otr0 = otr4;          pamela->var.ND = 0;
464        };          if ( !otr0 ) otr0 = otr4;
465        if ( !otr4 ){         };
466          dddec << " -ORB ";         if ( !otr4 ){
467          pamela->var.ORB = 0;          dddec << " -ORB ";
468          if ( !otr0 ) otr0 = otr5;          pamela->var.ORB = 0;
469        };          if ( !otr0 ) otr0 = otr5;
470        if ( !otr5 ){         };
471          dddec << " -S4 ";         if ( !otr5 ){
472          pamela->var.S4 = 0;          dddec << " -S4 ";
473          if ( !otr0 ) otr0 = otr6;          pamela->var.S4 = 0;
474        };          if ( !otr0 ) otr0 = otr6;
475        if ( !otr6 ){         };
476          dddec << " -TOF ";         if ( !otr6 ){
477          pamela->var.TOF = 0;          dddec << " -TOF ";
478          if ( !otr0 ) otr0 = otr8;          pamela->var.TOF = 0;
479        };          if ( !otr0 ) otr0 = otr8;
480        if ( !otr7 ){         };
481          dddec << " -RUN ";         if ( !otr7 ){
482          pamela->var.RUN = 0;          dddec << " -RUN ";
483        };          pamela->var.RUN = 0;
484        if ( !otr8 ){         };
485          dddec << " -AC ";         if ( !otr8 ){
486          pamela->var.AC = 0;          dddec << " -AC ";
487        };          pamela->var.AC = 0;
488           };
489        pamela->SetDDEC(dddec.str().c_str());        pamela->SetDDEC(dddec.str().c_str());
490      };      };
491      if ( !otr0 && !otr1 && !otr2 && !otr3 && !otr4 && !otr5 && !otr6 && !otr7 && !otr8 && !L0 ){      if ( !otr0 && !otr1 && !otr2 && !otr3 && !otr4 && !otr5 && !otr6 && !otr7 && !otr8 && !L0 ){
# Line 541  void ShowEvent(TString filename="help", Line 559  void ShowEvent(TString filename="help",
559    //    //
560    // display the first event (unless we are refreshing only the window)    // display the first event (unless we are refreshing only the window)
561    //    //
562    if ( !pamela->var.refresh ) i = pamela->minevent;    if ( !pamela->var.refresh && !pamela->var.restart ) i = pamela->minevent;
563      pamela->var.restart = false;
564    pamela->var.refresh = false;    pamela->var.refresh = false;
565    //    //
566    pamgui->RefreshButtons();    pamgui->RefreshButtons();
# Line 606  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 654  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;
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.10  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.23