45 inputFile.open(evfile);
51 "G4HEPEvtInterface:: cannot open file.");
61 const char* fn = evfile.
data();
62 inputFile.open((
char*)fn);
68 "G4HEPEvtInterface:: cannot open file.");
84 G4Exception(
"G4HEPEvtInterface::GeneratePrimaryVertex",
"Event0202",
89 for(
G4int IHEP=0; IHEP<NHEP; IHEP++ )
100 inputFile >> ISTHEP >> IDHEP >> JDAHEP1 >> JDAHEP2
101 >> PHEP1 >> PHEP2 >> PHEP3 >> PHEP5;
106 particle->
SetMass( PHEP5*GeV );
107 particle->
SetMomentum(PHEP1*GeV, PHEP2*GeV, PHEP3*GeV );
114 HPlist.push_back( hepParticle );
118 if( HPlist.size() == 0 )
return;
122 for(
size_t i=0; i<HPlist.size(); i++ )
124 if( HPlist[i]->GetJDAHEP1() > 0 )
126 G4int jda1 = HPlist[i]->GetJDAHEP1()-1;
127 G4int jda2 = HPlist[i]->GetJDAHEP2()-1;
129 for(
G4int j=jda1; j<=jda2; j++ )
132 if(HPlist[j]->GetISTHEP()>0)
145 for(
size_t ii=0; ii<HPlist.size(); ii++ )
147 if( HPlist[ii]->GetISTHEP() > 0 )
157 for(
size_t iii=0;iii<HPlist.size();iii++)
158 {
delete HPlist[iii]; }
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
G4HEPEvtInterface(char *evfile)
void GeneratePrimaryVertex(G4Event *evt)
void SetMomentum(G4double px, G4double py, G4double pz)
void SetMass(G4double mas)
void SetDaughter(G4PrimaryParticle *np)
void SetPrimary(G4PrimaryParticle *pp)
const char * data() const
G4ThreeVector particle_position
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)