00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <iostream>
00020 #include "HepMC/PythiaWrapper.h"
00021 #include "CascadeWrapper.h"
00022 #include "MyCascadeWrapper.h"
00023 #include "HepMC/IO_HEPEVT.h"
00024
00025 #include "HepMC/IO_GenEvent.h"
00026 #include "HepMC/GenEvent.h"
00027 #include "PythiaHelper.h"
00028
00029 #include <stdio.h>
00030 #include "HepMC/IO_AsciiParticles.h"
00031 #include "HepMC/SimpleVector.h"
00032
00033 #include "TH1.h"
00034 #include "TFile.h"
00035 #include "TMath.h"
00036 #include <TCanvas.h>
00037
00038 #include "TF1.h"
00039 #include <TH2.h>
00040 #include <TStyle.h>
00041 #include "TLegend.h"
00042 #include <TTree.h>
00043 #include <TString.h>
00044
00045
00046 #include "Configuration.h"
00047 #include "readCascadeConfigFile.h"
00048
00049 extern "C" {
00050 extern struct {
00051 int Nevent;
00052 } steer1_;
00053 }
00054 #define steer1 steer1_
00055
00056 using namespace std;
00057
00058
00059 int main( int argc, const char* argv[] )
00060 {
00061 if(argc <= 2 ) {
00062 std::cout << "Usage: " << argv[0] << " <Configuration File>" << " <name of file to generate to>"<< std::endl;
00063 return 0;
00064 }
00065
00066 Configuration* currentconfig = new Configuration();
00067 if ( currentconfig->read( argv[1] ) ) {
00068 cout << " ... skip !" << endl;
00069 return 0;
00070 }
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 pyjets.n=0;
00084 call_pyhepc(1);
00085
00086 HepMC::HEPEVT_Wrapper::set_max_number_entries(10000);
00087 HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 call_casini();
00099
00100
00101
00102
00103
00104 call_cascha();
00105
00106
00107 vector< string > cascade_commands;
00108
00109 for (unsigned int files=0; files<(currentconfig->ConfigFileNames).size(); files++)
00110 readConfigFile((currentconfig->ConfigFileNames)[files]);
00111
00112
00113 call_pytcha();
00114
00115
00116 call_cascade();
00117
00118
00119 call_caend(1);
00120
00121
00122
00123
00124
00125 HepMC::IO_HEPEVT hepevtio;
00126
00127 HepMC::IO_GenEvent ascii_out(argv[2],std::ios::out);
00128
00129
00130
00131
00132
00133
00134 int Nevent = currentconfig->nevents;
00135
00136 for ( int iEvent = 1; iEvent <= Nevent; iEvent++ ) {
00137 if ( iEvent == 1 || iEvent % 100 == 0 ) {
00138 cout << "Processing Event Number " << iEvent << endl;
00139 }
00140 call_event();
00141
00142
00143 call_pyhepc( 1 );
00144 HepMC::GenEvent* hepmcevt = hepevtio.read_next_event();
00145
00146
00147 hepmcevt->set_event_number(iEvent);
00148 hepmcevt->set_signal_process_id(11);
00149
00150
00151 ascii_out << hepmcevt;
00152
00153 delete hepmcevt;
00154
00155 }
00156
00157
00158 call_caend(2);
00159
00160
00161
00162
00163
00164 delete currentconfig;
00165
00166 cout << "cascade: program ends" << endl;
00167
00168 cout << "Run successfully!" << endl;
00169 return 0;
00170 }
00171