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