20 std::vector<std::string> pars,
21 const std::string& importPath) :
24 importFilename(importPath) {
31 for (
auto& parameter : pars) {
log->
warning(
" - parameter ", parameter); }
34 "Incorrect number of system parameters for GVolume: ", pars.size(),
", it should be ",
47 "the gVolume name <", name,
"> contains the invalid character: <",
GSYSTEM_DELIMITER,
63 visible = (pvis ==
"1") ?
true :
false;
73 exist = (pexists ==
"1") ?
true :
false;
91 string style =
"unknown";
92 if (gVol.style == 0) { style =
"wireframe"; }
93 else if (gVol.style == 1) { style =
"solid"; }
94 else if (gVol.style == 2) { style =
"cloud"; }
95 string visibility =
"yes";
96 if (!gVol.visible) { visibility =
"no"; }
99 stream <<
" - Name: " << gVol.name <<
" - " << gVol.description << std::endl;
100 stream <<
" - System: " << gVol.system << std::endl;
101 stream <<
" - Variation: " << gVol.variation << std::endl;
102 stream <<
" - Run Number: " << gVol.runno << std::endl;
104 stream <<
" - copyOf: " << gVol.
107 stream <<
" - solidsOpr: "
108 << gVol.solidsOpr << std::endl;
110 stream <<
" - Type: " << gVol.type <<
113 stream <<
" - Parameters: " <<
114 gVol.parameters << std::endl;
115 stream <<
" - Material: " << gVol.material << std::endl;
116 stream <<
" - Mother: " << gVol.motherName << std::endl;
117 stream <<
" - Positions: " << gVol.pos << std::endl;
118 stream <<
" - Rotation(s): " << gVol.rot << std::endl;
119 stream <<
" - G4 Placement: " << gVol.g4placementType << std::endl;
121 stream <<
" - E.M. emfield: " << gVol.
122 emfield << std::endl;
124 stream <<
" - Digitization: "
125 << gVol.digitization << std::endl;
127 stream <<
" - GIdentity: " <<
128 gVol.gidentity << std::endl;
129 stream <<
" - Col, Vis, Style: " << gVol.color <<
", " << visibility <<
", " << style << std::endl;
137 const std::shared_ptr<GLogger>& logger) :
142 string volumeParameters;
145 for (
size_t i = 1; i < rootDefinitions.size() - 1; i++) { volumeParameters +=
", " + rootDefinitions[i]; }
149 variation =
"default";
150 type = rootDefinitions[0];
151 parameters = volumeParameters;
152 material = rootDefinitions.back();
168 description =
"root volume";
175 importFilename =
"none";
std::shared_ptr< GLogger > log
void warning(Args &&... args) const
void error(int exit_code, Args &&... args) const
Geometry volume record loaded into a GSystem.
GVolume(const std::shared_ptr< GLogger > &log, const std::string &system, std::vector< std::string > pars, const std::string &importPath=UNINITIALIZEDSTRINGQUANTITY)
Construct a volume from a serialized parameter vector.
Conventions and shared constants for the detector-system module.
#define DEFAULTG4PLACEMENTTYPE
#define GSYSTEM_DELIMITER
Delimiter used to build fully-qualified names (system/name).
#define GVOLUMENUMBEROFPARS
#define GSYSTEMNOMODIFIER
#define ROOTWORLDGVOLUMENAME
Canonical name for the ROOT/world gvolume entry.
#define GVOLUMELEGACYNUMBEROFPARS
Number of database parameters defining a legacy gvolume entry without g4placement_type.
#define MOTHEROFUSALL
Special mother-name marker for the top-level world root.
#define ERR_GVOLUMENAMECONTAINSINVALID
#define ERR_GWRONGNUMBEROFPARS
#define UNINITIALIZEDSTRINGQUANTITY
std::ostream & operator<<(std::ostream &stream, const GVolume &gVol)
string removeAllSpacesFromString(const std::string &str)
vector< string > getStringVectorFromStringWithDelimiter(const string &input, const string &x)
string removeLeadingAndTrailingSpacesFromString(const std::string &input)