CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CAHitQuadrupletGenerator.h
Go to the documentation of this file.
1 #ifndef RECOPIXELVERTEXING_PIXELTRIPLETS_CAHITQUADRUPLETGENERATOR_H
2 #define RECOPIXELVERTEXING_PIXELTRIPLETS_CAHITQUADRUPLETGENERATOR_H
3 
12 
17 
21 
22 class TrackingRegion;
24 
25 namespace edm {
26  class Event;
27  class EventSetup;
29 } // namespace edm
30 
32 public:
34 
35  static constexpr unsigned int minLayers = 4;
37 
38 public:
40  : CAHitQuadrupletGenerator(cfg, iC) {}
42 
43  ~CAHitQuadrupletGenerator() = default;
44 
46  static const char* fillDescriptionsLabel() { return "caHitQuadrupletDefault"; }
47 
48  void initEvent(const edm::Event& ev, const edm::EventSetup& es);
49 
50  void hitNtuplets(const IntermediateHitDoublets& regionDoublets,
51  std::vector<OrderedHitSeeds>& result,
53 
54 private:
56 
57  std::unique_ptr<SeedComparitor> theComparitor;
58 
60  const MagneticField* theField = nullptr;
61 
63  public:
64  QuantityDependsPtEval(float v1, float v2, float c1, float c2)
65  : value1_(v1), value2_(v2), curvature1_(c1), curvature2_(c2) {}
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:
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") << "PixelQuadrupletGenerator::QuantityDependsPt: pt1 (" << pt1_
100  << ") needs to be smaller than pt2 (" << pt2_ << ")";
101  if (pt1_ <= 0)
102  throw cms::Exception("Configuration")
103  << "PixelQuadrupletGenerator::QuantityDependsPt: pt1 needs to be > 0; is " << pt1_;
104  if (pt2_ <= 0)
105  throw cms::Exception("Configuration")
106  << "PixelQuadrupletGenerator::QuantityDependsPt: pt2 needs to be > 0; is " << pt2_;
107  }
108 
110  if (enabled_) {
112  value2_,
114  PixelRecoUtilities::curvature(1.f / pt2_, field));
115  }
116  return QuantityDependsPtEval(value2_, value2_, 0.f, 0.f);
117  }
118 
119  private:
120  const float value1_;
121  const float value2_;
122  const float pt1_;
123  const float pt2_;
124  const bool enabled_;
125  };
126 
128 
130  const bool fitFastCircle;
133 
136  const float caHardPtCut = 0.f;
137 };
138 #endif
static const char * fillDescriptionsLabel()
~CAHitQuadrupletGenerator()=default
tuple cfg
Definition: looper.py:296
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
std::unique_ptr< SeedComparitor > theComparitor
static constexpr unsigned int minLayers
QuantityDependsPtEval evaluator(const MagneticField &field) const
T curvature(T InversePt, const MagneticField &field)
Definition: CACut.h:16
tuple result
Definition: mps_fire.py:311
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
void initEvent(const edm::Event &ev, const edm::EventSetup &es)
const MagneticField * theField
CAHitQuadrupletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
const QuantityDependsPt maxChi2
QuantityDependsPtEval(float v1, float v2, float c1, float c2)
void hitNtuplets(const IntermediateHitDoublets &regionDoublets, std::vector< OrderedHitSeeds > &result, const SeedingLayerSetsHits &layers)
static void fillDescriptions(edm::ParameterSetDescription &desc)