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 // Each non-empty line is a serialized parameter row separated by '|'.
26 while (!IN->eof()) {
27 std::string dbline;
28 getline(*IN, dbline);
29
30 if (dbline.empty()) { continue; }
31
32 // Extract gvolume parameters.
33 std::vector<std::string> gvolumePars =
35 system->addGVolume(gvolumePars);
36 }
37
38 IN->close();
39 }
40}
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