38 if(eventAsStringVector->size() != 17 &&
39 eventAsStringVector->size() != 20) {
40 std::cerr <<
"There are only " << eventAsStringVector->size() <<
" data words. This event will be null." << std::endl;
45 std::vector<std::string>::iterator itr = eventAsStringVector->begin();
46 std::vector<std::string>::iterator itr_end = eventAsStringVector->end();
48 for(;itr!=itr_end;++itr,++wordNumber) {
49 std::istringstream inStr((*itr));
61 case 10 : inStr >> doubleValue;
m_showerPrimary.position.setZ(doubleValue);
break;
62 case 11 : inStr >> doubleValue;
m_showerPrimary.position.setX(doubleValue);
break;
63 case 12 : inStr >> doubleValue;
m_showerPrimary.position.setY(doubleValue);
break;
84 std::cout.width(12); std::cout.precision(5); std::cout << std::scientific <<
m_kineticEnergy <<
" ";
85 std::cout.width(11); std::cout.precision(4); std::cout << std::scientific <<
m_weight <<
" ";
88 std::cout.width(14); std::cout.precision(7); std::cout << std::scientific <<
m_directionalCosines.x() <<
" ";
89 std::cout.width(14); std::cout.precision(7); std::cout << std::scientific <<
m_directionalCosines.y() <<
" ";
90 std::cout.width(11); std::cout.precision(4); std::cout << std::scientific <<
m_timeOfFlight <<
" ";
91 std::cout.width(12); std::cout.precision(5); std::cout << std::scientific <<
m_primaryProtonZ <<
" ";
92 std::cout.width(12); std::cout.precision(5); std::cout << std::scientific <<
m_showerPrimary.position.z() <<
" ";
93 std::cout.width(11); std::cout.precision(4); std::cout << std::scientific <<
m_showerPrimary.position.x() <<
" ";
94 std::cout.width(11); std::cout.precision(4); std::cout << std::scientific <<
m_showerPrimary.position.y() <<
" ";
95 std::cout.width(11); std::cout.precision(4); std::cout << std::scientific <<
m_showerPrimary.kineticEnergy <<
" ";
96 std::cout.width(11); std::cout.precision(4); std::cout << std::scientific <<
m_showerPrimary.weight <<
" ";
105 std::cout.width(11); std::cout.precision(4); std::cout << std::scientific <<
m_beamGasInteraction.timeOfFlight;
108 std::cout << std::endl;
110 std::cout.precision(6);
int read(std::vector< std::string > *eventAsStringVector)
A function to read the values from a single row definition and fill the data members.
int pdgId()
A function to return the PDG id for this particle.
MarsShowerPrimary m_showerPrimary
MarsBeamGasInteraction m_beamGasInteraction
HepMC::FourVector m_positionAtScoringPlane
HepMC::FourVector m_directionalCosines
void print(bool beamGas)
A function to print the contents of this particle.