/[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.7 by mocchiut, Fri Mar 30 11:16:44 2007 UTC revision 1.11 by mocchiut, Thu Nov 8 11:05:38 2007 UTC
# Line 129  void ShowEvent(TString filename="help", Line 129  void ShowEvent(TString filename="help",
129    Float_t winy = (float)hw*0.80; // 95    Float_t winy = (float)hw*0.80; // 95
130    Float_t winrap = winx/winy;    Float_t winrap = winx/winy;
131    //    //
132      //
133      //
134      TString plugindir = (TString)gSystem->ExpandPathName("$FEV_PLUGIN");
135      if ( strcmp(plugindir,"$FEV_PLUGIN") ){
136        TString wdir = gSystem->WorkingDirectory();    
137        printf("\n\n Plugin directory is %s \n",plugindir.Data());
138        printf(" Loading plugins: \n");
139        //
140        TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(plugindir),plugindir);
141        TList *temp = datadir->GetListOfFiles();
142        TIter next(temp);
143        TSystemFile *questo = 0;
144        Int_t npl = 0;
145        while ( (questo = (TSystemFile*) next()) ) {
146          TString name =  questo->GetName();
147          if( name.EndsWith(".so") || name.EndsWith(".o") ){
148            npl++;
149            char *fullpath = gSystem->ConcatFileName(gSystem->DirName(plugindir),gSystem->BaseName(name));          
150            gSystem->Load(fullpath);
151            printf(" %i -> %s plugin loaded \n",npl,name.Data());
152            delete fullpath;
153          };
154        }
155        delete temp;
156        delete datadir;
157      };
158      //
159    //  book the canvas    //  book the canvas
160    //    //
161    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 177  void ShowEvent(TString filename="help", Line 204  void ShowEvent(TString filename="help",
204    if ( filename.Data() == "" || !strcmp(filename.Data(),"help") ){    if ( filename.Data() == "" || !strcmp(filename.Data(),"help") ){
205      pamela->var.waitforever = true;      pamela->var.waitforever = true;
206    };    };
207    //  //   //
208    // chek if we are forcing level0  //   // chek if we are forcing level0
209    //  //   //
210    if ( pamela->var.fl0 == true ){  //   if ( pamela->var.fl0 == true ){
211      FORCELEV = 0;  //     FORCELEV = 0;
212    } else {  //   } else {
213      FORCELEV = -1;  //     FORCELEV = -1;
214    };  //   };
215    //    //
216    //  Define some variables    //  Define some variables
217    //    //
# Line 235  void ShowEvent(TString filename="help", Line 262  void ShowEvent(TString filename="help",
262    };    };
263    //    //
264    //    //
265    //  if ( pamela->var.fl0 == true ) {    if ( pamela->var.fl0 == true ) {
266    //    FORCELEV = 0;      FORCELEV = 0;
267    //  } else {    } else {
268    //    if ( pamela->var.refresh ) FORCELEV = -1;           //<<<<<<<<<<<<<<<<<<<<<<<<<<?????????????????????      if ( pamela->var.refresh ) FORCELEV = -1;           //<<<<<<<<<<<<<<<<<<<<<<<<<<?????????????????????
269    //  };    };
270    //    //
271    // check the detectors to be shown    // check the detectors to be shown
272    //    //
# Line 298  void ShowEvent(TString filename="help", Line 325  void ShowEvent(TString filename="help",
325      //      //
326      // load the structure header      // load the structure header
327      //      //
328      carica.str("");       carica.str("");
329      carica << paminc.str().c_str() << "/feventvstruct.h";       carica << paminc.str().c_str() << "/feventvstruct.h";
330      gROOT->LoadMacro(carica.str().c_str());       gROOT->LoadMacro(carica.str().c_str());
331        //    carica.str("");
332        //    carica << paminc.str().c_str() << "/CaloNuclei.h";
333        //    gROOT->LoadMacro(carica.str().c_str());
334      //      //
335      // load the selection macro      // load the selection macro
336      //      //
# Line 366  void ShowEvent(TString filename="help", Line 396  void ShowEvent(TString filename="help",
396    //    //
397    // ok, open file and determine if it is a YODA or DARTHVADER file    // ok, open file and determine if it is a YODA or DARTHVADER file
398    //    //
399    
400    headerFile=new TFile(filename.Data());    headerFile=new TFile(filename.Data());
401     if ( FORCELEV == 0 ){    if ( FORCELEV == 0 ){
402      pamela->level.file = 0;      pamela->level.file = 0;
403      L0 = (TTree*)headerFile->Get("Physics");      L0 = (TTree*)headerFile->Get("Physics");
404      if ( !L0 ){      if ( !L0 ){
# Line 393  void ShowEvent(TString filename="help", Line 424  void ShowEvent(TString filename="help",
424      } else {      } else {
425        stringstream dddec;        stringstream dddec;
426        dddec.str("");        dddec.str("");
427        dddec << " +ALL +RUN +CAL1 -TRKh -TRK1 ";        dddec << " +AUTO ";
428        if ( !otr0 ){        //      dddec << " +ALL +RUN +CAL1 -TRKh -TRK1 -TRK0 -CAL0";
429          dddec << " -TRG ";  //       if ( !otr0 ){
430          pamela->var.TRG = 0;  //      dddec << " -TRG ";
431          otr0 = otr1;  //      pamela->var.TRG = 0;
432        };  //      otr0 = otr1;
433        if ( !otr1 ){  //       };
434          dddec << " -CAL ";  //       if ( !otr1 ){
435          pamela->var.CALO = 0;  //      dddec << " -CAL ";
436          if ( !otr0 ) otr0 = otr2;  //              pamela->var.CALO = 0;
437        };  //      if ( !otr0 ) otr0 = otr2;
438        if ( !otr2 ){  //       };
439          dddec << " -TRK2 -TRK ";  //       if ( !otr2 ){
440          pamela->var.TRK = 0;  //      dddec << " -TRK2 -TRK ";
441          if ( !otr0 ) otr0 = otr3;  //              pamela->var.TRK = 0;
442        };  //      if ( !otr0 ) otr0 = otr3;
443        if ( !otr3 ){  //       };
444          dddec << " -ND ";  //       if ( !otr3 ){
445          pamela->var.ND = 0;  //      dddec << " -ND ";
446          if ( !otr0 ) otr0 = otr4;  //              pamela->var.ND = 0;
447        };  //      if ( !otr0 ) otr0 = otr4;
448        if ( !otr4 ){  //       };
449          dddec << " -ORB ";  //       if ( !otr4 ){
450          pamela->var.ORB = 0;  //      dddec << " -ORB ";
451          if ( !otr0 ) otr0 = otr5;  //      pamela->var.ORB = 0;
452        };  //      if ( !otr0 ) otr0 = otr5;
453        if ( !otr5 ){  //       };
454          dddec << " -S4 ";  //       if ( !otr5 ){
455          pamela->var.S4 = 0;  //      dddec << " -S4 ";
456          if ( !otr0 ) otr0 = otr6;  //              pamela->var.S4 = 0;
457        };  //      if ( !otr0 ) otr0 = otr6;
458        if ( !otr6 ){  //       };
459          dddec << " -TOF ";  //       if ( !otr6 ){
460          pamela->var.TOF = 0;  //      dddec << " -TOF ";
461          if ( !otr0 ) otr0 = otr8;  //              pamela->var.TOF = 0;
462        };  //      if ( !otr0 ) otr0 = otr8;
463        if ( !otr7 ){  //       };
464          dddec << " -RUN ";  //       if ( !otr7 ){
465          pamela->var.RUN = 0;  //      dddec << " -RUN ";
466        };  //      pamela->var.RUN = 0;
467        if ( !otr8 ){  //       };
468          dddec << " -AC ";  //       if ( !otr8 ){
469          pamela->var.AC = 0;  //      dddec << " -AC ";
470        };  //              pamela->var.AC = 0;
471    //       };
472        pamela->SetDDEC(dddec.str().c_str());        pamela->SetDDEC(dddec.str().c_str());
473      };      };
474      if ( !otr0 && !otr1 && !otr2 && !otr3 && !otr4 && !otr5 && !otr6 && !otr7 && !otr8 && !L0 ){      if ( !otr0 && !otr1 && !otr2 && !otr3 && !otr4 && !otr5 && !otr6 && !otr7 && !otr8 && !L0 ){
# Line 447  void ShowEvent(TString filename="help", Line 479  void ShowEvent(TString filename="help",
479        goto refresh;        goto refresh;
480      };      };
481    };    };
482      headerFile->Close("R");
483    //    //
484    if ( pamela->level.file != 2 ){    if ( pamela->level.file != 2 ){
485      printf(" This is a YODA (level0) file \n");      printf(" This is a YODA (level0) file \n");
# Line 461  void ShowEvent(TString filename="help", Line 494  void ShowEvent(TString filename="help",
494    // Load the file    // Load the file
495    //    //
496    if ( otr0 || L0 ){    if ( otr0 || L0 ){
497      otr = pamela->Load(*headerFile);      otr = pamela->Load(filename.Data());
498      if ( !otr ){      if ( !otr ){
499        pamela->level.file = -1;        pamela->level.file = -1;
500        printf("ERROR: problems opening file...\n");        printf("ERROR: problems opening file...\n");
# Line 481  void ShowEvent(TString filename="help", Line 514  void ShowEvent(TString filename="help",
514    //    //
515    // get the number of entries    // get the number of entries
516    //    //
   //  otr = pamela->GetChain();  
517    if ( !otr ) printf(" AGH! \n");    if ( !otr ) printf(" AGH! \n");
518    //    //
519    Long64_t nevents = otr->GetEntries();    Long64_t nevents = otr->GetEntries();
# Line 490  void ShowEvent(TString filename="help", Line 522  void ShowEvent(TString filename="help",
522    // check we have at least one event    // check we have at least one event
523    //    //
524    if (nevents<=0) {    if (nevents<=0) {
525      headerFile->Close();      //    headerFile->Close();
526      printf("The file is empty, exiting...\n");      printf("The file is empty, exiting...\n");
527      pamgui->DIALOG(0," The file contains no physics data! ");      pamgui->DIALOG(0," The file contains no physics data! ");
528      pamela->var.waitforever = true;      pamela->var.waitforever = true;
# Line 626  void ShowEvent(TString filename="help", Line 658  void ShowEvent(TString filename="help",
658          if ( pamela->GetL2() ) pamela->GetL2()->Reset();          if ( pamela->GetL2() ) pamela->GetL2()->Reset();
659          if ( pamela->level.file != 2 ) pamela->GetChain()->Delete();          if ( pamela->level.file != 2 ) pamela->GetChain()->Delete();
660          otr = NULL;          otr = NULL;
661          if ( headerFile ) headerFile->Close("R");          //      if ( headerFile ) headerFile->Close("R");
662          if ( pamela->var.refresh ) goto refresh;          if ( pamela->var.refresh ) goto refresh;
663          if ( pamela->var.restart ){          if ( pamela->var.restart ){
664            filename = pamela->var.thefilename.Data();            filename = pamela->var.thefilename.Data();

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

  ViewVC Help
Powered by ViewVC 1.1.23