当前位置: 首页>>代码示例>>C++>>正文


C++ Alignment::ptr方法代码示例

本文整理汇总了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;
    }
}
开发者ID:vvolkl,项目名称:DD4hep,代码行数:16,代码来源:AlignmentTools.cpp

示例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);
}
开发者ID:vvolkl,项目名称:DD4hep,代码行数:26,代码来源:AlignmentTools.cpp

示例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();
}
开发者ID:vvolkl,项目名称:DD4hep,代码行数:49,代码来源:AlignmentOperators.cpp


注:本文中的Alignment::ptr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。