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


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

本文整理汇总了C++中Alignment::isValid方法的典型用法代码示例。如果您正苦于以下问题:C++ Alignment::isValid方法的具体用法?C++ Alignment::isValid怎么用?C++ Alignment::isValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Alignment的用法示例。


在下文中一共展示了Alignment::isValid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: print_world_trafo

static void print_world_trafo(AlignmentsCalib& calib, const std::string& path)  {
  DetElement d(calib.detector(path));
  Alignment  a = calib.slice.get(d,align::Keys::alignmentKey);
  if ( a.isValid() )  {
    const double* tr = a.worldTransformation().GetTranslation();
    printout(INFO,"Example","++ World transformation of: %-32s  Tr:(%8.2g,%8.2g,%8.2g [cm])",
             path.c_str(), tr[0],tr[1],tr[2]);
    a.worldTransformation().Print();
    return;
  }
  Condition c = calib.slice.get(d,align::Keys::deltaKey);
  printout(WARNING,"Example",
           "++ Detector element:%s No alignment conditions present. Delta:%s",
           path.c_str(), c.isValid() ? "Present" : "Not availible");
}
开发者ID:AIDASoft,项目名称:DD4hep,代码行数:15,代码来源:AlignmentExample_align_telescope.cpp

示例2: ad

template <> void AlignmentActor<DDAlign_standard_operations::node_align>::operator()(Nodes::value_type& n) const  {
  Entry& e = *n.second.second;
  bool       check = e.checkOverlap();
  bool       overlap = e.overlapDefined();
  bool       has_matrix  = e.hasMatrix();
  DetElement det = e.detector;
  bool       valid     = det->global_alignment.isValid();
  string     det_placement = det.placementPath();

  if ( !valid && !has_matrix )  {
    cout << "++++ SKIP ALIGNMENT: ++++ " << e.path
         << " DE:" << det_placement
         << " Valid:" << yes_no(valid)
         << " Matrix:" << yes_no(has_matrix) << endl;
    /*    */
    return;
  }

  cout << "++++ " << e.path
       << " DE:" << det_placement
       << " Valid:" << yes_no(valid)
       << " Matrix:" << yes_no(has_matrix)
       << endl;
  /*  */
  // Need to care about optional arguments 'check_overlaps' and 'overlap'
  DetectorAlignment ad(det);
  Alignment alignment;
  bool is_not_volume = e.path == det_placement;
  if ( check && overlap )     {
    alignment = is_not_volume
      ? ad.align(e.transform, e.overlapValue(), e.overlap)
      : ad.align(e.path, e.transform, e.overlapValue(), e.overlap);
  }
  else if ( check )    {
    alignment = is_not_volume
      ? ad.align(e.transform, e.overlapValue())
      : ad.align(e.path, e.transform, e.overlapValue());
  }
  else     {
    alignment = is_not_volume ? ad.align(e.transform) : ad.align(e.path, e.transform);
  }
  if ( alignment.isValid() )  {
    insert(alignment);
    return;
  }
  throw runtime_error("Failed to apply alignment for "+e.path);
}
开发者ID:vvolkl,项目名称:DD4hep,代码行数:47,代码来源:AlignmentOperators.cpp


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