50 if(!eventAsStringVector) {
51 std::cerr <<
"ERROR: string vector passed to FlukaParticle::read is null." << std::endl;
56 if(eventAsStringVector->size() != 15) {
57 std::cerr <<
"ERROR: there are " << eventAsStringVector->size() <<
" data words, which is out of range. This particle will be null." << std::endl;
62 if(eventAsStringVector->size() < 10 || eventAsStringVector->size() > 11 ) {
63 std::cerr <<
"ERROR: there are " << eventAsStringVector->size() <<
" data words, which is out of range. This particle will be null." << std::endl;
68 std::cerr <<
"ERROR: unknown input Fluka record type. This particle will be null." << std::endl;
73 std::vector<std::string>::iterator itr = eventAsStringVector->begin();
74 std::vector<std::string>::iterator itr_end = eventAsStringVector->end();
77 for(;itr!=itr_end;++itr,++wordNumber) {
78 if((*itr).length() == 0) {
79 std::cerr <<
"ERROR: string word has zero length." << std::endl;
82 std::istringstream inStr((*itr));
104 for(;itr!=itr_end;++itr,++wordNumber) {
105 std::istringstream inStr((*itr));
106 switch (wordNumber) {
209 std::cout.width(6); std::cout <<
m_eventId <<
" ";
211 std::cout.width(6); std::cout <<
m_flukaId <<
" ";
212 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_kineticEnergy <<
" ";
213 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_weight <<
" ";
216 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_directionalCosines.x() <<
" ";
217 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_directionalCosines.y() <<
" ";
219 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_totalEnergy <<
" ";
220 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.x() <<
" ";
221 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.y() <<
" ";
222 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.z() <<
" ";
223 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.t() <<
" ";
224 std::cout.precision(6);
225 std::cout << std::endl;
229 std::cout.width(7); std::cout <<
m_eventId <<
" ";
230 std::cout.width(2); std::cout <<
m_flukaId <<
" ";
232 std::cout.width(19); std::cout.precision(12); std::cout << std::scientific <<
m_kineticEnergy <<
" ";
236 std::cout.width(19); std::cout.precision(12); std::cout << std::scientific <<
m_directionalCosines.x() <<
" ";
237 std::cout.width(19); std::cout.precision(12); std::cout << std::scientific <<
m_directionalCosines.y() <<
" ";
238 std::cout.width(19); std::cout.precision(12); std::cout << std::scientific <<
m_directionalCosines.z() <<
" ";
240 std::cout.precision(6);
241 std::cout << std::endl;
HepMC::FourVector m_directionalCosines
int read(std::vector< std::string > *eventAsStringVector)
A function to read the values from a single row definition and fill the data members.
void clear(void)
A function to clear the values of this particle.
HepMC::FourVector m_positionAtScoringPlane
void print(void)
A function to print the contents of this particle.
HepMC::FourVector m_positionAtPrimary
FlukaParticle(int type=0)
int type(void) const
A function to return the type of this FlukaParticle.
int pdgId()
A function to return the PDG id of this particle.