46 inputFile.open((
char*)evfile);
47 if (inputFile.is_open()) {
49 if(vl>0)
G4cout <<
"G4HEPEvtInterface - " << fileName <<
" is open." <<
G4endl;
53 "G4HEPEvtInterface:: cannot open file.");
83 if (inputFile.is_open()) {
88 "G4HEPEvtInterface:: cannot open file.");
92 G4Exception(
"G4HEPEvtInterface::GeneratePrimaryVertex",
"Event0202",
99 G4cout <<
"G4HEPEvtInterface - reading " << NHEP <<
" HEPEvt particles from "
100 << fileName <<
"." <<
G4endl;
102 for(
G4int IHEP=0; IHEP<NHEP; IHEP++ )
113 inputFile >> ISTHEP >> IDHEP >> JDAHEP1 >> JDAHEP2
114 >> PHEP1 >> PHEP2 >> PHEP3 >> PHEP5;
115 if( inputFile.eof() )
117 G4Exception(
"G4HEPEvtInterface::GeneratePrimaryVertex",
"Event0202",
122 G4cout <<
" " << ISTHEP <<
" " << IDHEP <<
" " << JDAHEP1 <<
" " << JDAHEP2
123 <<
" " << PHEP1 <<
" " << PHEP2 <<
" " << PHEP3 <<
" " << PHEP5
131 particle->
SetMomentum(PHEP1*GeV, PHEP2*GeV, PHEP3*GeV );
138 HPlist.push_back( hepParticle );
142 if( HPlist.size() == 0 )
return;
146 for(
size_t i=0; i<HPlist.size(); i++ )
148 if( HPlist[i]->GetJDAHEP1() > 0 )
150 G4int jda1 = HPlist[i]->GetJDAHEP1()-1;
151 G4int jda2 = HPlist[i]->GetJDAHEP2()-1;
153 for(
G4int j=jda1; j<=jda2; j++ )
156 if(HPlist[j]->GetISTHEP()>0)
169 for(
size_t ii=0; ii<HPlist.size(); ii++ )
171 if( HPlist[ii]->GetISTHEP() > 0 )
181 for(
size_t iii=0;iii<HPlist.size();iii++)
182 {
delete HPlist[iii]; }
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
void GeneratePrimaryVertex(G4Event *evt)
G4ThreeVector particle_position
G4HEPEvtInterface(const char *evfile, G4int vl=0)
G4GLOB_DLL std::ostream G4cout
void SetMass(G4double mas)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetDaughter(G4PrimaryParticle *np)
static constexpr double GeV
void SetPrimary(G4PrimaryParticle *pp)
void SetMomentum(G4double px, G4double py, G4double pz)