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 } // namespace edm
28 
30 public:
32 
33  static constexpr unsigned int minLayers = 3;
35 
36 public:
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  QuantityDependsPtEval(float v1, float v2, float c1, float c2)
60  : value1_(v1), value2_(v2), curvature1_(c1), curvature2_(c2) {}
61 
62  float value(float curvature) const {
63  if (value1_ == value2_) // not enabled
64  return value1_;
65 
66  if (curvature1_ < curvature)
67  return value1_;
68  if (curvature2_ < curvature && curvature <= curvature1_)
69  return value2_ + (curvature - curvature2_) / (curvature1_ - curvature2_) * (value1_ - value2_);
70  return value2_;
71  }
72 
73  private:
74  const float value1_;
75  const float value2_;
76  const float curvature1_;
77  const float curvature2_;
78  };
79 
80  // Linear interpolation (in curvature) between value1 at pt1 and
81  // value2 at pt2. If disabled, value2 is given (the point is to
82  // allow larger/smaller values of the quantity at low pt, so it
83  // makes more sense to have the high-pt value as the default).
84 
86  public:
88  : value1_(pset.getParameter<double>("value1")),
89  value2_(pset.getParameter<double>("value2")),
90  pt1_(pset.getParameter<double>("pt1")),
91  pt2_(pset.getParameter<double>("pt2")),
92  enabled_(pset.getParameter<bool>("enabled")) {
93  if (enabled_ && pt1_ >= pt2_)
94  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt1 (" << pt1_
95  << ") needs to be smaller than pt2 (" << pt2_ << ")";
96  if (pt1_ <= 0)
97  throw cms::Exception("Configuration")
98  << "CAHitTripletGenerator::QuantityDependsPt: pt1 needs to be > 0; is " << pt1_;
99  if (pt2_ <= 0)
100  throw cms::Exception("Configuration")
101  << "CAHitTripletGenerator::QuantityDependsPt: pt2 needs to be > 0; is " << pt2_;
102  }
103 
105  if (enabled_) {
106  return QuantityDependsPtEval(value1_,
107  value2_,
108  PixelRecoUtilities::curvature(1.f / pt1_, es),
109  PixelRecoUtilities::curvature(1.f / pt2_, es));
110  }
111  return QuantityDependsPtEval(value2_, value2_, 0.f, 0.f);
112  }
113 
114  private:
115  const float value1_;
116  const float value2_;
117  const float pt1_;
118  const float pt2_;
119  const bool enabled_;
120  };
121 
123 
126 
127  const float caThetaCut = 0.00125f;
128  const float caPhiCut = 1.f;
129  const float caHardPtCut = 0.f;
130 };
131 
132 #endif
QuantityDependsPt(const edm::ParameterSet &pset)
const QuantityDependsPt maxChi2
static const char * fillDescriptionsLabel()
bool ev
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
#define constexpr