#include "McPart.h"
#include "TMath.h"
///////////////////////////////////////////////////////////////////////////
// //
// McPart //
// //
// The class McPart is the class containing the Monte Carlo particle //
// information such as the particle ID, a pointer to the parent McPart //
// object if it exists,the charge and the position and momentum initially//
// and at the calorimeter. All particles recorded in the detector get an //
// McPart object assigned to them. //
// //
///////////////////////////////////////////////////////////////////////////
ClassImp(McPart)
///________________________________________________________________________
McPart::McPart() {
// Default constructor
m_type=0;
m_parnt = 0;
for(int i =0; i < 4; i++){
m_InitMom[i] = 0.;
m_InitPos[i] = 0.;
m_CalMom[i] = 0.;
m_CalPos[i] = 0.;
}
}
///________________________________________________________________________
McPart::McPart(Int_t ID) {
// Create an McPart object with STDHEP particle ID
m_type = ID;
}
///________________________________________________________________________
McPart::McPart(McPart* part){
// Copy constructor, still has to be finished
m_type = part->GetType();
m_status = part->GetStatus();
m_parnt = part->GetParnt();
m_charge = part->GetCharge();
}
///________________________________________________________________________
void McPart::SetUpParticle(Int_t type,Float_t charge,Int_t status,
McPart* parntptr, Float_t* tmom,Float_t* tpos) {
// Set all the attributes of the particle
m_parnt = parntptr;
m_charge = charge;
m_status=status;
m_type=type;
SetMomentum(tmom);
SetPosition(tpos);
}
///________________________________________________________________________
void McPart::SetMomentum(Float_t *momentum){
// Store the initial momentum of the particle
for(Int_t i=0; i<4; i++){
m_InitMom[i] = momentum[i];
}
}
///________________________________________________________________________
void McPart::SetPosition(Float_t *position){
// Store the initial position of the particle
for(Int_t i=0; i<3; i++){
m_InitPos[i] = position[i];
}
}
///________________________________________________________________________
void McPart::SetParticleAtCal(Float_t* momentum,Float_t* position){
// Store the position and momentum pf the particle at the calorimeter
for(Int_t i=0; i<3; i++){
m_CalMom[i] = momentum[i];
m_CalPos[i] = position[i];
}
}
ROOT page - Class index - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.