Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
CexmcProductionModel Class Reference

#include <CexmcProductionModel.hh>

Inheritance diagram for CexmcProductionModel:
CexmcChargeExchangeProductionModel< OutputParticle >

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
 

Detailed Description

Definition at line 60 of file CexmcProductionModel.hh.

Constructor & Destructor Documentation

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

Definition at line 49 of file CexmcProductionModel.cc.

References angularRanges.

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

Definition at line 60 of file CexmcProductionModel.cc.

61 {
62  delete messenger;
63 }

Member Function Documentation

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

Definition at line 90 of file CexmcProductionModel.cc.

References angularRanges, CexmcBadAngularRange, and CexmcInvalidAngularRange.

Referenced by CexmcProductionModelMessenger::SetNewValue().

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
CexmcAngularRangeList angularRanges
double G4double
Definition: G4Types.hh:76
void CexmcProductionModel::ApplyFermiMotion ( G4bool  on,
G4bool  fromMessenger = true 
)
inline

Definition at line 142 of file CexmcProductionModel.hh.

References CexmcCmdIsNotAllowed, fermiMotionIsOn, FermiMotionStatusChangeHook(), and ThrowExceptionIfProjectIsRead().

Referenced by CexmcProductionModelMessenger::SetNewValue().

144 {
145  if ( fromMessenger )
147 
148  fermiMotionIsOn = on;
149 
151 }
virtual void FermiMotionStatusChangeHook(void)
void ThrowExceptionIfProjectIsRead(CexmcExceptionType type, G4bool extraCond=true)
void CexmcProductionModel::FermiMotionStatusChangeHook ( void  )
protectedvirtual

Definition at line 129 of file CexmcProductionModel.cc.

Referenced by ApplyFermiMotion().

130 {
131 }
const CexmcAngularRangeList & CexmcProductionModel::GetAngularRanges ( void  ) const
inline

Definition at line 184 of file CexmcProductionModel.hh.

References angularRanges.

185 {
186  return angularRanges;
187 }
CexmcAngularRangeList angularRanges
G4ParticleDefinition * CexmcProductionModel::GetIncidentParticle ( void  ) const
inline
const G4String & CexmcProductionModel::GetName ( void  ) const
inline

Definition at line 210 of file CexmcProductionModel.hh.

References name.

211 {
212  return name;
213 }
G4ParticleDefinition * CexmcProductionModel::GetNucleusOutputParticle ( void  ) const
inline

Definition at line 237 of file CexmcProductionModel.hh.

References nucleusOutputParticle.

Referenced by CexmcChargeExchangeReconstructor::CexmcChargeExchangeReconstructor().

239 {
240  return nucleusOutputParticle;
241 }
G4ParticleDefinition * nucleusOutputParticle
G4ParticleDefinition * CexmcProductionModel::GetNucleusParticle ( void  ) const
inline

Definition at line 223 of file CexmcProductionModel.hh.

References nucleusParticle.

Referenced by CexmcChargeExchangeReconstructor::CexmcChargeExchangeReconstructor().

225 {
226  return nucleusParticle;
227 }
G4ParticleDefinition * nucleusParticle
G4ParticleDefinition * CexmcProductionModel::GetOutputParticle ( void  ) const
inline

Definition at line 230 of file CexmcProductionModel.hh.

References outputParticle.

Referenced by CexmcChargeExchangeReconstructor::CexmcChargeExchangeReconstructor().

232 {
233  return outputParticle;
234 }
G4ParticleDefinition * outputParticle
const CexmcProductionModelData & CexmcProductionModel::GetProductionModelData ( void  ) const
inline

Definition at line 198 of file CexmcProductionModel.hh.

References productionModelData.

199 {
200  return productionModelData;
201 }
CexmcProductionModelData productionModelData
const CexmcAngularRangeList & CexmcProductionModel::GetTriggeredAngularRanges ( void  ) const
inline

Definition at line 191 of file CexmcProductionModel.hh.

References triggeredAngularRanges.

192 {
193  return triggeredAngularRanges;
194 }
CexmcAngularRangeList triggeredAngularRanges
G4bool CexmcProductionModel::IsFermiMotionOn ( void  ) const
inline

Definition at line 204 of file CexmcProductionModel.hh.

References fermiMotionIsOn.

205 {
206  return fermiMotionIsOn;
207 }
void CexmcProductionModel::PrintInitialData ( void  ) const
inline

Definition at line 172 of file CexmcProductionModel.hh.

References angularRanges, CEXMC_LINE_START, fermiMotionIsOn, G4cout, and G4endl.

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
void CexmcProductionModel::SetAngularRange ( G4double  top,
G4double  bottom,
G4int  nmbOfDivs 
)

Definition at line 66 of file CexmcProductionModel.cc.

References angularRanges, CexmcBadAngularRange, and CexmcInvalidAngularRange.

Referenced by CexmcProductionModelMessenger::SetNewValue().

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 }
CexmcAngularRangeList angularRanges
double G4double
Definition: G4Types.hh:76
void CexmcProductionModel::SetAngularRanges ( const CexmcAngularRangeList angularRanges_)
inline

Definition at line 154 of file CexmcProductionModel.hh.

References angularRanges, and angularRangesRef.

156 {
157  angularRangesRef = angularRanges_;
159 #ifdef CEXMC_USE_ROOT
160  CexmcHistoManager::Instance()->SetupARHistos( angularRanges );
161 #endif
162 }
CexmcAngularRangeList angularRangesRef
CexmcAngularRangeList angularRanges
void CexmcProductionModel::SetProductionModelData ( const CexmcProductionModelData productionModelData_)
inline

Definition at line 165 of file CexmcProductionModel.hh.

References productionModelData.

167 {
168  productionModelData = productionModelData_;
169 }
CexmcProductionModelData productionModelData
void CexmcProductionModel::SetTriggeredAngularRanges ( G4double  opCosThetaSCM)

Definition at line 115 of file CexmcProductionModel.cc.

References angularRanges, and triggeredAngularRanges.

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

Field Documentation

CexmcAngularRangeList CexmcProductionModel::angularRanges
protected
CexmcAngularRangeList CexmcProductionModel::angularRangesRef
protected

Definition at line 122 of file CexmcProductionModel.hh.

Referenced by SetAngularRanges().

G4bool CexmcProductionModel::fermiMotionIsOn
protected

Definition at line 118 of file CexmcProductionModel.hh.

Referenced by ApplyFermiMotion(), IsFermiMotionOn(), and PrintInitialData().

G4ParticleDefinition* CexmcProductionModel::incidentParticle
protected
G4String CexmcProductionModel::name
protected

Definition at line 116 of file CexmcProductionModel.hh.

Referenced by GetName().

G4ParticleDefinition* CexmcProductionModel::nucleusOutputParticle
protected
G4ParticleDefinition* CexmcProductionModel::nucleusParticle
protected
G4ParticleDefinition* CexmcProductionModel::outputParticle
protected
CexmcProductionModelData CexmcProductionModel::productionModelData
protected
CexmcAngularRangeList CexmcProductionModel::triggeredAngularRanges
protected

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