diff --git a/src/app/crbeam/CRbeam.cpp b/src/app/crbeam/CRbeam.cpp index 697428352f4e4eef789d6556bd1bf70082828057..981b1fec2c7189941844a7871653922f6c249b10 100644 --- a/src/app/crbeam/CRbeam.cpp +++ b/src/app/crbeam/CRbeam.cpp @@ -346,7 +346,8 @@ int CRbeam::run() outputDir += suffix; } std::cout << "output dir: " << outputDir << std::endl; - SmartPtr<RawOutput3D> pOutput = new RawOutput3D(outputDir, fOverwriteOutput, fMz!=M_POINT_SOURCE, fPowerLaw>0, fTrajectoryLogging);//this creates folder outputDir, later we will set output to outputDir/z0 + bool saveZprod = true; + SmartPtr<RawOutput3D> pOutput = new RawOutput3D(outputDir, fOverwriteOutput, fMz!=M_POINT_SOURCE, fPowerLaw>0, fTrajectoryLogging, saveZprod);//this creates folder outputDir, later we will set output to outputDir/z0 if(fLogging){ debug.SetOutputFile(outputDir + "/log.txt"); debug.EnableTimestamp(); diff --git a/src/lib/Output.cpp b/src/lib/Output.cpp index 3eddf8426a021bc2fc0d94415a8a9df10e934c7e..ea09af21e007a4b490aad13a180e3cbfd1b2e6d6 100644 --- a/src/lib/Output.cpp +++ b/src/lib/Output.cpp @@ -253,6 +253,9 @@ void RawOutput::LookForRepetitions(std::vector<Particle>* aParticles) if(fSaveId){ aOut << "\t" << aParticle.id; } + if(fSaveZprod){ + aOut << "\t" << aParticle.fProductionTime.z(); + } } void RawOutput3D::WriteHeader(std::ostream& aOut, const Particle& aFirstParticle){ @@ -274,6 +277,9 @@ void RawOutput::LookForRepetitions(std::vector<Particle>* aParticles) if(fSaveId){ aOut << "\tId"; } + if(fSaveZprod){ + aOut << "\tz_prod"; + } } } /* namespace mcray */ diff --git a/src/lib/Output.h b/src/lib/Output.h index 851c024c9f545dbdfe81d2dc58d0cca3c686ef17..daf3cb5768e4194a4cdc6cd1f164e287d60aa6cf 100644 --- a/src/lib/Output.h +++ b/src/lib/Output.h @@ -79,14 +79,15 @@ private: class RawOutput3D : public RawOutput{ public: - RawOutput3D(std::string aDir, bool aOverwriteExisting = false, bool aSaveSourceZ=false, bool aSaveSourceE=false, bool aSaveId=false): - RawOutput(aDir, false, aOverwriteExisting),fSaveSourceZ(aSaveSourceZ), fSaveSourceE(aSaveSourceE), fSaveId(aSaveId){ } + RawOutput3D(std::string aDir, bool aOverwriteExisting = false, bool aSaveSourceZ=false, bool aSaveSourceE=false, bool aSaveId=false, bool aSaveZprod=false): + RawOutput(aDir, false, aOverwriteExisting),fSaveSourceZ(aSaveSourceZ), fSaveSourceE(aSaveSourceE), fSaveId(aSaveId), fSaveZprod(aSaveZprod){ } void WriteHeader(std::ostream& aOut, const Particle& aFirstParticle); void Write(std::ostream& aOut, const Particle& aParticle); private: bool fSaveSourceZ; bool fSaveSourceE; bool fSaveId; + bool fSaveZprod; }; class TotalEnergyOutput : public TSmartReferencedObj<IOutput> {