49 isFileRead(false),fVerbosity(0),nEvent(0)
86 void FCALPrimaryGeneratorAction::ReadKinematicFromFile(
G4double energy)
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);
118 fCosX->push_back(
c1);
119 fCosY->push_back(c2);
120 fCosZ->push_back(c3);
122 G4cout <<
"Read " << fX->size() <<
" events from file " << file_name <<
G4endl;
136 if (nEvent >= fX->size())
138 G4Exception(
"FCALPrimaryGeneratorAction::GeneratePrimaries",
"lAr002",
139 JustWarning,
"Data file with kinematics is over, restart it");
146 -1.0*fCosZ->at(nEvent)));
153 G4cout <<
"--------------------------------------------" <<
G4endl;
154 G4cout <<
" Event, X,Y,Z Generated Vertex : " <<
G4endl;
156 (*fY)[nEvent] <<
" " << (*fZ)[nEvent]<<
G4endl;
157 G4cout << -1.*(*fCosX)[nEvent] <<
" " << (*fCosY)[nEvent] <<
158 " " << -1.*(*fCosZ)[nEvent] <<
G4endl;
159 G4cout <<
"--------------------------------------------" <<
G4endl;
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
std::ostringstream G4ExceptionDescription
CLHEP::Hep3Vector G4ThreeVector
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
virtual void GeneratePrimaryVertex(G4Event *evt)
double precision function energy(A, Z)
void SetParticlePosition(G4ThreeVector aPosition)
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()
void GeneratePrimaries(G4Event *)
~FCALPrimaryGeneratorAction()
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
G4double GetParticleEnergy() const