CMS 3D CMS Logo

AlignableTracker.cc
Go to the documentation of this file.
2 
3 // Original Author: ?
4 // Last Update: Max Stark
5 // Date: Mon, 15 Feb 2016 09:32:12 CET
6 
7 // alignment
9 
12 
13 //_____________________________________________________________________________
14 AlignableTracker ::AlignableTracker(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology)
15  : // id not yet known, will be set by builder
17  tTopo_(trackerTopology),
18  trackerNameSpace_(trackerTopology),
19  alignableObjectId_(trackerGeometry, nullptr, nullptr, nullptr) {
20  AlignableTrackerBuilder builder(trackerGeometry, trackerTopology);
21  builder.buildAlignables(this);
24 }
25 
26 //_____________________________________________________________________________
27 void AlignableTracker::update(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology) {
28  AlignableTrackerBuilder builder(trackerGeometry, trackerTopology);
29  builder.buildAlignables(this, /* update = */ true);
30 }
31 
32 //_____________________________________________________________________________
34  Alignables all = list1;
35 
36  all.insert(all.end(), list2.begin(), list2.end());
37 
38  return all;
39 }
40 
41 //_____________________________________________________________________________
44  Alignments* m_alignments = new Alignments();
45  // Add components recursively
46  for (align::Alignables::iterator i = comp.begin(); i != comp.end(); i++) {
47  Alignments* tmpAlignments = (*i)->alignments();
48  std::copy(tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(), std::back_inserter(m_alignments->m_align));
49  delete tmpAlignments;
50  }
51 
52  // sort by rawId
53  std::sort(m_alignments->m_align.begin(), m_alignments->m_align.end());
54 
55  return m_alignments;
56 }
57 
58 //_____________________________________________________________________________
61  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
62 
63  // Add components recursively
64  for (align::Alignables::iterator i = comp.begin(); i != comp.end(); i++) {
65  AlignmentErrorsExtended* tmpAlignmentErrorsExtended = (*i)->alignmentErrors();
66  std::copy(tmpAlignmentErrorsExtended->m_alignError.begin(),
67  tmpAlignmentErrorsExtended->m_alignError.end(),
68  std::back_inserter(m_alignmentErrors->m_alignError));
69  delete tmpAlignmentErrorsExtended;
70  }
71 
72  // sort by rawId
73  std::sort(m_alignmentErrors->m_alignError.begin(), m_alignmentErrors->m_alignError.end());
74 
75  return m_alignmentErrors;
76 }
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
Alignments * alignments() const override
Return alignments, sorted by DetId.
void update(const TrackerGeometry *, const TrackerTopology *)
const Alignables & components() const override
Return vector of direct components.
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
AlignableTracker(const TrackerGeometry *, const TrackerTopology *)
const AlignableObjectId & objectIdProvider() const
Return tracker alignable object ID provider derived from the tracker&#39;s geometry.
AlignableObjectId alignableObjectId_
align::TrackerNameSpace trackerNameSpace_
const align::TrackerNameSpace & trackerNameSpace() const
Return tracker name space derived from the tracker&#39;s topology.
std::vector< AlignTransformErrorExtended > m_alignError
AlignmentErrorsExtended * alignmentErrors() const override
Return alignment errors, sorted by DetId.
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
const TrackerTopology * trackerTopology() const
Return tracker topology used to build AlignableTracker.
void buildAlignables(AlignableTracker *, bool update=false)
Alignables merge(const Alignables &list1, const Alignables &list2) const
align::Alignables Alignables
Definition: Alignable.h:34