Universita' di GenovaINFN Sezione di Genova  
AIRWATCH / EUSO Genova

MCTruth - source file

// $Id: MCTruth.cc,v 1.7 2005/11/14 15:48:20 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 if(fParticleCode == 56) fParticleName = "Iron";
    else {
        fParticleName = "Unknown";
        MsgForm(EsafMsg::Warning,"Unknown Particle Code, Particle Name set to Unknown");
    }
}
About Us | EUSO Official Website | Web pages created by Roberto Pesce and Alessandro Thea - Last Update Wed Nov 16 16:57:39 2005 Wed Nov 16 16:29:22 2005