44 , volumes(new TList())
45 , masterNodes(nullptr)
85 modules->AddAt(m[i], (sec * maxModules + i));
119 Int_t s1 = -1, s2 = 0;
125 for (Int_t s = s1; s < s2 && rc; s++) {
131 for (Int_t m = 0; m <
maxModules && rc; m++) {
132 Bool_t containsActiveModule = kFALSE;
133 for (Int_t s = s1; s < s2; s++) {
135 containsActiveModule = kTRUE;
140 rc =
readModule(fin, media, modName, eleName, containsActiveModule);
151 }
while (c ==
' ' || c ==
'\n');
152 if (c !=
'0' && c !=
'1') {
165 fin >> t[0] >> t[1] >> t[2];
166 for (Int_t i = 0; i < 9; i++) {
177 if (volu == 0 || media == 0 || refVolumes == 0) {
180 const Int_t maxbuf = 256;
182 TString name(volu->GetName());
183 Int_t nameLength = name.Length();
184 Bool_t isCopy = kFALSE;
209 Warning(
"readVolumeParams",
"Mother volume %s not found!", buf);
215 if (nameLength > 4) {
219 }
while (c ==
' ' || c ==
'\n');
220 Int_t i =
static_cast<Int_t
>(c);
226 refName = name(0, 4);
227 refNode =
static_cast<FairGeoCopyNode*
>(refVolumes->FindObject(refName));
240 for (Int_t k = 0; k < n; k++) {
248 Ssiz_t l = name.Last(
'#');
253 }
while (c ==
' ' || c ==
'\n');
254 Int_t i =
static_cast<Int_t
>(c);
259 refName = name(0, l);
260 refNode =
static_cast<FairGeoCopyNode*
>(refVolumes->FindObject(refName));
273 for (Int_t k = 0; k < n; k++) {
291 Error(
"readVolumeParams",
"Medium %s not found in list of media", buf);
296 fin.getline(buf, maxbuf);
312 fin.seekg(0, ios::beg);
316 const Int_t maxbuf = 256;
318 while (rc && !volu && !fin.eof()) {
321 fin.getline(buf, maxbuf);
322 }
else if (!fin.eof()) {
323 if (strcmp(buf, name) == 0) {
331 fin.getline(buf, maxbuf);
332 }
while (!fin.eof() && buf[0] !=
'/');
350 Bool_t containsActiveMod)
353 const Int_t maxbuf = 256;
356 fin.seekg(0, ios::beg);
361 while (rc && !fin.eof()) {
364 fin.getline(buf, maxbuf);
365 }
else if (!fin.eof()) {
368 if (name.BeginsWith(modName)) {
383 Error(
"readModule",
"Failed for module %s\n", volu->GetName());
387 }
else if (!eleName.IsNull() && name.BeginsWith(eleName)) {
396 Error(
"readModule",
"Failed for %s\n", volu->GetName());
402 fin.getline(buf, maxbuf);
403 }
while (!fin.eof() && buf[0] !=
'/');
415 cout <<
"//Author: " <<
author <<
'\n';
421 cout <<
"//----------------------------------------------------------\n";
423 std::ios_base::fmtflags tmp = cout.setf(ios::fixed, ios::floatfield);
426 while ((volu = static_cast<FairGeoNode*>(iter.Next()))) {
436 fout <<
"//Author: " <<
author <<
'\n';
441 fout <<
"//----------------------------------------------------------\n";
442 std::ios_base::fmtflags tmp = fout.setf(ios::fixed, ios::floatfield);
446 while ((volu = static_cast<FairGeoNode*>(iter.Next())) && rc) {
447 rc = volu->
write(fout);
461 while ((volu = static_cast<FairGeoNode*>(iter.Next())) && rc) {
478 Error(
"create",
"Creation of %s failed!", volu->GetName());
488 if (fName.CompareTo(rset.GetName()) != 0) {
489 Error(
"compare",
"Sets have different type");
494 Int_t n = 0, nnf = 0, nDiff = 0;
495 cout <<
"name\t mother medium shape points pos rot\n";
496 cout <<
"------------------------------------------------\n";
497 while ((volu = static_cast<FairGeoNode*>(iter.Next()))) {
502 }
else if (volu->
compare(*rNode) > 0) {
506 cout <<
"Number of volumes in first list: " << n <<
'\n';
507 cout <<
"Number of different volumes: " << nDiff << endl;
508 cout <<
"Number of volumes not found in second list: " << nnf <<
'\n';
510 if (rlist->GetSize() != (n - nnf)) {
512 TListIter riter(rlist);
513 while ((volu = static_cast<FairGeoNode*>(riter.Next()))) {
522 cout <<
"Number of additional volumes in second list: " << nnf <<
'\n';
virtual const char * getEleName(Int_t)
void readTransform(std::fstream &, FairGeoTransform &)
void setCopyNode(FairGeoNode *p)
void setActive(Bool_t a=kTRUE)
void setPoint(const Int_t, const Double_t, const Double_t, const Double_t)
void compare(FairGeoSet &)
virtual Bool_t createNode(FairGeoNode *, Int_t hadFormat=0)=0
FairGeoTransform & getCenterPosition()
TGeoVolume * getRootVolume()
void setModules(Int_t, Int_t *)
virtual Bool_t create(FairGeoBuilder *)
virtual Bool_t read(std::fstream &, FairGeoMedia *)
ClassImp(FairEventBuilder)
virtual void write(std::fstream &)
virtual Int_t getSecNumInMod(const TString &)
virtual const char * getModuleName(Int_t)
void setRootVolume(TGeoVolume *p)
void setMother(FairGeoNode *s)
void setShape(FairGeoBasicShape *s)
FairGeoNode * getVolume(const char *name)
virtual const char * getKeepinName(Int_t, Int_t)
void createPoints(const Int_t)
FairGeoBasicShape * selectShape(FairGeoVolume *)
Bool_t readVolumeParams(std::fstream &, FairGeoMedia *, FairGeoNode *, TList *l=0)
TList * getListOfVolumes()
Bool_t write(std::fstream &)
FairGeoVector * getPoint(const Int_t n)
Bool_t readModule(std::fstream &, FairGeoMedia *, TString &, TString &, Bool_t a=kFALSE)
void setVolumeType(EFairGeoNodeType t)
void setMedium(FairGeoMedium *med)
FairGeoMedium * getMedium()
virtual Int_t readPoints(std::fstream *, FairGeoVolume *)
FairGeoTransform & getTransform()
FairGeoNode * getMasterNode(const char *name)
void readInout(std::fstream &)
virtual Int_t getModNumInMod(const TString &)
Int_t compare(FairGeoNode &)
void setCenterPosition(const FairGeoTransform &t)
FairGeoBasicShape * getShapePointer()
Bool_t readKeepIn(std::fstream &, FairGeoMedia *, TString &)
Int_t getModule(Int_t, Int_t)