Go to the documentation of this file.00001 #include "RecoTracker/TkSeedingLayers/interface/SeedingLayer.h"
00002 #include "HitExtractor.h"
00003
00004
00005 using namespace ctfseeding;
00006 using namespace std;
00007
00008
00009 class SeedingLayer::SeedingLayerImpl {
00010 public:
00011 SeedingLayerImpl(
00012 const std::string & name,
00013 const DetLayer* layer,
00014 const TransientTrackingRecHitBuilder * hitBuilder,
00015 const HitExtractor * hitExtractor)
00016 : theName(name),
00017 theLayer(layer),
00018 theTTRHBuilder(hitBuilder),
00019 theHitExtractor(hitExtractor),
00020 theHasPredefinedHitErrors(false),thePredefinedHitErrorRZ(0.),thePredefinedHitErrorRPhi(0.) { }
00021
00022 SeedingLayerImpl(
00023 const string & name,
00024 const DetLayer* layer,
00025 const TransientTrackingRecHitBuilder * hitBuilder,
00026 const HitExtractor * hitExtractor,
00027 float hitErrorRZ, float hitErrorRPhi)
00028 : theName(name), theLayer(layer),
00029 theTTRHBuilder(hitBuilder), theHitExtractor(hitExtractor),
00030 theHasPredefinedHitErrors(true),
00031 thePredefinedHitErrorRZ(hitErrorRZ), thePredefinedHitErrorRPhi(hitErrorRPhi) { }
00032
00033 ~SeedingLayerImpl() { delete theHitExtractor; }
00034
00035 SeedingLayer::Hits hits(const SeedingLayer &sl, const edm::Event& ev,
00036 const edm::EventSetup& es) const { return theHitExtractor->hits(sl,ev,es); }
00037
00038 std::string name() const { return theName; }
00039
00040 const DetLayer* detLayer() const { return theLayer; }
00041 const TransientTrackingRecHitBuilder * hitBuilder() const { return theTTRHBuilder; }
00042
00043 bool hasPredefinedHitErrors() const { return theHasPredefinedHitErrors; }
00044 float predefinedHitErrorRZ() const { return thePredefinedHitErrorRZ; }
00045 float predefinedHitErrorRPhi() const { return thePredefinedHitErrorRPhi; }
00046
00047 private:
00048 SeedingLayerImpl(const SeedingLayerImpl &);
00049
00050 private:
00051 std::string theName;
00052 const DetLayer* theLayer;
00053 const TransientTrackingRecHitBuilder *theTTRHBuilder;
00054 const HitExtractor * theHitExtractor;
00055 bool theHasPredefinedHitErrors;
00056 float thePredefinedHitErrorRZ, thePredefinedHitErrorRPhi;
00057 };
00058
00059
00060
00061
00062 SeedingLayer::SeedingLayer(
00063 const std::string & name,
00064 const DetLayer* layer,
00065 const TransientTrackingRecHitBuilder * hitBuilder,
00066 const HitExtractor * hitExtractor,
00067 bool usePredefinedErrors, float hitErrorRZ, float hitErrorRPhi)
00068 {
00069 SeedingLayerImpl * l = usePredefinedErrors ?
00070 new SeedingLayerImpl(name,layer,hitBuilder,hitExtractor,hitErrorRZ,hitErrorRPhi)
00071 : new SeedingLayerImpl(name,layer,hitBuilder,hitExtractor);
00072 theImpl = boost::shared_ptr<SeedingLayerImpl> (l);
00073 }
00074
00075 std::string SeedingLayer::name() const
00076 {
00077 return theImpl->name();
00078 }
00079
00080 const DetLayer* SeedingLayer::detLayer() const
00081 {
00082 return theImpl->detLayer();
00083 }
00084
00085 const TransientTrackingRecHitBuilder * SeedingLayer::hitBuilder() const
00086 {
00087 return theImpl->hitBuilder();
00088 }
00089
00090 SeedingLayer::Hits SeedingLayer::hits(const edm::Event& ev, const edm::EventSetup& es) const
00091 {
00092 return theImpl->hits( *this,ev,es);
00093 }
00094
00095 bool SeedingLayer::hasPredefinedHitErrors() const
00096 {
00097 return theImpl->hasPredefinedHitErrors();
00098 }
00099
00100 float SeedingLayer::predefinedHitErrorRZ() const
00101 {
00102 return theImpl->predefinedHitErrorRZ();
00103 }
00104
00105 float SeedingLayer::predefinedHitErrorRPhi() const
00106 {
00107 return theImpl->predefinedHitErrorRPhi();
00108 }