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 
12 #include "CAGraph.h"
13 
14 
19 
21 
22 class TrackingRegion;
25 
26 namespace edm {
27  class Event;
28  class EventSetup;
30 }
31 
33 public:
35 
36  static constexpr unsigned int minLayers = 4;
38 
39 public:
40 
41  CAHitQuadrupletGenerator(const edm::ParameterSet& cfg, edm::ConsumesCollector&& iC, bool needSeedingLayerSetsHits=true): CAHitQuadrupletGenerator(cfg, iC, needSeedingLayerSetsHits) {}
42  CAHitQuadrupletGenerator(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC, bool needSeedingLayerSetsHits=true);
43 
44  virtual ~CAHitQuadrupletGenerator();
45 
46  static void fillDescriptions(edm::ParameterSetDescription& desc);
47  static const char *fillDescriptionsLabel() { return "caHitQuadruplet"; }
48 
49  void initEvent(const edm::Event& ev, const edm::EventSetup& es);
50 
51 
53  virtual void hitQuadruplets(const TrackingRegion& reg, OrderedHitSeeds & quadruplets,
54  const edm::Event & ev, const edm::EventSetup& es);
55 
56  // new-style
57  void hitNtuplets(const IntermediateHitDoublets& regionDoublets,
58  std::vector<OrderedHitSeeds>& result,
59  const edm::EventSetup& es,
61 
62 private:
63  // actual work
64  void hitQuadruplets(const TrackingRegion& reg, OrderedHitSeeds& result,
65  std::vector<const HitDoublets *>& hitDoublets,
66  const CAGraph& g,
67  const edm::EventSetup& es);
68 
70 
71  LayerCacheType theLayerCache;
72 
73  std::unique_ptr<SeedComparitor> theComparitor;
74 
76  public:
77 
78  QuantityDependsPtEval(float v1, float v2, float c1, float c2) :
79  value1_(v1), value2_(v2), curvature1_(c1), curvature2_(c2) {
80  }
81 
82  float value(float curvature) const {
83  if (value1_ == value2_) // not enabled
84  return value1_;
85 
86  if (curvature1_ < curvature)
87  return value1_;
88  if (curvature2_ < curvature && curvature <= curvature1_)
89  return value2_ + (curvature - curvature2_) / (curvature1_ - curvature2_) * (value1_ - value2_);
90  return value2_;
91  }
92 
93  private:
94  const float value1_;
95  const float value2_;
96  const float curvature1_;
97  const float curvature2_;
98  };
99 
100  // Linear interpolation (in curvature) between value1 at pt1 and
101  // value2 at pt2. If disabled, value2 is given (the point is to
102  // allow larger/smaller values of the quantity at low pt, so it
103  // makes more sense to have the high-pt value as the default).
104 
106  public:
107 
109  value1_(pset.getParameter<double>("value1")),
110  value2_(pset.getParameter<double>("value2")),
111  pt1_(pset.getParameter<double>("pt1")),
112  pt2_(pset.getParameter<double>("pt2")),
113  enabled_(pset.getParameter<bool>("enabled")) {
114  if (enabled_ && pt1_ >= pt2_)
115  throw cms::Exception("Configuration") << "PixelQuadrupletGenerator::QuantityDependsPt: pt1 (" << pt1_ << ") needs to be smaller than pt2 (" << pt2_ << ")";
116  if (pt1_ <= 0)
117  throw cms::Exception("Configuration") << "PixelQuadrupletGenerator::QuantityDependsPt: pt1 needs to be > 0; is " << pt1_;
118  if (pt2_ <= 0)
119  throw cms::Exception("Configuration") << "PixelQuadrupletGenerator::QuantityDependsPt: pt2 needs to be > 0; is " << pt2_;
120  }
121 
123  if (enabled_) {
124  return QuantityDependsPtEval(value1_, value2_,
125  PixelRecoUtilities::curvature(1.f / pt1_, es),
126  PixelRecoUtilities::curvature(1.f / pt2_, es));
127  }
128  return QuantityDependsPtEval(value2_, value2_, 0.f, 0.f);
129  }
130 
131  private:
132  const float value1_;
133  const float value2_;
134  const float pt1_;
135  const float pt2_;
136  const bool enabled_;
137  };
138 
140 
142  const bool fitFastCircle;
145 
146  const float caThetaCut = 0.00125f;
147  const float caPhiCut = 0.1f;
148  const float caHardPtCut = 0.f;
149  const bool caOnlyOneLastHitPerLayerFilter = false;
150 };
151 #endif
static const char * fillDescriptionsLabel()
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
CAHitQuadrupletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC, bool needSeedingLayerSetsHits=true)
bool ev
std::unique_ptr< SeedComparitor > theComparitor
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
#define constexpr
T curvature(T InversePt, const edm::EventSetup &iSetup)
double f[11][100]
const QuantityDependsPt maxChi2
QuantityDependsPtEval(float v1, float v2, float c1, float c2)
HLT enums.
QuantityDependsPtEval evaluator(const edm::EventSetup &es) const
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken