/[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.3 by mocchiut, Mon Feb 26 17:30:33 2007 UTC revision 1.4 by mocchiut, Thu Mar 15 14:02:33 2007 UTC
# Line 146  void ShowEvent(TString filename="help", Line 146  void ShowEvent(TString filename="help",
146    pamela->SetGUIPtr(*pamgui);    pamela->SetGUIPtr(*pamgui);
147    if ( outDir == "" ) outDir = startingdir;        if ( outDir == "" ) outDir = startingdir;    
148    //    //
149      TTree *otr0 = 0;
150    TTree *otr1 = 0;    TTree *otr1 = 0;
151    TTree *otr2 = 0;    TTree *otr2 = 0;
152    TTree *otr3 = 0;    TTree *otr3 = 0;
# Line 327  void ShowEvent(TString filename="help", Line 328  void ShowEvent(TString filename="help",
328    //    //
329    //    //
330    TFile *headerFile = 0;    TFile *headerFile = 0;
331    TTree *otr = 0;    TChain *otr = 0;
332      TTree *L0 = 0;
333    //    //
334    // check if user has given as input a correct path    // check if user has given as input a correct path
335    //    //
# Line 350  void ShowEvent(TString filename="help", Line 352  void ShowEvent(TString filename="help",
352    // 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
353    //    //
354    headerFile=new TFile(filename.Data());    headerFile=new TFile(filename.Data());
355    if ( FORCELEV == 0 ){     if ( FORCELEV == 0 ){
356      pamela->level.file = 0;      pamela->level.file = 0;
357      otr = (TTree*)headerFile->Get("Physics");      L0 = (TTree*)headerFile->Get("Physics");
358      if ( !otr ){      if ( !L0 ){
359        printf("ERROR: no Physics tree...\n");        printf("ERROR: no Physics tree...\n");
360        pamgui->DIALOG(2,"No Physics tree in this file");        pamgui->DIALOG(2,"No Physics tree in this file");
361        pamela->var.waitforever = true;        pamela->var.waitforever = true;
# Line 361  void ShowEvent(TString filename="help", Line 363  void ShowEvent(TString filename="help",
363      }      }
364    } else {    } else {
365      pamela->level.file = 2;      pamela->level.file = 2;
366      otr = (TTree*)headerFile->Get("Trigger");      otr0 = (TTree*)headerFile->Get("Trigger");
367      otr1 = (TTree*)headerFile->Get("Calorimeter");      otr1 = (TTree*)headerFile->Get("Calorimeter");
368      otr2 = (TTree*)headerFile->Get("Tracker");      otr2 = (TTree*)headerFile->Get("Tracker");
369      otr3 = (TTree*)headerFile->Get("NeutronD");      otr3 = (TTree*)headerFile->Get("NeutronD");
# Line 370  void ShowEvent(TString filename="help", Line 372  void ShowEvent(TString filename="help",
372      otr6 = (TTree*)headerFile->Get("ToF");      otr6 = (TTree*)headerFile->Get("ToF");
373      otr7 = (TTree*)headerFile->Get("Run");      otr7 = (TTree*)headerFile->Get("Run");
374      otr8 = (TTree*)headerFile->Get("Anticounter");      otr8 = (TTree*)headerFile->Get("Anticounter");
375      if ( !otr && !otr1 && !otr2 && !otr3 && !otr4 && !otr5 && !otr6 && !otr7 && !otr8 ){      if ( !otr0 && !otr1 && !otr2 && !otr3 && !otr4 && !otr5 && !otr6 && !otr7 && !otr8 ){
376        otr = (TTree*)headerFile->Get("Physics");              L0 = (TTree*)headerFile->Get("Physics");      
377        pamela->level.file = -1;        pamela->level.file = -1;
378      } else {      } else {
379        stringstream dddec;        stringstream dddec;
380        dddec.str("");        dddec.str("");
381        dddec << " +ALL +CAL1 -TRKh -TRK1 ";        dddec << " +ALL +RUN +CAL1 -TRKh -TRK1 ";
382        if ( !otr ){        if ( !otr0 ){
383          dddec << " -TRG ";          dddec << " -TRG ";
384          pamela->var.TRG = 0;          pamela->var.TRG = 0;
385          otr = otr1;          otr0 = otr1;
386        };        };
387        if ( !otr1 ){        if ( !otr1 ){
388          dddec << " -CAL ";          dddec << " -CAL ";
389          pamela->var.CALO = 0;          pamela->var.CALO = 0;
390          if ( !otr ) otr = otr2;          if ( !otr0 ) otr0 = otr2;
391        };        };
392        if ( !otr2 ){        if ( !otr2 ){
393          dddec << " -TRK2 -TRK ";          dddec << " -TRK2 -TRK ";
394          pamela->var.TRK = 0;          pamela->var.TRK = 0;
395          if ( !otr ) otr = otr3;          if ( !otr0 ) otr0 = otr3;
396        };        };
397        if ( !otr3 ){        if ( !otr3 ){
398          dddec << " -ND ";          dddec << " -ND ";
399          pamela->var.ND = 0;          pamela->var.ND = 0;
400          if ( !otr ) otr = otr4;          if ( !otr0 ) otr0 = otr4;
401        };        };
402        if ( !otr4 ){        if ( !otr4 ){
403          dddec << " -ORB ";          dddec << " -ORB ";
404          pamela->var.ORB = 0;          pamela->var.ORB = 0;
405          if ( !otr ) otr = otr5;          if ( !otr0 ) otr0 = otr5;
406        };        };
407        if ( !otr5 ){        if ( !otr5 ){
408          dddec << " -S4 ";          dddec << " -S4 ";
409          pamela->var.S4 = 0;          pamela->var.S4 = 0;
410          if ( !otr ) otr = otr6;          if ( !otr0 ) otr0 = otr6;
411        };        };
412        if ( !otr6 ){        if ( !otr6 ){
413          dddec << " -TOF ";          dddec << " -TOF ";
414          pamela->var.TOF = 0;          pamela->var.TOF = 0;
415          if ( !otr ) otr = otr8;          if ( !otr0 ) otr0 = otr8;
416        };        };
417        if ( !otr7 ){        if ( !otr7 ){
418          dddec << " -RUN ";          dddec << " -RUN ";
# Line 422  void ShowEvent(TString filename="help", Line 424  void ShowEvent(TString filename="help",
424        };        };
425        pamela->SetDDEC(dddec.str().c_str());        pamela->SetDDEC(dddec.str().c_str());
426      };      };
427      if ( !otr && !otr1 && !otr2 && !otr3 && !otr4 && !otr5 && !otr6 && !otr7 && !otr8){      if ( !otr0 && !otr1 && !otr2 && !otr3 && !otr4 && !otr5 && !otr6 && !otr7 && !otr8 && !L0 ){
428        pamela->level.file = -1;        pamela->level.file = -1;
429        printf("ERROR: nor Physics nor Run tree...\n");        printf("ERROR: nor Physics nor Run tree...\n");
430        pamgui->DIALOG(2,"Nor Physics nor Run tree in this file");        pamgui->DIALOG(2,"Nor Physics nor Run tree in this file");
# Line 443  void ShowEvent(TString filename="help", Line 445  void ShowEvent(TString filename="help",
445    //    //
446    // Load the file    // Load the file
447    //    //
448    if ( otr ){    if ( otr0 || L0 ){
449      if ( !pamela->Load(*otr,*headerFile) ){      otr = pamela->Load(*headerFile);
450        if ( !otr ){
451        pamela->level.file = -1;        pamela->level.file = -1;
452        printf("ERROR: problems opening file...\n");        printf("ERROR: problems opening file...\n");
453        pamgui->DIALOG(2,"Problems opening file");        pamgui->DIALOG(2,"Problems opening file");
# Line 463  void ShowEvent(TString filename="help", Line 466  void ShowEvent(TString filename="help",
466    //    //
467    // get the number of entries    // get the number of entries
468    //    //
469    //  otr->Print();    //  otr = pamela->GetChain();
470      if ( !otr ) printf(" AGH! \n");
471    //    //
472    Long64_t nevents = otr->GetEntries();    Long64_t nevents = otr->GetEntries();
473    printf(" The file contains %i physics events \n",(int)nevents);    printf(" The file contains %i physics events \n",(int)nevents);

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

  ViewVC Help
Powered by ViewVC 1.1.23