20 std::vector<std::string> pars,
21 const std::string& importPath) :
24 importFilename(importPath) {
27 for (
auto& parameter : pars) {
log->
warning(
" - parameter ", parameter); }
30 "Incorrect number of system parameters for GVolume: ", pars.size(),
", it should be ",
43 "the gVolume name <", name,
"> contains the invalid character: <",
GSYSTEM_DELIMITER,
55 visible = (pvis ==
"1") ?
true :
false;
65 exist = (pexists ==
"1") ?
true :
false;
83 string style =
"unknown";
84 if (gVol.style == 0) { style =
"wireframe"; }
85 else if (gVol.style == 1) { style =
"solid"; }
86 string visibility =
"yes";
87 if (!gVol.visible) { visibility =
"no"; }
90 stream <<
" - Name: " << gVol.name <<
" - " << gVol.description << std::endl;
91 stream <<
" - System: " << gVol.system << std::endl;
92 stream <<
" - Variation: " << gVol.variation << std::endl;
93 stream <<
" - Run Number: " << gVol.runno << std::endl;
95 stream <<
" - copyOf: " << gVol.
98 stream <<
" - solidsOpr: "
99 << gVol.solidsOpr << std::endl;
101 stream <<
" - Type: " << gVol.type <<
104 stream <<
" - Parameters: " <<
105 gVol.parameters << std::endl;
106 stream <<
" - Material: " << gVol.material << std::endl;
107 stream <<
" - Mother: " << gVol.motherName << std::endl;
108 stream <<
" - Positions: " << gVol.pos << std::endl;
109 stream <<
" - Rotation(s): " << gVol.rot << std::endl;
111 stream <<
" - E.M. emfield: " << gVol.
112 emfield << std::endl;
114 stream <<
" - Digitization: "
115 << gVol.digitization << std::endl;
117 stream <<
" - GIdentity: " <<
118 gVol.gidentity << std::endl;
119 stream <<
" - Col, Vis, Style: " << gVol.color <<
", " << visibility <<
", " << style << std::endl;
130 string volumeParameters;
133 for (
size_t i = 1; i < rootDefinitions.size() - 1; i++) { volumeParameters +=
", " + rootDefinitions[i]; }
137 variation =
"default";
138 type = rootDefinitions[0];
139 parameters = volumeParameters;
140 material = rootDefinitions.back();
155 description =
"root volume";
162 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 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 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)