9 #include "G4LogicalVolume.hh"
10 #include "G4LogicalVolumeStore.hh"
11 #include "G4UserLimits.hh"
14 #include <boost/tokenizer.hpp>
17 : base_class(
name,pSvcLocator)
25 G4LogicalVolumeStore& lvs=*(G4LogicalVolumeStore::GetInstance());
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());
32 ATH_MSG_INFO(
"G4LogicalVolumeStore unique size: " << volumes.size());
36 std::map<std::string, function_t> funcMap;
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)
45 const std::string& volName(*volumeItr);
46 unsigned int ndone(0);
47 for (
unsigned int i=0;
i<lvs.size();
i++)
49 G4LogicalVolume *lv=lvs[
i];
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);
72 return StatusCode::SUCCESS;
77 return (logicalVolume.find(
pattern) != std::string::npos);
83 if (
a==
"*")
return true;
84 if (
a==
b)
return true;
86 boost::char_separator<char>
sep{
"*"};
87 typedef boost::tokenizer< boost::char_separator<char> > tokenizer;
88 tokenizer tok{
a,
sep};
89 bool returnValue=
true;
92 std::vector<std::string>
tokens;
93 for (
const auto& token : tok)
97 for (
unsigned int i=0;
i<
tokens.size();
i++)
100 std::string::size_type npos=temp.find(
tokens[
i]);
103 if (npos!=std::string::npos)
105 temp=temp.substr(npos, temp.size()-npos);
116 std::string temp2=
b.substr(
b.size()-temp.size(),temp.size());