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< T, TOPO > GCC11_FINAL< T, TOPO > RingedForwardLayer TECLayer GCC11_FINAL< T, TOPO > 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 GCC11_FINAL
 Which part of the detector (barrel, endcap) More...
 
virtual const BoundDiskspecificSurface () const GCC11_FINAL
 
virtual const BoundSurfacesurface () const GCC11_FINAL
 The surface of the GeometricSearchDet. More...
 
virtual ~ForwardDetLayer ()
 
- Public Member Functions inherited from DetLayer
template<typename... Args>
std::vector< const DetLayer * > compatibleLayers (Args &&...args) const
 Returns all layers compatible. More...
 
 DetLayer (bool ibar)
 
bool isBarrel () const
 
bool isForward () const
 
NavigableLayernavigableLayer () const
 Return the NavigableLayer associated with this DetLayer. More...
 
template<typename... Args>
std::vector< const DetLayer * > nextLayers (Args &&...args) const
 
int seqNum () const
 
void setNavigableLayer (NavigableLayer *nlp)
 Set the NavigableLayer associated with this DetLayer. More...
 
void setSeqNum (int sq)
 
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 ( )
inline

Definition at line 23 of file ForwardDetLayer.h.

23 : DetLayer(false), theDisk(0){}
ReferenceCountingPointer< BoundDisk > theDisk
DetLayer(bool ibar)
Definition: DetLayer.h:30
ForwardDetLayer::~ForwardDetLayer ( )
virtual

Definition at line 10 of file ForwardDetLayer.cc.

10  {
11 }

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< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, and GCC11_FINAL< T, TOPO >.

Definition at line 104 of file ForwardDetLayer.cc.

References abs, deltaR(), TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), PV3DBase< T, PVType, FrameType >::perp(), LocalTrajectoryError::positionError(), Propagator::propagate(), mathSSE::sqrt(), tmp, unlikely, LocalError::xx(), LocalError::yy(), PV3DBase< T, PVType, FrameType >::z(), SiStripMonitorClusterAlca_cfi::zmax, SiStripMonitorClusterAlca_cfi::zmin, and zPos.

Referenced by MuRingForwardLayer::compatibleDets().

107 {
108  if unlikely(theDisk == 0) edm::LogError("DetLayers")
109  << "ERROR: BarrelDetLayer::compatible() is used before the layer surface is initialized" ;
110  // throw an exception? which one?
111 
112  TrajectoryStateOnSurface myState = prop.propagate( ts, specificSurface());
113  if unlikely( !myState.isValid()) return make_pair( false, myState);
114 
115  // take into account the thickness of the layer
116  float deltaR = 0.5f*surface().bounds().thickness() *
117  myState.localDirection().perp()/std::abs(myState.localDirection().z());
118 
119  // take into account the error on the predicted state
120  const float nSigma = 3.;
121  if (myState.hasError()) {
122  LocalError err = myState.localError().positionError();
123  // ignore correlation for the moment...
124  deltaR += nSigma * sqrt(err.xx() + err.yy());
125  }
126 
127  float zPos = 0.5f*(zmax()+zmin());
129  zmin()-zPos, zmax()-zPos);
130 
131  return make_pair( tmp.inside(myState.localPosition()), myState);
132 }
float xx() const
Definition: LocalError.h:24
double zPos
float rmin() const
#define abs(x)
Definition: mlp_lapack.h:159
float zmin() const
float float float z
#define unlikely(x)
Definition: Likely.h:21
float yy() const
Definition: LocalError.h:26
virtual const BoundSurface & surface() const GCC11_FINAL
The surface of the GeometricSearchDet.
T sqrt(T t)
Definition: SSEVec.h:48
double f[11][100]
ReferenceCountingPointer< BoundDisk > theDisk
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
float zmax() const
string const
Definition: compareJSON.py:14
virtual const BoundDisk & specificSurface() const GCC11_FINAL
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
T perp() const
Magnitude of transverse component.
if(dp >Float(M_PI)) dp-
float rmax() const
static const int ERROR
BoundDisk * ForwardDetLayer::computeSurface ( )
protectedvirtual

Reimplemented in MuRingForwardDoubleLayer.

Definition at line 29 of file ForwardDetLayer.cc.

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

29  {
30  LogDebug("DetLayers") << "ForwaLayer::computeSurface callded" ;
31  vector<const GeomDet*> comps= basicComponents();
32 
33  vector<const GeomDet*>::const_iterator ifirst = comps.begin();
34  vector<const GeomDet*>::const_iterator ilast = comps.end();
35 
36  // Find extension in R
37  float theRmin = components().front()->position().perp();
38  float theRmax = theRmin;
39  float theZmin = components().back()->position().z();
40  float theZmax = theZmin;
41  for ( vector<const GeomDet*>::const_iterator deti = ifirst;
42  deti != ilast; deti++) {
43  vector<GlobalPoint> corners =
44  BoundingBox().corners( dynamic_cast<const Plane&>((**deti).surface()));
45  for (vector<GlobalPoint>::const_iterator ic = corners.begin();
46  ic != corners.end(); ic++) {
47  float r = ic->perp();
48  LogDebug("DetLayers") << "corner.perp(): " << r ;
49  float z = ic->z();
50  theRmin = min( theRmin, r);
51  theRmax = max( theRmax, r);
52  theZmin = min( theZmin, z);
53  theZmax = max( theZmax, z);
54  }
55 
56  // in addition to the corners we have to check the middle of the
57  // det +/- length/2
58  // , since the min (max) radius for typical fw dets is reached there
59 
60  float rdet = (**deti).position().perp();
61  float len = (**deti).surface().bounds().length();
62  float width = (**deti).surface().bounds().width();
63 
64  GlobalVector xAxis = (**deti).toGlobal(LocalVector(1,0,0));
65  GlobalVector yAxis = (**deti).toGlobal(LocalVector(0,1,0));
66  GlobalVector perpDir = GlobalVector( (**deti).position() - GlobalPoint(0,0,(**deti).position().z()) );
67 
68  double xAxisCos = xAxis.unit().dot(perpDir.unit());
69  double yAxisCos = yAxis.unit().dot(perpDir.unit());
70 
71  LogDebug("DetLayers") << "in ForwardDetLayer::computeSurface(),xAxisCos,yAxisCos: " << xAxisCos << " , " << yAxisCos ;
72  LogDebug("DetLayers") << "det pos.perp,length,width: "
73  << rdet << " , "
74  << len << " , "
75  << width ;
76 
77  if( fabs(xAxisCos) > fabs(yAxisCos) ) {
78  theRmin = min( theRmin, rdet-width/2.F);
79  theRmax = max( theRmax, rdet+width/2.F);
80  }else{
81  theRmin = min( theRmin, rdet-len/2.F);
82  theRmax = max( theRmax, rdet+len/2.F);
83  }
84  }
85 
86 
87  LogDebug("DetLayers") << "creating SimpleDiskBounds with r range" << theRmin << " "
88  << theRmax << " and z range " << theZmin << " " << theZmax ;
89 
90  // By default the forward layers are positioned around the z axis of the
91  // global frame, and the axes of their local frame coincide with
92  // those of the global grame (z along the disk axis)
93  float zPos = (theZmax+theZmin)/2.;
94  PositionType pos(0.,0.,zPos);
96 
97  return new BoundDisk( pos, rot,
98  new SimpleDiskBounds( theRmin, theRmax,
99  theZmin-zPos, theZmax-zPos));
100 }
#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
float float float z
const T & max(const T &a, const T &b)
Vector3DBase unit() const
Definition: Vector3DBase.h:57
Disk BoundDisk
Definition: BoundDisk.h:64
static std::vector< GlobalPoint > corners(const Plane &)
Definition: BoundingBox.cc:24
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 19 of file ForwardDetLayer.cc.

19  {
20  return surface().bounds().inside(p);
21 }
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
const Bounds & bounds() const
Definition: Surface.h:128
virtual const BoundSurface & surface() const GCC11_FINAL
The surface of the GeometricSearchDet.
void ForwardDetLayer::initialize ( )
protectedvirtual

Definition at line 24 of file ForwardDetLayer.cc.

24  {
26 }
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 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 MuRingForwardDoubleLayer::compatible(), TECLayer::computeDisk(), and MuRingForwardDoubleLayer::computeSurface().

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

Definition at line 15 of file ForwardDetLayer.cc.

References CommonMethods::cp().

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

15  {
16  theDisk = cp;
17 }
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 MuRingForwardDoubleLayer::compatible(), TECLayer::computeDisk(), and MuRingForwardDoubleLayer::computeSurface().

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

Definition at line 49 of file ForwardDetLayer.h.

References theDisk.

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

49 { return (theDisk->position().z() - theDisk->bounds().thickness()*0.5f);}
ReferenceCountingPointer< BoundDisk > theDisk

Member Data Documentation

ReferenceCountingPointer<BoundDisk> ForwardDetLayer::theDisk
private

Definition at line 57 of file ForwardDetLayer.h.

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