Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:29

0001 #include "TrackingTools/GeomPropagators/interface/TrackerBounds.h"
0002 
0003 #include "DataFormats/GeometrySurface/interface/BoundCylinder.h"
0004 #include "DataFormats/GeometrySurface/interface/BoundDisk.h"
0005 #include "DataFormats/GeometrySurface/interface/SimpleCylinderBounds.h"
0006 #include "DataFormats/GeometrySurface/interface/SimpleDiskBounds.h"
0007 
0008 //Ported from ORCA
0009 
0010 static const float epsilon = 0.001;  // should not matter at all
0011 
0012 static Cylinder* initCylinder() {
0013   Surface::RotationType rot;  // unit rotation matrix
0014   auto cb = new SimpleCylinderBounds(TrackerBounds::radius() - epsilon,
0015                                      TrackerBounds::radius() + epsilon,
0016                                      -TrackerBounds::halfLength(),
0017                                      TrackerBounds::halfLength());
0018   return new Cylinder(Cylinder::computeRadius(*cb), Surface::PositionType(0, 0, 0), rot, cb);
0019 }
0020 
0021 static Disk* initNegative() {
0022   Surface::RotationType rot;  // unit rotation matrix
0023 
0024   return new Disk(Surface::PositionType(0, 0, -TrackerBounds::halfLength()),
0025                   rot,
0026                   new SimpleDiskBounds(0, TrackerBounds::radius(), -epsilon, epsilon));
0027 }
0028 
0029 static Disk* initPositive() {
0030   Surface::RotationType rot;  // unit rotation matrix
0031 
0032   return new Disk(Surface::PositionType(0, 0, TrackerBounds::halfLength()),
0033                   rot,
0034                   new SimpleDiskBounds(0, TrackerBounds::radius(), -epsilon, epsilon));
0035 }
0036 
0037 bool TrackerBounds::isInside(const GlobalPoint& point) {
0038   return (point.perp() <= TrackerBounds::radius() && fabs(point.z()) <= TrackerBounds::halfLength());
0039 }
0040 
0041 // static initializers
0042 
0043 const ReferenceCountingPointer<BoundCylinder> TrackerBounds::theCylinder = initCylinder();
0044 const ReferenceCountingPointer<BoundDisk> TrackerBounds::theNegativeDisk = initNegative();
0045 const ReferenceCountingPointer<BoundDisk> TrackerBounds::thePositiveDisk = initPositive();