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 PixelForwardLayer PixelForwardLayerPhase1 TECLayer

Public Member Functions

virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
 
bool contains (const Local3DPoint &p) const
 
 ForwardDetLayer (bool doHaveGroups)
 
virtual Location location () const final
 Which part of the detector (barrel, endcap) More...
 
virtual const BoundDiskspecificSurface () const final
 
virtual const BoundSurfacesurface () const final
 The surface of the GeometricSearchDet. More...
 
virtual ~ForwardDetLayer ()
 
- Public Member Functions inherited from DetLayer
 DetLayer (bool doHaveGroup, bool ibar)
 
bool isBarrel () const
 
bool isForward () const
 
int seqNum () const
 
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 (bool doHaveGroups)
 
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
 
bool hasGroups () const
 
virtual const
Surface::PositionType
position () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Protected Member Functions

SimpleDiskBounds const & bounds () const
 
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
bool haveGroups
 
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 23 of file ForwardDetLayer.h.

Constructor & Destructor Documentation

ForwardDetLayer::ForwardDetLayer ( bool  doHaveGroups)
inline

Definition at line 26 of file ForwardDetLayer.h.

26 : DetLayer(doHaveGroups,false) {}
DetLayer(bool doHaveGroup, bool ibar)
Definition: DetLayer.h:27
ForwardDetLayer::~ForwardDetLayer ( )
virtual

Definition at line 10 of file ForwardDetLayer.cc.

10  {
11 }

Member Function Documentation

SimpleDiskBounds const& ForwardDetLayer::bounds ( ) const
inlineprotected

Definition at line 58 of file ForwardDetLayer.h.

References theDisk.

Referenced by zmax(), and zmin().

58 { return static_cast<SimpleDiskBounds const &>(theDisk->bounds());}
ReferenceCountingPointer< BoundDisk > theDisk
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.

Definition at line 104 of file ForwardDetLayer.cc.

References funct::abs(), deltaR(), f, TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), bookConverter::max, HLT_25ns10e33_v2_cff::nSigma, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::perp2(), LocalTrajectoryError::positionError(), Propagator::propagate(), diffTwoXMLs::r2, mathSSE::sqrt(), unlikely, LocalError::xx(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

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 
116  // check z; (are we sure?????)
117  // auto z = myState.localPosition().z();
118  // if ( z<bounds().minZ | z>bounds().maxZ) return make_pair( false, myState);
119 
120  // check r
121  auto r2 = myState.localPosition().perp2();
122  if ( (r2 > rmin()*rmin()) & (r2< rmax()*rmax()) ) return make_pair( true, myState);
123 
124 
125  // take into account the thickness of the layer
126  float deltaR = 0.5f*bounds().thickness() *
127  myState.localDirection().perp()/std::abs(myState.localDirection().z());
128 
129  // and take into account the error on the predicted state
130  const float nSigma = 3.;
131  if (myState.hasError()) {
132  LocalError err = myState.localError().positionError();
133  // ignore correlation for the moment...
134  deltaR += nSigma * sqrt(err.xx() + err.yy());
135  }
136 
137  // check r again;
138  auto ri2 = std::max(rmin()-deltaR,0.f); ri2*=ri2;
139  auto ro2 = rmax()+deltaR; ro2*=ro2;
140  return make_pair( (r2>ri2) & (r2<ro2), myState);
141 }
float xx() const
Definition: LocalError.h:24
SimpleDiskBounds const & bounds() const
float rmin() const
#define unlikely(x)
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
ReferenceCountingPointer< BoundDisk > theDisk
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
T perp2() const
Squared magnitude of transverse component.
string const
Definition: compareJSON.py:14
virtual const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
return(e1-e2)*(e1-e2)+dp *dp
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
T perp() const
Magnitude of transverse component.
if(dp >Float(M_PI)) dp-
float rmax() const
virtual const BoundDisk & specificSurface() const final
volatile std::atomic< bool > shutdown_flag false
static const int ERROR
BoundDisk * ForwardDetLayer::computeSurface ( )
protectedvirtual

Definition at line 29 of file ForwardDetLayer.cc.

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

Referenced by PixelForwardLayer::PixelForwardLayer(), and PixelForwardLayerPhase1::PixelForwardLayerPhase1().

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
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.
T min(T a, T b)
Definition: MathUtil.h:58
Vector3DBase unit() const
Definition: Vector3DBase.h:57
Disk BoundDisk
Definition: BoundDisk.h:62
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:120
virtual const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
void ForwardDetLayer::initialize ( void  )
protectedvirtual

Definition at line 24 of file ForwardDetLayer.cc.

24  {
26 }
virtual BoundDisk * computeSurface()
void setSurface(BoundDisk *cp)
virtual Location ForwardDetLayer::location ( ) const
inlinefinalvirtual

Which part of the detector (barrel, endcap)

Implements DetLayer.

Definition at line 38 of file ForwardDetLayer.h.

References GeomDetEnumerators::endcap.

float ForwardDetLayer::rmax ( ) const
inlineprotected

Definition at line 51 of file ForwardDetLayer.h.

References theDisk.

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

Definition at line 50 of file ForwardDetLayer.h.

References theDisk.

50 { 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 PixelForwardLayer::PixelForwardLayer(), PixelForwardLayerPhase1::PixelForwardLayerPhase1(), and TECLayer::TECLayer().

15  {
16  theDisk = cp;
17 }
ReferenceCountingPointer< BoundDisk > theDisk
virtual const BoundDisk& ForwardDetLayer::specificSurface ( ) const
inlinefinalvirtual
virtual const BoundSurface& ForwardDetLayer::surface ( ) const
inlinefinalvirtual
float ForwardDetLayer::zmax ( ) const
inlineprotected

Definition at line 53 of file ForwardDetLayer.h.

References bounds(), theDisk, and SimpleDiskBounds::thickness().

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

Definition at line 52 of file ForwardDetLayer.h.

References bounds(), theDisk, and SimpleDiskBounds::thickness().

52 { return (theDisk->position().z() - bounds().thickness()*0.5f);}
SimpleDiskBounds const & bounds() const
ReferenceCountingPointer< BoundDisk > theDisk
virtual float thickness() const

Member Data Documentation

ReferenceCountingPointer<BoundDisk> ForwardDetLayer::theDisk
private

Definition at line 61 of file ForwardDetLayer.h.

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