4 ///////////////////////////////////////////////////////////////////
6 // WrapIniHist.hh - Sara Vanini
8 // Wrapper for reinitialization of FluggNavigator history.
11 // modified 24.10.01: by I. Hrivnacova
12 // functions declarations separated from implementation
13 // (moved to Wrappers.hh);
15 ///////////////////////////////////////////////////////////////////
18 #include "Wrappers.hh"
19 #include "FGeometryInit.hh"
20 #include "NavHistWithCount.hh"
21 #include "G4NavigationHistory.hh"
22 #include "FluggNavigator.hh"
25 void inihwr(G4int& intHist)
28 #ifdef G4GEOMETRY_DEBUG
29 G4cout << "============= INIHWR ==============" << G4endl;
30 G4cout << "Ptr History=" <<intHist<< G4endl;
33 G4cout << "ERROR! This history has been deleted!" << G4endl;
37 //get NavHistWithCount,G4NavigationHistory,FGeometryInit,
38 //FluggNavigator pointers
39 NavHistWithCount* ptrNavHistCount=
40 reinterpret_cast<NavHistWithCount*>(intHist);
41 G4NavigationHistory* ptrNavHist=ptrNavHistCount->GetNavHistPtr();
42 static FGeometryInit * ptrGeoInit = FGeometryInit::GetInstance();
43 FluggNavigator* ptrNavig = ptrGeoInit->getNavigatorForTracking();
45 //reinitialize navigator history
46 ptrNavig->UpdateNavigatorHistory(ptrNavHist);
48 //update utility histories: touch,temp, and reset old history
49 ptrGeoInit->UpdateHistories(ptrNavHist,0);
51 //save new history in jrLtGeant if not present
52 G4int LttcFlagGeant = ptrGeoInit->GetLttcFlagGeant();
53 G4int * jrLtGeant = ptrGeoInit->GetJrLtGeantArray();
55 G4bool intHistInJrLtGeant = false;
56 for(G4int h=0; h<=LttcFlagGeant; h++)
57 if(jrLtGeant[h]==intHist)
58 intHistInJrLtGeant = true;
60 if(!intHistInJrLtGeant) {
62 ptrGeoInit->SetLttcFlagGeant(LttcFlagGeant);
64 jrLtGeant[LttcFlagGeant]=intHist;
66 #ifdef G4GEOMETRY_DEBUG
67 G4cout << "* CONHWR call to increment counter" << G4endl;
70 conhwr(jrLtGeant[LttcFlagGeant],&incrCount);
74 #ifdef G4GEOMETRY_DEBUG
75 G4cout << "History reinitialized in:" << G4endl;
76 G4cout << *ptrNavHist << G4endl;
77 ptrGeoInit->PrintJrLtGeant();