source: branches/start/MagicSoft/Simulation/Corsika/Simone/simone.cxx@ 18752

Last change on this file since 18752 was 324, checked in by harald, 25 years ago
This is the start point for the development of this Statisic Information about MONte carlo Events S I MON E
File size: 1.7 KB
Line 
1//
2//
3//
4//
5//
6//
7#include <stdlib.h>
8#include "TROOT.h"
9
10#include "TFile.h"
11#include "TNtuple.h"
12
13#include "COREventHeader.hxx"
14#include "CORParticle.hxx"
15#include "CORStatfile.hxx"
16
17#include "MSimone.hxx"
18
19main()
20 {
21 // initialise ROOT
22
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] = "/hd31/Data/mmcs_prod_1009_30:30000_14" ;
27 // char path[100] = "/data/mmcs/" ;
28 char cername[120] ;
29 char datname[120] ;
30
31 ifstream cerfile ;
32
33 COREventHeader Event ;
34
35 MSimone Infos ;
36 Infos.Print() ;
37 //
38 // now create a root-file for the ntuple output
39 //
40
41 TFile *outfile = new TFile("simone.root","RECREATE");
42
43 TNtuple *Ntup = new TNtuple("simone",
44 "Simone info of mmcs",
45 "PartId:Energy:Theta:Phi");
46
47
48 for (int i_cer = 1; i_cer < 1000; i_cer++ ) {
49
50 //
51 // create the file names
52 //
53 sprintf ( cername, "%s/cer%06d", path, i_cer ) ;
54 sprintf ( datname, "%s/dat%06d", path, i_cer ) ;
55
56 // cout << cername << endl ;
57 // cout << datname << endl ;
58
59 //
60 // try to open the files
61 //
62
63 cerfile.open( cername );
64
65 if ( cerfile.bad() ) {
66 cout << "Cannot open input file: " << cername << endl ;
67 continue ;
68 }
69
70 cout << " Read event " << endl ;
71 Event.read( cerfile );
72
73 Infos.Transfer ( &Event ) ;
74
75 Infos.Print() ;
76
77 Infos.NtupFill ( Ntup ) ;
78
79 cerfile.close();
80
81 }
82
83
84 //
85 // write all to file
86 //
87 outfile->Write() ;
88
89 }
90
91
Note: See TracBrowser for help on using the repository browser.