Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel > Class Template Reference

#include <CexmcPhysicsList.hh>

Inheritance diagram for CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >:
Collaboration diagram for CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >:

Public Member Functions

 CexmcPhysicsList ()
 
CexmcProductionModelGetProductionModel (void)
 
G4bool IsStudiedProcessAllowed (void) const
 
void ResampleTrackLengthInTarget (const G4Track *track, const G4StepPoint *stepPoint)
 
void SetupConstructionHook (const CexmcSetup *setup)
 
- Public Member Functions inherited from CexmcPhysicsManager
 CexmcPhysicsManager ()
 
virtual ~CexmcPhysicsManager ()
 
G4bool OnlyBeamParticleCanTriggerStudiedProcess (void) const
 
void IncrementNumberOfTriggeredStudiedInteractions (void)
 
void ResetNumberOfTriggeredStudiedInteractions (void)
 
G4double GetProposedMaxIL (void) const
 
void SetMaxIL (const G4ThreeVector &direction)
 
void SetMaxILCorrection (G4double value)
 
void SetProposedMaxIL (G4double value)
 

Protected Member Functions

void CalculateBasicMaxIL (const G4ThreeVector &direction)
 

Additional Inherited Members

- Protected Attributes inherited from CexmcPhysicsManager
G4double basicMaxIL
 
G4double maxILCorrection
 
G4double proposedMaxIL
 
G4int numberOfTriggeredStudiedInteractions
 
G4bool onlyBeamParticleCanTriggerStudiedProcess
 

Detailed Description

template<typename BasePhysics, template< typename > class StudiedPhysics, typename ProductionModel>
class CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >

Definition at line 62 of file CexmcPhysicsList.hh.

Constructor & Destructor Documentation

template<typename BasePhysics , template< typename > class StudiedPhysics, typename ProductionModel >
CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >::CexmcPhysicsList ( )

Definition at line 92 of file CexmcPhysicsList.hh.

92  : studiedPhysics( NULL ), targetSolid( NULL )
93 {
94  studiedPhysics = new StudiedPhysics< ProductionModel >( this );
95  this->RegisterPhysics( studiedPhysics );
96 }

Member Function Documentation

template<typename BasePhysics , template< typename > class StudiedPhysics, typename ProductionModel >
void CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >::CalculateBasicMaxIL ( const G4ThreeVector direction)
protectedvirtual

Implements CexmcPhysicsManager.

Definition at line 164 of file CexmcPhysicsList.hh.

165 {
166  /* basicMaxIL is double distance from the point (0, 0, 0) to the edge of the
167  * target solid along the specified direction */
168  basicMaxIL = targetSolid->DistanceToOut( G4ThreeVector(),
169  targetTransform.TransformAxis( direction ) ) * 2;
170 }
CLHEP::Hep3Vector G4ThreeVector
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
template<typename BasePhysics , template< typename > class StudiedPhysics, typename ProductionModel >
CexmcProductionModel * CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >::GetProductionModel ( void  )
virtual

Implements CexmcPhysicsManager.

Definition at line 103 of file CexmcPhysicsList.hh.

104 {
105  return studiedPhysics->GetProductionModel();
106 }
template<typename BasePhysics , template< typename > class StudiedPhysics, typename ProductionModel >
G4bool CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >::IsStudiedProcessAllowed ( void  ) const
virtual

Implements CexmcPhysicsManager.

Definition at line 112 of file CexmcPhysicsList.hh.

113 {
115 }
template<typename BasePhysics , template< typename > class StudiedPhysics, typename ProductionModel >
void CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >::ResampleTrackLengthInTarget ( const G4Track track,
const G4StepPoint stepPoint 
)
virtual

Implements CexmcPhysicsManager.

Definition at line 121 of file CexmcPhysicsList.hh.

123 {
124  /* BEWARE: all callers must ensure that:
125  * 1) track (or stepPoint if not NULL) is inside target volume:
126  * in this case we can use already calculated targetTransform
127  * 2) track info object is of type CexmcIncidentParticleTrackInfo*:
128  * in this case we can use static_cast<> for trackInfo */
129  CexmcIncidentParticleTrackInfo * trackInfo(
130  static_cast< CexmcIncidentParticleTrackInfo * >(
131  track->GetUserInformation() ) );
132 
133  if ( ! trackInfo )
134  return;
135 
137  G4ThreeVector direction;
138 
139  if ( stepPoint )
140  {
141  position = targetTransform.TransformPoint( stepPoint->GetPosition() );
142  direction = targetTransform.TransformAxis(
143  stepPoint->GetMomentumDirection() );
144  }
145  else
146  {
147  position = targetTransform.TransformPoint( track->GetPosition() );
148  direction = targetTransform.TransformAxis(
149  track->GetMomentumDirection() );
150  }
151 
152  G4double distanceInTarget( targetSolid->DistanceToOut( position,
153  direction ) );
154  trackInfo->ResetCurrentTrackLengthInTarget();
155  trackInfo->SetFinalTrackLengthInTarget( G4UniformRand() *
156  std::max( distanceInTarget, proposedMaxIL ) );
157  trackInfo->SetNeedsTrackLengthResampling( false );
158 }
const G4ThreeVector & GetPosition() const
G4VUserTrackInformation * GetUserInformation() const
const G4ThreeVector & GetMomentumDirection() const
#define position
Definition: xmlparse.cc:622
#define G4UniformRand()
Definition: Randomize.hh:97
const G4ThreeVector & GetPosition() const
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
const G4ThreeVector & GetMomentumDirection() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
double G4double
Definition: G4Types.hh:76
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0

Here is the call graph for this function:

template<typename BasePhysics , template< typename > class StudiedPhysics, typename ProductionModel >
void CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >::SetupConstructionHook ( const CexmcSetup setup)
virtual

Implements CexmcPhysicsManager.

Definition at line 176 of file CexmcPhysicsList.hh.

177 {
178  targetSolid = setup->GetVolume( CexmcSetup::Target )->GetSolid();
179  targetTransform = setup->GetTargetTransform().Inverse();
180 }
G4AffineTransform Inverse() const
G4VSolid * GetSolid() const
const G4LogicalVolume * GetVolume(SpecialVolumeType volume) const
Definition: CexmcSetup.hh:188
const G4AffineTransform & GetTargetTransform(void) const
Definition: CexmcSetup.hh:161

Here is the call graph for this function:


The documentation for this class was generated from the following file: