File indexing completed on 2023-03-31 23:02:19
0001 #include "RecoTracker/PixelSeeding/interface/ThirdHitRZPredictionBase.h"
0002 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0003 #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h"
0004 #include "TrackingTools/DetLayers/interface/ForwardDetLayer.h"
0005 #include "TrackingTools/DetLayers/interface/DetLayer.h"
0006 #include "DataFormats/GeometrySurface/interface/SimpleDiskBounds.h"
0007 #include "RecoTracker/TkMSParametrization/interface/MultipleScatteringParametrisation.h"
0008
0009 ThirdHitRZPredictionBase::ThirdHitRZPredictionBase() : theBarrel(false), theForward(false), theTolerance(0., 0.) {}
0010
0011 ThirdHitRZPredictionBase::ThirdHitRZPredictionBase(float tolerance, const DetLayer* layer)
0012 : theBarrel(false), theForward(false), theTolerance(tolerance, tolerance) {
0013 if (layer)
0014 initLayer(layer);
0015 }
0016
0017 void ThirdHitRZPredictionBase::initLayer(const DetLayer* layer) {
0018 if (layer->location() == GeomDetEnumerators::barrel) {
0019 theBarrel = true;
0020 theForward = false;
0021 const BarrelDetLayer& bl = reinterpret_cast<const BarrelDetLayer&>(*layer);
0022 float halfThickness = bl.surface().bounds().thickness() / 2;
0023 float radius = bl.specificSurface().radius();
0024 theDetRange = Range(radius - halfThickness, radius + halfThickness);
0025 float maxZ = bl.surface().bounds().length() / 2;
0026 theDetSize = Range(-maxZ, maxZ);
0027 } else if (layer->location() == GeomDetEnumerators::endcap) {
0028 theBarrel = false;
0029 theForward = true;
0030 const ForwardDetLayer& fl = reinterpret_cast<const ForwardDetLayer&>(*layer);
0031 float halfThickness = fl.surface().bounds().thickness() / 2;
0032 float zLayer = fl.position().z();
0033 theDetRange = Range(zLayer - halfThickness, zLayer + halfThickness);
0034 const SimpleDiskBounds& diskRadialBounds = static_cast<const SimpleDiskBounds&>(fl.surface().bounds());
0035 theDetSize = Range(diskRadialBounds.innerRadius(), diskRadialBounds.outerRadius());
0036 } else {
0037 theBarrel = theForward = false;
0038 }
0039 }