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

McPositionHit Class Reference

#include <McPositionHit.h>

List of all members.

Public Member Functions

 McPositionHit ()
virtual ~McPositionHit ()
void Clear (Option_t *option="")
void Fake (Int_t ievent, UInt_t rank, Float_t randNum)
Bool_t CompareInRange (const McPositionHit &, const std::string &name="") const
void Print (Option_t *option="") const
void initialize (Int_t particleId, Double_t edep, const VolumeIdentifier &volId, const TVector3 &entry, const TVector3 &exit, McParticle *mc, McParticle *origin, const TLorentzVector &p4Mom, Double_t tof, UInt_t flags=0)
void initialize (Int_t mcParticleId, Int_t originParticleId, Double_t edep, const VolumeIdentifier &volId, const TVector3 &entry, const TVector3 &exit, const TVector3 &gEntry, const TVector3 &gExit, McParticle *mc, McParticle *origin, const TLorentzVector &p4Mom, Double_t tof, UInt_t flags=0)
const VolumeIdentifier & getVolumeId () const
const TVector3 & getEntryPosition () const
const TVector3 & getGlobalEntryPosition () const
const TVector3 & getExitPosition () const
const TVector3 & getGlobalExitPosition () const
Int_t getMcParticleId () const
Int_t getOriginMcParticleId () const
Double_t getDepositedEnergy () const
Double_t getParticleEnergy () const
TVector3 getParticleMomentum () const
TLorentzVector getParticle4Momentum () const
void setParticle4Momentum (TVector3 &partMom, Double_t partE)
Double_t getTimeOfFlight () const
Double_t getDirectionCosine () const
const McParticlegetMcParticle () const
void setMcParticle (TObject *o)
const McParticlegetOriginMcParticle () const
void setOriginMcParticle (TObject *o)
Bool_t needDigi () const
 Retrieve whether this hit should be digitized.

void * operator new (size_t size)
void * operator new (size_t size, void *vp)
McPositionHitoperator= (const McPositionHit &rhs)

Private Attributes

Double_t m_depositedEnergy
Double_t m_particleEnergy
Double_t m_timeOfFlight
UInt_t m_statusFlags
 Packed flags for the internal use.

Int_t m_mcParticleId
 ID of the McParticle causing the hit.

Int_t m_originMcParticleId
 ID of the origin McParticle.

TVector3 m_entry
 local coordinates

TVector3 m_exit
 local coordinates

TVector3 m_globalEntry
TVector3 m_globalExit
TRef m_mcParticle
TRef m_originMcParticle
VolumeIdentifier m_volumeId
TLorentzVector m_particleFourMomentum
 Particle 4-momentum at this hit.


Constructor & Destructor Documentation

McPositionHit::McPositionHit  ) 
 

McPositionHit::~McPositionHit  )  [virtual]
 

Definition at line 15 of file McPositionHit.cxx.

References Clear().

00016 {
00017     Clear();
00018 }


Member Function Documentation

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

Definition at line 20 of file McPositionHit.cxx.

References m_depositedEnergy, m_entry, m_exit, m_globalEntry, m_globalExit, m_particleFourMomentum, m_statusFlags, m_timeOfFlight, and m_volumeId.

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

00021 {
00022     m_depositedEnergy = 0.;
00023     m_particleFourMomentum = TLorentzVector(0.,0.,0.,0.);
00024     m_timeOfFlight = 0.;
00025     m_statusFlags = 0;
00026     m_entry = TVector3(0., 0., 0.);
00027     m_exit = TVector3(0., 0., 0.);
00028     m_globalEntry = TVector3(0., 0., 0.);
00029     m_globalExit = TVector3(0., 0., 0.);
00030     m_volumeId.Clear();
00031 }

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

Definition at line 99 of file McPositionHit.cxx.

References COMPARE_IN_RANGE, and getVolumeId().

00099                                                                                               {
00100 
00101     Bool_t result = true ;
00102     
00103     // the test comes before " && result" because we want to enforce all tests
00104     result = COMPARE_IN_RANGE(McParticleId) && result ;
00105     result = COMPARE_IN_RANGE(OriginMcParticleId) && result ;
00106 
00107     result = COMPARE_IN_RANGE(VolumeId) && result ;
00108     // method above does not check name, which is probably redundat,
00109     // but we wanted to add the additionnal test below.
00110     result = rootdatautil::CompareInRange(getVolumeId().name(),ref.getVolumeId().name(),"VolumeId Name") && result ;
00111     
00112     result = COMPARE_IN_RANGE(EntryPosition) && result ;
00113     result = COMPARE_IN_RANGE(ExitPosition) && result ;
00114     result = COMPARE_IN_RANGE(GlobalEntryPosition) && result ;
00115     result = COMPARE_IN_RANGE(GlobalExitPosition) && result ;
00116 
00117     result = COMPARE_IN_RANGE(DepositedEnergy) && result ;
00118     result = COMPARE_IN_RANGE(ParticleEnergy) && result ;
00119     result = COMPARE_IN_RANGE(TimeOfFlight) && result ;
00120 
00121     if (!result) {
00122         if ( name == "" ) {
00123             std::cout<<"Comparison ERROR for "<<ClassName()<<std::endl ;
00124         }
00125         else {
00126             std::cout<<"Comparison ERROR for "<<name<<std::endl ;
00127         }
00128     }
00129     return result ;
00130 
00131 }

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

Definition at line 66 of file McPositionHit.cxx.

References Clear(), and initialize().

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

00066                                                                          {
00067 
00068     Clear() ;
00069 
00070     Float_t f = Float_t(rank);
00071     Float_t fr = f*randNum;
00072     TVector3 entry(1., 1., 1.);
00073     TVector3 exit(fr, fr, fr);
00074     TVector3 gEntry(3., 3., 3.);
00075     TVector3 gExit(fr*2., fr*2., fr*2.);
00076             
00077     VolumeIdentifier id ;
00078     id.append(1) ;
00079             
00080     Double_t depE = randNum;
00081     Double_t partE = randNum*0.1 ;
00082     TVector3 partMom = entry-exit ;
00083     TLorentzVector part4Mom(partMom,partE) ;
00084     Double_t tof = randNum*0.4 ;
00085     UInt_t flags = 0 ;
00086     McParticle * mcPart = 0 ;
00087     McParticle * originMcPart = 0 ;
00088     Int_t particleId = 7 ;
00089     Int_t originId = -13 ;
00090     
00091     initialize(particleId,originId,depE,id, 
00092       entry,exit,gEntry,gExit,
00093       mcPart,originMcPart,part4Mom,tof,flags) ;
00094 
00095 }

Double_t McPositionHit::getDepositedEnergy  )  const [inline]
 

Definition at line 115 of file McPositionHit.h.

References m_depositedEnergy.

00115 { return m_depositedEnergy; }

Double_t McPositionHit::getDirectionCosine  )  const
 

Definition at line 164 of file McPositionHit.cxx.

References m_entry, and m_exit.

Referenced by Print().

00165 { 
00166     TVector3 dir = (m_exit - m_entry).Unit();
00167     return dir.Z();
00168 }

const TVector3& McPositionHit::getEntryPosition  )  const [inline]
 

Definition at line 103 of file McPositionHit.h.

References m_entry.

00103 { return m_entry; }

const TVector3& McPositionHit::getExitPosition  )  const [inline]
 

Definition at line 107 of file McPositionHit.h.

References m_exit.

00107 { return m_exit; };

const TVector3& McPositionHit::getGlobalEntryPosition  )  const [inline]
 

Definition at line 105 of file McPositionHit.h.

References m_globalEntry.

00105 { return m_globalEntry; }

const TVector3& McPositionHit::getGlobalExitPosition  )  const [inline]
 

Definition at line 109 of file McPositionHit.h.

References m_globalExit.

00109 { return m_globalExit; }

const McParticle* McPositionHit::getMcParticle  )  const [inline]
 

Definition at line 127 of file McPositionHit.h.

References m_mcParticle.

Referenced by Print().

00127 { return (McParticle*)m_mcParticle.GetObject();};

Int_t McPositionHit::getMcParticleId  )  const [inline]
 

Definition at line 111 of file McPositionHit.h.

References m_mcParticleId.

00111 { return m_mcParticleId; };

const McParticle* McPositionHit::getOriginMcParticle  )  const [inline]
 

Definition at line 130 of file McPositionHit.h.

References m_originMcParticle.

Referenced by Print().

00130 { return (McParticle*)m_originMcParticle.GetObject(); };

Int_t McPositionHit::getOriginMcParticleId  )  const [inline]
 

Definition at line 113 of file McPositionHit.h.

References m_originMcParticleId.

00113 { return m_originMcParticleId; };

TLorentzVector McPositionHit::getParticle4Momentum  )  const [inline]
 

Definition at line 119 of file McPositionHit.h.

References m_particleFourMomentum.

00119 {return m_particleFourMomentum;}

Double_t McPositionHit::getParticleEnergy  )  const [inline]
 

Definition at line 117 of file McPositionHit.h.

References m_particleFourMomentum.

00117 { return m_particleFourMomentum.E(); }

TVector3 McPositionHit::getParticleMomentum  )  const [inline]
 

Definition at line 118 of file McPositionHit.h.

References m_particleFourMomentum.

00118 { return m_particleFourMomentum.Vect();}

Double_t McPositionHit::getTimeOfFlight  )  const [inline]
 

Definition at line 123 of file McPositionHit.h.

References m_timeOfFlight.

00123 { return m_timeOfFlight; }

const VolumeIdentifier& McPositionHit::getVolumeId  )  const [inline]
 

Definition at line 101 of file McPositionHit.h.

References m_volumeId.

Referenced by CompareInRange().

00101 { return m_volumeId; };

void McPositionHit::initialize Int_t  mcParticleId,
Int_t  originParticleId,
Double_t  edep,
const VolumeIdentifier &  volId,
const TVector3 &  entry,
const TVector3 &  exit,
const TVector3 &  gEntry,
const TVector3 &  gExit,
McParticle mc,
McParticle origin,
const TLorentzVector &  p4Mom,
Double_t  tof,
UInt_t  flags = 0
 

Definition at line 190 of file McPositionHit.cxx.

References m_depositedEnergy, m_entry, m_exit, m_globalEntry, m_globalExit, m_mcParticle, m_mcParticleId, m_originMcParticle, m_originMcParticleId, m_particleFourMomentum, m_statusFlags, m_timeOfFlight, and m_volumeId.

00196 {
00197     m_mcParticleId = mcParticleId;
00198     m_originMcParticleId = originParticleId;
00199     m_depositedEnergy = edep;
00200     m_volumeId = volId;
00201     m_entry = entry;
00202     m_exit = exit;
00203     m_globalEntry = gEntry;
00204     m_globalExit = gExit;
00205     m_mcParticle = mc;
00206     m_originMcParticle = origin;
00207     m_particleFourMomentum = p4Mom;
00208     m_timeOfFlight = tof;
00209     m_statusFlags = flags;
00210 }

void McPositionHit::initialize Int_t  particleId,
Double_t  edep,
const VolumeIdentifier &  volId,
const TVector3 &  entry,
const TVector3 &  exit,
McParticle mc,
McParticle origin,
const TLorentzVector &  p4Mom,
Double_t  tof,
UInt_t  flags = 0
 

Definition at line 171 of file McPositionHit.cxx.

References m_depositedEnergy, m_entry, m_exit, m_mcParticle, m_mcParticleId, m_originMcParticle, m_particleFourMomentum, m_statusFlags, m_timeOfFlight, and m_volumeId.

Referenced by Fake().

00177 {
00178     m_mcParticleId = particleId;
00179     m_depositedEnergy = edep;
00180     m_volumeId = volId;
00181     m_entry = entry;
00182     m_exit = exit;
00183     m_mcParticle = mc;
00184     m_originMcParticle = origin;
00185     m_particleFourMomentum = p4Mom;
00186     m_timeOfFlight = tof;
00187     m_statusFlags = flags;
00188 }

Bool_t McPositionHit::needDigi  )  const
 

Retrieve whether this hit should be digitized.

Definition at line 213 of file McPositionHit.cxx.

References m_statusFlags, and McParticle::NEED_DIGI.

00214 {
00215     return m_statusFlags & McParticle::NEED_DIGI;
00216 }

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

Definition at line 40 of file McPositionHit.cxx.

00041 {
00042     return vp;
00043 }

void * McPositionHit::operator new size_t  size  ) 
 

Definition at line 33 of file McPositionHit.cxx.

References McObjectManager::getNewMcPositionHit(), and McObjectManager::getPointer().

00034 {
00035     McPositionHit* temp = McObjectManager::getPointer()->getNewMcPositionHit();
00036 
00037     return temp;
00038 }

McPositionHit & McPositionHit::operator= const McPositionHit rhs  ) 
 

Definition at line 45 of file McPositionHit.cxx.

References m_depositedEnergy, m_entry, m_exit, m_globalEntry, m_globalExit, m_mcParticle, m_mcParticleId, m_originMcParticle, m_originMcParticleId, m_particleEnergy, m_particleFourMomentum, m_statusFlags, m_timeOfFlight, and m_volumeId.

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

Definition at line 133 of file McPositionHit.cxx.

References getDirectionCosine(), getMcParticle(), getOriginMcParticle(), m_depositedEnergy, m_entry, m_exit, m_globalEntry, m_globalExit, m_mcParticleId, m_originMcParticleId, m_particleFourMomentum, m_statusFlags, m_timeOfFlight, m_volumeId, and McParticle::Print().

00133                                                 {
00134     using namespace std;
00135     TObject::Print(option);
00136     m_volumeId.Print(option);
00137     std::cout.precision(2);
00138     std::cout << "Flags: " << m_statusFlags 
00139         << "    Dep Energy: " << m_depositedEnergy
00140         << "    Part Energy: " << m_particleFourMomentum.E()
00141         << "    TOF:  " << m_timeOfFlight << std::endl;
00142     std::cout << "Local Entry: (" << m_entry.X() << ","
00143         << m_entry.Y() << "," << m_entry.Z() << ")"
00144         << "  Local Exit: (" << m_exit.X() << "," 
00145         << m_exit.Y() << "," << m_exit.Z() << ") Direction Cosine: " 
00146         << getDirectionCosine() << std::endl;
00147     std::cout << "Global Entry: (" << m_globalEntry.X() << ","
00148         << m_globalEntry.Y() << "," << m_globalEntry.Z() << ")"
00149         << "  Global Entry: (" << m_globalExit.X() << ","
00150         << m_globalExit.Y() << "," << m_globalExit.Z() << ")" << std::endl;
00151     std::cout << "McParticleId " << m_mcParticleId << std::endl;
00152     if (getMcParticle() != 0) {
00153         cout << "McParticle Ref" << std::endl;
00154         getMcParticle()->Print();
00155     }
00156     std::cout << "Origin ParticleId " << m_originMcParticleId << endl;
00157     if (getOriginMcParticle() != 0) {
00158         cout << "Origin Particle Ref" << std::endl;
00159         getOriginMcParticle()->Print();
00160     }
00161 
00162 }

void McPositionHit::setMcParticle TObject *  o  )  [inline]
 

Definition at line 128 of file McPositionHit.h.

References m_mcParticle.

00128 { m_mcParticle=o;};

void McPositionHit::setOriginMcParticle TObject *  o  )  [inline]
 

Definition at line 131 of file McPositionHit.h.

References m_originMcParticle.

00131 { m_originMcParticle=o;};

void McPositionHit::setParticle4Momentum TVector3 &  partMom,
Double_t  partE
[inline]
 

Definition at line 120 of file McPositionHit.h.

References m_particleFourMomentum.

00121     {m_particleFourMomentum = TLorentzVector(partMom, partE);}


Member Data Documentation

Double_t McPositionHit::m_depositedEnergy [private]
 

Definition at line 144 of file McPositionHit.h.

Referenced by Clear(), getDepositedEnergy(), initialize(), operator=(), and Print().

TVector3 McPositionHit::m_entry [private]
 

local coordinates

Definition at line 157 of file McPositionHit.h.

Referenced by Clear(), getDirectionCosine(), getEntryPosition(), initialize(), operator=(), and Print().

TVector3 McPositionHit::m_exit [private]
 

local coordinates

Definition at line 159 of file McPositionHit.h.

Referenced by Clear(), getDirectionCosine(), getExitPosition(), initialize(), operator=(), and Print().

TVector3 McPositionHit::m_globalEntry [private]
 

Definition at line 162 of file McPositionHit.h.

Referenced by Clear(), getGlobalEntryPosition(), initialize(), operator=(), and Print().

TVector3 McPositionHit::m_globalExit [private]
 

Definition at line 164 of file McPositionHit.h.

Referenced by Clear(), getGlobalExitPosition(), initialize(), operator=(), and Print().

TRef McPositionHit::m_mcParticle [private]
 

Definition at line 166 of file McPositionHit.h.

Referenced by getMcParticle(), initialize(), operator=(), and setMcParticle().

Int_t McPositionHit::m_mcParticleId [private]
 

ID of the McParticle causing the hit.

Definition at line 152 of file McPositionHit.h.

Referenced by getMcParticleId(), initialize(), operator=(), and Print().

TRef McPositionHit::m_originMcParticle [private]
 

Definition at line 167 of file McPositionHit.h.

Referenced by getOriginMcParticle(), initialize(), operator=(), and setOriginMcParticle().

Int_t McPositionHit::m_originMcParticleId [private]
 

ID of the origin McParticle.

Definition at line 154 of file McPositionHit.h.

Referenced by getOriginMcParticleId(), initialize(), operator=(), and Print().

Double_t McPositionHit::m_particleEnergy [private]
 

Definition at line 145 of file McPositionHit.h.

Referenced by operator=().

TLorentzVector McPositionHit::m_particleFourMomentum [private]
 

Particle 4-momentum at this hit.

Definition at line 172 of file McPositionHit.h.

Referenced by Clear(), getParticle4Momentum(), getParticleEnergy(), getParticleMomentum(), initialize(), operator=(), Print(), and setParticle4Momentum().

UInt_t McPositionHit::m_statusFlags [private]
 

Packed flags for the internal use.

Definition at line 150 of file McPositionHit.h.

Referenced by Clear(), initialize(), needDigi(), operator=(), and Print().

Double_t McPositionHit::m_timeOfFlight [private]
 

Definition at line 147 of file McPositionHit.h.

Referenced by Clear(), getTimeOfFlight(), initialize(), operator=(), and Print().

VolumeIdentifier McPositionHit::m_volumeId [private]
 

Definition at line 169 of file McPositionHit.h.

Referenced by Clear(), getVolumeId(), initialize(), operator=(), and Print().


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