64 size_t nextEventId = 0;
69 if ( nextEventId >= fX.size() )
71 G4Exception(
"FCALPrimaryGeneratorAction::GeneratePrimaries",
"lAr002",
72 JustWarning,
"Data file with kinematics is over, restart it");
81 if ( isFileRead )
return;
83 G4String file_name =
"data-tracks/tracks-80GeV.dat";
85 file_name =
"data-tracks/tracks-20GeV.dat";
86 else if (energy < 50*
GeV)
87 file_name =
"data-tracks/tracks-40GeV.dat";
88 else if (energy < 70*
GeV)
89 file_name =
"data-tracks/tracks-60GeV.dat";
90 else if (energy < 90*
GeV)
91 file_name =
"data-tracks/tracks-80GeV.dat";
92 else if (energy < 150*
GeV)
93 file_name =
"data-tracks/tracks-120GeV.dat";
95 file_name =
"data-tracks/tracks-200GeV.dat";
96 std::ifstream Traks_file(file_name);
100 ed <<
"Failed to open file " << file_name <<
G4endl;
101 G4Exception(
"FCALPrimaryGeneratorAction::FCALPrimaryGeneratorAction()",
106 while(!(Traks_file.eof())) {
107 Traks_file >> iev >> xx >> yy >>
zz >>
c1 >>
c2 >> c3;
115 G4cout <<
"Read " << fX.size() <<
" events from file " << file_name <<
G4endl;
154 size_t nEvent = GetNextId();
158 -1.0*fCosZ[nEvent]));
165 <<anEvent->
GetEventID() <<
" (x,y,z)=(" << fX[nEvent] <<
","
166 <<fY[nEvent] <<
"," << fZ[nEvent]<<
") (cosX,cosY,cosZ)=("
167 << -1.*fCosX[nEvent] <<
"," << fCosY[nEvent]
168 <<
"," << -1.*fCosZ[nEvent] <<
")"<<
G4endl;
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::Hep3Vector G4ThreeVector
std::ostringstream G4ExceptionDescription
static G4ParticleTable * GetParticleTable()
void SetParticlePosition(G4ThreeVector aPosition)
#define G4MUTEX_INITIALIZER
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
FCALPrimaryGeneratorAction()
~FCALPrimaryGeneratorAction()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void GeneratePrimaries(G4Event *)
G4double GetParticleEnergy() const
virtual void GeneratePrimaryVertex(G4Event *evt)
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
G4ParticleGun * particleGun
void SetParticleEnergy(G4double aKineticEnergy)
static constexpr double GeV
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)