Changeset 415


Ignore:
Timestamp:
07/06/00 11:24:00 (24 years ago)
Author:
harald
Message:
small changes to read in also cphotons
Location:
trunk/MagicSoft/Simulation/Corsika/Simone
Files:
5 edited

Legend:

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

    r324 r415  
    2727  CoreY   = 0. ;
    2828 
    29   FirstInt = 0. ;
     29  FirstInt = 0. ;
     30
     31  NumCerPhot = 0. ;
    3032}
    3133
     
    5557 
    5658  FirstInt= 0.  ;
     59
     60  NumCerPhot = 0. ;
    5761}
    5862
     
    7781  Phi            = e->Phi;
    7882 
     83  Float_t x, y ;
     84
     85  CoreD = e->get_core(&x, &y, 0 ) ;
     86
     87  CoreX = x ;
     88  CoreY = y ;
     89
    7990  FirstInt      = e->zFirstInt;
     91
    8092}
    8193
     94void MSimone::SetNumCerPhot( Int_t iN )
     95{
     96  NumCerPhot = (Float_t) iN ;
     97}
    8298
    8399void MSimone::NtupFill( TNtuple *n )
    84100{
    85   n->Fill(PartId,Energy,Theta,Phi) ;
     101  n->Fill(PartId,Energy,Theta,Phi,CoreX, CoreY, CoreD, NumCerPhot ) ;
    86102}
    87103
  • trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.hxx

    r324 r415  
    2929  Float_t  FirstInt ;    // First interaction in cm above sea level
    3030
    31 
     31  Float_t  NumCerPhot ;  // Number of Cerenkov photons in shower
     32 
    3233 public:
    3334  MSimone() ;         
     
    4344  void NtupFill ( TNtuple *n ) ;
    4445
     46  void SetNumCerPhot( Int_t iN ) ;
     47
    4548  //  ClassDef(MSimone, 1)   //Stores Montecarlo Information
    4649
  • trunk/MagicSoft/Simulation/Corsika/Simone/Makefile

    r324 r415  
    1919#
    2020# $RCSfile: Makefile,v $
    21 # $Revision: 1.1.1.1 $
     21# $Revision: 1.2 $
    2222# $Author: harald $
    23 # $Date: 1999-11-18 09:39:14 $
     23# $Date: 2000-07-06 10:24:00 $
    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
    192 MSimone.o: MSimone.hxx /usr/include/stdlib.h /usr/include/standards.h
    193 MSimone.o: /usr/include/getopt.h /usr/include/sys/types.h
    194 MSimone.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
    195 MSimone.o: /usr/include/stdio.h /usr/include/sys/seek.h
    196 MSimone.o: /usr/include/va_list.h /usr/include/sys/limits.h
    197 MSimone.o: /usr/include/sys/machine/machlimits.h /usr/include/sys/syslimits.h
    198 MSimone.o: /usr/include/sys/machine/machtime.h /usr/include/sys/rt_limits.h
    199 MSimone.o: /usr/include/string.h /usr/include/strings.h /usr/include/unistd.h
    200 MSimone.o: /usr/include/sys/access.h /usr/include/fcntl.h
    201 MSimone.o: /usr/include/sys/fcntl.h /usr/include/sys/mode.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
     231MSimone.o: MSimone.hxx /usr/include/stdlib.h /usr/include/features.h
     232MSimone.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
     233MSimone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
     234MSimone.o: /usr/include/sys/types.h /usr/include/bits/types.h
     235MSimone.o: /usr/include/time.h /usr/include/endian.h
     236MSimone.o: /usr/include/bits/endian.h /usr/include/sys/select.h
     237MSimone.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
     238MSimone.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
     239MSimone.o: /usr/include/stdio.h
     240MSimone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
     241MSimone.o: /usr/include/libio.h /usr/include/_G_config.h
     242MSimone.o: /usr/include/bits/stdio_lim.h /usr/include/string.h
     243MSimone.o: /usr/include/unistd.h /usr/include/bits/posix_opt.h
     244MSimone.o: /usr/include/bits/confname.h /usr/include/getopt.h
     245MSimone.o: /usr/include/fcntl.h /usr/include/bits/fcntl.h
    202246MSimone.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
    203 MSimone.o: /usr/include/math.h
    204 simone.o: /usr/include/stdlib.h /usr/include/standards.h
    205 simone.o: /usr/include/getopt.h /usr/include/sys/types.h
    206 simone.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
     247MSimone.o: /usr/include/math.h /usr/include/bits/huge_val.h
     248MSimone.o: /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h
     249MSimone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
     250simone.o: /usr/include/stdlib.h /usr/include/features.h
     251simone.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
     252simone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
     253simone.o: /usr/include/sys/types.h /usr/include/bits/types.h
     254simone.o: /usr/include/time.h /usr/include/endian.h
     255simone.o: /usr/include/bits/endian.h /usr/include/sys/select.h
     256simone.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
     257simone.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
    207258simone.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
    208 simone.o: /usr/include/math.h ../../Detector/include-CORSIKA/CORParticle.hxx
     259simone.o: /usr/include/math.h /usr/include/bits/huge_val.h
     260simone.o: /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h
     261simone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
     262simone.o: ../../Detector/include-CORSIKA/CORParticle.hxx
    209263simone.o: ../../Detector/include-CORSIKA/CORStatfile.hxx MSimone.hxx
    210 simone.o: /usr/include/stdio.h /usr/include/sys/seek.h /usr/include/va_list.h
    211 simone.o: /usr/include/sys/limits.h /usr/include/sys/machine/machlimits.h
    212 simone.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
    213 simone.o: /usr/include/sys/rt_limits.h /usr/include/string.h
    214 simone.o: /usr/include/strings.h /usr/include/unistd.h
    215 simone.o: /usr/include/sys/access.h /usr/include/fcntl.h
    216 simone.o: /usr/include/sys/fcntl.h /usr/include/sys/mode.h
     264simone.o: /usr/include/stdio.h
     265simone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
     266simone.o: /usr/include/libio.h /usr/include/_G_config.h
     267simone.o: /usr/include/bits/stdio_lim.h /usr/include/string.h
     268simone.o: /usr/include/unistd.h /usr/include/bits/posix_opt.h
     269simone.o: /usr/include/bits/confname.h /usr/include/getopt.h
     270simone.o: /usr/include/fcntl.h /usr/include/bits/fcntl.h
  • trunk/MagicSoft/Simulation/Corsika/Simone/config.mk.linux-gnu

    r324 r415  
    1818#---------------------------------------------------------------
    1919# $RCSfile: config.mk.linux-gnu,v $
    20 # $Revision: 1.1.1.1 $
     20# $Revision: 1.2 $
    2121# $Author: harald $
    22 # $Date: 1999-11-18 09:39:14 $
     22# $Date: 2000-07-06 10:24:00 $
    2323##################################################################
    2424# @maintitle
     
    5252
    5353
    54 ROOTLIBS      = -L$(ROOTSYS)/lib -lNew -lBase -lCint -lClib \
    55                 -lCont -lFunc -lGraf -lGraf3d -lHist -lHtml \
    56                 -lMatrix -lMeta -lMinuit -lNet -lPostscript \
    57                 -lProof -lTree -lUnix -lZip -lRint
     54ROOTLIBS      = -L/cern/root/lib -lNew -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lm -ldl -lpthread -rdynamic
    5855
    5956ROOTGLIBS     = -lGpad -lGui -lGX11 -lX3d -lX11
  • trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx

    r405 r415  
    77#include <stdlib.h>
    88#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"
    918
    1019#include "TFile.h"
     
    1726#include "MSimone.hxx"
    1827
    19 main()
    20   {
    21     // initialise ROOT
     28int main(int argc, char **argv)
     29{
     30  // initialise ROOT
    2231
    23     TROOT simple("simple", "SIMONE - statistic of MonteCarlo");
    24              
    25     //    char  path[100] = "/hd61/Maggi/Data/mcMAGIC-1-30:30000-1" ;
    26     char  path[100] = "/hd02/Maggi/Data/prot_15/" ;
    27     //    char  path[100] = "/data/mmcs/" ;
    28     char  cername[120] ;
    29     char  datname[120] ;
     32  TROOT simple("simple", "SIMONE - statistic of MonteCarlo");
    3033
    31     ifstream   cerfile ;
     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/" ;
     39  char  cername[120] ;
     40  char  datname[120] ;
     41 
     42  ifstream   cerfile ;
     43 
     44  COREventHeader Event ;   
     45  CORParticle    Photon ;
     46 
     47  MSimone    Infos ;
     48   
     49  Int_t iPhotonInShower ;
     50 
     51  Float_t lambda ;
     52 
     53  cout << " SImulated MONte carlo Events" << endl ;
    3254
    33     COREventHeader Event ;   
    34     CORParticle    Photon ;
     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 
     66  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      }
    3574
    36     MSimone    Infos ;
     75    //
     76    //   create the file names
     77    //
     78    sprintf ( cername, "%s/cer%06d", path, i_cer ) ;
     79    sprintf ( datname, "%s/dat%06d", path, i_cer ) ;
    3780   
    38     Int_t iPhotonInShower ;
     81    //      cout << cername  << endl ;
     82    //      cout << datname  << endl ;
     83   
     84    //
     85    //   try to open the files
     86    //
     87   
     88    cerfile.open( cername );
     89   
     90    if ( cerfile.bad() ) {
     91      cout << "Cannot open input file:  " << cername << endl ;
     92      continue ;
     93    }
     94   
     95    //   
     96    //    cout << " Read event " << endl ;
     97    //
     98   
     99    Event.read( cerfile );
     100    Infos.Transfer ( &Event ) ;
     101   
     102    //
     103    //   loop over the particles (cerenkov photons) in
     104    //   the file
     105    //
     106   
     107    iPhotonInShower = 0 ;
     108   
     109    while( ! (cerfile.eof() || cerfile.bad() )) {
     110     
     111      //
     112      //   read in the particles
     113      //
     114     
     115      Photon.read ( cerfile ) ;
     116     
     117      //
     118      //   only if the wavelength lambda is greater than
     119      //   1.0 it is a real cerenkov photon
     120      //
     121      lambda = Photon.get_wl() ;
     122     
     123      if ( lambda < 1.0 )
     124        break ;
     125     
     126      iPhotonInShower++ ;
     127     
     128      //Photon.print() ;
     129    }
     130   
     131    Infos.SetNumCerPhot( iPhotonInShower ) ;
     132   
     133    //
     134    //   fill the ntuple
     135    //
     136   
     137    Infos.NtupFill ( Ntup ) ;
     138   
     139   
     140    cerfile.close();
     141   
     142   
     143   
     144  }
     145 
     146 
     147  //
     148  //   write all to file
     149  //
     150  outfile->Write() ;
    39151
    40     Float_t lambda ;
    41     //
    42     //    now create a root-file for the ntuple output
    43     //
     152 
     153  //
     154  //
     155  //
    44156
    45     TFile *outfile = new TFile("simone.root","RECREATE");
    46 
    47     TNtuple *Ntup = new TNtuple("simone",
    48                                "Simone info of mmcs",
    49                                "fPartId:fEnergy:fTheta:fPhi");
     157  Ntup->Draw("fEnergy") ;
    50158
    51159
    52     for (int i_cer = 1; i_cer <= 100; i_cer++ ) {
    53 
    54       //
    55       //   info of progress
    56       //
    57       if (!( i_cer %10) )
    58         {
    59           cout << i_cer << endl ;
    60         }
    61 
    62       //
    63       //   create the file names
    64       //
    65       sprintf ( cername, "%s/cer%06d", path, i_cer ) ;
    66       sprintf ( datname, "%s/dat%06d", path, i_cer ) ;
    67 
    68       //      cout << cername  << endl ;
    69       //      cout << datname  << endl ;
    70 
    71       //
    72       //   try to open the files
    73       //
    74 
    75       cerfile.open( cername );
    76        
    77       if ( cerfile.bad() ) {
    78         cout << "Cannot open input file:  " << cername << endl ;
    79         continue ;
    80       }
    81          
    82       //   
    83       //    cout << " Read event " << endl ;
    84       //
    85 
    86       Event.read( cerfile );
    87       Infos.Transfer ( &Event ) ;
    88 
    89       //
    90       //   fill the ntuple
    91       //
    92       Infos.NtupFill ( Ntup ) ;
    93  
    94       //
    95       //   loop over the particles (cerenkov photons) in
    96       //   the file
    97       //
    98 
    99       iPhotonInShower = 0 ;
    100      
    101       while( ! (cerfile.eof() || cerfile.bad() )) {
    102        
    103         //
    104         //   read in the particles
    105         //
    106 
    107         Photon.read ( cerfile ) ;
    108        
    109         //
    110         //   only if the wavelength lambda is greater than
    111         //   1.0 it is a real cerenkov photon
    112         //
    113         lambda = Photon.get_wl() ;
    114 
    115         if ( lambda < 1.0 )
    116           break ;
    117 
    118         iPhotonInShower++ ;
    119 
    120         Photon.print() ;
    121 
    122       }
    123 
    124       cout << iPhotonInShower << endl ;       
     160  theApp.Run();
     161  return 0;                           
     162   
     163 
     164}
    125165
    126166
    127 
    128       cerfile.close();
    129      
    130 
    131 
    132     }
    133    
    134 
    135     //
    136     //   write all to file
    137     //
    138     outfile->Write() ;
    139 
    140 
    141     //
    142     //
    143     //
    144    
    145   }
    146 
    147 
Note: See TracChangeset for help on using the changeset viewer.