CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
22 class TrackingRegion;
24 
25 namespace edm {
26  class Event;
27  class EventSetup;
29 }
30 
32 public:
34 
35  static constexpr unsigned int minLayers = 3;
37 
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 
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  // new-style
55  void hitNtuplets(const IntermediateHitDoublets::RegionLayerSets& regionLayerPairs,
57  const edm::EventSetup& es,
59 
60 private:
61  // actual work
63  std::vector<const HitDoublets *>& hitDoublets,
64  const CAGraph& g,
65  const edm::EventSetup& es);
66 
68 
70 
71  std::unique_ptr<SeedComparitor> theComparitor;
72 
74  public:
75 
76  QuantityDependsPtEval(float v1, float v2, float c1, float c2) :
77  value1_(v1), value2_(v2), curvature1_(c1), curvature2_(c2) {
78  }
79 
80  float value(float curvature) const {
81  if (value1_ == value2_) // not enabled
82  return value1_;
83 
84  if (curvature1_ < curvature)
85  return value1_;
86  if (curvature2_ < curvature && curvature <= curvature1_)
87  return value2_ + (curvature - curvature2_) / (curvature1_ - curvature2_) * (value1_ - value2_);
88  return value2_;
89  }
90 
91  private:
92  const float value1_;
93  const float value2_;
94  const float curvature1_;
95  const float curvature2_;
96  };
97 
98  // Linear interpolation (in curvature) between value1 at pt1 and
99  // value2 at pt2. If disabled, value2 is given (the point is to
100  // allow larger/smaller values of the quantity at low pt, so it
101  // makes more sense to have the high-pt value as the default).
102 
104  public:
105 
107  value1_(pset.getParameter<double>("value1")),
108  value2_(pset.getParameter<double>("value2")),
109  pt1_(pset.getParameter<double>("pt1")),
110  pt2_(pset.getParameter<double>("pt2")),
111  enabled_(pset.getParameter<bool>("enabled")) {
112  if (enabled_ && pt1_ >= pt2_)
113  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt1 (" << pt1_ << ") needs to be smaller than pt2 (" << pt2_ << ")";
114  if (pt1_ <= 0)
115  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt1 needs to be > 0; is " << pt1_;
116  if (pt2_ <= 0)
117  throw cms::Exception("Configuration") << "CAHitTripletGenerator::QuantityDependsPt: pt2 needs to be > 0; is " << pt2_;
118  }
119 
121  if (enabled_) {
125  }
126  return QuantityDependsPtEval(value2_, value2_, 0.f, 0.f);
127  }
128 
129  private:
130  const float value1_;
131  const float value2_;
132  const float pt1_;
133  const float pt2_;
134  const bool enabled_;
135  };
136 
138 
141 
142  const float caThetaCut = 0.00125f;
143  const float caPhiCut = 1.f;
144  const float caHardPtCut = 0.f;
145 
146 };
147 
148 
149 
150 
151 #endif
QuantityDependsPt(const edm::ParameterSet &pset)
const QuantityDependsPt maxChi2
tuple cfg
Definition: looper.py:293
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
Definition: Event.h:16
tuple result
Definition: mps_fire.py:84
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]
void initEvent(const edm::Event &ev, const edm::EventSetup &es)
OrderedHitTriplets ResultType
QuantityDependsPtEval(float v1, float v2, float c1, float c2)
virtual void hitTriplets(const TrackingRegion &reg, OrderedHitTriplets &triplets, const edm::Event &ev, const edm::EventSetup &es)
from base class
static void fillDescriptions(edm::ParameterSetDescription &desc)
void hitNtuplets(const IntermediateHitDoublets::RegionLayerSets &regionLayerPairs, OrderedHitTriplets &result, const edm::EventSetup &es, const SeedingLayerSetsHits &layers)
std::unique_ptr< SeedComparitor > theComparitor
static unsigned int minLayers