From e73e0522c17dc710c12a3e387e0c452723b80979 Mon Sep 17 00:00:00 2001 From: iglez2 Date: Fri, 8 Nov 2002 16:21:37 +0000 Subject: [PATCH 1/1] Cleanup of output messages... --- Flugg/FGeometryInit.cxx | 113 ++++++++++++++++++++++++------------- Flugg/FGeometryInit.icc | 4 -- Flugg/FluggNavigator.cxx | 19 ++++++- Flugg/NavHistWithCount.icc | 4 ++ Flugg/WrapLookFX.cxx | 2 - Flugg/WrapLookZ.cxx | 1 - Flugg/Wrappers.hh | 2 - 7 files changed, 94 insertions(+), 51 deletions(-) diff --git a/Flugg/FGeometryInit.cxx b/Flugg/FGeometryInit.cxx index 18b376ce38e..b1600bd2de9 100644 --- a/Flugg/FGeometryInit.cxx +++ b/Flugg/FGeometryInit.cxx @@ -11,13 +11,17 @@ FGeometryInit * FGeometryInit::flagInstance=0; FGeometryInit* FGeometryInit::GetInstance() { - cout << "==> Flugg::FGeometryInit::GetInstance(), instance=" << flagInstance - << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "==> Flugg::FGeometryInit::GetInstance(), instance=" + << flagInstance << G4endl; +#endif if (!flagInstance) flagInstance = new FGeometryInit(); - cout << "<== Flugg::FGeometryInit::GetInstance(), instance=" << flagInstance - << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "<== Flugg::FGeometryInit::GetInstance(), instance=" + << flagInstance << G4endl; +#endif return flagInstance; } @@ -34,26 +38,30 @@ FGeometryInit::FGeometryInit(): ptrJrLtGeant(0), fTransportationManager(G4TransportationManager::GetTransportationManager()){ - cout << "==> Flugg FGeometryInit::FGeometryInit()" << endl; - cout << "\t+ Changing the G4Navigator for FluggNavigator..." << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "==> Flugg FGeometryInit::FGeometryInit()" << G4endl; + G4cout << "\t+ Changing the G4Navigator for FluggNavigator..." << G4endl; +#endif G4Navigator* actualnav = fTransportationManager->GetNavigatorForTracking(); if (actualnav) { FluggNavigator* newnav = new FluggNavigator(); fTransportationManager->SetNavigatorForTracking(newnav); } else { - cerr << "ERROR: Could not find the actual G4Navigator" << endl; + cerr << "ERROR: Could not find the actual G4Navigator" << G4endl; abort(); } - cout << "<== Flugg FGeometryInit::FGeometryInit()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "<== Flugg FGeometryInit::FGeometryInit()" << G4endl; +#endif } FGeometryInit::~FGeometryInit() { - cout << "==> Flugg FGeometryInit::~FGeometryInit()" << endl; + G4cout << "==> Flugg FGeometryInit::~FGeometryInit()" << G4endl; DeleteHistories(); ptrGeoMan->OpenGeometry(); if (fTransportationManager) @@ -63,12 +71,14 @@ FGeometryInit::~FGeometryInit() { DelHistArray(); //keep ATTENTION: never delete a pointer twice! - cout << "<== Flugg FGeometryInit::FGeometryInit()" << endl; + G4cout << "<== Flugg FGeometryInit::FGeometryInit()" << G4endl; } void FGeometryInit::closeGeometry() { - cout << "==> Flugg FGeometryInit::closeGeometry()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "==> Flugg FGeometryInit::closeGeometry()" << G4endl; +#endif ptrGeoMan = G4GeometryManager::GetInstance(); if (ptrGeoMan) { @@ -85,17 +95,23 @@ void FGeometryInit::closeGeometry() { << G4endl; } - cout << "<== Flugg FGeometryInit::closeGeometry()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "<== Flugg FGeometryInit::closeGeometry()" << G4endl; +#endif } //************************************************************************* void FGeometryInit::InitHistArray() { - cout << "==> Flugg FGeometryInit::InitHistArray()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "==> Flugg FGeometryInit::InitHistArray()" << G4endl; +#endif ptrArray = new G4int[1000000]; for(G4int i=0;i<1000000;i++) ptrArray[i]=0; - cout << "<== Flugg FGeometryInit::InitHistArray()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "<== Flugg FGeometryInit::InitHistArray()" << G4endl; +#endif } @@ -104,20 +120,24 @@ void FGeometryInit::InitHistArray() { //jrLtGeant stores all crossed lattice volume histories. void FGeometryInit::InitJrLtGeantArray() { - cout << "==> Flugg FGeometryInit::InitJrLtGeantArray()" << endl; #ifdef G4GEOMETRY_DEBUG + G4cout << "==> Flugg FGeometryInit::InitJrLtGeantArray()" << G4endl; G4cout << "Initializing JrLtGeant array" << G4endl; #endif ptrJrLtGeant = new G4int[10000]; for(G4int x=0;x<10000;x++) ptrJrLtGeant[x]=-1; flagLttcGeant = -1; - cout << "<== Flugg FGeometryInit::InitJrLtGeantArray()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "<== Flugg FGeometryInit::InitJrLtGeantArray()" << G4endl; +#endif } void FGeometryInit::SetLttcFlagGeant(G4int newFlagLttc) { - cout << "==> Flugg FGeometryInit::SetLttcFlagGeant()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "==> Flugg FGeometryInit::SetLttcFlagGeant()" << G4endl; +#endif // Added by A.Solodkov if (newFlagLttc >= 10000) { G4cout << "Problems in FGeometryInit::SetLttcFlagGeant" << G4endl; @@ -127,7 +147,9 @@ void FGeometryInit::SetLttcFlagGeant(G4int newFlagLttc) { exit(1); } flagLttcGeant = newFlagLttc; - cout << "<== Flugg FGeometryInit::SetLttcFlagGeant()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "<== Flugg FGeometryInit::SetLttcFlagGeant()" << G4endl; +#endif } void FGeometryInit::PrintJrLtGeant() { @@ -157,32 +179,41 @@ void FGeometryInit::PrintHistories() { void FGeometryInit::InitHistories() { - cout << "==> Flugg FGeometryInit::InitHistories()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "==> Flugg FGeometryInit::InitHistories()" << G4endl; +#endif //init utility histories with navigator history ptrTouchHist = fTransportationManager->GetNavigatorForTracking()->CreateTouchableHistory(); ptrTempNavHist = fTransportationManager->GetNavigatorForTracking()->CreateTouchableHistory(); ptrOldNavHist = new G4TouchableHistory(); - cout << "<== Flugg FGeometryInit::InitHistories()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "<== Flugg FGeometryInit::InitHistories()" << G4endl; +#endif } void FGeometryInit::DeleteHistories() { - cout << "==> Flugg FGeometryInit::DeleteHistories()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "==> Flugg FGeometryInit::DeleteHistories()" << G4endl; +#endif + delete ptrTouchHist; delete ptrOldNavHist; delete ptrTempNavHist; #ifdef G4GEOMETRY_DEBUG G4cout << "Deleting step-history objects at end of run!" << G4endl; + G4cout << "<== Flugg FGeometryInit::DeleteHistories()" << G4endl; #endif - cout << "<== Flugg FGeometryInit::DeleteHistories()" << endl; } void FGeometryInit::UpdateHistories(const G4NavigationHistory * history, G4int flagHist) { - cout << "==> Flugg FGeometryInit::UpdateHistories()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "==> Flugg FGeometryInit::UpdateHistories()" << G4endl; +#endif PrintHistories(); #ifdef G4GEOMETRY_DEBUG @@ -238,14 +269,15 @@ void FGeometryInit::UpdateHistories(const G4NavigationHistory * history, } //default } //switch - cout << "<== Flugg FGeometryInit::UpdateHistories()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "<== Flugg FGeometryInit::UpdateHistories()" << G4endl; +#endif } //***************************************************************************** void FGeometryInit::createFlukaMatFile() { - cout << "==> Flugg FGeometryInit::createFlukaMatFile()" << endl; // last modification Sara Vanini 1/III/99 // NAMES OF ELEMENTS AND COMPOUNDS: the names must be written in upper case, // according to the fluka standard. In addition,. they must be equal to the @@ -255,6 +287,7 @@ void FGeometryInit::createFlukaMatFile() { // own .pemf, in order to get the right cross sections loaded in memory. #ifdef G4GEOMETRY_DEBUG + G4cout << "==> Flugg FGeometryInit::createFlukaMatFile()" << G4endl; G4cout << "================== FILEWR =================" << G4endl; #endif @@ -527,13 +560,13 @@ void FGeometryInit::createFlukaMatFile() { if(treCount==1) fout << setw10 << " " << setw10 << " " << setw10 << " " << setw10 << " " - << nameMat << endl; + << nameMat << G4endl; if(treCount==2) fout << setw10 << " " << setw10 << " " - << nameMat << endl; + << nameMat << G4endl; if(treCount==3) - fout << nameMat << endl; - fout << "*" << endl; + fout << nameMat << G4endl; + fout << "*" << G4endl; } @@ -559,9 +592,9 @@ void FGeometryInit::createFlukaMatFile() { ofstream vout("Volumes_index.inp"); //... and write title - vout << "*" << endl; + vout << "*" << G4endl; vout << "******************** GEANT4 VOLUMES *******************\n"; - vout << "*" << endl; + vout << "*" << G4endl; //loop over all volumes... for(unsigned int l=0;lGetFieldManager(); @@ -616,7 +649,7 @@ void FGeometryInit::createFlukaMatFile() { fout << setw10 << G4double(indexRegFlukaTo); fout << setw10 << "0.0"; fout << setw10 << G4double(flagField); - fout << setw10 << "0.0" << endl; + fout << setw10 << "0.0" << G4endl; } } @@ -629,14 +662,14 @@ void FGeometryInit::createFlukaMatFile() { fout << setw10 << "0.0"; fout << setw10 << "0.0"; fout << setw10 << G4double(lastFlagField); - fout << setw10 << "0.0" << endl; + fout << setw10 << "0.0" << G4endl; } } else { fout << setw10 << G4double(indexRegFlukaTo); fout << setw10 << "0.0"; fout << setw10 << G4double(lastFlagField); - fout << setw10 << "0.0" << endl; + fout << setw10 << "0.0" << G4endl; } // begin material card @@ -653,7 +686,7 @@ void FGeometryInit::createFlukaMatFile() { fout << setw10 << "0.0"; fout << setw10 << "0.0"; fout << setw10 << G4double(flagField); - fout << setw10 << "0.0" << endl; + fout << setw10 << "0.0" << G4endl; } } lastFlagField = flagField; @@ -667,7 +700,7 @@ void FGeometryInit::createFlukaMatFile() { fout << setw10 << "0.0"; fout << setw10 << "0.0"; fout << setw10 << "0.0"; - fout << setw10 << "0.0" << endl; + fout << setw10 << "0.0" << G4endl; // *** magnetic field *** if(fTransportationManager->GetFieldManager()->DoesFieldExist()) { @@ -713,11 +746,13 @@ void FGeometryInit::createFlukaMatFile() { << G4std::setprecision(4) << Bx << setw10 << By << setw10 << Bz - << endl; + << G4endl; } // end if magnetic field vout.close(); fout.close(); delete [] indexMatFluka; - cout << "<== Flugg FGeometryInit::createFlukaMatFile()" << endl; +#ifdef G4GEOMETRY_DEBUG + G4cout << "<== Flugg FGeometryInit::createFlukaMatFile()" << G4endl; +#endif } diff --git a/Flugg/FGeometryInit.icc b/Flugg/FGeometryInit.icc index 0ea504a2394..ba83861f5d8 100644 --- a/Flugg/FGeometryInit.icc +++ b/Flugg/FGeometryInit.icc @@ -15,10 +15,6 @@ void FGeometryInit::setDetector() { } void FGeometryInit::setMotherVolume() { - cout << "\t\t+ fTransportationManager = " << fTransportationManager << endl; - cout << "\t\t+ myTopNode = " << myTopNode << endl; - cout << "\t\t+ NavigatorForTracking = " - << getNavigatorForTracking() << endl; getNavigatorForTracking()->SetWorldVolume(myTopNode); } diff --git a/Flugg/FluggNavigator.cxx b/Flugg/FluggNavigator.cxx index 6e4b26e3dd2..755e4dc6fac 100644 --- a/Flugg/FluggNavigator.cxx +++ b/Flugg/FluggNavigator.cxx @@ -30,26 +30,39 @@ #include "G4ios.hh" #include "g4std/iomanip" -#define G4DEBUG_NAVIGATION 1 -#define G4VERBOSE 1 +#ifdef G4GEOMETRY_DEBUG +# define G4DEBUG_NAVIGATION 1 +# define G4VERBOSE 1 +#endif FluggNavigator::FluggNavigator() : G4Navigator() { +#ifdef G4GEOMETRY_DEBUG G4cout << "==> Flugg FluggNavigator constructor" << G4endl; - G4cout << "\t+fHistory=" << fHistory << ") ..." << G4endl; +#endif + ResetStackAndState(); + +#ifdef G4GEOMETRY_DEBUG G4cout << "<== Flugg FluggNavigator constructor" << G4endl; +#endif } void FluggNavigator::UpdateNavigatorHistory(const G4NavigationHistory* newNavHistory) { +#ifdef G4GEOMETRY_DEBUG cout << "==> Flugg FluggNavigator::UpdateNavigatorHistory(" << newNavHistory << ")" << endl; cout << "\t+fHistory=" << fHistory << ") ..." << G4endl; +#endif + ResetStackAndState(); fHistory = *newNavHistory; SetupHierarchy(); + +#ifdef G4GEOMETRY_DEBUG cout << "<== Flugg FluggNavigator::UpdateNavigatorHistory(" << newNavHistory << ")" << endl; +#endif } diff --git a/Flugg/NavHistWithCount.icc b/Flugg/NavHistWithCount.icc index d45f4d5ad77..c4468cdc0ab 100644 --- a/Flugg/NavHistWithCount.icc +++ b/Flugg/NavHistWithCount.icc @@ -11,7 +11,9 @@ inline NavHistWithCount::NavHistWithCount(const G4NavigationHistory &history) { +#ifdef G4GEOMETRY_DEBUG G4cout << "NavHistWithCount::NavHistWithCount created" << G4endl; +#endif fhistory = new G4NavigationHistory(history); fDelate=0; count=0; @@ -19,7 +21,9 @@ inline NavHistWithCount::NavHistWithCount(const G4NavigationHistory &history) inline NavHistWithCount::~NavHistWithCount() { +#ifdef G4GEOMETRY_DEBUG G4cout << "NavHistWithCount::NavHistWithCount deleted" << G4endl; +#endif delete fhistory; fDelate=1; fhistory=0; diff --git a/Flugg/WrapLookFX.cxx b/Flugg/WrapLookFX.cxx index 5ffe4499424..fde8e48904c 100644 --- a/Flugg/WrapLookFX.cxx +++ b/Flugg/WrapLookFX.cxx @@ -24,8 +24,6 @@ #include "G4PhysicalVolumeStore.hh" #include "globals.hh" -#define G4GEOMETRY_DEBUG 1 - void lkfxwr(G4double& pSx, G4double& pSy, G4double& pSz, G4double* pV, const G4int& oldReg, const G4int& oldLttc, G4int& newReg, G4int& flagErr, G4int& newLttc) diff --git a/Flugg/WrapLookZ.cxx b/Flugg/WrapLookZ.cxx index fd2302b6947..b2c7ffaf340 100644 --- a/Flugg/WrapLookZ.cxx +++ b/Flugg/WrapLookZ.cxx @@ -26,7 +26,6 @@ #include "G4PhysicalVolumeStore.hh" #include "globals.hh" -#define G4GEOMETRY_DEBUG 1 void lkwr(G4double& pSx, G4double& pSy, G4double& pSz, G4double* pV, const G4int& oldReg, const G4int& oldLttc, diff --git a/Flugg/Wrappers.hh b/Flugg/Wrappers.hh index 707fad5434e..c194b674be9 100644 --- a/Flugg/Wrappers.hh +++ b/Flugg/Wrappers.hh @@ -28,8 +28,6 @@ #define isvhwr isvhwr_ -#define G4GEOMETRY_DEBUG 1 - // WrapDN extern "C" G4int idnrwr(const G4int & nreg, const G4int & mlat); -- 2.39.3