本文整理汇总了C++中TGeoVolume::GetNode方法的典型用法代码示例。如果您正苦于以下问题:C++ TGeoVolume::GetNode方法的具体用法?C++ TGeoVolume::GetNode怎么用?C++ TGeoVolume::GetNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGeoVolume
的用法示例。
在下文中一共展示了TGeoVolume::GetNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dump
long dump(TGeoNode* ideal, TGeoNode* aligned,int level, VIDs volids) const {
char fmt[128];
string opt_info;
PlacedVolume pv(ideal);
bool sensitive = false;
if ( m_printPositions || m_printVolIDs ) {
stringstream log;
if ( m_printPositions ) {
const double* trans = ideal->GetMatrix()->GetTranslation();
::snprintf(fmt, sizeof(fmt), "Pos: (%f,%f,%f) ",trans[0],trans[1],trans[2]);
log << fmt;
}
// Top level volume! have no volume ids
if ( m_printVolIDs && ideal && ideal->GetMotherVolume() ) {
VIDs vid = pv.volIDs();
if ( !vid.empty() ) {
sensitive = true;
log << " VolID: ";
volids.std::vector<VID>::insert(volids.end(),vid.begin(),vid.end());
for(VIDs::const_iterator i=volids.begin(); i!=volids.end(); ++i) {
::snprintf(fmt, sizeof(fmt), "%s:%2d ",(*i).first.c_str(), (*i).second);
log << fmt;
}
}
}
opt_info = log.str();
}
TGeoVolume* volume = ideal->GetVolume();
if ( !m_printSensitivesOnly || (m_printSensitivesOnly && sensitive) ) {
char sens = pv.volume().isSensitive() ? 'S' : ' ';
if ( ideal == aligned ) {
::snprintf(fmt,sizeof(fmt),"%03d %%-%ds %%s (%%s: %%s) \t[%p] %c %%s",
level+1,2*level+1,(void*)ideal, sens);
}
else {
::snprintf(fmt,sizeof(fmt),"%03d %%-%ds %%s (%%s: %%s) Ideal:%p Aligned:%p %c %%s",
level+1,2*level+1,(void*)ideal,(void*)aligned, sens);
}
printout(INFO,"+++",fmt,"",
aligned->GetName(),
volume->GetTitle(),
volume->GetShape()->IsA()->GetName(),
opt_info.c_str());
}
for (Int_t idau = 0, ndau = aligned->GetNdaughters(); idau < ndau; ++idau) {
TGeoNode* ideal_daughter = ideal->GetDaughter(idau);
const char* daughter_name = ideal_daughter->GetName();
TGeoNode* aligned_daughter = volume->GetNode(daughter_name);
dump(ideal_daughter, aligned_daughter, level+1, volids);
}
return 1;
}