Skip to content
Snippets Groups Projects
Commit 022be3d9 authored by Marilena Bandieramonte's avatar Marilena Bandieramonte
Browse files

Merge branch 'fixOutput-gmgeantino' into 'master'

Reduce the verbosity of gmgeantino

See merge request !116
parents 9a98ff82 e2c5f0e5
No related branches found
No related tags found
1 merge request!116Reduce the verbosity of gmgeantino
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
######################################################################## ########################################################################
## PRIMARY GENERATOR ## PRIMARY GENERATOR
## --------------------------------------------------------------------- ## ---------------------------------------------------------------------
/gps/verbose 2 /gps/verbose 0
/gps/particle geantino /gps/particle geantino
#/gps/pos/type Plane #/gps/pos/type Plane
#/gps/pos/shape Square #/gps/pos/shape Square
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
######################################################################## ########################################################################
## PRIMARY GENERATOR ## PRIMARY GENERATOR
## --------------------------------------------------------------------- ## ---------------------------------------------------------------------
/gps/verbose 2 /gps/verbose 0
/gps/particle geantino /gps/particle geantino
#/gps/pos/type Plane #/gps/pos/type Plane
#/gps/pos/shape Square #/gps/pos/shape Square
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
######################################################################## ########################################################################
## PRIMARY GENERATOR ## PRIMARY GENERATOR
## --------------------------------------------------------------------- ## ---------------------------------------------------------------------
/gps/verbose 2 /gps/verbose 0
/gps/particle geantino /gps/particle geantino
#/gps/pos/type Plane #/gps/pos/type Plane
#/gps/pos/shape Square #/gps/pos/shape Square
......
...@@ -103,20 +103,28 @@ namespace G4UA ...@@ -103,20 +103,28 @@ namespace G4UA
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void MyLengthIntegratorEventAction::BeginOfEventAction(const G4Event* event) void MyLengthIntegratorEventAction::BeginOfEventAction(const G4Event* event)
{ {
std::cout << "\n ========================================================= " <<std::endl; bool verbose = false;
G4cout << " ****** BeginOfEventAction ****** " <<G4endl; if (verbose){
G4cout << "\n ========================================================= " <<G4endl;
G4cout << " ****** BeginOfEventAction ****** " <<G4endl;
}
//clear the detThickMap for the event that begins //clear the detThickMap for the event that begins
m_stepAct->m_detThickMap.clear(); m_stepAct->m_detThickMap.clear();
G4PrimaryVertex* vert = event->GetPrimaryVertex(0); G4PrimaryVertex* vert = event->GetPrimaryVertex(0);
G4PrimaryParticle* part = vert->GetPrimary(); G4PrimaryParticle* part = vert->GetPrimary();
G4ThreeVector mom = part->GetMomentum(); G4ThreeVector mom = part->GetMomentum();
G4cout<<" ****** Primary Particle: "<< part->GetParticleDefinition()->GetParticleName()<<" ****** " <<G4endl;
G4cout<<" ****** Momentum: "<< mom <<" ****** " <<G4endl;
m_etaPrimary = mom.eta(); m_etaPrimary = mom.eta();
m_phiPrimary = mom.phi(); m_phiPrimary = mom.phi();
G4cout.precision(6);
G4cout<<" ****** Eta: "<< m_etaPrimary<<" ****** " <<G4endl; if(verbose){
G4cout<<" ****** Phi: "<< m_phiPrimary<<" ****** " <<G4endl; G4cout.precision(6);
G4cout<<" ****** Primary Particle: "<< part->GetParticleDefinition()->GetParticleName()<<" ****** " <<G4endl;
G4cout<<" ****** Momentum: "<< mom <<" ****** " <<G4endl;
G4cout<<" ****** Eta: "<< m_etaPrimary<<" ****** " <<G4endl;
G4cout<<" ****** Phi: "<< m_phiPrimary<<" ****** " <<G4endl;
}
} }
...@@ -125,14 +133,15 @@ namespace G4UA ...@@ -125,14 +133,15 @@ namespace G4UA
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void MyLengthIntegratorEventAction::EndOfEventAction(const G4Event*) void MyLengthIntegratorEventAction::EndOfEventAction(const G4Event*)
{ {
G4cout <<" ****** EndOfEventAction ****** " << G4endl; bool verbose = false;
if (verbose) G4cout <<" ****** EndOfEventAction ****** " << G4endl;
auto analysisManager = G4AnalysisManager::Instance(); auto analysisManager = G4AnalysisManager::Instance();
// Lazily protect this whole code from concurrent access // Lazily protect this whole code from concurrent access
std::lock_guard<std::mutex> lock(gHistSvcMutex); std::lock_guard<std::mutex> lock(gHistSvcMutex);
//m_stepAct //m_stepAct
if (m_stepAct->m_detThickMap.size()==0){ if (m_stepAct->m_detThickMap.size()==0){
G4cout<<" m_detThickMap size is zero! "<<G4endl; G4cout<<"ERROR! m_detThickMap size is zero! Exiting"<<G4endl;
exit(-1); exit(-1);
} }
// Loop over volumes // Loop over volumes
...@@ -357,7 +366,7 @@ namespace G4UA ...@@ -357,7 +366,7 @@ namespace G4UA
} }
}//~Geant4 }//~Geant4
} }
std::cout << "\n ========================================================= " << std::endl; if (verbose) std::cout << "\n ========================================================= " << std::endl;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -186,11 +186,11 @@ void MyRunAction::EndOfRunAction(const G4Run*) { ...@@ -186,11 +186,11 @@ void MyRunAction::EndOfRunAction(const G4Run*) {
auto analysisManager= G4AnalysisManager::Instance(); auto analysisManager= G4AnalysisManager::Instance();
//Finalize analysisManager and Write out file //Finalize analysisManager and Write out file
if (analysisManager->IsOpenFile()){ if (analysisManager->IsOpenFile()){
G4cout<<"\n\n EndOfRunAction, writing output file: "<<analysisManager->GetFileName() << G4endl; //G4cout<<"\n\n EndOfRunAction, writing output file: "<<analysisManager->GetFileName() << G4endl;
analysisManager->Write(); analysisManager->Write();
G4cout<<"... closing output file: "<<analysisManager->GetFileName() << G4endl; //G4cout<<"... closing output file: "<<analysisManager->GetFileName() << G4endl;
analysisManager->CloseFile(); analysisManager->CloseFile();
G4cout<<"Output File successfully saved and closed! " << G4endl; //G4cout<<"Output File successfully saved and closed! " << G4endl;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment