CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/RecoTracker/TkSeedGenerator/interface/FastHelix.h

Go to the documentation of this file.
00001 #ifndef TR_FastHelix_H_
00002 #define TR_FastHelix_H_
00003 
00004 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00005 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00006 #include "RecoTracker/TkSeedGenerator/interface/FastCircle.h"
00007 #include "FWCore/Framework/interface/EventSetup.h"
00008 #include "FWCore/Framework/interface/ESHandle.h"
00009 #include "MagneticField/Engine/interface/MagneticField.h"
00010 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00011 
00028 class FastHelix {
00029 
00030 private:
00031   
00032   typedef FreeTrajectoryState FTS;
00033 
00034 public:
00035 
00036 
00037   //Original constructor (no basis vertex)
00038    FastHelix(const GlobalPoint& outerHit,
00039                 const GlobalPoint& middleHit,
00040                 const GlobalPoint& aVertex,
00041                 const edm::EventSetup& iSetup) : theOuterHit(outerHit),
00042                                                  theMiddleHit(middleHit),
00043                                                  theVertex(aVertex),
00044                                                  theCircle(outerHit,
00045                                                            middleHit,
00046                                                            aVertex) {
00047                   iSetup.get<IdealMagneticFieldRecord>().get(pSetup);
00048                   tesla0=0.1*double(pSetup->nominalValue());
00049                   maxRho = maxPt/(0.01 * 0.3*tesla0);
00050                   useBasisVertex = false;
00051                 }
00052 
00053   //New constructor (with basis vertex)
00054   FastHelix(const GlobalPoint& outerHit,
00055                 const GlobalPoint& middleHit,
00056                 const GlobalPoint& aVertex,
00057                 const edm::EventSetup& iSetup,
00058                 const GlobalPoint& bVertex) : theOuterHit(outerHit),
00059                                               theMiddleHit(middleHit),
00060                                               theVertex(aVertex),
00061                                               basisVertex(bVertex),
00062                                               theCircle(outerHit,
00063                                                         middleHit,
00064                                                         aVertex) {
00065                   iSetup.get<IdealMagneticFieldRecord>().get(pSetup);
00066                   tesla0=0.1*double(pSetup->nominalValue());
00067                   maxRho = maxPt/(0.01 * 0.3*tesla0);
00068                   useBasisVertex = true;
00069                 }
00070 
00071   ~FastHelix() {}
00072   
00073   bool isValid() const {return theCircle.isValid();}
00074 
00075   FTS stateAtVertex() const;
00076 
00077   FTS helixStateAtVertex() const;
00078 
00079   FTS straightLineStateAtVertex() const;
00080 
00081   const FastCircle & circle() const { return theCircle; }
00082 
00083 private:
00084 
00085   static constexpr double maxPt = 10000; // 10Tev
00086 
00087   GlobalPoint theOuterHit;
00088   GlobalPoint theMiddleHit;
00089   GlobalPoint theVertex;
00090   GlobalPoint basisVertex;
00091   FastCircle theCircle;
00092   edm::ESHandle<MagneticField> pSetup;
00093   double tesla0;
00094   double maxRho;
00095   bool useBasisVertex;
00096 };
00097 
00098 #endif //TR_FastHelix_H_
00099