00001 // $Header: /nfs/slac/g/glast/ground/cvs/GlastEvent/src/MonteCarlo/McPositionHit.cxx,v 1.4 2001/01/30 00:31:21 igable Exp $ 00002 00003 #include <iostream> 00004 #include <math.h> 00005 #include "GlastEvent/MonteCarlo/McPositionHit.h" 00006 #include "GlastEvent/Utilities/CLHEPStreams.h" 00007 00008 00009 // FIXME!!: 00010 // The next `using' directive is an ad-hoc declaration for the transition 00011 // phase to the namespace `GlastEvent'. 00012 // After the transition is completed, it should be removed and each 00013 // function definition should have the namespace identifier. 00014 using namespace GlastEvent; 00015 00017 double McPositionHit::directionCosine() const 00018 { 00019 double dx = m_exit.x()-m_entry.x(); 00020 double dy = m_exit.y()-m_entry.y(); 00021 double dz = m_exit.z()-m_entry.z(); 00022 return dz / sqrt(dx * dx + dy * dy); 00023 } 00024 00025 00026 00027 00028 00029 const VolumeID McPositionHit::volumeID() const 00030 { 00031 return m_volumeID; 00032 } 00034 void McPositionHit::setVolumeID( VolumeID value ) 00035 { 00036 m_volumeID = value; 00037 } 00038 00039 00041 const HepPoint3D& McPositionHit::entryPoint() const 00042 { 00043 return m_entry; 00044 } 00045 HepPoint3D& McPositionHit::entryPoint() 00046 { 00047 return m_entry; 00048 } 00049 00050 00052 void McPositionHit::setEntryPoint( const HepPoint3D& value ) 00053 { 00054 m_entry = value; 00055 } 00056 00057 00059 const HepPoint3D& McPositionHit::exitPoint() const 00060 { 00061 return m_exit; 00062 } 00063 HepPoint3D& McPositionHit::exitPoint() 00064 { 00065 return m_exit; 00066 } 00067 00068 00070 void McPositionHit::setExitPoint( const HepPoint3D& value ) 00071 { 00072 m_exit = value; 00073 } 00074 00075 00077 double McPositionHit::depositedEnergy() const 00078 { 00079 return m_depositedEnergy; 00080 } 00081 00082 00084 void McPositionHit::setDepositedEnergy( double value ) 00085 { 00086 m_depositedEnergy = value; 00087 } 00088 00090 double McPositionHit::particleEnergy() const 00091 { 00092 return m_particleEnergy; 00093 } 00094 00096 void McPositionHit::setParticleEnergy(double value) 00097 { 00098 m_particleEnergy = value; 00099 } 00100 00102 bool McPositionHit::primaryOrigin() const 00103 { 00104 using GlastEvent::McConstants::ORIGIN_PRIMARY; 00105 return m_packedFlags & ORIGIN_PRIMARY; 00106 } 00108 void McPositionHit::setPrimaryOrigin( bool value ) 00109 { 00110 using GlastEvent::McConstants::ORIGIN_PRIMARY; 00111 if (value){ 00112 m_packedFlags |= ORIGIN_PRIMARY; 00113 } else { 00114 m_packedFlags &= ~ORIGIN_PRIMARY; 00115 } 00116 } 00118 bool McPositionHit::caloShowerOrigin() const 00119 { 00120 using GlastEvent::McConstants::ORIGIN_CALOSHOWER; 00121 return m_packedFlags & ORIGIN_CALOSHOWER; 00122 } 00124 void McPositionHit::setCaloShowerOrigin( bool value ) 00125 { 00126 using GlastEvent::McConstants::ORIGIN_CALOSHOWER; 00127 if (value){ 00128 m_packedFlags |= ORIGIN_CALOSHOWER; 00129 } else { 00130 m_packedFlags &= ~ORIGIN_CALOSHOWER; 00131 } 00132 } 00133 00135 bool McPositionHit::needDigi() const 00136 { 00137 using GlastEvent::McConstants::NEED_DIGI; 00138 return m_packedFlags & NEED_DIGI; 00139 } 00141 void McPositionHit::setNeedDigi( bool value ) 00142 { 00143 using GlastEvent::McConstants::NEED_DIGI; 00144 if (value){ 00145 m_packedFlags |= NEED_DIGI; 00146 } else { 00147 m_packedFlags &= ~NEED_DIGI; 00148 } 00149 } 00150 00151 00153 double McPositionHit::timeOfFlight() const 00154 { 00155 return m_timeOfFlight; 00156 } 00157 00158 00160 void McPositionHit::setTimeOfFlight( double value ) 00161 { 00162 m_timeOfFlight = value; 00163 } 00164 00165 00167 const McParticle* McPositionHit::mcParticle() const 00168 { 00169 return m_mcParticle; 00170 } 00171 McParticle* McPositionHit::mcParticle() 00172 { 00173 return m_mcParticle; 00174 } 00176 void McPositionHit::setMcParticle( McParticle* value ) 00177 { 00178 m_mcParticle = value; 00179 } 00180 void McPositionHit::setMcParticle( SmartRef<McParticle> value ) 00181 { 00182 m_mcParticle = value; 00183 } 00184 00185 00187 const McParticle* McPositionHit::originMcParticle() const 00188 { 00189 return m_originMcParticle; 00190 } 00191 McParticle* McPositionHit::originMcParticle() 00192 { 00193 return m_originMcParticle; 00194 } 00196 void McPositionHit::setOriginMcParticle( McParticle* value ) 00197 { 00198 m_originMcParticle = value; 00199 } 00200 void McPositionHit::setOriginMcParticle( SmartRef<McParticle> value ) 00201 { 00202 m_originMcParticle = value; 00203 }
1.2.3 written by Dimitri van Heesch,
© 1997-2000