CMS 3D CMS Logo

BarrelDetLayer.cc
Go to the documentation of this file.
8 
9 using namespace std;
10 
12 
13 //--- Extension of the interface
14 void BarrelDetLayer::setSurface(BoundCylinder* cp) { theCylinder = cp; }
15 
16 bool BarrelDetLayer::contains(const Local3DPoint& p) const { return surface().bounds().inside(p); }
17 
18 void BarrelDetLayer::initialize() { setSurface(computeSurface()); }
19 
20 //--- protected methods
22  vector<const GeomDet*> comps = basicComponents();
23 
24  // Find extension in Z
25  float theRmin = comps.front()->position().perp();
26  float theRmax = theRmin;
27  float theZmin = comps.front()->position().z();
28  float theZmax = theZmin;
29  for (vector<const GeomDet*>::const_iterator deti = comps.begin(); deti != comps.end(); deti++) {
30  vector<GlobalPoint> corners = BoundingBox().corners(dynamic_cast<const Plane&>((*deti)->surface()));
31  for (vector<GlobalPoint>::const_iterator ic = corners.begin(); ic != corners.end(); ic++) {
32  float r = ic->perp();
33  float z = ic->z();
34  theRmin = min(theRmin, r);
35  theRmax = max(theRmax, r);
36  theZmin = min(theZmin, z);
37  theZmax = max(theZmax, z);
38  }
39  // in addition to the corners we have to check the middle of the
40  // det +/- thickness/2
41  // , since the min radius for some barrel dets is reached there
42  float rdet = (**deti).position().perp();
43  float thick = (**deti).surface().bounds().thickness();
44  theRmin = min(theRmin, rdet - thick / 2.F);
45  theRmax = max(theRmax, rdet + thick / 2.F);
46  }
47 
48  // By default the barrel layers are positioned at the center of the
49  // global frame, and the axes of their local frame coincide with
50  // those of the global grame (z along the cylinder axis)
51  PositionType pos(0., 0., 0.);
53 
54  auto scp = new SimpleCylinderBounds(theRmin, theRmax, theZmin, theZmax);
55  return new Cylinder(Cylinder::computeRadius(*scp), pos, rot, scp);
56 }
57 
58 pair<bool, TrajectoryStateOnSurface> BarrelDetLayer::compatible(const TrajectoryStateOnSurface& ts,
59  const Propagator& prop,
60  const MeasurementEstimator&) const {
61  if
62  UNLIKELY(theCylinder == nullptr)
63  edm::LogError("DetLayers") << "ERROR: BarrelDetLayer::compatible() is used before the layer surface is initialized";
64  // throw an exception? which one?
65 
66  TrajectoryStateOnSurface myState = prop.propagate(ts, specificSurface());
67  if
68  UNLIKELY(!myState.isValid()) return make_pair(false, myState);
69 
70  // check z assuming symmetric bounds around position().z()
71  auto z0 = std::abs(myState.globalPosition().z() - specificSurface().position().z());
72  auto deltaZ = 0.5f * bounds().length();
73  if (z0 < deltaZ)
74  return make_pair(true, myState);
75 
76  // take into account the thickness of the layer
77  deltaZ += 0.5f * bounds().thickness() * std::abs(myState.globalDirection().z()) / myState.globalDirection().perp();
78 
79  // take also into account the error on the predicted state
80  const float nSigma = 3.;
81  if (myState.hasError())
82  deltaZ += nSigma * sqrt(myState.cartesianError().position().czz());
83  //
84  // check z again
85  return make_pair(z0 < deltaZ, myState);
86 }
Likely.h
TrajectoryStateOnSurface::globalDirection
GlobalVector globalDirection() const
Definition: TrajectoryStateOnSurface.h:67
MeasurementEstimator
Definition: MeasurementEstimator.h:19
TkRotation< float >
BarrelDetLayer::computeSurface
virtual BoundCylinder * computeSurface()
Definition: BarrelDetLayer.cc:21
TrajectoryStateOnSurface.h
MessageLogger.h
TrajectoryStateOnSurface::cartesianError
const CartesianTrajectoryError cartesianError() const
Definition: TrajectoryStateOnSurface.h:71
min
T min(T a, T b)
Definition: MathUtil.h:58
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
pos
Definition: PixelAliasList.h:18
BarrelDetLayer::~BarrelDetLayer
~BarrelDetLayer() override
Definition: BarrelDetLayer.cc:11
SimpleCylinderBounds.h
BarrelDetLayer::initialize
virtual void initialize()
Definition: BarrelDetLayer.cc:18
BoundingBox.h
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
SimpleCylinderBounds
Definition: SimpleCylinderBounds.h:19
Propagator
Definition: Propagator.h:44
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
BoundingBox
Definition: BoundingBox.h:12
BarrelDetLayer::compatible
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const final
Definition: BarrelDetLayer.cc:58
Surface.h
TrajectoryStateOnSurface::hasError
bool hasError() const
Definition: TrajectoryStateOnSurface.h:56
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
BarrelDetLayer::contains
bool contains(const Local3DPoint &p) const
Definition: BarrelDetLayer.cc:16
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
Point3DBase< float, LocalTag >
edm::LogError
Definition: MessageLogger.h:183
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
BarrelDetLayer.h
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
alignCSCRings.r
r
Definition: alignCSCRings.py:93
std
Definition: JetResolutionObject.h:76
BarrelDetLayer::setSurface
void setSurface(BoundCylinder *cp)
Definition: BarrelDetLayer.cc:14
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
BoundingBox::corners
static std::vector< GlobalPoint > corners(const Plane &)
Definition: BoundingBox.cc:20
BoundCylinder
GlobalErrorBase::czz
T czz() const
Definition: GlobalErrorBase.h:107
Cylinder::computeRadius
static float computeRadius(Bounds const &bounds)
Definition: Cylinder.h:28
Cylinder
Definition: Cylinder.h:19
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CommonMethods.cp
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)
Definition: CommonMethods.py:192
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
CartesianTrajectoryError::position
const GlobalError position() const
Position error submatrix.
Definition: CartesianTrajectoryError.h:41
HLTSiStripMonitoring_cff.nSigma
nSigma
Definition: HLTSiStripMonitoring_cff.py:151
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54