CMS 3D CMS Logo

CAHitTripletGenerator.h
Go to the documentation of this file.
1 #ifndef RECOPIXELVERTEXING_PIXELTRIPLETS_CAHITTRIPLETGENERATOR_H
2 #define RECOPIXELVERTEXING_PIXELTRIPLETS_CAHITTRIPLETGENERATOR_H
3 
7 
11 
16 
18 
20 class TrackingRegion;
22 
23 namespace edm {
24  class Event;
25  class EventSetup;
27 }
28 
30 public:
32 
33  static constexpr unsigned int minLayers = 3;
35 public:
36 
39 
40  ~CAHitTripletGenerator() = default;
41 
43  static const char *fillDescriptionsLabel() { return "caHitTriplet"; }
44 
45  void initEvent(const edm::Event& ev, const edm::EventSetup& es);
46 
47  void hitNtuplets(const IntermediateHitDoublets& regionDoublets,
48  std::vector<OrderedHitSeeds>& result,
49  const edm::EventSetup& es,
51 
52 private:
53  LayerCacheType theLayerCache;
54 
55  std::unique_ptr<SeedComparitor> theComparitor;
56 
58  public:
59 
60  QuantityDependsPtEval(float v1, float v2, float c1, float c2) :
61  value1_(v1), value2_(v2), curvature1_(c1), curvature2_(c2) {
62  }
63 
64  float value(float curvature) const {
65  if (value1_ == value2_) // not enabled
66  return value1_;
67 
68  if (curvature1_ < curvature)
69  return value1_;
70  if (curvature2_ < curvature && curvature <= curvature1_)
71  return value2_ + (curvature - curvature2_) / (curvature1_ - curvature2_) * (value1_ - value2_);
72  return value2_;
73  }
74 
75  private:
76  const float value1_;
77  const float value2_;
78  const float curvature1_;
79  const float curvature2_;
80  };
81 
82  // Linear interpolation (in curvature) between value1 at pt1 and
83  // value2 at pt2. If disabled, value2 is given (the point is to
84  // allow larger/smaller values of the quantity at low pt, so it
85  // makes more sense to have the high-pt value as the default).
86 
88  public:
89 
91  value1_(pset.getParameter<double>("value1")),
92  value2_(pset.getParameter<double>("value2")),
93  pt1_(pset.getParameter<double>("pt1")),
94  pt2_(pset.getParameter<double>("pt2")),
95  enabled_(pset.getParameter<bool>("enabled")) {
96  if (enabled_ && pt1_ >= pt2_)
97  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt1 (" << pt1_ << ") needs to be smaller than pt2 (" << pt2_ << ")";
98  if (pt1_ <= 0)
99  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt1 needs to be > 0; is " << pt1_;
100  if (pt2_ <= 0)
101  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt2 needs to be > 0; is " << pt2_;
102  }
103 
105  if (enabled_) {
106  return QuantityDependsPtEval(value1_, value2_,
107  PixelRecoUtilities::curvature(1.f / pt1_, es),
108  PixelRecoUtilities::curvature(1.f / pt2_, es));
109  }
110  return QuantityDependsPtEval(value2_, value2_, 0.f, 0.f);
111  }
112 
113  private:
114  const float value1_;
115  const float value2_;
116  const float pt1_;
117  const float pt2_;
118  const bool enabled_;
119  };
120 
122 
125 
126  const float caThetaCut = 0.00125f;
127  const float caPhiCut = 1.f;
128  const float caHardPtCut = 0.f;
129 };
130 
131 
132 
133 
134 #endif
QuantityDependsPt(const edm::ParameterSet &pset)
const QuantityDependsPt maxChi2
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
static const char * fillDescriptionsLabel()
bool ev
#define constexpr
CAHitTripletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
QuantityDependsPtEval evaluator(const edm::EventSetup &es) const
T curvature(T InversePt, const edm::EventSetup &iSetup)
LayerHitMapCache LayerCacheType
double f[11][100]
QuantityDependsPtEval(float v1, float v2, float c1, float c2)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HLT enums.
std::unique_ptr< SeedComparitor > theComparitor