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 #include "CAGraph.h"
12 
13 
18 
20 
22 class TrackingRegion;
24 
25 namespace edm {
26  class Event;
27  class EventSetup;
29 }
30 
32 public:
34 
35  static constexpr unsigned int minLayers = 3;
37 public:
38 
41 
42  ~CAHitTripletGenerator() = default;
43 
44  static void fillDescriptions(edm::ParameterSetDescription& desc);
45  static const char *fillDescriptionsLabel() { return "caHitTriplet"; }
46 
47  void initEvent(const edm::Event& ev, const edm::EventSetup& es);
48 
49  void hitNtuplets(const IntermediateHitDoublets& regionDoublets,
50  std::vector<OrderedHitSeeds>& result,
51  const edm::EventSetup& es,
53 
54 private:
55  LayerCacheType theLayerCache;
56 
57  std::unique_ptr<SeedComparitor> theComparitor;
58 
60  public:
61 
62  QuantityDependsPtEval(float v1, float v2, float c1, float c2) :
63  value1_(v1), value2_(v2), curvature1_(c1), curvature2_(c2) {
64  }
65 
66  float value(float curvature) const {
67  if (value1_ == value2_) // not enabled
68  return value1_;
69 
70  if (curvature1_ < curvature)
71  return value1_;
72  if (curvature2_ < curvature && curvature <= curvature1_)
73  return value2_ + (curvature - curvature2_) / (curvature1_ - curvature2_) * (value1_ - value2_);
74  return value2_;
75  }
76 
77  private:
78  const float value1_;
79  const float value2_;
80  const float curvature1_;
81  const float curvature2_;
82  };
83 
84  // Linear interpolation (in curvature) between value1 at pt1 and
85  // value2 at pt2. If disabled, value2 is given (the point is to
86  // allow larger/smaller values of the quantity at low pt, so it
87  // makes more sense to have the high-pt value as the default).
88 
90  public:
91 
93  value1_(pset.getParameter<double>("value1")),
94  value2_(pset.getParameter<double>("value2")),
95  pt1_(pset.getParameter<double>("pt1")),
96  pt2_(pset.getParameter<double>("pt2")),
97  enabled_(pset.getParameter<bool>("enabled")) {
98  if (enabled_ && pt1_ >= pt2_)
99  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt1 (" << pt1_ << ") needs to be smaller than pt2 (" << pt2_ << ")";
100  if (pt1_ <= 0)
101  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt1 needs to be > 0; is " << pt1_;
102  if (pt2_ <= 0)
103  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt2 needs to be > 0; is " << pt2_;
104  }
105 
107  if (enabled_) {
108  return QuantityDependsPtEval(value1_, value2_,
109  PixelRecoUtilities::curvature(1.f / pt1_, es),
110  PixelRecoUtilities::curvature(1.f / pt2_, es));
111  }
112  return QuantityDependsPtEval(value2_, value2_, 0.f, 0.f);
113  }
114 
115  private:
116  const float value1_;
117  const float value2_;
118  const float pt1_;
119  const float pt2_;
120  const bool enabled_;
121  };
122 
124 
127 
128  const float caThetaCut = 0.00125f;
129  const float caPhiCut = 1.f;
130  const float caHardPtCut = 0.f;
131 
132 };
133 
134 
135 
136 
137 #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)
HLT enums.
std::unique_ptr< SeedComparitor > theComparitor