CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

AlignableDTBarrel Class Reference

#include <AlignableDTBarrel.h>

Inheritance diagram for AlignableDTBarrel:
AlignableComposite Alignable

List of all members.

Public Member Functions

 AlignableDTBarrel (const std::vector< AlignableDTWheel * > dtWheels)
 The constructor simply copies the vector of wheels and computes the surface from them.
AlignmentErrorsalignmentErrors () const
 Return vector of alignment errors.
Alignmentsalignments () const
 Return alignment data.
virtual std::vector< Alignable * > components () const
 Return vector of direct components.
RotationType computeOrientation ()
 Just initialize to default given by default constructor of a RotationType.
PositionType computePosition ()
 Compute average z position from all components (x and y forced to 0)
AlignableSurface computeSurface ()
void dump (void) const
 Recursive printout of the muon Barrel structure.
AlignableDTWheelwheel (int i)
 Return AlignableBarrelLayer at given index.
 ~AlignableDTBarrel ()
 Clean delete of the vector and its elements.

Private Attributes

std::vector< AlignableDTWheel * > theDTWheels

Friends

std::ostream & operator<< (std::ostream &, const AlignableDTBarrel &)
 Printout muon Barrel information (not recursive)

Detailed Description

Concrete class for muon DT Barrel alignable.

Misalignment can be de-/reactivated (forwarded to components).

The alignable muon DT barrel.

Date:
2011/09/15 10:07:07
Revision:
1.11
Author:
Andre Sznajder - UERJ(Brazil)

Definition at line 30 of file AlignableDTBarrel.h.


Constructor & Destructor Documentation

AlignableDTBarrel::AlignableDTBarrel ( const std::vector< AlignableDTWheel * >  dtWheels)

The constructor simply copies the vector of wheels and computes the surface from them.

Definition at line 17 of file AlignableDTBarrel.cc.

References computeSurface(), AlignableComposite::setSurface(), and theDTWheels.

   : AlignableComposite(dtWheels[0]->id(), align::AlignableDTBarrel)
{

  theDTWheels.insert( theDTWheels.end(), dtWheels.begin(), dtWheels.end() );

  setSurface( computeSurface() );
   
}
AlignableDTBarrel::~AlignableDTBarrel ( )

Clean delete of the vector and its elements.

Definition at line 29 of file AlignableDTBarrel.cc.

References theDTWheels.

{
  for ( std::vector<AlignableDTWheel*>::iterator iter = theDTWheels.begin(); 
        iter != theDTWheels.end(); iter++)
    delete *iter;

}

Member Function Documentation

AlignmentErrors * AlignableDTBarrel::alignmentErrors ( void  ) const [virtual]

Return vector of alignment errors.

Reimplemented from AlignableComposite.

Definition at line 132 of file AlignableDTBarrel.cc.

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

{

  std::vector<Alignable*> comp = this->components();
  AlignmentErrors* m_alignmentErrors = new AlignmentErrors();

  // Add components recursively
  for ( std::vector<Alignable*>::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 * AlignableDTBarrel::alignments ( void  ) const [virtual]

Return alignment data.

Reimplemented from AlignableComposite.

Definition at line 110 of file AlignableDTBarrel.cc.

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

{

  std::vector<Alignable*> comp = this->components();
  Alignments* m_alignments = new Alignments();
  // Add components recursively
  for ( std::vector<Alignable*>::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;

}
virtual std::vector<Alignable*> AlignableDTBarrel::components ( ) const [inline, virtual]

Return vector of direct components.

Reimplemented from AlignableComposite.

Definition at line 39 of file AlignableDTBarrel.h.

References query::result, and theDTWheels.

Referenced by alignmentErrors(), and alignments().

  {

        std::vector<Alignable*> result;
        result.insert( result.end(), theDTWheels.begin(), theDTWheels.end() );
        return result;

  }
AlignableDTBarrel::RotationType AlignableDTBarrel::computeOrientation ( )

Just initialize to default given by default constructor of a RotationType.

Definition at line 78 of file AlignableDTBarrel.cc.

Referenced by computeSurface().

{
  return RotationType();
}
AlignableDTBarrel::PositionType AlignableDTBarrel::computePosition ( )

Compute average z position from all components (x and y forced to 0)

Definition at line 61 of file AlignableDTBarrel.cc.

References theDTWheels, and PV3DBase< T, PVType, FrameType >::z().

Referenced by computeSurface().

{

  float zz = 0.;

  for ( std::vector<AlignableDTWheel*>::iterator ilayer = theDTWheels.begin();
                ilayer != theDTWheels.end(); ilayer++ )
    zz += (*ilayer)->globalPosition().z();

  zz /= static_cast<float>(theDTWheels.size());

  return PositionType( 0.0, 0.0, zz );

}
AlignableSurface AlignableDTBarrel::computeSurface ( )

Returns surface corresponding to current position and orientation, as given by average on all components

Definition at line 51 of file AlignableDTBarrel.cc.

References computeOrientation(), and computePosition().

Referenced by AlignableDTBarrel().

void AlignableDTBarrel::dump ( void  ) const [virtual]

Recursive printout of the muon Barrel structure.

Recursive printout of whole Half Barrel structure.

Reimplemented from AlignableComposite.

Definition at line 99 of file AlignableDTBarrel.cc.

References theDTWheels.

{

  edm::LogInfo("AlignableDump") << (*this);
  for ( std::vector<AlignableDTWheel*>::const_iterator iWheel = theDTWheels.begin();
                iWheel != theDTWheels.end(); iWheel++ )
        (*iWheel)->dump();

}
AlignableDTWheel & AlignableDTBarrel::wheel ( int  i)

Return AlignableBarrelLayer at given index.

Definition at line 38 of file AlignableDTBarrel.cc.

References Exception, i, Alignable::size(), and theDTWheels.

{
  
  if (i >= size() ) 
        throw cms::Exception("LogicError") << "Wheel index (" << i << ") out of range";

  return *theDTWheels[i];
  
}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const AlignableDTBarrel b 
) [friend]

Printout muon Barrel information (not recursive)

Definition at line 86 of file AlignableDTBarrel.cc.

{

  os << "This DTBarrel contains " << b.theDTWheels.size() << " Barrel wheels" << std::endl;
  os << "(phi, r, z) =  (" << b.globalPosition().phi() << "," 
     << b.globalPosition().perp() << "," << b.globalPosition().z();
  os << "),  orientation:" << std::endl<< b.globalRotation() << std::endl;
  return os;

}

Member Data Documentation