Skip to content
Snippets Groups Projects
Commit 90aaf935 authored by Oleg Kalashev's avatar Oleg Kalashev
Browse files

save particle production time in output3d

parent 07172572
No related branches found
No related tags found
No related merge requests found
...@@ -346,7 +346,8 @@ int CRbeam::run() ...@@ -346,7 +346,8 @@ int CRbeam::run()
outputDir += suffix; outputDir += suffix;
} }
std::cout << "output dir: " << outputDir << std::endl; 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){ if(fLogging){
debug.SetOutputFile(outputDir + "/log.txt"); debug.SetOutputFile(outputDir + "/log.txt");
debug.EnableTimestamp(); debug.EnableTimestamp();
......
...@@ -253,6 +253,9 @@ void RawOutput::LookForRepetitions(std::vector<Particle>* aParticles) ...@@ -253,6 +253,9 @@ void RawOutput::LookForRepetitions(std::vector<Particle>* aParticles)
if(fSaveId){ if(fSaveId){
aOut << "\t" << aParticle.id; aOut << "\t" << aParticle.id;
} }
if(fSaveZprod){
aOut << "\t" << aParticle.fProductionTime.z();
}
} }
void RawOutput3D::WriteHeader(std::ostream& aOut, const Particle& aFirstParticle){ void RawOutput3D::WriteHeader(std::ostream& aOut, const Particle& aFirstParticle){
...@@ -274,6 +277,9 @@ void RawOutput::LookForRepetitions(std::vector<Particle>* aParticles) ...@@ -274,6 +277,9 @@ void RawOutput::LookForRepetitions(std::vector<Particle>* aParticles)
if(fSaveId){ if(fSaveId){
aOut << "\tId"; aOut << "\tId";
} }
if(fSaveZprod){
aOut << "\tz_prod";
}
} }
} /* namespace mcray */ } /* namespace mcray */
...@@ -79,14 +79,15 @@ private: ...@@ -79,14 +79,15 @@ private:
class RawOutput3D : public RawOutput{ class RawOutput3D : public RawOutput{
public: public:
RawOutput3D(std::string aDir, bool aOverwriteExisting = false, bool aSaveSourceZ=false, bool aSaveSourceE=false, bool aSaveId=false): 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){ } RawOutput(aDir, false, aOverwriteExisting),fSaveSourceZ(aSaveSourceZ), fSaveSourceE(aSaveSourceE), fSaveId(aSaveId), fSaveZprod(aSaveZprod){ }
void WriteHeader(std::ostream& aOut, const Particle& aFirstParticle); void WriteHeader(std::ostream& aOut, const Particle& aFirstParticle);
void Write(std::ostream& aOut, const Particle& aParticle); void Write(std::ostream& aOut, const Particle& aParticle);
private: private:
bool fSaveSourceZ; bool fSaveSourceZ;
bool fSaveSourceE; bool fSaveSourceE;
bool fSaveId; bool fSaveId;
bool fSaveZprod;
}; };
class TotalEnergyOutput : public TSmartReferencedObj<IOutput> { class TotalEnergyOutput : public TSmartReferencedObj<IOutput> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment