49 isFileRead(false),fVerbosity(0),nEvent(0)
89 G4String file_name =
"data-tracks/tracks-80GeV.dat";
91 file_name =
"data-tracks/tracks-20GeV.dat";
92 else if (energy < 50*
GeV)
93 file_name =
"data-tracks/tracks-40GeV.dat";
94 else if (energy < 70*
GeV)
95 file_name =
"data-tracks/tracks-60GeV.dat";
96 else if (energy < 90*
GeV)
97 file_name =
"data-tracks/tracks-80GeV.dat";
98 else if (energy < 150*
GeV)
99 file_name =
"data-tracks/tracks-120GeV.dat";
101 file_name =
"data-tracks/tracks-200GeV.dat";
103 std::ifstream Traks_file(file_name);
107 ed <<
"Failed to open file " << file_name <<
G4endl;
108 G4Exception(
"FCALPrimaryGeneratorAction::FCALPrimaryGeneratorAction()",
113 while(!(Traks_file.eof())) {
114 Traks_file >> iev >> xx >> yy >> zz >>
c1 >>
c2 >>
c3;
115 fX->push_back(xx*
cm);
116 fY->push_back(yy*cm);
117 fZ->push_back(zz*cm);
120 fCosZ->push_back(c3);
122 G4cout <<
"Read " <<
fX->size() <<
" events from file " << file_name <<
G4endl;
138 G4Exception(
"FCALPrimaryGeneratorAction::GeneratePrimaries",
"lAr002",
139 JustWarning,
"Data file with kinematics is over, restart it");
153 G4cout <<
"--------------------------------------------" <<
G4endl;
154 G4cout <<
" Event, X,Y,Z Generated Vertex : " <<
G4endl;
159 G4cout <<
"--------------------------------------------" <<
G4endl;
void ReadKinematicFromFile(G4double energy)
static c2_factory< G4double > c2
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
std::ostringstream G4ExceptionDescription
CLHEP::Hep3Vector G4ThreeVector
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
virtual void GeneratePrimaryVertex(G4Event *evt)
void SetParticlePosition(G4ThreeVector aPosition)
G4ParticleGun * particleGun
G4GLOB_DLL std::ostream G4cout
FCALPrimaryGeneratorAction()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetParticleEnergy(G4double aKineticEnergy)
static G4ParticleTable * GetParticleTable()
G4double energy(const ThreeVector &p, const G4double m)
void GeneratePrimaries(G4Event *)
~FCALPrimaryGeneratorAction()
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
G4double GetParticleEnergy() const