49 PrepareHitsAccumulation();
55 if (i != (GAMMAKNIFE_SOURCES - 1))
72 mesh->
RotateX( thetaAngles[position] );
73 mesh->
RotateZ( phiAngles[position] );
78 void GammaKnifeController::RotateBack(
G4int position )
86 mesh->
RotateZ( - phiAngles[position] );
87 mesh->
RotateX( - thetaAngles[position] );
92 void GammaKnifeController::PrepareHitsAccumulation()
99 for (
size_t i = 0; i < size; i++)
106 MeshScoreMap::iterator it = scoreMap.begin();
107 for( ; it != scoreMap.end(); it++)
109 std::string hitMapName = it->first;
112 storedScoreMap[ hitMapName ] = hitMapToStore;
118 void GammaKnifeController::StoreHits()
131 MeshScoreMap::iterator it = scoreMap.begin();
132 for( ; it != scoreMap.end(); it++)
134 std::string hitMapName = it->first;
136 auto storedMap = storedScoreMap[hitMapName]->GetMap();
137 auto mapItr = it->second->GetMap()->begin();
138 for(;mapItr!=it->second->GetMap()->end();mapItr++)
140 auto key = mapItr->first;
141 auto val = mapItr->second;
142 if(storedMap->find(key)==storedMap->end())
144 (*storedMap)[key]->add(val);
151 void GammaKnifeController::AccumulateAllHits()
160 MeshScoreMap::iterator it = storedScoreMap.begin();
161 for( ; it != storedScoreMap.end(); it++)
179 ifs.open( fileName.c_str() );
186 for (
G4int c = 0;
c < 4;
c++) ifs.get();
189 ifs.getline(buf, SZ);
191 phiAngles.push_back( phi *
degree );
192 thetaAngles.push_back( theta * degree );
void ReadFile(std::string fileName)
void Accumulate(G4THitsMap< G4double > *map)
void RotateX(G4double delta)
virtual void BeamOn(G4int n_event, const char *macroFile=0, G4int n_select=-1)
GammaKnifeController(GammaKnifeDetectorConstruction *)
static G4ScoringManager * GetScoringManagerIfExist()
static constexpr double degree
void RotateZ(G4double delta)
static G4RunManager * GetRunManager()
#define GAMMAKNIFE_SOURCES
MeshScoreMap GetScoreMap() const
size_t GetNumberOfMesh() const
G4VScoringMesh * GetMesh(G4int i) const
std::map< G4String, RunScore * > MeshScoreMap