Changeset 418 for trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx
- Timestamp:
- 07/12/00 11:19:10 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx
r415 r418 6 6 // 7 7 #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"21 8 22 9 #include "COREventHeader.hxx" … … 24 11 #include "CORStatfile.hxx" 25 12 26 #include "MSimone.hxx"27 28 13 int main(int argc, char **argv) 29 14 { 30 // initialise ROOT15 char path[100] = "" ; 31 16 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/" ;39 17 char cername[120] ; 40 18 char datname[120] ; … … 45 23 CORParticle Photon ; 46 24 47 MSimone Infos ;48 49 25 Int_t iPhotonInShower ; 50 26 51 27 Float_t lambda ; 52 28 29 cout << " ============================" << endl ; 30 cout << " SIMONE" << endl ; 31 cout << " " << endl ; 53 32 cout << " SImulated MONte carlo Events" << endl ; 33 cout << " " << endl ; 54 34 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 66 47 for (int i_cer = 1; i_cer <= 100; i_cer++ ) { 67 //68 // info of progress69 //70 if (!( i_cer %10) )71 {72 cout << i_cer << endl ;73 }74 75 48 // 76 49 // create the file names … … 98 71 99 72 Event.read( cerfile ); 100 Infos.Transfer ( &Event ) ; 101 73 74 Event.Print() ; 75 102 76 // 103 77 // loop over the particles (cerenkov photons) in … … 126 100 iPhotonInShower++ ; 127 101 128 //Photon.print() ;102 Photon.print() ; 129 103 } 130 104 131 Infos.SetNumCerPhot( iPhotonInShower ) ;132 133 105 // 134 // fill the ntuple106 // close the file 135 107 // 136 137 Infos.NtupFill ( Ntup ) ;138 139 108 140 109 cerfile.close(); … … 144 113 } 145 114 146 147 //148 // write all to file149 //150 outfile->Write() ;151 152 153 //154 //155 //156 157 Ntup->Draw("fEnergy") ;158 159 160 theApp.Run();161 return 0;162 163 164 115 } 165 116
Note:
See TracChangeset
for help on using the changeset viewer.