Ignore:
Timestamp:
07/12/00 11:19:10 (24 years ago)
Author:
harald
Message:
Changed in a way that SIMONE is able to read CER files and print
the content of the shower on screen.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx

    r415 r418  
    66//
    77#include <stdlib.h>
    8 #include "TROOT.h"
    9 #include "TApplication.h"
    10 
    11 #include "TCanvas.h"
    12 #include "TView.h"
    13 
    14 #include "TSPHE.h"
    15 #include "TBRIK.h"
    16 
    17 #include "TNode.h"
    18 
    19 #include "TFile.h"
    20 #include "TNtuple.h"
    218
    229#include "COREventHeader.hxx"
     
    2411#include "CORStatfile.hxx"
    2512
    26 #include "MSimone.hxx"
    27 
    2813int main(int argc, char **argv)
    2914{
    30   // initialise ROOT
     15  char  path[100] = "" ;
    3116
    32   TROOT simple("simple", "SIMONE - statistic of MonteCarlo");
    33 
    34   TApplication theApp("App", &argc, argv);
    35  
    36   char  path[100] = "/dat1/Mmcs/Gamm/" ;
    37   //    char  path[100] = "/hd02/Maggi/Data/prot_15/" ;
    38   //    char  path[100] = "/data/mmcs/" ;
    3917  char  cername[120] ;
    4018  char  datname[120] ;
     
    4523  CORParticle    Photon ;
    4624 
    47   MSimone    Infos ;
    48    
    4925  Int_t iPhotonInShower ;
    5026 
    5127  Float_t lambda ;
    52  
     28
     29  cout << " ============================" << endl ;
     30  cout << " SIMONE" << endl ;
     31  cout << "                             " << endl ;
    5332  cout << " SImulated MONte carlo Events" << endl ;
     33  cout << "                             " << endl ;
    5434
    55   //
    56   //    now create a root-file for the ntuple output
    57   //
    58  
    59   TFile *outfile = new TFile("simone.root","RECREATE");
    60  
    61   TNtuple *Ntup = new TNtuple("simone",
    62                               "Simone info of mmcs",
    63                               "fPartId:fEnergy:fTheta:fPhi:fCoreX:fCoreY:fCoreD:fNumCerPhot");
    64  
    65  
     35
     36  if ( argc <= 1 ) {
     37    cout << endl ;
     38    cout << " INFO: You have to start the program with "<<endl <<endl ;
     39    cout << "        -> simone DIRECTORY_WITH_CER_FILES" <<endl <<endl ;
     40    cout << "        no SLASH at the end of the directory name"<<endl ;
     41    cout << "        (example: -> simone /hd123/Protons   "<<endl ;
     42    exit (-1) ;
     43  }
     44
     45  sprintf (path , "%s", argv[1] ) ;
     46   
    6647  for (int i_cer = 1; i_cer <= 100; i_cer++ ) {
    67     //
    68     //   info of progress
    69     //
    70     if (!( i_cer %10) )
    71       {
    72         cout << i_cer << endl ;
    73       }
    74 
    7548    //
    7649    //   create the file names
     
    9871   
    9972    Event.read( cerfile );
    100     Infos.Transfer ( &Event ) ;
    101    
     73 
     74    Event.Print() ;
     75
    10276    //
    10377    //   loop over the particles (cerenkov photons) in
     
    126100      iPhotonInShower++ ;
    127101     
    128       //Photon.print() ;
     102      Photon.print() ;
    129103    }
    130104   
    131     Infos.SetNumCerPhot( iPhotonInShower ) ;
    132    
    133105    //
    134     //   fill the ntuple
     106    //   close the file
    135107    //
    136    
    137     Infos.NtupFill ( Ntup ) ;
    138    
    139108   
    140109    cerfile.close();
     
    144113  }
    145114 
    146  
    147   //
    148   //   write all to file
    149   //
    150   outfile->Write() ;
    151 
    152  
    153   //
    154   //
    155   //
    156 
    157   Ntup->Draw("fEnergy") ;
    158 
    159 
    160   theApp.Run();
    161   return 0;                           
    162    
    163  
    164115}
    165116
Note: See TracChangeset for help on using the changeset viewer.