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 
8 
12 #include "CAGraph.h"
13 
14 
19 
21 
23 class TrackingRegion;
25 
26 namespace edm {
27  class Event;
28  class EventSetup;
30 }
31 
33 public:
35 
36  static constexpr unsigned int minLayers = 3;
38 public:
39 
40  CAHitTripletGenerator(const edm::ParameterSet& cfg, edm::ConsumesCollector&& iC, bool needSeedingLayerSetsHits=true): CAHitTripletGenerator(cfg, iC, needSeedingLayerSetsHits) {}
41  CAHitTripletGenerator(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC, bool needSeedingLayerSetsHits=true);
42 
43  virtual ~CAHitTripletGenerator();
44 
45  static void fillDescriptions(edm::ParameterSetDescription& desc);
46  static const char *fillDescriptionsLabel() { return "caHitTriplet"; }
47 
48  void initEvent(const edm::Event& ev, const edm::EventSetup& es);
49 
51  virtual void hitTriplets(const TrackingRegion& reg, OrderedHitTriplets & triplets,
52  const edm::Event & ev, const edm::EventSetup& es);
53 
54  void hitNtuplets(const IntermediateHitDoublets& regionDoublets,
55  std::vector<OrderedHitSeeds>& result,
56  const edm::EventSetup& es,
58 
59 private:
60  // actual work
61  void hitTriplets(const TrackingRegion& reg, OrderedHitTriplets& result,
62  std::vector<const HitDoublets *>& hitDoublets,
63  CAGraph& g,
64  const edm::EventSetup& es);
65 
67 
68  LayerCacheType theLayerCache;
69 
70  std::unique_ptr<SeedComparitor> theComparitor;
71 
73  public:
74 
75  QuantityDependsPtEval(float v1, float v2, float c1, float c2) :
76  value1_(v1), value2_(v2), curvature1_(c1), curvature2_(c2) {
77  }
78 
79  float value(float curvature) const {
80  if (value1_ == value2_) // not enabled
81  return value1_;
82 
83  if (curvature1_ < curvature)
84  return value1_;
85  if (curvature2_ < curvature && curvature <= curvature1_)
86  return value2_ + (curvature - curvature2_) / (curvature1_ - curvature2_) * (value1_ - value2_);
87  return value2_;
88  }
89 
90  private:
91  const float value1_;
92  const float value2_;
93  const float curvature1_;
94  const float curvature2_;
95  };
96 
97  // Linear interpolation (in curvature) between value1 at pt1 and
98  // value2 at pt2. If disabled, value2 is given (the point is to
99  // allow larger/smaller values of the quantity at low pt, so it
100  // makes more sense to have the high-pt value as the default).
101 
103  public:
104 
106  value1_(pset.getParameter<double>("value1")),
107  value2_(pset.getParameter<double>("value2")),
108  pt1_(pset.getParameter<double>("pt1")),
109  pt2_(pset.getParameter<double>("pt2")),
110  enabled_(pset.getParameter<bool>("enabled")) {
111  if (enabled_ && pt1_ >= pt2_)
112  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt1 (" << pt1_ << ") needs to be smaller than pt2 (" << pt2_ << ")";
113  if (pt1_ <= 0)
114  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt1 needs to be > 0; is " << pt1_;
115  if (pt2_ <= 0)
116  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt2 needs to be > 0; is " << pt2_;
117  }
118 
120  if (enabled_) {
121  return QuantityDependsPtEval(value1_, value2_,
122  PixelRecoUtilities::curvature(1.f / pt1_, es),
123  PixelRecoUtilities::curvature(1.f / pt2_, es));
124  }
125  return QuantityDependsPtEval(value2_, value2_, 0.f, 0.f);
126  }
127 
128  private:
129  const float value1_;
130  const float value2_;
131  const float pt1_;
132  const float pt2_;
133  const bool enabled_;
134  };
135 
137 
140 
141  const float caThetaCut = 0.00125f;
142  const float caPhiCut = 1.f;
143  const float caHardPtCut = 0.f;
144 
145 };
146 
147 
148 
149 
150 #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
CAHitTripletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC, bool needSeedingLayerSetsHits=true)
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
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
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