CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
AlignableExtras Class Reference

#include <AlignableExtras.h>

Public Types

typedef align::Alignables Alignables
 

Public Member Functions

 AlignableExtras ()
 Constructor (builds all alignables) More...
 
AlignmentErrorsExtendedalignmentErrors () const
 Return alignment errors, sorted by DetId. More...
 
Alignmentsalignments () const
 Return alignments, sorted by DetId. More...
 
AlignablesbeamSpot ()
 Return beam spot alignable as a vector with one element. More...
 
Alignables components () const
 
void dump (void) const
 
void initializeBeamSpot (double x, double y, double z, double dxdz, double dydz)
 Initialize the alignable beam spot with the given parameters. More...
 
void resetBeamSpot ()
 Initialize the alignable beam spot with the given parameters. More...
 
AlignablessubStructures (const std::string &subStructName)
 Return alignables determined by name. More...
 

Private Attributes

AlignableMap alignableLists_
 
Alignables components_
 

Detailed Description

A container for additional/extra alignables

Original author: Andreas Mussgiller, August 2010

Date
2009/02/28 21:04:59
Revision
1.3

(last update by

Author
mussgill

)

Definition at line 19 of file AlignableExtras.h.

Member Typedef Documentation

Definition at line 23 of file AlignableExtras.h.

Constructor & Destructor Documentation

AlignableExtras::AlignableExtras ( )
explicit

Constructor (builds all alignables)

Definition at line 23 of file AlignableExtras.cc.

References alignableLists_, components_, and AlignableMap::get().

24 {
25  align::Alignables& alis = alignableLists_.get("BeamSpot");
26  alis.push_back(new AlignableBeamSpot());
27  components_.push_back(alis.back());
28 }
Alignables components_
AlignableMap alignableLists_
Alignables & get(const std::string &name="")
Definition: AlignableMap.cc:9
std::vector< Alignable * > Alignables
Definition: Utilities.h:31

Member Function Documentation

AlignmentErrorsExtended * AlignableExtras::alignmentErrors ( void  ) const

Return alignment errors, sorted by DetId.

Definition at line 65 of file AlignableExtras.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), popcon2dropbox::copy(), mps_fire::i, and AlignmentErrorsExtended::m_alignError.

Referenced by components().

66 {
68  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
69 
70  // Add components recursively
71  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
72  {
73  AlignmentErrorsExtended* tmpAlignmentErrorsExtended = (*i)->alignmentErrors();
74  std::copy( tmpAlignmentErrorsExtended->m_alignError.begin(), tmpAlignmentErrorsExtended->m_alignError.end(),
75  std::back_inserter(m_alignmentErrors->m_alignError) );
76  delete tmpAlignmentErrorsExtended;
77  }
78 
79  std::sort( m_alignmentErrors->m_alignError.begin(), m_alignmentErrors->m_alignError.end(),
81 
82  return m_alignmentErrors;
83 }
Alignables components() const
std::vector< AlignTransformErrorExtended > m_alignError
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
Alignments * AlignableExtras::alignments ( void  ) const

Return alignments, sorted by DetId.

Definition at line 45 of file AlignableExtras.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), popcon2dropbox::copy(), mps_fire::i, and Alignments::m_align.

Referenced by components().

46 {
48  Alignments* m_alignments = new Alignments();
49  // Add components recursively
50  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
51  {
52  Alignments* tmpAlignments = (*i)->alignments();
53  std::copy( tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(),
54  std::back_inserter(m_alignments->m_align) );
55  delete tmpAlignments;
56  }
57 
58  std::sort( m_alignments->m_align.begin(), m_alignments->m_align.end(),
60 
61  return m_alignments;
62 }
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
Alignables components() const
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
Alignables& AlignableExtras::beamSpot ( )
inline

Return beam spot alignable as a vector with one element.

Definition at line 34 of file AlignableExtras.h.

References subStructures().

Referenced by initializeBeamSpot(), resetBeamSpot(), and AlignmentProducerBase::storeAlignmentsToDB().

34 { return this->subStructures("BeamSpot");}
Alignables & subStructures(const std::string &subStructName)
Return alignables determined by name.
Alignables AlignableExtras::components ( ) const
inline
void AlignableExtras::dump ( void  ) const

Definition at line 31 of file AlignableExtras.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), and mps_fire::i.

Referenced by components().

32 {
33  Alignables comp = this->components();
34 
35  // Dump this
36  edm::LogInfo("AlignableDump")
37  << " AlignableExtras knows " << comp.size() << " alignable(s)" << std::endl;
38 
39  // Dump components
40  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
41  (*i)->dump();
42 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
Alignables components() const
void AlignableExtras::initializeBeamSpot ( double  x,
double  y,
double  z,
double  dxdz,
double  dydz 
)

Initialize the alignable beam spot with the given parameters.

Definition at line 86 of file AlignableExtras.cc.

References beamSpot(), and AlignableBeamSpot::initialize().

Referenced by components(), and AlignmentProducerBase::initBeamSpot().

88 {
89  align::Alignables& alis = beamSpot();
90  AlignableBeamSpot * aliBS = dynamic_cast<AlignableBeamSpot*>(alis.back());
91  if (aliBS) {
92  aliBS->initialize(x, y, z, dxdz, dydz);
93  } else {
94  edm::LogError("AlignableExtras")
95  << " AlignableBeamSpot not available. Cannot initialize!" << std::endl;
96  }
97 }
void initialize(double x, double y, double z, double dxdz, double dydz)
initialize the alignable with the passed beam spot parameters
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
Alignables & beamSpot()
Return beam spot alignable as a vector with one element.
void AlignableExtras::resetBeamSpot ( )

Initialize the alignable beam spot with the given parameters.

Definition at line 100 of file AlignableExtras.cc.

References beamSpot(), and AlignableBeamSpot::reset().

Referenced by components().

101 {
102  align::Alignables& alis = beamSpot();
103  AlignableBeamSpot * aliBS = dynamic_cast<AlignableBeamSpot*>(alis.back());
104  if (aliBS) {
105  aliBS->reset();
106  } else {
107  edm::LogWarning("AlignableExtras")
108  << "@SUB=AlignableExtras::resetBeamSpot"
109  << "AlignableBeamSpot not available. Cannot reset!" << std::endl;
110  }
111 }
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
void reset()
reset beam spot to the uninitialized state
Alignables & beamSpot()
Return beam spot alignable as a vector with one element.
Alignables& AlignableExtras::subStructures ( const std::string &  subStructName)
inline

Return alignables determined by name.

Definition at line 29 of file AlignableExtras.h.

References alignableLists_, and AlignableMap::find().

Referenced by AlignmentParameterSelector::addSelection(), and beamSpot().

29  {
30  return alignableLists_.find(subStructName);
31  }
AlignableMap alignableLists_
Alignables & find(const std::string &name="")
Definition: AlignableMap.cc:15

Member Data Documentation

AlignableMap AlignableExtras::alignableLists_
private

Definition at line 55 of file AlignableExtras.h.

Referenced by AlignableExtras(), and subStructures().

Alignables AlignableExtras::components_
private

Definition at line 56 of file AlignableExtras.h.

Referenced by AlignableExtras(), and components().