CMS 3D CMS Logo

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