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
Branches
No related tags found
No related merge requests found
......@@ -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();
......
......@@ -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 */
......@@ -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> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment