CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/TrackingTools/GeomPropagators/src/TrackerBounds.cc

Go to the documentation of this file.
00001 #include "TrackingTools/GeomPropagators/interface/TrackerBounds.h"
00002 
00003 #include "DataFormats/GeometrySurface/interface/BoundCylinder.h"
00004 #include "DataFormats/GeometrySurface/interface/BoundDisk.h"
00005 #include "DataFormats/GeometrySurface/interface/SimpleCylinderBounds.h"
00006 #include "DataFormats/GeometrySurface/interface/SimpleDiskBounds.h"
00007 
00008 //Ported from ORCA
00009 //  $Date: 2012/12/25 14:24:26 $
00010 //  $Revision: 1.4 $
00011 
00012 void TrackerBounds::initialize() 
00013 {
00014   const float epsilon = 0.001; // should not matter at all
00015 
00016   Surface::RotationType rot; // unit rotation matrix
00017   auto cb = new SimpleCylinderBounds( radius()-epsilon, 
00018                                       radius()+epsilon, 
00019                                       -halfLength(),  halfLength()
00020                                      );
00021 
00022  theCylinder = new Cylinder(Cylinder::computeRadius(*cb), Surface::PositionType(0,0,0), rot, cb);
00023 
00024 
00025   theNegativeDisk = 
00026     new Disk( Surface::PositionType( 0, 0, -halfLength()), rot, 
00027                    new SimpleDiskBounds( 0, radius(), -epsilon, epsilon));
00028 
00029   thePositiveDisk = 
00030     new Disk( Surface::PositionType( 0, 0, halfLength()), rot, 
00031                    new SimpleDiskBounds( 0, radius(), -epsilon, epsilon));
00032 
00033 
00034   theInit = true;
00035 }
00036 
00037 bool TrackerBounds::isInside(const GlobalPoint &point){
00038   return (point.perp() <= radius() &&
00039           fabs(point.z()) <= halfLength());
00040 }
00041 
00042 
00043 // static initializers
00044 
00045 ReferenceCountingPointer<BoundCylinder>  TrackerBounds::theCylinder = 0;
00046 ReferenceCountingPointer<BoundDisk>      TrackerBounds::theNegativeDisk = 0;
00047 ReferenceCountingPointer<BoundDisk>      TrackerBounds::thePositiveDisk = 0;
00048 
00049 bool TrackerBounds::theInit = false;
00050 
00051