gsystem
Loading...
Searching...
No Matches
loadGeometry.cc
Go to the documentation of this file.
1
8// gsystem
9#include "systemTextFactory.h"
10
11// glibrary
12#include "gutilities.h"
13
14// c++
15#include <iostream>
16
17void GSystemTextFactory::loadGeometry(GSystem* system) {
18 // Will exit if not found unless the system annotation allows skipping.
19 auto IN = gSystemTextFileStream(system, GTEXTGEOMTYPE);
20
21 if (IN != nullptr) {
22 log->info(1, "Loading geometry for system ", system->getName(),
23 " using factory ", system->getFactoryName()
24 );
25
26 // Each non-empty line is a serialized parameter row separated by '|'.
27 while (!IN->eof()) {
28 std::string dbline;
29 getline(*IN, dbline);
30
31 if (dbline.empty())
32 continue;
33
34 // Extract gvolume parameters.
35 std::vector<std::string> gvolumePars =
37 system->addGVolume(gvolumePars);
38 }
39
40 IN->close();
41 }
42}
std::shared_ptr< GLogger > log
void info(int level, Args &&... args) const
Represents a single detector system (e.g., calorimeter, tracker).
Definition gsystem.h:32
std::string getFactoryName() const
Definition gsystem.h:109
void addGVolume(std::vector< std::string > pars)
Build and add a volume from a serialized parameter list.
Definition gsystem.cc:77
std::string getName() const
Definition gsystem.h:108
vector< string > getStringVectorFromStringWithDelimiter(const string &input, const string &x)
#define GTEXTGEOMTYPE