// $Id: MCTruth.cc,v 1.6 2005/04/19 12:19:33 moreggia Exp $
// Author: M. Pallavicini
//
/*****************************************************************************
* ESAF: Euso Simulation and Analysis Framework *
* *
* Id: MCTruth *
* Package: GenBase *
* Coordinator: Sergio.Bottai, D.Naumov *
* *
*****************************************************************************/
//______________________________________________________________________________
//
// Monte Carlo Truth
//
// MCTruth holds the parameters u
#include "MCTruth.hh"
#include "Etypes.hh"
#include <stdexcept>
ClassImp(MCTruth)
//______________________________________________________________________________
MCTruth::MCTruth() : fEnergy(0), fTheta(0), fPhi(0), fX1(0), fEarthAge(0),
fShowerXMax(0), fHclouds(-kHuge), fCloudsthick(0), fCloudsOD(0) {
//
// Constructor
//
}
//______________________________________________________________________________
MCTruth::~MCTruth() {
//
// Destructor
//
}
//______________________________________________________________________________
void MCTruth::Clear() {
//
// Reset the truth
//
fEnergy = 0;
fTheta = 0;
fPhi = 0;
fParticleName.clear();
fParticleCode = 0;
fInitPos.SetXYZ(0,0,0);
fX1 = 0;
fEarthImpact.SetXYZ(0,0,0);
fEarthAge = 0;
fShowerMaxPos.SetXYZ(0,0,0);
fShowerXMax = 0;
fHclouds = -kHuge;
fCloudsthick = 0;
fCloudsOD = 0;
}
//______________________________________________________________________________
const string& MCTruth::Dump() {
//
// Dump the contents of the truth on screen
//
fDumpText = "Dumping MCTruth object:n";
char truth[300];
sprintf(truth,"Energy= %10.5enTheta= %fnPhi = %fn",fEnergy,fTheta,fPhi);
fDumpText += truth;
return fDumpText;
}
//______________________________________________________________________________
void MCTruth::BuildName() {
//
// Fill particle name according to code
//
if(fParticleCode == 1)
fParticleName = "Proton";
else {
fParticleName = "Unknown";
MsgForm(EsafMsg::Warning,"Unknown Particle Code, Particle Name set to Unknown");
}
}