Main Page | Compound List | File List | Compound Members | File Members | Related Pages

McTrajectory Class Reference

GLAST Monte Carlo Particle Trajectory class. More...

#include <McTrajectory.h>

List of all members.

Public Member Functions

 McTrajectory ()
virtual ~McTrajectory ()
void Clear (Option_t *option="")
 clear lists, free pointers, etc., after read from / write to file

void Fake (Int_t ievent, UInt_t rank, Float_t randNum)
Bool_t CompareInRange (const McTrajectory &, const std::string &name="") const
void Print (Option_t *option="") const
void initialize ()
void addMcTrajectoryPoint (McTrajectoryPoint *point)
 Add McTrajectoryPoint to our list.

const TObjArray * getMcPointCol () const
 return the full TObjArray containing the points on the trajectory

UInt_t getMcPointCount () const
 retrieve number of points stored in the collection

void addMcPoint (McTrajectoryPoint *point)
 add a TVector3 to points collection

void clearMcPointCol ()
 clear of the array (necessary for converters)

void * operator new (size_t size)
 Overload the new operator to use our managed pool.

void * operator new (size_t size, void *vp)
 Overload the new operator again for managed pool.

McTrajectoryoperator= (const McTrajectory &rhs)
 We need the = operator for pool management.


Private Attributes

TObjArray m_pointCol
 An array of points defining the trajectory.


Detailed Description

GLAST Monte Carlo Particle Trajectory class.

The McTrajectory class contains the step by step position information for particles tracked through GLAST during the simulation stage. The class contains:

Header
/nfs/slac/g/glast/ground/cvs/mcRootData/mcRootData/McTrajectory.h,v 1.7 2007/11/13 16:54:46 heather Exp

Definition at line 99 of file McTrajectory.h.


Constructor & Destructor Documentation

McTrajectory::McTrajectory  ) 
 

McTrajectory::~McTrajectory  )  [virtual]
 

Definition at line 25 of file McTrajectory.cxx.

References Clear(), and m_pointCol.

00026 {    
00027     m_pointCol.Clear();
00028     //delete m_pointCol;
00029     //m_pointCol = 0;
00030 
00031         Clear();
00032 }


Member Function Documentation

void McTrajectory::addMcPoint McTrajectoryPoint point  )  [inline]
 

add a TVector3 to points collection

Definition at line 128 of file McTrajectory.h.

References m_pointCol.

Referenced by Fake().

00128 {m_pointCol.Add(point);}

void McTrajectory::addMcTrajectoryPoint McTrajectoryPoint point  )  [inline]
 

Add McTrajectoryPoint to our list.

Definition at line 115 of file McTrajectory.h.

References m_pointCol.

00115 {m_pointCol.Add(point);}

void McTrajectory::Clear Option_t *  option = ""  ) 
 

clear lists, free pointers, etc., after read from / write to file

Definition at line 66 of file McTrajectory.cxx.

References m_pointCol.

Referenced by Fake(), and ~McTrajectory().

00067 {
00068 //    if (m_pointCol) m_pointCol->Clear();
00069     m_pointCol.Clear();
00070 
00071     return;
00072 }

void McTrajectory::clearMcPointCol  )  [inline]
 

clear of the array (necessary for converters)

Definition at line 131 of file McTrajectory.h.

References m_pointCol.

00131 { m_pointCol.Clear(); };

Bool_t McTrajectory::CompareInRange const McTrajectory ,
const std::string &  name = ""
const
 

Definition at line 93 of file McTrajectory.cxx.

References getMcPointCol().

00093                                                                                             {
00094 
00095     Bool_t result = true ;
00096     
00097 //    result = COMPARE_IN_RANGE(McTrajectoryCharge) && result 
00098 
00099 //    const McParticle *myPart = getMcParticle();
00100 //    const McParticle *refPart = ref.getMcParticle();
00101 //    result = rootdatautil::CompareInRange(*myPart,*refPart,"McParticle") && result ;
00102 
00103 
00104     //result = COMPARE_IN_RANGE(McParticle) && result ;  need to pass reference
00105 
00106     result = rootdatautil::TObjArrayCompareInRange<McTrajectoryPoint>(getMcPointCol(),ref.getMcPointCol(),"McPoint") && result ;
00107       
00108     if (!result) {
00109         if ( name == "" ) {
00110             std::cout<<"Comparison ERROR for "<<ClassName()<<std::endl ;
00111         }
00112         else {
00113             std::cout<<"Comparison ERROR for "<<name<<std::endl ;
00114         }
00115     }
00116     return result ;
00117 
00118 }

void McTrajectory::Fake Int_t  ievent,
UInt_t  rank,
Float_t  randNum
 

Definition at line 75 of file McTrajectory.cxx.

References addMcPoint(), Clear(), and McTrajectoryPoint::Fake().

Referenced by McEvent::CompareToFake(), and McEvent::Fake().

00075                                                                         {
00076 
00077     Clear() ;
00078     
00079     Float_t f = Float_t(rank) ;
00080     Float_t fr = f*randNum ;
00081 
00082     McTrajectoryPoint* point = new McTrajectoryPoint();
00083     point->Fake(0, rank, randNum);
00084     addMcPoint(point);
00085 
00086     point = new McTrajectoryPoint();
00087     point->Fake(0, 2*rank, randNum);
00088     addMcPoint(point);
00089 }

const TObjArray* McTrajectory::getMcPointCol  )  const [inline]
 

return the full TObjArray containing the points on the trajectory

Definition at line 118 of file McTrajectory.h.

References m_pointCol.

Referenced by CompareInRange(), and operator=().

00118 { return &m_pointCol; };

UInt_t McTrajectory::getMcPointCount  )  const [inline]
 

retrieve number of points stored in the collection

Definition at line 121 of file McTrajectory.h.

References m_pointCol.

00122     { 
00123 //        return ((m_pointCol) ? m_pointCol->GetEntries() : 0);
00124         return m_pointCol.GetEntries();
00125     };

void McTrajectory::initialize  ) 
 

Definition at line 34 of file McTrajectory.cxx.

00035 {
00036     return;
00037 }

void * McTrajectory::operator new size_t  size,
void *  vp
 

Overload the new operator again for managed pool.

Definition at line 52 of file McTrajectory.cxx.

00053 {
00054     return vp;
00055 }

void * McTrajectory::operator new size_t  size  ) 
 

Overload the new operator to use our managed pool.

Definition at line 40 of file McTrajectory.cxx.

References McObjectManager::getNewMcTrajectory(), McObjectManager::getPointer(), and m_pointCol.

00041 {
00042     McTrajectory* temp = McObjectManager::getPointer()->getNewMcTrajectory();
00043 
00044     // Clear out the TobjArray
00045     temp->m_pointCol.Clear();
00046     //delete temp->m_pointCol;
00047     //temp->m_pointCol = 0;
00048 
00049     return temp;
00050 }

McTrajectory & McTrajectory::operator= const McTrajectory rhs  ) 
 

We need the = operator for pool management.

Definition at line 57 of file McTrajectory.cxx.

References getMcPointCol(), and m_pointCol.

00058 {
00059 //    m_pointCol = rhs.m_pointCol;
00060     for(int idx = 0; idx < rhs.getMcPointCol()->GetEntries(); idx++)
00061         m_pointCol.Add(rhs.getMcPointCol()->At(idx));
00062 
00063     return *this;
00064 }

void McTrajectory::Print Option_t *  option = ""  )  const
 

Definition at line 120 of file McTrajectory.cxx.

00121 {
00122 /*
00123     using namespace std;
00124     TObject::Print(option);
00125     std::cout.precision(2);
00126     std::cout << "Run: " << m_runId << " Event: " << m_eventId << std::endl;
00127     std::cout << m_particleCol->GetEntries() << " McParticles" << std::endl;
00128     std::cout << m_positionHitCol->GetEntries() << " McPositionHits" << std::endl;
00129     std::cout << m_integratingHitCol->GetEntries() 
00130         << " McIntegratingHits" << std::endl;
00131 */
00132 }


Member Data Documentation

TObjArray McTrajectory::m_pointCol [private]
 

An array of points defining the trajectory.

Definition at line 142 of file McTrajectory.h.

Referenced by addMcPoint(), addMcTrajectoryPoint(), ClassImp(), Clear(), clearMcPointCol(), getMcPointCol(), getMcPointCount(), operator new(), operator=(), and ~McTrajectory().


The documentation for this class was generated from the following files:
Generated on Tue Dec 11 16:28:56 2007 by doxygen 1.3.3