00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CBSTDHEP_HH
00012 #define CBSTDHEP_HH
00013
00014 #include "CLHEP/StdHep/StdEvent.hh"
00015
00016 #include "CLHEP/HepMC/include/stdhep.h"
00017 #include "CLHEP/HepMC/include/hepev4.h"
00018 #include "CLHEP/StdHep/include/stdtmp.h"
00019
00020 namespace StdHep {
00021
00026 class CBstdhep {
00027
00028 public:
00029
00030 CBstdhep()
00031 : hptr( & hepevt_ ),
00032 hptr2( & hepev2_ ),
00033 hptr3( & hepev3_ ),
00034 hptr4( & hepev4_ ),
00035 hptr5( & hepev5_ ),
00036 tptr( & stdtmp_ ),
00037 tptr4( & tmpev4_ ),
00038 itsTrustMothers( true )
00039 { ; }
00040
00041 hepevt_t * hepevt() { return hptr; }
00042 hepev2_t * hepev2() { return hptr2; }
00043 hepev3_t * hepev3() { return hptr3; }
00044 hepev4_t * hepev4() { return hptr4; }
00045 hepev5_t * hepev5() { return hptr5; }
00046 static int max_number_entries() { return NMXHEP; }
00047 static int max_multiple_interactions() { return NMXMLT; }
00048 int number_children( int index );
00049 int number_parents( int index );
00050
00051 void clean( );
00052 void cleanStdtmp( );
00053 bool toGenEvent( HepMC::GenEvent *, bool printErrors );
00054 bool fromStdEvent( const StdEvent * );
00055
00056
00057 bool trustMothers() const { return itsTrustMothers; }
00058 void setTrustMothers( bool b ) { itsTrustMothers = b; }
00059
00060 private:
00061
00062 hepevt_t * hptr;
00063 hepev2_t * hptr2;
00064 hepev3_t * hptr3;
00065 hepev4_t * hptr4;
00066 hepev5_t * hptr5;
00067 stdtmp_t * tptr;
00068 tmpev4_t * tptr4;
00069 bool itsTrustMothers;
00070
00071
00072 bool CollisionToStdTmp( const HepMC::GenEvent * col );
00073 bool MultipleInteractionInfo( int & i );
00074 int findInTemporaryMap( const std::map<HepMC::GenParticle*,int>& m,
00075 HepMC::GenParticle* p);
00076 HepMC::GenParticle* createParticle( int index );
00077 void buildProductionVertex( int i,
00078 std::vector<HepMC::GenParticle*>& hepevt_particle,
00079 HepMC::GenEvent* evt,
00080 bool printInconsistencyErrors );
00081 void buildEndVertex( int i, std::vector<HepMC::GenParticle*>& hepevt_particle,
00082 HepMC::GenEvent* evt,
00083 bool printInconsistencyErrors );
00084
00085 };
00086
00087 }
00088
00089 #include "CLHEP/StdHep/CBstdhep.icc"
00090 #include "CLHEP/StdHep/StdHepfromStdEvent.icc"
00091 #include "CLHEP/StdHep/StdHeptoGenEvent.icc"
00092
00093 #endif // CBSTDHEP_HH