File indexing completed on 2024-04-06 11:57:28
0001 #include "Alignment/TrackerAlignment/interface/AlignableTracker.h"
0002
0003
0004
0005
0006
0007
0008 #include "Alignment/TrackerAlignment/interface/AlignableTrackerBuilder.h"
0009
0010 #include "CondFormats/Alignment/interface/Alignments.h"
0011 #include "CondFormats/Alignment/interface/AlignmentErrorsExtended.h"
0012
0013
0014 AlignableTracker ::AlignableTracker(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology)
0015 :
0016 AlignableComposite(0, align::Tracker, RotationType()),
0017 tTopo_(trackerTopology),
0018 trackerNameSpace_(trackerTopology),
0019 alignableObjectId_(trackerGeometry, nullptr, nullptr, nullptr) {
0020 AlignableTrackerBuilder builder(trackerGeometry, trackerTopology);
0021 builder.buildAlignables(this);
0022 trackerNameSpace_ = builder.trackerNameSpace();
0023 alignableObjectId_ = builder.objectIdProvider();
0024 }
0025
0026
0027 void AlignableTracker::update(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology) {
0028 AlignableTrackerBuilder builder(trackerGeometry, trackerTopology);
0029 builder.buildAlignables(this, true);
0030 }
0031
0032
0033 align::Alignables AlignableTracker::merge(const Alignables& list1, const Alignables& list2) const {
0034 Alignables all = list1;
0035
0036 all.insert(all.end(), list2.begin(), list2.end());
0037
0038 return all;
0039 }
0040
0041
0042 Alignments* AlignableTracker::alignments(void) const {
0043 align::Alignables comp = this->components();
0044 Alignments* m_alignments = new Alignments();
0045
0046 for (align::Alignables::iterator i = comp.begin(); i != comp.end(); i++) {
0047 Alignments* tmpAlignments = (*i)->alignments();
0048 std::copy(tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(), std::back_inserter(m_alignments->m_align));
0049 delete tmpAlignments;
0050 }
0051
0052
0053 std::sort(m_alignments->m_align.begin(), m_alignments->m_align.end());
0054
0055 return m_alignments;
0056 }
0057
0058
0059 AlignmentErrorsExtended* AlignableTracker::alignmentErrors(void) const {
0060 align::Alignables comp = this->components();
0061 AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
0062
0063
0064 for (align::Alignables::iterator i = comp.begin(); i != comp.end(); i++) {
0065 AlignmentErrorsExtended* tmpAlignmentErrorsExtended = (*i)->alignmentErrors();
0066 std::copy(tmpAlignmentErrorsExtended->m_alignError.begin(),
0067 tmpAlignmentErrorsExtended->m_alignError.end(),
0068 std::back_inserter(m_alignmentErrors->m_alignError));
0069 delete tmpAlignmentErrorsExtended;
0070 }
0071
0072
0073 std::sort(m_alignmentErrors->m_alignError.begin(), m_alignmentErrors->m_alignError.end());
0074
0075 return m_alignmentErrors;
0076 }