CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

BarrelDetLayer Class Reference

#include <BarrelDetLayer.h>

Inheritance diagram for BarrelDetLayer:
DetLayer GeometricSearchDet GCC11_FINAL RodBarrelLayer GCC11_FINAL GCC11_FINAL MuRodBarrelLayer

List of all members.

Public Member Functions

 BarrelDetLayer ()
virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const
bool contains (const Local3DPoint &p) const
virtual Location location () const
 DetLayer interface.
virtual const BoundCylinderspecificSurface () const
 Extension of the interface.
virtual const BoundSurfacesurface () const
 GeometricSearchDet interface.
virtual ~BarrelDetLayer ()

Protected Member Functions

virtual BoundCylindercomputeSurface ()
virtual void initialize ()
void setSurface (BoundCylinder *cp)

Private Attributes

ReferenceCountingPointer
< BoundCylinder
theCylinder

Detailed Description

A specialization of the DetLayer interface for barrel layers. Barrel layers are cylinders with their axes parallel to the global Z axis. The methods that have a common implementation for all BarrelDetLayers are implemented in this class, but some methods are left abstract.

Date:
2007/08/21 20:48:46
Revision:
1.8

Definition at line 25 of file BarrelDetLayer.h.


Constructor & Destructor Documentation

BarrelDetLayer::BarrelDetLayer ( ) [inline]

Definition at line 28 of file BarrelDetLayer.h.

                   : 
    theCylinder(0){}
BarrelDetLayer::~BarrelDetLayer ( ) [virtual]

Definition at line 10 of file BarrelDetLayer.cc.

{}

Member Function Documentation

pair< bool, TrajectoryStateOnSurface > BarrelDetLayer::compatible ( const TrajectoryStateOnSurface ts,
const Propagator ,
const MeasurementEstimator  
) const [virtual]

tests the geometrical compatibility of the Det with the predicted state. The FreeTrajectoryState argument is propagated to the Det surface using the Propagator argument. The resulting TrajectoryStateOnSurface is tested for compatibility with the surface bounds. If compatible, a std::pair< true, propagatedState> is returned. If the propagation fails, or if the state is not compatible, a std::pair< false, propagatedState> is returned.

Implements GeometricSearchDet.

Reimplemented in GCC11_FINAL, GCC11_FINAL, GCC11_FINAL, GCC11_FINAL, GCC11_FINAL, GCC11_FINAL, GCC11_FINAL, and GCC11_FINAL.

Definition at line 74 of file BarrelDetLayer.cc.

References TrajectoryStateOnSurface::cartesianError(), GlobalErrorBase< T, ErrorWeightType >::czz(), TrajectoryStateOnSurface::globalDirection(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::isValid(), CartesianTrajectoryError::position(), Propagator::propagate(), mathSSE::sqrt(), funct::tan(), PV3DBase< T, PVType, FrameType >::theta(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by MuRodBarrelLayer::compatibleDets().

{
  if(theCylinder == 0)  edm::LogError("DetLayers") 
    << "ERROR: BarrelDetLayer::compatible() is used before the layer surface is initialized" ;
  // throw an exception? which one?

  TrajectoryStateOnSurface myState = prop.propagate( ts, specificSurface());
  if ( !myState.isValid()) return make_pair( false, myState);

  // take into account the thickness of the layer
  float deltaZ = surface().bounds().thickness()/2. / 
    fabs( tan( myState.globalDirection().theta()));

  // take into account the error on the predicted state
  const float nSigma = 3.;
  if (myState.hasError()) {
    deltaZ += nSigma * sqrt( myState.cartesianError().position().czz());
  }
  //
  // check z assuming symmetric bounds around position().z()
  //
  deltaZ += surface().bounds().length()/2;
  return make_pair(fabs(myState.globalPosition().z()-surface().position().z())<deltaZ,
                   myState);  
}
BoundCylinder * BarrelDetLayer::computeSurface ( ) [protected, virtual]

Definition at line 31 of file BarrelDetLayer.cc.

References BoundingBox::corners(), F(), max(), min, pos, alignCSCRings::r, makeMuonMisalignmentScenario::rot, and z.

                                              {
  vector< const GeomDet*> comps = basicComponents();

  // Find extension in Z
  float theRmin = comps.front()->position().perp();   
  float theRmax = theRmin;
  float theZmin = comps.front()->position().z(); 
  float theZmax = theZmin;
  for ( vector< const GeomDet*>::const_iterator deti = comps.begin(); 
        deti != comps.end(); deti++) {
    vector<GlobalPoint> corners = 
      BoundingBox().corners( dynamic_cast<const BoundPlane&>((*deti)->surface()));
    for (vector<GlobalPoint>::const_iterator ic = corners.begin();
         ic != corners.end(); ic++) {
      float r = ic->perp();
      float z = ic->z();
      theRmin = min( theRmin, r);
      theRmax = max( theRmax, r);
      theZmin = min( theZmin, z);
      theZmax = max( theZmax, z);
    }
    // in addition to the corners we have to check the middle of the 
    // det +/- thickness/2
    // , since the min  radius for some barrel dets is reached there
    float rdet = (**deti).position().perp();
    float thick = (**deti).surface().bounds().thickness();
    theRmin = min( theRmin, rdet-thick/2.F);
    theRmax = max( theRmax, rdet+thick/2.F);
  }
  
  // By default the barrel layers are positioned at the center of the 
  // global frame, and the axes of their local frame coincide with 
  // those of the global grame (z along the cylinder axis)
  PositionType pos(0.,0.,0.);
  RotationType rot;

  return new BoundCylinder( pos, rot, 
                            SimpleCylinderBounds( theRmin, theRmax, 
                                                  theZmin, theZmax));
}  
bool BarrelDetLayer::contains ( const Local3DPoint p) const

Definition at line 19 of file BarrelDetLayer.cc.

                                                         {
  return surface().bounds().inside(p);
}
void BarrelDetLayer::initialize ( ) [protected, virtual]

Definition at line 23 of file BarrelDetLayer.cc.

Referenced by MuRodBarrelLayer::MuRodBarrelLayer().

virtual Location BarrelDetLayer::location ( ) const [inline, virtual]

DetLayer interface.

Implements DetLayer.

Definition at line 41 of file BarrelDetLayer.h.

References Reference_intrackfit_cff::barrel.

void BarrelDetLayer::setSurface ( BoundCylinder cp) [protected]

Definition at line 15 of file BarrelDetLayer.cc.

References CommonMethods::cp().

                                                  { 
  theCylinder = cp;
}
virtual const BoundCylinder& BarrelDetLayer::specificSurface ( ) const [inline, virtual]
virtual const BoundSurface& BarrelDetLayer::surface ( ) const [inline, virtual]

Member Data Documentation

Reimplemented in GCC11_FINAL.

Definition at line 61 of file BarrelDetLayer.h.

Referenced by specificSurface(), and surface().