Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
+11 -1
View File
@@ -1,4 +1,4 @@
$Id: History 96231 2016-03-30 10:35:46Z gcosmo $
$Id: History 101439 2016-11-17 14:54:08Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -16,6 +16,16 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Nov 17, 2016 L.Desorgher (tracking-V10-02-05)
- G4AdjointSteppingAction remove a test on weight with FPE issue.
Octb 27, 2016 L.Desorgher (tracking-V10-02-04)
- G4AdjointSteppingAction remove a print info on the weight, when stopping reverse tracking.
for the implementation of the splitting of the reverse MC tracking.
July 21, 2016 L.Desorgher (tracking-V10-02-03)
- Modification of G4AdjointTrackingAction and G4AdjointSteppingAction
for the implementation of the splitting of the reverse MC tracking.
30th Jan 2016 A. Dotti (tracking-V10-02-02)
- G4VTrajectory.cc: Added std::endl at end of ShowTrajectory.
@@ -65,24 +65,27 @@ public: // with description
virtual void PreUserTrackingAction(const G4Track*);
virtual void PostUserTrackingAction(const G4Track*);
void RegisterAtEndOfAdjointTrack();
void ClearEndOfAdjointTrackInfoVectors();
//inline methods
inline void SetUserForwardTrackingAction(G4UserTrackingAction* anAction){
theUserFwdTrackingAction = anAction;}
inline G4ThreeVector GetPositionAtEndOfLastAdjointTrack(){ return last_pos;}
inline G4ThreeVector GetDirectionAtEndOfLastAdjointTrack(){ return last_direction;}
inline G4double GetEkinAtEndOfLastAdjointTrack(){ return last_ekin;}
inline G4double GetEkinNucAtEndOfLastAdjointTrack(){ return last_ekin_nuc;}
inline G4double GetWeightAtEndOfLastAdjointTrack(){return last_weight;}
inline G4double GetCosthAtEndOfLastAdjointTrack(){return last_cos_th;}
inline G4ThreeVector GetPositionAtEndOfLastAdjointTrack(size_t i=0){ return last_pos_vec[i];}
inline G4ThreeVector GetDirectionAtEndOfLastAdjointTrack(size_t i=0){ return last_direction_vec[i];}
inline G4double GetEkinAtEndOfLastAdjointTrack(size_t i=0){ return last_ekin_vec[i];}
inline G4double GetEkinNucAtEndOfLastAdjointTrack(size_t i=0){ return last_ekin_nuc_vec[i];}
inline G4double GetWeightAtEndOfLastAdjointTrack(size_t i=0){return last_weight_vec[i];}
inline G4double GetCosthAtEndOfLastAdjointTrack(size_t i=0){return last_cos_th_vec[i];}
inline const G4String& GetFwdParticleNameAtEndOfLastAdjointTrack(){return last_fwd_part_name;}
inline G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(){return last_fwd_part_PDGEncoding;}
inline G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(size_t i=0){return last_fwd_part_PDGEncoding_vec[i];}
inline G4bool GetIsAdjointTrackingMode(){return is_adjoint_tracking_mode;}
inline G4int GetLastFwdParticleIndex(){
return last_fwd_part_index;};
inline G4int GetLastFwdParticleIndex(size_t i=0){
return last_fwd_part_index_vec[i];};
inline size_t GetNbOfAdointTracksReachingTheExternalSurface(){return last_pos_vec.size();}
inline void SetListOfPrimaryFwdParticles( std::vector<G4ParticleDefinition*>*
aListOfParticles){pListOfPrimaryFwdParticles=aListOfParticles;}
private:
G4AdjointSteppingAction* theAdjointSteppingAction;
G4UserTrackingAction* theUserFwdTrackingAction;
@@ -101,7 +104,14 @@ private:
G4int last_fwd_part_index;
std::vector<G4ParticleDefinition*>* pListOfPrimaryFwdParticles;
std::vector<G4ThreeVector> last_pos_vec;
std::vector<G4ThreeVector> last_direction_vec;
std::vector<G4double> last_ekin_vec;
std::vector<G4double> last_ekin_nuc_vec;
std::vector<G4double> last_cos_th_vec;
std::vector<G4double> last_weight_vec;
std::vector<G4int> last_fwd_part_PDGEncoding_vec;
std::vector<G4int> last_fwd_part_index_vec;
};
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AdjointSteppingAction.cc 81774 2014-06-05 08:36:37Z gcosmo $
// $Id: G4AdjointSteppingAction.cc 101439 2016-11-17 14:54:08Z gcosmo $
//
/////////////////////////////////////////////////////////////////////////////
// Class Name: G4AdjointSteppingAction
@@ -44,7 +44,7 @@
G4AdjointSteppingAction::G4AdjointSteppingAction()
: ext_sourceEMax(0.), start_event(false),
did_adj_part_reach_ext_source(false), last_ekin(0.), last_weight(0.),
prim_weight(0.), last_part_def(0), theUserAdjointSteppingAction(0),
prim_weight(1.), last_part_def(0), theUserAdjointSteppingAction(0),
theUserFwdSteppingAction(0)
{
theG4AdjointCrossSurfChecker = G4AdjointCrossSurfChecker::GetInstance();
@@ -59,6 +59,7 @@ G4AdjointSteppingAction::~G4AdjointSteppingAction()
void G4AdjointSteppingAction::UserSteppingAction(const G4Step* aStep)
{
G4Track* aTrack =aStep->GetTrack();
//G4cout<<"Ste weight "<<<<std:.endl;
//forward tracking mode
if(!is_adjoint_tracking_mode){
//check if last adjoint did reach the external source
@@ -72,6 +73,7 @@ void G4AdjointSteppingAction::UserSteppingAction(const G4Step* aStep)
}
//Apply first the user adjoint stepping action
//---------------------------
did_adj_part_reach_ext_source=false;
if (theUserAdjointSteppingAction) theUserAdjointSteppingAction->UserSteppingAction(aStep);
@@ -88,15 +90,17 @@ void G4AdjointSteppingAction::UserSteppingAction(const G4Step* aStep)
did_adj_part_reach_ext_source=false;
return;
}
G4double weight_factor = aTrack->GetWeight()/prim_weight;
//G4cout<<"Weight adjoint "<<aTrack->GetWeight()<<std::endl;
/*G4double weight_factor = aTrack->GetWeight()/prim_weight;
if ( (weight_factor>0 && weight_factor<=0) || weight_factor<= 1e-290 || weight_factor>1.e200)
{
//std::cout<<"Weight_factor problem! Value = "<<weight_factor<<std::endl;
aTrack->SetTrackStatus(fStopAndKill);
did_adj_part_reach_ext_source=false;
//G4cout<<thePartDef->GetParticleName()<<std::endl;
return;
}
*/
//Kill conditions for surface crossing
+21 -1
View File
@@ -100,10 +100,30 @@ void G4AdjointTrackingAction::PreUserTrackingAction(const G4Track* aTrack)
last_fwd_part_index=i;
i++;
}
//Fill the vectors
last_pos_vec.push_back(last_pos);
last_direction_vec.push_back(last_direction);
last_ekin_vec.push_back(last_ekin);
last_ekin_nuc_vec.push_back(last_ekin_nuc);
last_cos_th_vec.push_back(last_cos_th);
last_weight_vec.push_back(last_weight);
//G4cout<<"Last weight "<<last_weight<<std::endl;
last_fwd_part_PDGEncoding_vec.push_back(last_fwd_part_PDGEncoding);
last_fwd_part_index_vec.push_back(last_fwd_part_index);
}
else {
}
}
/////////////////////////////////////////////////////////
void G4AdjointTrackingAction::ClearEndOfAdjointTrackInfoVectors()
{ last_pos_vec.clear();
last_direction_vec.clear();
last_ekin_vec.clear();
last_ekin_nuc_vec.clear();
last_cos_th_vec.clear();
last_weight_vec.clear();
last_fwd_part_PDGEncoding_vec.clear();
last_fwd_part_index_vec.clear();
}