CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
ForwardDetLayer Class Reference

#include <ForwardDetLayer.h>

Inheritance diagram for ForwardDetLayer:
DetLayer GeometricSearchDet GCC11_FINAL RingedForwardLayer TECLayer GCC11_FINAL MuRingForwardDoubleLayer MuRingForwardLayer

Public Member Functions

virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
 
bool contains (const Local3DPoint &p) const
 
 ForwardDetLayer ()
 
virtual Location location () const
 Which part of the detector (barrel, endcap) More...
 
virtual const BoundDiskspecificSurface () const
 
virtual const BoundSurfacesurface () const
 The surface of the GeometricSearchDet. More...
 
virtual ~ForwardDetLayer ()
 
- Public Member Functions inherited from DetLayer
std::vector< const DetLayer * > compatibleLayers (NavigationDirection direction) const
 
std::vector< const DetLayer * > compatibleLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
 
std::vector< const DetLayer * > compatibleLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection, int &counter) const
 
 DetLayer ()
 
NavigableLayernavigableLayer () const
 Return the NavigableLayer associated with this DetLayer. More...
 
virtual std::vector< const
DetLayer * > 
nextLayers (NavigationDirection direction) const
 
virtual std::vector< const
DetLayer * > 
nextLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
 
virtual void setNavigableLayer (NavigableLayer *nlp)
 Set the NavigableLayer associated with this DetLayer. More...
 
virtual SubDetector subDetector () const =0
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
virtual ~DetLayer ()
 
- Public Member Functions inherited from GeometricSearchDet
virtual const std::vector
< const GeomDet * > & 
basicComponents () const =0
 
virtual std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual void compatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
 
virtual const std::vector
< const GeometricSearchDet * > & 
components () const =0
 Returns basic components, if any. More...
 
 GeometricSearchDet ()
 
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual void groupedCompatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
 
virtual bool hasGroups () const =0
 
virtual const
Surface::PositionType
position () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Protected Member Functions

virtual BoundDiskcomputeSurface ()
 
virtual void initialize ()
 
float rmax () const
 
float rmin () const
 
void setSurface (BoundDisk *cp)
 
float zmax () const
 
float zmin () const
 

Private Attributes

ReferenceCountingPointer
< BoundDisk
theDisk
 

Additional Inherited Members

- Public Types inherited from DetLayer
typedef
GeomDetEnumerators::Location 
Location
 
typedef
GeomDetEnumerators::SubDetector 
SubDetector
 
- Public Types inherited from GeometricSearchDet
typedef std::pair< const
GeomDet
*, TrajectoryStateOnSurface
DetWithState
 
typedef BoundSurface::PositionType PositionType
 
typedef BoundSurface::RotationType RotationType
 
typedef TrajectoryStateOnSurface TrajectoryState
 
- Protected Attributes inherited from GeometricSearchDet
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

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

Definition at line 20 of file ForwardDetLayer.h.

Constructor & Destructor Documentation

ForwardDetLayer::ForwardDetLayer ( )

Definition at line 9 of file ForwardDetLayer.cc.

9  :
10  theDisk(0)
11  //theRmin(0), theRmax(0), theZmin(0), theZmax(0)
12 {}
ReferenceCountingPointer< BoundDisk > theDisk
ForwardDetLayer::~ForwardDetLayer ( )
virtual

Definition at line 15 of file ForwardDetLayer.cc.

15  {
16 }

Member Function Documentation

pair< bool, TrajectoryStateOnSurface > ForwardDetLayer::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 MuRingForwardDoubleLayer, GCC11_FINAL, GCC11_FINAL, GCC11_FINAL, GCC11_FINAL, GCC11_FINAL, GCC11_FINAL, GCC11_FINAL, and GCC11_FINAL.

Definition at line 109 of file ForwardDetLayer.cc.

References BoundSurface::bounds(), deltaR(), TrajectoryStateOnSurface::hasError(), SimpleDiskBounds::inside(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LocalTrajectoryError::positionError(), Propagator::propagate(), rmax(), rmin(), specificSurface(), mathSSE::sqrt(), surface(), funct::tan(), theDisk, PV3DBase< T, PVType, FrameType >::theta(), Bounds::thickness(), tmp, LocalError::xx(), LocalError::yy(), zmax(), zmin(), and zPos.

Referenced by MuRingForwardLayer::compatibleDets().

112 {
113  if(theDisk == 0) edm::LogError("DetLayers")
114  << "ERROR: BarrelDetLayer::compatible() is used before the layer surface is initialized" ;
115  // throw an exception? which one?
116 
117  TrajectoryStateOnSurface myState = prop.propagate( ts, specificSurface());
118  if ( !myState.isValid()) return make_pair( false, myState);
119 
120  // take into account the thickness of the layer
121  float deltaR = surface().bounds().thickness()/2. *
122  fabs( tan( myState.localDirection().theta()));
123 
124  // take into account the error on the predicted state
125  const float nSigma = 3.;
126  if (myState.hasError()) {
127  LocalError err = myState.localError().positionError();
128  // ignore correlation for the moment...
129  deltaR += nSigma * sqrt(err.xx() + err.yy());
130  }
131 
132  float zPos = (zmax()+zmin())/2.;
133  SimpleDiskBounds tmp( rmin()-deltaR, rmax()+deltaR,
134  zmin()-zPos, zmax()-zPos);
135 
136  return make_pair( tmp.inside(myState.localPosition()), myState);
137 }
float xx() const
Definition: LocalError.h:24
double zPos
LocalVector localDirection() const
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
float rmin() const
float zmin() const
LocalError positionError() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:74
virtual float thickness() const =0
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:46
virtual const BoundDisk & specificSurface() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
ReferenceCountingPointer< BoundDisk > theDisk
const LocalTrajectoryError & localError() const
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
float zmax() const
const Bounds & bounds() const
Definition: BoundSurface.h:89
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
float rmax() const
BoundDisk * ForwardDetLayer::computeSurface ( )
protectedvirtual

Reimplemented in MuRingForwardDoubleLayer.

Definition at line 34 of file ForwardDetLayer.cc.

References GeometricSearchDet::basicComponents(), GeometricSearchDet::components(), BoundingBox::corners(), Vector3DBase< T, FrameTag >::dot(), F(), LogDebug, max(), min, pos, alignCSCRings::r, makeMuonMisalignmentScenario::rot, Vector3DBase< T, FrameTag >::unit(), tablePrinter::width, detailsBasic3DVector::z, and zPos.

Referenced by initialize().

34  {
35  LogDebug("DetLayers") << "ForwaLayer::computeSurface callded" ;
36  vector<const GeomDet*> comps= basicComponents();
37 
38  vector<const GeomDet*>::const_iterator ifirst = comps.begin();
39  vector<const GeomDet*>::const_iterator ilast = comps.end();
40 
41  // Find extension in R
42  float theRmin = components().front()->position().perp();
43  float theRmax = theRmin;
44  float theZmin = components().back()->position().z();
45  float theZmax = theZmin;
46  for ( vector<const GeomDet*>::const_iterator deti = ifirst;
47  deti != ilast; deti++) {
48  vector<GlobalPoint> corners =
49  BoundingBox().corners( dynamic_cast<const BoundPlane&>((**deti).surface()));
50  for (vector<GlobalPoint>::const_iterator ic = corners.begin();
51  ic != corners.end(); ic++) {
52  float r = ic->perp();
53  LogDebug("DetLayers") << "corner.perp(): " << r ;
54  float z = ic->z();
55  theRmin = min( theRmin, r);
56  theRmax = max( theRmax, r);
57  theZmin = min( theZmin, z);
58  theZmax = max( theZmax, z);
59  }
60 
61  // in addition to the corners we have to check the middle of the
62  // det +/- length/2
63  // , since the min (max) radius for typical fw dets is reached there
64 
65  float rdet = (**deti).position().perp();
66  float len = (**deti).surface().bounds().length();
67  float width = (**deti).surface().bounds().width();
68 
69  GlobalVector xAxis = (**deti).toGlobal(LocalVector(1,0,0));
70  GlobalVector yAxis = (**deti).toGlobal(LocalVector(0,1,0));
71  GlobalVector perpDir = GlobalVector( (**deti).position() - GlobalPoint(0,0,(**deti).position().z()) );
72 
73  double xAxisCos = xAxis.unit().dot(perpDir.unit());
74  double yAxisCos = yAxis.unit().dot(perpDir.unit());
75 
76  LogDebug("DetLayers") << "in ForwardDetLayer::computeSurface(),xAxisCos,yAxisCos: " << xAxisCos << " , " << yAxisCos ;
77  LogDebug("DetLayers") << "det pos.perp,length,width: "
78  << rdet << " , "
79  << len << " , "
80  << width ;
81 
82  if( fabs(xAxisCos) > fabs(yAxisCos) ) {
83  theRmin = min( theRmin, rdet-width/2.F);
84  theRmax = max( theRmax, rdet+width/2.F);
85  }else{
86  theRmin = min( theRmin, rdet-len/2.F);
87  theRmax = max( theRmax, rdet+len/2.F);
88  }
89  }
90 
91 
92  LogDebug("DetLayers") << "creating SimpleDiskBounds with r range" << theRmin << " "
93  << theRmax << " and z range " << theZmin << " " << theZmax ;
94 
95  // By default the forward layers are positioned around the z axis of the
96  // global frame, and the axes of their local frame coincide with
97  // those of the global grame (z along the disk axis)
98  float zPos = (theZmax+theZmin)/2.;
99  PositionType pos(0.,0.,zPos);
101 
102  return new BoundDisk( pos, rot,
103  SimpleDiskBounds( theRmin, theRmax,
104  theZmin-zPos, theZmax-zPos));
105 }
#define LogDebug(id)
BoundSurface::RotationType RotationType
BoundSurface::PositionType PositionType
Local3DVector LocalVector
Definition: LocalVector.h:12
double zPos
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
virtual const std::vector< const GeometricSearchDet * > & components() const =0
Returns basic components, if any.
#define min(a, b)
Definition: mlp_lapack.h:161
double double double z
static std::vector< GlobalPoint > corners(const BoundPlane &)
Definition: BoundingBox.cc:24
const T & max(const T &a, const T &b)
Vector3DBase unit() const
Definition: Vector3DBase.h:57
virtual const std::vector< const GeomDet * > & basicComponents() const =0
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
Global3DVector GlobalVector
Definition: GlobalVector.h:10
bool ForwardDetLayer::contains ( const Local3DPoint p) const

Definition at line 24 of file ForwardDetLayer.cc.

References BoundSurface::bounds(), Bounds::inside(), and surface().

24  {
25  return surface().bounds().inside(p);
26 }
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
const Bounds & bounds() const
Definition: BoundSurface.h:89
void ForwardDetLayer::initialize ( )
protectedvirtual

Definition at line 29 of file ForwardDetLayer.cc.

References computeSurface(), and setSurface().

29  {
31 }
virtual BoundDisk * computeSurface()
void setSurface(BoundDisk *cp)
virtual Location ForwardDetLayer::location ( ) const
inlinevirtual

Which part of the detector (barrel, endcap)

Implements DetLayer.

Definition at line 35 of file ForwardDetLayer.h.

References GeomDetEnumerators::endcap.

float ForwardDetLayer::rmax ( ) const
inlineprotected

Definition at line 48 of file ForwardDetLayer.h.

References theDisk.

Referenced by compatible(), MuRingForwardDoubleLayer::compatible(), TECLayer::computeDisk(), and MuRingForwardDoubleLayer::computeSurface().

48 { return theDisk->outerRadius();}
ReferenceCountingPointer< BoundDisk > theDisk
float ForwardDetLayer::rmin ( ) const
inlineprotected

Definition at line 47 of file ForwardDetLayer.h.

References theDisk.

Referenced by compatible(), MuRingForwardDoubleLayer::compatible(), TECLayer::computeDisk(), and MuRingForwardDoubleLayer::computeSurface().

47 { return theDisk->innerRadius();}
ReferenceCountingPointer< BoundDisk > theDisk
void ForwardDetLayer::setSurface ( BoundDisk cp)
protected

Definition at line 20 of file ForwardDetLayer.cc.

References CommonMethods::cp(), and theDisk.

Referenced by initialize(), MuRingForwardDoubleLayer::MuRingForwardDoubleLayer(), MuRingForwardLayer::MuRingForwardLayer(), and TECLayer::TECLayer().

20  {
21  theDisk = cp;
22 }
ReferenceCountingPointer< BoundDisk > theDisk
virtual const BoundDisk& ForwardDetLayer::specificSurface ( ) const
inlinevirtual
virtual const BoundSurface& ForwardDetLayer::surface ( ) const
inlinevirtual
float ForwardDetLayer::zmax ( ) const
inlineprotected

Definition at line 50 of file ForwardDetLayer.h.

References theDisk.

Referenced by compatible(), MuRingForwardDoubleLayer::compatible(), TECLayer::computeDisk(), and MuRingForwardDoubleLayer::computeSurface().

50 { return (theDisk->position().z() + theDisk->bounds().thickness()/2);}
ReferenceCountingPointer< BoundDisk > theDisk
float ForwardDetLayer::zmin ( ) const
inlineprotected

Definition at line 49 of file ForwardDetLayer.h.

References theDisk.

Referenced by compatible(), MuRingForwardDoubleLayer::compatible(), TECLayer::computeDisk(), and MuRingForwardDoubleLayer::computeSurface().

49 { return (theDisk->position().z() - theDisk->bounds().thickness()/2);}
ReferenceCountingPointer< BoundDisk > theDisk

Member Data Documentation

ReferenceCountingPointer<BoundDisk> ForwardDetLayer::theDisk
private

Definition at line 58 of file ForwardDetLayer.h.

Referenced by compatible(), rmax(), rmin(), setSurface(), specificSurface(), surface(), zmax(), and zmin().