23{
25 G4LogicalVolumeStore& lvs=*(G4LogicalVolumeStore::GetInstance());
26
27 ATH_MSG_INFO(
"G4LogicalVolumeStore size: " << lvs.size());
28 std::set<G4String> volumes;
29 for (
unsigned int i = 0;
i < lvs.size();
i++) {
30 volumes.insert(lvs[i]->GetName());
31 }
32 ATH_MSG_INFO(
"G4LogicalVolumeStore unique size: " << volumes.size());
33
34
36 std::map<std::string, function_t> funcMap;
39
40
41 std::vector<std::string>::const_iterator volumeItr(
m_logicalVolumes.value().begin());
42 const std::vector<std::string>::const_iterator endOfVolumesItr(
m_logicalVolumes.value().end());
43 while(volumeItr!=endOfVolumesItr)
44 {
45 const std::string& volName(*volumeItr);
46 unsigned int ndone(0);
47 for (
unsigned int i=0;
i<lvs.size();
i++)
48 {
49 G4LogicalVolume *lv=lvs[
i];
50
51 if ( (this->*(funcMap[
m_matchType.value()]))(volName, lv->GetName()) ){
52 G4UserLimits *
ul=lv->GetUserLimits();
53 if (!ul)
ul=
new G4UserLimits;
59 lv->SetUserLimits(ul);
60 ++ndone;
61 }
62 }
68
69 ++volumeItr;
70 }
71
72 return StatusCode::SUCCESS;
73}
Gaudi::Property< std::vector< std::string > > m_logicalVolumes
List of Logical volume to which these limits should be applied.
Gaudi::Property< double > m_MaxTime
Maximum global time for a track.
Gaudi::Property< double > m_MinRange
Minimum remaining range for a track.
bool isMatch(const std::string &pattern, const std::string &logicalVolume) const
Functions for string comparison.
bool contains(const std::string &pattern, const std::string &logicalVolume) const
Gaudi::Property< double > m_MinEkine
Minimum remaining kinetic energy for a track.
Gaudi::Property< std::string > m_matchType
Use 'contains' or 'isMatch' function for string comparison.
UserLimitsSvc(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< double > m_MaxTrackLength
Maximum total track length.
Gaudi::Property< double > m_MaxStep
Maximum step length.
setBGCode setTAP setLVL2ErrorBits bool