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 
15 //_____________________________________________________________________________
17 ::AlignableTracker(const TrackerGeometry* trackerGeometry,
18  const TrackerTopology* trackerTopology) :
19  // id not yet known, will be set by builder
21  tTopo_(trackerTopology),
22  trackerNameSpace_(trackerTopology),
23  alignableObjectId_(trackerGeometry, nullptr, nullptr)
24 {
25  AlignableTrackerBuilder builder(trackerGeometry, trackerTopology);
26  builder.buildAlignables(this);
27  trackerNameSpace_ = builder.trackerNameSpace();
28  alignableObjectId_ = builder.objectIdProvider();
29 }
30 
31 //_____________________________________________________________________________
32 void AlignableTracker::update(const TrackerGeometry* trackerGeometry,
33  const TrackerTopology* trackerTopology)
34 {
35  AlignableTrackerBuilder builder(trackerGeometry, trackerTopology);
36  builder.buildAlignables(this, /* update = */ true);
37 }
38 
39 //_____________________________________________________________________________
41  const Alignables& list2 ) const
42 {
43  Alignables all = list1;
44 
45  all.insert( all.end(), list2.begin(), list2.end() );
46 
47  return all;
48 }
49 
50 //_____________________________________________________________________________
52 {
53 
55  Alignments* m_alignments = new Alignments();
56  // Add components recursively
57  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
58  {
59  Alignments* tmpAlignments = (*i)->alignments();
60  std::copy( tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(),
61  std::back_inserter(m_alignments->m_align) );
62  delete tmpAlignments;
63  }
64 
65  // sort by rawId
66  std::sort( m_alignments->m_align.begin(), m_alignments->m_align.end());
67 
68  return m_alignments;
69 
70 }
71 
72 //_____________________________________________________________________________
74 {
75 
77  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
78 
79  // Add components recursively
80  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
81  {
82  AlignmentErrorsExtended* tmpAlignmentErrorsExtended = (*i)->alignmentErrors();
83  std::copy( tmpAlignmentErrorsExtended->m_alignError.begin(), tmpAlignmentErrorsExtended->m_alignError.end(),
84  std::back_inserter(m_alignmentErrors->m_alignError) );
85  delete tmpAlignmentErrorsExtended;
86  }
87 
88  // sort by rawId
89  std::sort( m_alignmentErrors->m_alignError.begin(), m_alignmentErrors->m_alignError.end());
90 
91  return m_alignmentErrors;
92 
93 }
const Alignables & components() const override
Return vector of direct components.
def copy(args, dbName)
Alignables merge(const Alignables &list1, const Alignables &list2) const
void update(const TrackerGeometry *, const TrackerTopology *)
#define nullptr
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
const AlignableObjectId & objectIdProvider() const
Return tracker alignable object ID provider derived from the tracker&#39;s geometry.
AlignableTracker(const TrackerGeometry *, const TrackerTopology *)
std::vector< AlignTransformErrorExtended > m_alignError
const align::TrackerNameSpace & trackerNameSpace() const
Return tracker name space derived from the tracker&#39;s topology.
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
Alignments * alignments() const override
Return alignments, sorted by DetId.
AlignmentErrorsExtended * alignmentErrors() const override
Return alignment errors, sorted by DetId.
void buildAlignables(AlignableTracker *, bool update=false)
align::Alignables Alignables
Definition: Alignable.h:37