本文整理汇总了C++中Alignment::ptr方法的典型用法代码示例。如果您正苦于以下问题:C++ Alignment::ptr方法的具体用法?C++ Alignment::ptr怎么用?C++ Alignment::ptr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alignment
的用法示例。
在下文中一共展示了Alignment::ptr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/// Copy alignment object from source object
void DD4hep::Alignments::AlignmentTools::copy(Alignment from, Alignment to) {
Alignment::Object* f = from.ptr();
Alignment::Object* t = to.ptr();
if ( t != f ) {
t->flag = f->flag;
t->detectorTrafo = f->detectorTrafo;
t->worldTrafo = f->worldTrafo;
t->trToWorld = f->trToWorld;
t->detector = f->detector;
t->placement = f->placement;
t->nodes = f->nodes;
t->delta = f->delta;
t->magic = f->magic;
}
}
示例2: mask
/// Compute the survey to-world transformation from the detector element placement with respect to the survey constants
void DD4hep::Alignments::AlignmentTools::computeSurvey(Alignment alignment)
{
Alignment::Object* a = alignment.ptr();
DetElement parent = a->detector.parent();
MaskManipulator mask(a->flag);
if ( parent.isValid() ) {
DetectorTools::PlacementPath path;
DetectorTools::placementPath(parent, a->detector, path);
// TODO: need to take survey corrections into account!
for (size_t i = 0, n=path.size(); n>0 && i < n-1; ++i) {
const PlacedVolume& p = path[i];
a->detectorTrafo.MultiplyLeft(p->GetMatrix());
}
a->worldTrafo = parent.survey()->worldTrafo;
a->worldTrafo.MultiplyLeft(&a->detectorTrafo);
a->trToWorld = Geometry::_transform(&a->worldTrafo);
a->placement = a->detector.placement();
}
mask.set(AlignmentData::SURVEY);
//mask.clear(AlignmentData::INVALID|AlignmentData::DIRTY);
//mask.set(AlignmentData::VALID|AlignmentData::IDEAL);
}
示例3: alignment_reset_dbg
void alignment_reset_dbg(const string& path, const Alignment& a) {
TGeoPhysicalNode* n = a.ptr();
cout << " +++++++++++++++++++++++++++++++ " << path << endl;
cout << " +++++ Misaligned physical node: " << endl;
n->Print();
string np;
if ( n->IsAligned() ) {
for (Int_t i=0; i<=n->GetLevel(); i++) {
TGeoMatrix* mm = n->GetNode(i)->GetMatrix();
np += "/";
np += n->GetNode(i)->GetName();
if ( mm->IsIdentity() ) continue;
if ( i == 0 ) continue;
TGeoHMatrix* glob = n->GetMatrix(i-1);
NodeMap::const_iterator j=original_matrices.find(np);
if ( j != original_matrices.end() && i!=n->GetLevel() ) {
cout << " +++++ Patch Level: " << i << np << endl;
*mm = *((*j).second);
}
else {
if ( i==n->GetLevel() ) {
cout << " +++++ Level: " << i << np << " --- Original matrix: " << endl;
n->GetOriginalMatrix()->Print();
cout << " +++++ Level: " << i << np << " --- Local matrix: " << endl;
mm->Print();
TGeoHMatrix* hm = dynamic_cast<TGeoHMatrix*>(mm);
hm->SetTranslation(n->GetOriginalMatrix()->GetTranslation());
hm->SetRotation(n->GetOriginalMatrix()->GetRotationMatrix());
cout << " +++++ Level: " << i << np << " --- New local matrix" << endl;
mm->Print();
}
else {
cout << " +++++ Level: " << i << np << " --- Keep matrix " << endl;
mm->Print();
}
}
cout << " +++++ Level: " << i << np << " --- Global matrix: " << endl;
glob->Print();
*glob *= *mm;
cout << " +++++ Level: " << i << np << " --- New global matrix: " << endl;
glob->Print();
}
}
cout << "\n\n\n +++++ physical node (full): " << np << endl;
n->Print();
cout << " +++++ physical node (global): " << np << endl;
n->GetMatrix()->Print();
}