#include "G4AtlasTools/UserLimitsSvc.h"
|
Gaudi::Property< double > | m_MaxStep {this, "MaxStep", -1., "Maximum step length"} |
| Maximum step length. More...
|
|
Gaudi::Property< double > | m_MinEkine {this, "MinEkine", -1., "Minimum remaining kinetic energy for a track"} |
| Minimum remaining kinetic energy for a track. More...
|
|
Gaudi::Property< double > | m_MaxTrackLength {this, "MaxTrackLength", -1., "Maximum total track length"} |
| Maximum total track length. More...
|
|
Gaudi::Property< double > | m_MaxTime {this, "MaxTime", -1., "Maximum global time for a track"} |
| Maximum global time for a track. More...
|
|
Gaudi::Property< double > | m_MinRange {this, "MinRange", -1., "Minimum remaining range for a track"} |
| Minimum remaining range for a track. More...
|
|
Gaudi::Property< std::string > | m_matchType {this, "MatchType", "isMatch", "Use 'contains' or 'isMatch' function for string comparison"} |
| Use 'contains' or 'isMatch' function for string comparison. More...
|
|
Gaudi::Property< std::vector< std::string > > | m_logicalVolumes {this, "VolumeList" , {}, "List of Logical volume to which these limits should be applied"} |
| List of Logical volume to which these limits should be applied. More...
|
|
Concrete Tool to apply G4 User Limits
Definition at line 21 of file UserLimitsSvc.h.
◆ UserLimitsSvc()
UserLimitsSvc::UserLimitsSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~UserLimitsSvc()
virtual UserLimitsSvc::~UserLimitsSvc |
( |
| ) |
|
|
virtualdefault |
◆ contains()
bool UserLimitsSvc::contains |
( |
const std::string & |
pattern, |
|
|
const std::string & |
logicalVolume |
|
) |
| const |
|
private |
◆ initialize()
StatusCode UserLimitsSvc::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 22 of file UserLimitsSvc.cxx.
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;
◆ isMatch()
bool UserLimitsSvc::isMatch |
( |
const std::string & |
pattern, |
|
|
const std::string & |
logicalVolume |
|
) |
| const |
|
private |
Functions for string comparison.
Definition at line 80 of file UserLimitsSvc.cxx.
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());
◆ m_logicalVolumes
Gaudi::Property<std::vector<std::string> > UserLimitsSvc::m_logicalVolumes {this, "VolumeList" , {}, "List of Logical volume to which these limits should be applied"} |
|
private |
List of Logical volume to which these limits should be applied.
Definition at line 46 of file UserLimitsSvc.h.
◆ m_matchType
Gaudi::Property<std::string> UserLimitsSvc::m_matchType {this, "MatchType", "isMatch", "Use 'contains' or 'isMatch' function for string comparison"} |
|
private |
Use 'contains' or 'isMatch' function for string comparison.
Definition at line 44 of file UserLimitsSvc.h.
◆ m_MaxStep
Gaudi::Property<double> UserLimitsSvc::m_MaxStep {this, "MaxStep", -1., "Maximum step length"} |
|
private |
◆ m_MaxTime
Gaudi::Property<double> UserLimitsSvc::m_MaxTime {this, "MaxTime", -1., "Maximum global time for a track"} |
|
private |
◆ m_MaxTrackLength
Gaudi::Property<double> UserLimitsSvc::m_MaxTrackLength {this, "MaxTrackLength", -1., "Maximum total track length"} |
|
private |
◆ m_MinEkine
Gaudi::Property<double> UserLimitsSvc::m_MinEkine {this, "MinEkine", -1., "Minimum remaining kinetic energy for a track"} |
|
private |
Minimum remaining kinetic energy for a track.
Definition at line 36 of file UserLimitsSvc.h.
◆ m_MinRange
Gaudi::Property<double> UserLimitsSvc::m_MinRange {this, "MinRange", -1., "Minimum remaining range for a track"} |
|
private |
The documentation for this class was generated from the following files: