16 #include <TRealData.h>
17 #include <TDataMember.h>
39 char user[128], host[128];
41 getlogin_r(user, 128-1);
42 gethostname(host, 128-1);
43 mAuthor = TString(user) +
"@" + host;
59 mVersion(version), mSubVersion(subVersion)
73 TString mediaFileName = TString(getenv(
"VMCWORKDIR")) +
"/geometry/media.geo";
126 if (dim[iq])
max = iq;
131 for(
unsigned iq=0; iq<=
max; iq++)
161 const std::vector<LogicalVolumeGroupProjection*> &coords =
164 if (what >= coords.size() || !coords[what])
return -1;
166 coords[what]->mCircular =
true;
174 unsigned group,
unsigned logical[])
176 if (!map || !geo || !logical) {
177 printf(
"-E- EicGeoParData::SetMappingTableEntry(): zero pointer(s) used as arguments!\n");
182 printf(
"-E- EicGeoParData::SetMappingTableEntry(): group index '%d' exceeds '%d'!\n",
191 printf(
"-E- EicGeoParData::SetMappingTableEntry(): group index '%d' exceeds "
195 const std::vector<LogicalVolumeGroupProjection*> &coords =
198 for(
unsigned iq=0; iq<coords.size(); iq++) {
200 if (!logical[iq])
continue;
208 printf(
"-E- EicGeoParData::SetMappingTableEntry(): coordinate '%d' was not configured!\n", iq);
212 printf(
"-E- EicGeoParData::SetMappingTableEntry(): logical index #%d (%d) exceeds "
213 "max configured entry num (%d)!\n", iq, logical[iq], (
unsigned)coord->
mMaxEntryNum);
233 if (!fileName)
return;
235 FILE *fin = fopen(fileName,
"r");
237 printf(
"-E- SourceFile::SourceFile(): file '%s' does not exist!\n", fileName);
245 snprintf(buffer, 1024-1,
"%s", fileName);
251 fseek(fin, 0, SEEK_END);
272 printf(
" --------------------");
273 for(
unsigned iq=0; iq<
mFileName.Length(); iq++)
293 printf(
"\n No file '%s' was attached!\n", fileName);
334 const char *suffix = root ?
".root" :
".gdml";
348 return TString(fileName);
374 assert(0);
return "";
391 while ((volume=(TGeoVolume*)next())) {
398 volume->SetLineColor(cpattern->second);
399 volume->SetFillColor(cpattern->second);
406 if (tpattern) volume->SetFillStyle(4000 + tpattern->second);
410 volume->SetVisibility(kFALSE);
451 const std::vector<LogicalVolumeGroupProjection*> &coords =
454 return (what < coords.size() && coords[what] ? coords[what]->mMaxEntryNum : 0);
461 unsigned group =
GetGroup(logicalID);
465 const std::vector<LogicalVolumeGroupProjection*> &coords =
468 if (what >= coords.size() || !coords[what])
return 0;
481 const std::vector<LogicalVolumeGroupProjection*> &coords =
484 if (what >= coords.size() || !coords[what])
return false;
486 return coords[what]->mCircular;
534 TString returnBackPath = gGeoManager->GetPath();
547 if (containerName.IsNull())
continue;
559 assert(cellLevel != -1);
562 if (cellLevel == -1)
continue;
584 snprintf(buffer, 128-1,
"%d", nID);
590 gGeoManager->cd(vPath);
591 TGeoNode *gNode = gGeoManager->GetCurrentNode();
599 node->
mGeoMtx =
new TGeoHMatrix(*gGeoManager->GetCurrentMatrix());
606 gGeoManager->cd(returnBackPath);
658 unsigned maxChebyshevDist)
const
672 if (!dim[iq])
continue;
674 UInt_t dist =
abs(x2[iq] - x1[iq]);
679 UInt_t cdist = dim[iq] - dist;
680 if (cdist < dist) dist = cdist;
686 if (dist > maxLinearDist)
return false;
689 if (maxChebyshevDist)
691 distChebyshev += dist;
696 if (distChebyshev > maxChebyshevDist)
return false;
709 printf(
"\nClass name: %s (v.%d); object name: %s\n\n",
710 ClassName(), Class()->GetClassVersion(), GetName());
725 TList *dataList = gROOT->GetClass(ClassName())->GetListOfRealData();
726 TIter next(dataList);
729 printf(
" Basic type variables:\n");
730 printf(
" ---------------------\n\n");
733 while ((data=(TRealData*)next())) {
734 TDataMember *member = data->GetDataMember();
737 if (!member->IsPersistent())
continue;
740 if (!member->IsBasic())
continue;
743 if (!strcmp(data->GetName(),
"fUniqueID") || !strcmp(data->GetName(),
"fBits"))
continue;
744 if (!strcmp(data->GetName(),
"mVersion") || !strcmp(data->GetName(),
"mSubVersion"))
continue;
745 if (!strcmp(data->GetName(),
"mTimeStamp.fSec") ||
746 !strcmp(data->GetName(),
"mTimeStamp.fNanoSec"))
749 printf(
"%-30s (%-10s):", data->GetName(), member->GetFullTypeName());
751 Long_t
offset = member->GetOffset();
753 if (!strcmp(member->GetFullTypeName(),
"Double_t"))
754 printf(
" %f\n", *(Double_t*)((
char*)
this + offset));
755 else if (!strcmp(member->GetFullTypeName(),
"Int_t"))
756 printf(
" %d\n", *(Int_t*)((
char*)
this + offset));
757 else if (!strcmp(member->GetFullTypeName(),
"UInt_t"))
758 printf(
" %u\n", *(UInt_t*)((
char*)
this + offset));
759 else if (!strcmp(member->GetFullTypeName(),
"Bool_t"))
760 printf(
" %s\n", *(Bool_t*)((
char*)
this + offset) ?
"true" :
"false");
768 double xlocal[3] = {local.X(), local.Y(), local.Z()}, xmaster[3];
770 mtx->LocalToMaster(xlocal, xmaster);
772 return TVector3(xmaster[0], xmaster[1], xmaster[2]);
779 double xlocal[3] = {local.X(), local.Y(), local.Z()}, xmaster[3];
781 mtx->LocalToMasterVect(xlocal, xmaster);
783 return TVector3(xmaster[0], xmaster[1], xmaster[2]);
790 double xmaster[3] = {master.X(), master.Y(), master.Z()}, xlocal[3];
792 mtx->MasterToLocal(xmaster, xlocal);
794 return TVector3(xlocal[0], xlocal[1], xlocal[2]);
801 double xmaster[3] = {master.X(), master.Y(), master.Z()}, xlocal[3];
803 mtx->MasterToLocalVect(xmaster, xlocal);
805 return TVector3(xlocal[0], xlocal[1], xlocal[2]);