本文整理汇总了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");
}
示例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);
}