CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
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 27 of file AlignableExtras.cc.

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

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

Member Function Documentation

AlignmentErrorsExtended * AlignableExtras::alignmentErrors ( void  ) const

Return alignment errors, sorted by DetId.

Definition at line 69 of file AlignableExtras.cc.

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

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

Return alignments, sorted by DetId.

Definition at line 49 of file AlignableExtras.cc.

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

50 {
52  Alignments* m_alignments = new Alignments();
53  // Add components recursively
54  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
55  {
56  Alignments* tmpAlignments = (*i)->alignments();
57  std::copy( tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(),
58  std::back_inserter(m_alignments->m_align) );
59  delete tmpAlignments;
60  }
61 
62  std::sort( m_alignments->m_align.begin(), m_alignments->m_align.end(),
64 
65  return m_alignments;
66 }
int i
Definition: DBlmapReader.cc:9
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
Alignables components() const
std::vector< Alignable * > Alignables
Definition: Utilities.h:30
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 AlignmentProducer::endOfJob(), and initializeBeamSpot().

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 35 of file AlignableExtras.cc.

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

36 {
37  Alignables comp = this->components();
38 
39  // Dump this
40  edm::LogInfo("AlignableDump")
41  << " AlignableExtras knows " << comp.size() << " alignable(s)" << std::endl;
42 
43  // Dump components
44  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
45  (*i)->dump();
46 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:251
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 89 of file AlignableExtras.cc.

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

Referenced by AlignmentProducer::duringLoop().

91 {
92  align::Alignables& alis = beamSpot();
93  AlignableBeamSpot * aliBS = dynamic_cast<AlignableBeamSpot*>(alis.back());
94  if (aliBS) {
95  aliBS->initialize(x, y, z, dxdz, dydz);
96  } else {
97  edm::LogError("AlignableExtras")
98  << " AlignableBeamSpot not available. Cannot initialize!" << std::endl;
99  }
100 }
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:30
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 52 of file AlignableExtras.h.

Referenced by AlignableExtras(), and subStructures().

Alignables AlignableExtras::components_
private

Definition at line 53 of file AlignableExtras.h.

Referenced by AlignableExtras(), and components().