00001
00002
00003
00004
00005
00007
00008
00009
00010
00011 #include <iostream>
00012
00013 #include "VectorConversion.h"
00014 #include "HepMC/GenEvent.h"
00015 #include "HepMC/ParticleDataTable.h"
00016 #include "CLHEP/Vector/LorentzVector.h"
00017
00018
00019
00020
00021
00022
00023 using namespace HepMC;
00024 using namespace CLHEP;
00025
00026 int main() {
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 ParticleDataTable pdt("my particle data table");
00043
00044
00045 pdt.insert( new ParticleData( "p+", 2212, +1, 0.938, -1, .5 ) );
00046 pdt.insert( new ParticleData( "d", 1, -2./3., 0, -1, .5 ) );
00047 pdt.insert( new ParticleData( "u~", -2, -1./3., 0, -1, .5 ) );
00048 pdt.insert( new ParticleData( "W-", -24, -1, 80.396,
00049 clifetime_from_width(2.06), 1 ) );
00050 pdt.insert( new ParticleData( "gamma", 22, 0, 0, -1, 1 ) );
00051
00052
00053 pdt.print();
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 GenEvent* evt = new GenEvent( 20, 1 );
00071
00072
00073 GenVertex* v1 = new GenVertex();
00074 evt->add_vertex( v1 );
00075 v1->add_particle_in( new GenParticle( HepLorentzVector(0,0,7000,7000),
00076 2212, 3 ) );
00077 GenVertex* v2 = new GenVertex();
00078 evt->add_vertex( v2 );
00079 v2->add_particle_in( new GenParticle( HepLorentzVector(0,0,-7000,7000),
00080 2212, 3 ) );
00081
00082
00083 GenParticle* p3 =
00084 new GenParticle( HepLorentzVector(.750,-1.569,32.191,32.238), 1, 3 );
00085 v1->add_particle_out( p3 );
00086 GenParticle* p4 =
00087 new GenParticle( HepLorentzVector(-3.047,-19.,-54.629,57.920), -2, 3 );
00088 v2->add_particle_out( p4 );
00089
00090
00091 GenVertex* v3 = new GenVertex();
00092 evt->add_vertex( v3 );
00093 v3->add_particle_in( p3 );
00094 v3->add_particle_in( p4 );
00095 v3->add_particle_out(
00096 new GenParticle( HepLorentzVector(-3.813,0.113,-1.833,4.233 ), 22, 1 )
00097 );
00098 GenParticle* p5 =
00099 new GenParticle( HepLorentzVector(1.517,-20.68,-20.605,85.925), -24,3);
00100 v3->add_particle_out( p5 );
00101
00102
00103 GenVertex* v4 = new GenVertex(HepLorentzVector(0.12,-0.3,0.05,0.004));
00104 evt->add_vertex( v4 );
00105 v4->add_particle_in( p5 );
00106 v4->add_particle_out(
00107 new GenParticle( HepLorentzVector(-2.445,28.816,6.082,29.552), 1,1 )
00108 );
00109 v4->add_particle_out(
00110 new GenParticle( HepLorentzVector(3.962,-49.498,-26.687,56.373), -2,1 )
00111 );
00112
00113
00114 evt->set_signal_process_vertex( v3 );
00115
00116 evt->print();
00117
00118
00119
00120 std::cout << std::endl;
00121 std::cout << " Add output momenta " << std::endl;
00122 HepLorentzVector sum;
00123 for ( GenEvent::particle_const_iterator p = evt->particles_begin();
00124 p != evt->particles_end(); ++p ){
00125 if( (*p)->status() == 1 ) {
00126 sum += SVtoLV( (*p)->momentum() );
00127 (*p)->print();
00128 }
00129 }
00130 std::cout << "Vector Sum: " << sum << std::endl;
00131
00132
00133
00134
00135
00136 delete evt;
00137
00138
00139 pdt.delete_all();
00140
00141 return 0;
00142 }