63 size_t nextEventId = 0;
68 if ( nextEventId >= fX.size() )
70 G4Exception(
"FCALPrimaryGeneratorAction::GeneratePrimaries",
"lAr002",
71 JustWarning,
"Data file with kinematics is over, restart it");
80 if ( isFileRead )
return;
82 G4String file_name =
"data-tracks/tracks-80GeV.dat";
84 file_name =
"data-tracks/tracks-20GeV.dat";
85 else if (energy < 50*
GeV)
86 file_name =
"data-tracks/tracks-40GeV.dat";
87 else if (energy < 70*
GeV)
88 file_name =
"data-tracks/tracks-60GeV.dat";
89 else if (energy < 90*
GeV)
90 file_name =
"data-tracks/tracks-80GeV.dat";
91 else if (energy < 150*
GeV)
92 file_name =
"data-tracks/tracks-120GeV.dat";
94 file_name =
"data-tracks/tracks-200GeV.dat";
95 std::ifstream Traks_file(file_name);
99 ed <<
"Failed to open file " << file_name <<
G4endl;
100 G4Exception(
"FCALPrimaryGeneratorAction::FCALPrimaryGeneratorAction()",
105 while(!(Traks_file.eof())) {
106 Traks_file >> iev >> xx >> yy >>
zz >>
c1 >>
c2 >> c3;
114 G4cout <<
"Read " << fX.size() <<
" events from file " << file_name <<
G4endl;
153 size_t nEvent = GetNextId();
157 -1.0*fCosZ[nEvent]));
164 <<anEvent->
GetEventID() <<
" (x,y,z)=(" << fX[nEvent] <<
","
165 <<fY[nEvent] <<
"," << fZ[nEvent]<<
") (cosX,cosY,cosZ)=("
166 << -1.*fCosX[nEvent] <<
"," << fCosY[nEvent]
167 <<
"," << -1.*fCosZ[nEvent] <<
")"<<
G4endl;