Geant4  10.02.p03
CexmcProductionModel Class Reference

#include <CexmcProductionModel.hh>

Inheritance diagram for CexmcProductionModel:
Collaboration diagram for CexmcProductionModel:

Public Member Functions

 CexmcProductionModel (const G4String &name="unspecified", G4bool fermiMotionIsOn=false)
 
virtual ~CexmcProductionModel ()
 
void ApplyFermiMotion (G4bool on, G4bool fromMessenger=true)
 
void SetAngularRange (G4double top, G4double bottom, G4int nmbOfDivs)
 
void SetAngularRanges (const CexmcAngularRangeList &angularRanges_)
 
void AddAngularRange (G4double top, G4double bottom, G4int nmbOfDivs)
 
void SetProductionModelData (const CexmcProductionModelData &productionModelData_)
 
void PrintInitialData (void) const
 
const CexmcAngularRangeListGetAngularRanges (void) const
 
const CexmcAngularRangeListGetTriggeredAngularRanges (void) const
 
const CexmcProductionModelDataGetProductionModelData (void) const
 
G4bool IsFermiMotionOn (void) const
 
void SetTriggeredAngularRanges (G4double opCosThetaSCM)
 
const G4StringGetName (void) const
 
G4ParticleDefinitionGetIncidentParticle (void) const
 
G4ParticleDefinitionGetNucleusParticle (void) const
 
G4ParticleDefinitionGetOutputParticle (void) const
 
G4ParticleDefinitionGetNucleusOutputParticle (void) const
 

Protected Member Functions

virtual void FermiMotionStatusChangeHook (void)
 

Protected Attributes

G4String name
 
G4bool fermiMotionIsOn
 
CexmcAngularRangeList angularRanges
 
CexmcAngularRangeList angularRangesRef
 
CexmcAngularRangeList triggeredAngularRanges
 
CexmcProductionModelData productionModelData
 
G4ParticleDefinitionincidentParticle
 
G4ParticleDefinitionnucleusParticle
 
G4ParticleDefinitionoutputParticle
 
G4ParticleDefinitionnucleusOutputParticle
 

Private Member Functions

G4bool IsValidCandidateForAngularRange (G4double top, G4double bottom, G4int nmbOfDivs=1) const
 
G4bool IsGoodCandidateForAngularRange (G4double top, G4double bottom) const
 

Private Attributes

CexmcProductionModelMessengermessenger
 

Detailed Description

Definition at line 60 of file CexmcProductionModel.hh.

Constructor & Destructor Documentation

◆ CexmcProductionModel()

CexmcProductionModel::CexmcProductionModel ( const G4String name = "unspecified",
G4bool  fermiMotionIsOn = false 
)
explicit

Definition at line 49 of file CexmcProductionModel.cc.

50  :
52  nucleusParticle( NULL ), outputParticle( NULL ),
53  nucleusOutputParticle( NULL ), messenger( NULL )
54 {
55  angularRanges.push_back( CexmcAngularRange( 1.0, -1.0, 0 ) );
57 }
G4ParticleDefinition * nucleusOutputParticle
G4ParticleDefinition * nucleusParticle
G4ParticleDefinition * incidentParticle
CexmcAngularRangeList angularRanges
CexmcProductionModelMessenger * messenger
G4ParticleDefinition * outputParticle

◆ ~CexmcProductionModel()

CexmcProductionModel::~CexmcProductionModel ( )
virtual

Definition at line 60 of file CexmcProductionModel.cc.

61 {
62  delete messenger;
63 }
CexmcProductionModelMessenger * messenger

Member Function Documentation

◆ AddAngularRange()

void CexmcProductionModel::AddAngularRange ( G4double  top,
G4double  bottom,
G4int  nmbOfDivs 
)

Definition at line 90 of file CexmcProductionModel.cc.

92 {
93  if ( ! IsValidCandidateForAngularRange( top, bottom, nmbOfDivs ) )
95 
96  if ( ! IsGoodCandidateForAngularRange( top, bottom ) )
98 
99  G4int curIndex( angularRanges.size() );
100  G4double curBottom( top );
101  for ( int i( 0 ); i < nmbOfDivs; ++i )
102  {
103  G4double binWidth( ( top - bottom ) / nmbOfDivs );
104  G4double curTop( curBottom );
105  curBottom -= binWidth;
106  CexmcAngularRange aRange( curTop, curBottom, curIndex + i );
107  angularRanges.push_back( aRange );
108 #ifdef CEXMC_USE_ROOT
109  CexmcHistoManager::Instance()->AddARHistos( aRange );
110 #endif
111  }
112 }
int G4int
Definition: G4Types.hh:78
G4bool IsGoodCandidateForAngularRange(G4double top, G4double bottom) const
G4bool IsValidCandidateForAngularRange(G4double top, G4double bottom, G4int nmbOfDivs=1) const
CexmcAngularRangeList angularRanges
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ApplyFermiMotion()

void CexmcProductionModel::ApplyFermiMotion ( G4bool  on,
G4bool  fromMessenger = true 
)
inline

Definition at line 142 of file CexmcProductionModel.hh.

144 {
145  if ( fromMessenger )
147 
148  fermiMotionIsOn = on;
149 
151 }
virtual void FermiMotionStatusChangeHook(void)
void ThrowExceptionIfProjectIsRead(CexmcExceptionType type, G4bool extraCond=true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FermiMotionStatusChangeHook()

void CexmcProductionModel::FermiMotionStatusChangeHook ( void  )
protectedvirtual

Definition at line 129 of file CexmcProductionModel.cc.

130 {
131 }
Here is the caller graph for this function:

◆ GetAngularRanges()

const CexmcAngularRangeList & CexmcProductionModel::GetAngularRanges ( void  ) const
inline

Definition at line 184 of file CexmcProductionModel.hh.

185 {
186  return angularRanges;
187 }
CexmcAngularRangeList angularRanges
Here is the caller graph for this function:

◆ GetIncidentParticle()

G4ParticleDefinition * CexmcProductionModel::GetIncidentParticle ( void  ) const
inline

Definition at line 216 of file CexmcProductionModel.hh.

218 {
219  return incidentParticle;
220 }
G4ParticleDefinition * incidentParticle
Here is the caller graph for this function:

◆ GetName()

const G4String & CexmcProductionModel::GetName ( void  ) const
inline

Definition at line 210 of file CexmcProductionModel.hh.

211 {
212  return name;
213 }

◆ GetNucleusOutputParticle()

G4ParticleDefinition * CexmcProductionModel::GetNucleusOutputParticle ( void  ) const
inline

Definition at line 237 of file CexmcProductionModel.hh.

239 {
240  return nucleusOutputParticle;
241 }
G4ParticleDefinition * nucleusOutputParticle
Here is the caller graph for this function:

◆ GetNucleusParticle()

G4ParticleDefinition * CexmcProductionModel::GetNucleusParticle ( void  ) const
inline

Definition at line 223 of file CexmcProductionModel.hh.

225 {
226  return nucleusParticle;
227 }
G4ParticleDefinition * nucleusParticle
Here is the caller graph for this function:

◆ GetOutputParticle()

G4ParticleDefinition * CexmcProductionModel::GetOutputParticle ( void  ) const
inline

Definition at line 230 of file CexmcProductionModel.hh.

232 {
233  return outputParticle;
234 }
G4ParticleDefinition * outputParticle
Here is the caller graph for this function:

◆ GetProductionModelData()

const CexmcProductionModelData & CexmcProductionModel::GetProductionModelData ( void  ) const
inline

Definition at line 198 of file CexmcProductionModel.hh.

199 {
200  return productionModelData;
201 }
CexmcProductionModelData productionModelData

◆ GetTriggeredAngularRanges()

const CexmcAngularRangeList & CexmcProductionModel::GetTriggeredAngularRanges ( void  ) const
inline

Definition at line 191 of file CexmcProductionModel.hh.

192 {
193  return triggeredAngularRanges;
194 }
CexmcAngularRangeList triggeredAngularRanges

◆ IsFermiMotionOn()

G4bool CexmcProductionModel::IsFermiMotionOn ( void  ) const
inline

Definition at line 204 of file CexmcProductionModel.hh.

205 {
206  return fermiMotionIsOn;
207 }
Here is the caller graph for this function:

◆ IsGoodCandidateForAngularRange()

G4bool CexmcProductionModel::IsGoodCandidateForAngularRange ( G4double  top,
G4double  bottom 
) const
private

Definition at line 134 of file CexmcProductionModel.cc.

136 {
137  CexmcRunManager * runManager( static_cast< CexmcRunManager * >(
139 
140  if ( ! runManager->ProjectIsRead() )
141  return true;
142 
143  CexmcAngularRangeList normalizedARanges;
144  GetNormalizedAngularRange( angularRangesRef, normalizedARanges );
145 
146  for ( CexmcAngularRangeList::iterator k( normalizedARanges.begin() );
147  k != normalizedARanges.end(); ++k )
148  {
149  if ( top <= k->top && bottom >= k->bottom )
150  return true;
151  }
152 
153  return false;
154 }
CexmcAngularRangeList angularRangesRef
void GetNormalizedAngularRange(const CexmcAngularRangeList &src, CexmcAngularRangeList &dst)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
std::vector< CexmcAngularRange > CexmcAngularRangeList
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsValidCandidateForAngularRange()

G4bool CexmcProductionModel::IsValidCandidateForAngularRange ( G4double  top,
G4double  bottom,
G4int  nmbOfDivs = 1 
) const
inlineprivate

Definition at line 244 of file CexmcProductionModel.hh.

246 {
247  return top > bottom && top <= 1.0 && top > -1.0 && bottom < 1.0 &&
248  bottom >= -1.0 && nmbOfDivs >= 1;
249 }
Here is the caller graph for this function:

◆ PrintInitialData()

void CexmcProductionModel::PrintInitialData ( void  ) const
inline

Definition at line 172 of file CexmcProductionModel.hh.

173 {
174  const char * fermiMotionMsg( "Fermi motion in the target is off" );
175  if ( fermiMotionIsOn )
176  fermiMotionMsg = "Fermi motion in the target is on";
177 
178  G4cout << CEXMC_LINE_START << fermiMotionMsg << G4endl;
179  G4cout << CEXMC_LINE_START << "Angular ranges:" << angularRanges;
180 }
G4GLOB_DLL std::ostream G4cout
#define CEXMC_LINE_START
Definition: CexmcCommon.hh:52
CexmcAngularRangeList angularRanges
#define G4endl
Definition: G4ios.hh:61

◆ SetAngularRange()

void CexmcProductionModel::SetAngularRange ( G4double  top,
G4double  bottom,
G4int  nmbOfDivs 
)

Definition at line 66 of file CexmcProductionModel.cc.

68 {
69  if ( ! IsValidCandidateForAngularRange( top, bottom, nmbOfDivs ) )
71 
72  if ( ! IsGoodCandidateForAngularRange( top, bottom ) )
74 
75  angularRanges.clear();
76  G4double curBottom( top );
77  for ( int i( 0 ); i < nmbOfDivs; ++i )
78  {
79  G4double binWidth( ( top - bottom ) / nmbOfDivs );
80  G4double curTop( curBottom );
81  curBottom -= binWidth;
82  angularRanges.push_back( CexmcAngularRange( curTop, curBottom, i ) );
83  }
84 #ifdef CEXMC_USE_ROOT
85  CexmcHistoManager::Instance()->SetupARHistos( angularRanges );
86 #endif
87 }
G4bool IsGoodCandidateForAngularRange(G4double top, G4double bottom) const
G4bool IsValidCandidateForAngularRange(G4double top, G4double bottom, G4int nmbOfDivs=1) const
CexmcAngularRangeList angularRanges
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAngularRanges()

void CexmcProductionModel::SetAngularRanges ( const CexmcAngularRangeList angularRanges_)
inline

Definition at line 154 of file CexmcProductionModel.hh.

156 {
157  angularRangesRef = angularRanges_;
159 #ifdef CEXMC_USE_ROOT
160  CexmcHistoManager::Instance()->SetupARHistos( angularRanges );
161 #endif
162 }
CexmcAngularRangeList angularRangesRef
CexmcAngularRangeList angularRanges
Here is the caller graph for this function:

◆ SetProductionModelData()

void CexmcProductionModel::SetProductionModelData ( const CexmcProductionModelData productionModelData_)
inline

Definition at line 165 of file CexmcProductionModel.hh.

167 {
168  productionModelData = productionModelData_;
169 }
CexmcProductionModelData productionModelData

◆ SetTriggeredAngularRanges()

void CexmcProductionModel::SetTriggeredAngularRanges ( G4double  opCosThetaSCM)

Definition at line 115 of file CexmcProductionModel.cc.

116 {
117  triggeredAngularRanges.clear();
118 
119  for ( CexmcAngularRangeList::iterator k( angularRanges.begin() );
120  k != angularRanges.end(); ++k )
121  {
122  if ( opCosThetaSCM <= k->top && opCosThetaSCM > k->bottom )
124  k->top, k->bottom, k->index ) );
125  }
126 }
CexmcAngularRangeList angularRanges
CexmcAngularRangeList triggeredAngularRanges

Member Data Documentation

◆ angularRanges

CexmcAngularRangeList CexmcProductionModel::angularRanges
protected

Definition at line 120 of file CexmcProductionModel.hh.

◆ angularRangesRef

CexmcAngularRangeList CexmcProductionModel::angularRangesRef
protected

Definition at line 122 of file CexmcProductionModel.hh.

◆ fermiMotionIsOn

G4bool CexmcProductionModel::fermiMotionIsOn
protected

Definition at line 118 of file CexmcProductionModel.hh.

◆ incidentParticle

G4ParticleDefinition* CexmcProductionModel::incidentParticle
protected

Definition at line 129 of file CexmcProductionModel.hh.

◆ messenger

CexmcProductionModelMessenger* CexmcProductionModel::messenger
private

Definition at line 138 of file CexmcProductionModel.hh.

◆ name

G4String CexmcProductionModel::name
protected

Definition at line 116 of file CexmcProductionModel.hh.

◆ nucleusOutputParticle

G4ParticleDefinition* CexmcProductionModel::nucleusOutputParticle
protected

Definition at line 135 of file CexmcProductionModel.hh.

◆ nucleusParticle

G4ParticleDefinition* CexmcProductionModel::nucleusParticle
protected

Definition at line 131 of file CexmcProductionModel.hh.

◆ outputParticle

G4ParticleDefinition* CexmcProductionModel::outputParticle
protected

Definition at line 133 of file CexmcProductionModel.hh.

◆ productionModelData

CexmcProductionModelData CexmcProductionModel::productionModelData
protected

Definition at line 126 of file CexmcProductionModel.hh.

◆ triggeredAngularRanges

CexmcAngularRangeList CexmcProductionModel::triggeredAngularRanges
protected

Definition at line 124 of file CexmcProductionModel.hh.


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