45 inputFile.open((
char*)evfile);
46 if (inputFile.is_open())
50 G4cout <<
"G4HEPEvtInterface - " << fileName <<
" is open." <<
G4endl;
54 G4Exception(
"G4HEPEvtInterface::G4HEPEvtInterface",
"Event0201",
69 if (inputFile.is_open())
75 G4Exception(
"G4HEPEvtInterface::G4HEPEvtInterface",
"Event0201",
80 G4Exception(
"G4HEPEvtInterface::GeneratePrimaryVertex",
"Event0202",
82 "End-Of-File: HEPEvt input file -- no more event to read!");
88 G4cout <<
"G4HEPEvtInterface - reading " << NHEP
89 <<
" HEPEvt particles from " << fileName <<
"." <<
G4endl;
91 for(
G4int IHEP=0; IHEP<NHEP; ++IHEP )
102 inputFile >> ISTHEP >> IDHEP >> JDAHEP1 >> JDAHEP2
103 >> PHEP1 >> PHEP2 >> PHEP3 >> PHEP5;
104 if( inputFile.eof() )
106 G4Exception(
"G4HEPEvtInterface::GeneratePrimaryVertex",
"Event0203",
108 "Unexpected End-Of-File in the middle of an event");
112 G4cout <<
" " << ISTHEP <<
" " << IDHEP <<
" " << JDAHEP1
113 <<
" " << JDAHEP2 <<
" " << PHEP1 <<
" " << PHEP2
114 <<
" " << PHEP3 <<
" " << PHEP5 <<
G4endl;
120 particle->
SetMass( PHEP5*GeV );
121 particle->
SetMomentum(PHEP1*GeV, PHEP2*GeV, PHEP3*GeV );
130 HPlist.push_back( hepParticle );
135 if( HPlist.size() == 0 )
return;
139 for( std::size_t i=0; i<HPlist.size(); ++i )
141 if( HPlist[i]->GetJDAHEP1() > 0 )
143 G4int jda1 = HPlist[i]->GetJDAHEP1()-1;
144 G4int jda2 = HPlist[i]->GetJDAHEP2()-1;
146 for(
G4int j=jda1; j<=jda2; ++j )
149 if(HPlist[j]->GetISTHEP()>0)
164 for( std::size_t ii=0; ii<HPlist.size(); ++ii )
166 if( HPlist[ii]->GetISTHEP() > 0 )
176 for(std::size_t iii=0; iii<HPlist.size(); ++iii)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
G4HEPEvtInterface(const char *evfile, G4int vl=0)
void GeneratePrimaryVertex(G4Event *evt)
void SetMomentum(G4double px, G4double py, G4double pz)
void SetMass(G4double mas)
void SetDaughter(G4PrimaryParticle *np)
void SetPrimary(G4PrimaryParticle *pp)
G4ThreeVector particle_position