Changeset 425 for trunk


Ignore:
Timestamp:
07/17/00 09:05:20 (24 years ago)
Author:
harald
Message:
first version with the possibility of drawing event distributions
Location:
trunk/MagicSoft/Simulation/Corsika/GuiSimone
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Corsika/GuiSimone/MainFrameSimone.cxx

    r424 r425  
    2626
    2727  fNtupEvt = new TNtuple ("fNtupEvt", "Ntuple with Event distributions",
    28                           "WaveLen:PosX:PoxY:Height:Time:DireX:DireY") ;
     28                          "WaveLen:PosX:PosY:Height:Time:DireX:DireY") ;
    2929 
    3030
     
    3434
    3535  //
    36   // First create the MenuBar.
    37   //
     36  // First create the MenuBar.   //
    3837
    3938  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX,
     
    215214  fTabF3 = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ;
    216215   
    217   tf->AddFrame(fTabF3, fLayTab) ;
     216  tf->AddFrame(fTabF3, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5)) ;
    218217
    219218
     
    408407  else 
    409408    printf("No Ntuple exist!!\n");
     409
     410  return (kFALSE) ;
     411}
     412
     413
     414// ======================================================================
     415// ======================================================================       
     416
     417Bool_t MainFrameSimone::DrawEvtParam (Char_t *paraName) {
     418
     419  TCanvas *canvas =  fCanvasEvt->GetCanvas();
     420 
     421  canvas->cd() ;
     422
     423  if ( fNtupEvt->GetEntries() > 0  ) 
     424    {
     425      fNtupEvt->Draw(paraName) ;
     426      canvas->Modified() ;
     427      canvas->Update() ;
     428     
     429      return(kTRUE) ;
     430    }
     431  else 
     432    printf("No entries in Ntuple!!\n");
    410433
    411434  return (kFALSE) ;
     
    588611}
    589612
     613
     614// ======================================================================
     615// ======================================================================
     616
     617Bool_t MainFrameSimone::ReadinEvt()
     618{
     619  FILE  *unit ;
     620  Char_t  filename[256] ;
     621
     622  ifstream   cerfile ;
     623 
     624  COREventHeader Event ;   
     625  CORParticle    Photon ;
     626 
     627  Int_t iPhotonInShower ;
     628  Float_t lambda ;
     629
     630  //
     631  //  check the input Path
     632  //
     633
     634  if ( ! strcmp( fInputPath, "\0")  ) {
     635    printf ("No InputPath specified!! Do this before!!\n") ;
     636    return (kFALSE) ;
     637  }
     638 
     639  if ( fEvtNb == 0 ) {
     640    printf ("Don't press the Prev Button at the first time!!\n") ;
     641    return (kFALSE) ;
     642  }
     643
     644  sprintf ( filename, "%s/cer%06d", fInputPath, fEvtNb ) ;
     645  cout << filename << endl ;
     646
     647  fNtupEvt->Reset() ;
     648 
     649  //
     650  //   open the file
     651  //
     652 
     653  cerfile.open( filename );
     654   
     655  if ( cerfile.bad() ) {
     656    cout << "Cannot open input file:  " << filename << endl ;
     657   
     658    return (kFALSE) ;
     659  }
     660
     661  //
     662  //   read in the header
     663  //
     664     
     665  Event.read( cerfile );
     666 
     667  //
     668  //   loop over the particles
     669  //
     670 
     671   
     672  iPhotonInShower = 0 ;
     673   
     674  while( ! (cerfile.eof() || cerfile.bad() )) {
     675     
     676    //
     677    //   read in the particles
     678    //
     679     
     680    Photon.read ( cerfile ) ;
     681          //
     682    //   only if the wavelength lambda is greater than
     683    //   1.0 it is a real cerenkov photon
     684    //
     685   
     686    lambda = Photon.get_wl() ;
     687   
     688    if ( lambda < 1.0 )
     689      break ;
     690   
     691    iPhotonInShower++ ;
     692   
     693    Photon.print() ;
     694
     695    fNtupEvt->Fill(Photon.get_wl(),
     696                   Photon.get_x(),
     697                   Photon.get_y(),
     698                   Photon.get_h(),
     699                   Photon.get_t(),
     700                   Photon.get_u(),
     701                   Photon.get_v()  ) ;
     702
     703    }
     704 
     705 
     706  //
     707  //   close the file
     708  //
     709   
     710  cerfile.close();
     711 
     712
     713  cout << fNtupEvt->GetEntries()  << endl ;
     714 
     715  return (kTRUE) ;
     716
     717}
    590718// ======================================================================
    591719// ======================================================================
     
    730858        fEvtNb-- ;
    731859       
    732 
    733 
     860        if (fEvtNb < 1 ) {
     861          fEvtNb++ ;
     862         
     863        }
     864         
    734865        sprintf (wort2, "%d", fEvtNb ) ;
    735866        fDirEvtNb->RemoveEntry(1) ;
     
    737868        fDirEvtNb->MapSubwindows() ;
    738869        fDirEvtNb->Layout() ;
     870
     871        ReadinEvt() ;
    739872        break; 
    740873
     
    747880        fDirEvtNb->AddEntry( wort2, 1 ) ;
    748881        fDirEvtNb->MapSubwindows() ;
    749         fDirEvtNb->Layout() ;
     882        fDirEvtNb->Layout() ;
     883
     884        ReadinEvt() ;
     885       
    750886        break; 
     887
     888
     889      case M_BUTTON_WAVELEN:
     890        DrawEvtParam("WaveLen") ;
     891        break;
     892
     893      case M_BUTTON_POSIT:
     894        DrawEvtParam("PosY:PosX") ;
     895        break;
     896
     897      case M_BUTTON_HEIGHT:
     898        DrawEvtParam("Height") ;
     899        break;
     900
     901      case M_BUTTON_TIME:
     902        DrawEvtParam("Time") ;
     903        break;
     904
     905      case M_BUTTON_DIRE:
     906        DrawEvtParam("DireX:DireY") ;
     907        break;
    751908
    752909
  • trunk/MagicSoft/Simulation/Corsika/GuiSimone/MainFrameSimone.hxx

    r424 r425  
    1515
    1616#include "COREventHeader.hxx"
     17#include "CORParticle.hxx"
    1718
    1819
     
    104105  void CloseWindow()  ;
    105106
    106 
    107107  Bool_t CerFileExist(Char_t *dir) ;
    108108  Bool_t DrawRunParam(Char_t *paraName) ;
     109  Bool_t DrawEvtParam(Char_t *paraName) ;
     110
    109111  Bool_t CheckNtup() ;
     112
    110113  Bool_t ReadDataToNtup() ;
     114  Bool_t ReadinEvt() ;
     115
    111116  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
    112117
     
    119124
    120125
    121 
    122 
    123 
    124 
    125 
    126 
    127 
    128 
    129 
  • trunk/MagicSoft/Simulation/Corsika/GuiSimone/Makefile

    r424 r425  
    1919#
    2020# $RCSfile: Makefile,v $
    21 # $Revision: 1.4 $
     21# $Revision: 1.5 $
    2222# $Author: harald $
    23 # $Date: 2000-07-15 11:15:57 $
     23# $Date: 2000-07-17 08:05:20 $
    2424#
    2525##################################################################
     
    168168../../Detector/include-CORSIKA/COREventHeader.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
    169169../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/stdlib.h
    170 ../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/standards.h
    171 ../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/getopt.h
     170../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/features.h
     171../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/cdefs.h
     172../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/gnu/stubs.h
     173../../Detector/include-CORSIKA/COREventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
    172174../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/types.h
    173 ../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/mach/machine/vm_types.h
     175../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/types.h
     176../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/time.h
     177../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/endian.h
     178../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/endian.h
    174179../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/select.h
     180../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/select.h
     181../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/sigset.h
     182../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/sysmacros.h
     183../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/alloca.h
    175184../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/math.h
     185../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/huge_val.h
     186../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/mathdef.h
     187../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/mathcalls.h
     188../../Detector/include-CORSIKA/COREventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
    176189../../Detector/include-CORSIKA/CORParticle.o: ../../Detector/include-CORSIKA/CORParticle.hxx
    177190../../Detector/include-CORSIKA/CORParticle.o: /usr/include/stdlib.h
    178 ../../Detector/include-CORSIKA/CORParticle.o: /usr/include/standards.h
    179 ../../Detector/include-CORSIKA/CORParticle.o: /usr/include/getopt.h
     191../../Detector/include-CORSIKA/CORParticle.o: /usr/include/features.h
     192../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/cdefs.h
     193../../Detector/include-CORSIKA/CORParticle.o: /usr/include/gnu/stubs.h
     194../../Detector/include-CORSIKA/CORParticle.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
    180195../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/types.h
    181 ../../Detector/include-CORSIKA/CORParticle.o: /usr/include/mach/machine/vm_types.h
     196../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/types.h
     197../../Detector/include-CORSIKA/CORParticle.o: /usr/include/time.h
     198../../Detector/include-CORSIKA/CORParticle.o: /usr/include/endian.h
     199../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/endian.h
    182200../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/select.h
     201../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/select.h
     202../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/sigset.h
     203../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/sysmacros.h
     204../../Detector/include-CORSIKA/CORParticle.o: /usr/include/alloca.h
    183205../../Detector/include-CORSIKA/CORParticle.o: /usr/include/math.h
     206../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/huge_val.h
     207../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/mathdef.h
     208../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/mathcalls.h
     209../../Detector/include-CORSIKA/CORParticle.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
    184210../../Detector/include-CORSIKA/CORStatfile.o: ../../Detector/include-CORSIKA/CORStatfile.hxx
    185211../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/stdlib.h
    186 ../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/standards.h
    187 ../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/getopt.h
     212../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/features.h
     213../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/cdefs.h
     214../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/gnu/stubs.h
     215../../Detector/include-CORSIKA/CORStatfile.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
    188216../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/types.h
    189 ../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/mach/machine/vm_types.h
     217../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/types.h
     218../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/time.h
     219../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/endian.h
     220../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/endian.h
    190221../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/select.h
     222../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/select.h
     223../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/sigset.h
     224../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/sysmacros.h
     225../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/alloca.h
    191226../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/math.h
     227../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/huge_val.h
     228../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/mathdef.h
     229../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/mathcalls.h
     230../../Detector/include-CORSIKA/CORStatfile.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
    192231MainFrameSimone.o: MainFrameSimone.hxx
    193232MainFrameSimone.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
    194 MainFrameSimone.o: /usr/include/stdlib.h /usr/include/standards.h
    195 MainFrameSimone.o: /usr/include/getopt.h /usr/include/sys/types.h
    196 MainFrameSimone.o: /usr/include/mach/machine/vm_types.h
    197 MainFrameSimone.o: /usr/include/sys/select.h /usr/include/math.h
    198 simone.o: /usr/include/stdlib.h /usr/include/standards.h
    199 simone.o: /usr/include/getopt.h /usr/include/sys/types.h
    200 simone.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
     233MainFrameSimone.o: /usr/include/stdlib.h /usr/include/features.h
     234MainFrameSimone.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
     235MainFrameSimone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
     236MainFrameSimone.o: /usr/include/sys/types.h /usr/include/bits/types.h
     237MainFrameSimone.o: /usr/include/time.h /usr/include/endian.h
     238MainFrameSimone.o: /usr/include/bits/endian.h /usr/include/sys/select.h
     239MainFrameSimone.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
     240MainFrameSimone.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
     241MainFrameSimone.o: /usr/include/math.h /usr/include/bits/huge_val.h
     242MainFrameSimone.o: /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h
     243MainFrameSimone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
     244MainFrameSimone.o: ../../Detector/include-CORSIKA/CORParticle.hxx
     245simone.o: /usr/include/stdlib.h /usr/include/features.h
     246simone.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
     247simone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
     248simone.o: /usr/include/sys/types.h /usr/include/bits/types.h
     249simone.o: /usr/include/time.h /usr/include/endian.h
     250simone.o: /usr/include/bits/endian.h /usr/include/sys/select.h
     251simone.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
     252simone.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
    201253simone.o: MainFrameSimone.hxx
    202254simone.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
    203 simone.o: /usr/include/math.h
     255simone.o: /usr/include/math.h /usr/include/bits/huge_val.h
     256simone.o: /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h
     257simone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
     258simone.o: ../../Detector/include-CORSIKA/CORParticle.hxx
Note: See TracChangeset for help on using the changeset viewer.