diff --git a/.gitignore b/.gitignore index ff7ac6feeaead84301a0b30a66a0445fe80e49cd..1d3c15eff1e7deb9b6c732146c462363b979d296 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ spack* ./Generator/output/ ./Generator/options/ -InstallArea/ \ No newline at end of file +InstallArea/ diff --git a/Generator/src/BeamBackgroundFileParserV1.cpp b/Generator/src/BeamBackgroundFileParserV1.cpp index 478aca944da45024c455463d63cd425da70319a0..7f1e5408df3a8721dab9485e66c18905bae33b97 100644 --- a/Generator/src/BeamBackgroundFileParserV1.cpp +++ b/Generator/src/BeamBackgroundFileParserV1.cpp @@ -51,6 +51,7 @@ bool BeamBackgroundFileParserV1::load(IBeamBackgroundFileParser::BeamBackgroundD // Now, we get a almost valid data const double m2mm = 1e3; // convert from m to mm result.pdgid = pid; + result.charge = (pid == 11) ? -1 : (pid == -11) ? 1 : -1; result.x = x * m2mm; result.y = y * m2mm; result.z = (z+dz) * m2mm; diff --git a/Generator/src/BeamBackgroundFileParserV1.h b/Generator/src/BeamBackgroundFileParserV1.h index 6485207c509800a2c44f09990bf42fa724def95d..00527a2d63937b68a5d0a6cc1be4a58007a6f0a7 100644 --- a/Generator/src/BeamBackgroundFileParserV1.h +++ b/Generator/src/BeamBackgroundFileParserV1.h @@ -23,7 +23,7 @@ private: double m_timewindow; double x, y, z, cosx, cosy, dz, dp, cosz; - int pid; + int pid, charge; };