CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

AlignableExtras Class Reference

#include <AlignableExtras.h>

List of all members.

Public Types

typedef align::Alignables Alignables

Public Member Functions

 AlignableExtras ()
 Constructor (builds all alignables)
AlignmentErrorsalignmentErrors () const
 Return alignment errors, sorted by DetId.
Alignmentsalignments () const
 Return alignments, sorted by DetId.
AlignablesbeamSpot ()
 Return beam spot alignable as a vector with one element.
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.
AlignablessubStructures (const std::string &subStructName)
 Return alignables determined by name.

Private Attributes

AlignSetup< AlignablesalignableLists_
Alignables components_

Detailed Description

A container for additional/extra alignables

Original author: Andreas Mussgiller, August 2010

Date:
2010/09/10 10:26:20
Revision:
1.1

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

References alignableLists_, components_, and AlignSetup< Type >::get().

{
  align::Alignables& alis = alignableLists_.get("BeamSpot");
  alis.push_back(new AlignableBeamSpot());
  components_.push_back(alis.back());
}

Member Function Documentation

AlignmentErrors * AlignableExtras::alignmentErrors ( void  ) const

Return alignment errors, sorted by DetId.

Definition at line 68 of file AlignableExtras.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), filterCSVwithJSON::copy, i, AlignmentErrors::m_alignError, and python::multivaluedict::sort().

{
  align::Alignables comp = this->components();
  AlignmentErrors* m_alignmentErrors = new AlignmentErrors();

  // Add components recursively
  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
    {
          AlignmentErrors* tmpAlignmentErrors = (*i)->alignmentErrors();
      std::copy( tmpAlignmentErrors->m_alignError.begin(), tmpAlignmentErrors->m_alignError.end(), 
                 std::back_inserter(m_alignmentErrors->m_alignError) );
          delete tmpAlignmentErrors;
    }
  
  std::sort( m_alignmentErrors->m_alignError.begin(), m_alignmentErrors->m_alignError.end(), 
             lessAlignmentDetId<AlignTransformError>() );

  return m_alignmentErrors;
}
Alignments * AlignableExtras::alignments ( void  ) const

Return alignments, sorted by DetId.

Definition at line 48 of file AlignableExtras.cc.

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

{
  align::Alignables comp = this->components();
  Alignments* m_alignments = new Alignments();
  // Add components recursively
  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
    {
      Alignments* tmpAlignments = (*i)->alignments();
      std::copy( tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(), 
                 std::back_inserter(m_alignments->m_align) );
          delete tmpAlignments;
    }

  std::sort( m_alignments->m_align.begin(), m_alignments->m_align.end(), 
             lessAlignmentDetId<AlignTransform>() );

  return m_alignments;
}
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().

{ return this->subStructures("BeamSpot");}
Alignables AlignableExtras::components ( ) const [inline]
void AlignableExtras::dump ( void  ) const

Definition at line 34 of file AlignableExtras.cc.

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

{
  Alignables comp = this->components();

  // Dump this
  edm::LogInfo("AlignableDump") 
    << " AlignableExtras knows " << comp.size() << " alignable(s)" << std::endl;

  // Dump components
  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
    (*i)->dump();
}
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 88 of file AlignableExtras.cc.

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

Referenced by AlignmentProducer::duringLoop().

{
  align::Alignables& alis = beamSpot();
  AlignableBeamSpot * aliBS = dynamic_cast<AlignableBeamSpot*>(alis.back());
  if (aliBS) {
    aliBS->initialize(x, y, z, dxdz, dydz);
  } else {
    edm::LogError("AlignableExtras") 
      << " AlignableBeamSpot not available. Cannot initialize!" << std::endl;
  }
}
Alignables& AlignableExtras::subStructures ( const std::string &  subStructName) [inline]

Return alignables determined by name.

Definition at line 29 of file AlignableExtras.h.

References alignableLists_, and AlignSetup< Type >::find().

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

                                                            {
    return alignableLists_.find(subStructName);
  }

Member Data Documentation

Definition at line 52 of file AlignableExtras.h.

Referenced by AlignableExtras(), and subStructures().

Definition at line 53 of file AlignableExtras.h.

Referenced by AlignableExtras(), and components().