CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
PixelTripletLargeTipGenerator Class Reference

#include <PixelTripletLargeTipGenerator.h>

Inheritance diagram for PixelTripletLargeTipGenerator:
HitTripletGeneratorFromPairAndLayers

Public Member Functions

void hitTriplets (const TrackingRegion &region, OrderedHitTriplets &trs, const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayerSet &pairLayers, const std::vector< SeedingLayerSetsHits::SeedingLayer > &thirdLayers) override
 
void hitTriplets (const TrackingRegion &region, OrderedHitTriplets &trs, const edm::Event &ev, const edm::EventSetup &es, const HitDoublets &doublets, const std::vector< SeedingLayerSetsHits::SeedingLayer > &thirdLayers, std::vector< int > *tripletLastLayerIndex, LayerCacheType &layerCache)
 
void hitTriplets (const TrackingRegion &region, OrderedHitTriplets &result, const edm::EventSetup &es, const HitDoublets &doublets, const RecHitsSortedInPhi **thirdHitMap, const std::vector< const DetLayer * > &thirdLayerDetLayer, const int nThirdLayers) override
 
void hitTriplets (const TrackingRegion &region, OrderedHitTriplets &result, const edm::EventSetup &es, const HitDoublets &doublets, const RecHitsSortedInPhi **thirdHitMap, const std::vector< const DetLayer * > &thirdLayerDetLayer, const int nThirdLayers, std::vector< int > *tripletLastLayerIndex)
 
 PixelTripletLargeTipGenerator (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
 PixelTripletLargeTipGenerator (const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
 
 ~PixelTripletLargeTipGenerator () override
 
- Public Member Functions inherited from HitTripletGeneratorFromPairAndLayers
 HitTripletGeneratorFromPairAndLayers (unsigned int maxElement=0)
 
 HitTripletGeneratorFromPairAndLayers (const edm::ParameterSet &pset)
 
void init (std::unique_ptr< HitPairGeneratorFromLayerPair > &&pairs, LayerCacheType *layerCache)
 
const HitPairGeneratorFromLayerPairpairGenerator () const
 
virtual ~HitTripletGeneratorFromPairAndLayers ()
 

Static Public Member Functions

static void fillDescriptions (edm::ParameterSetDescription &desc)
 
static const char * fillDescriptionsLabel ()
 
- Static Public Member Functions inherited from HitTripletGeneratorFromPairAndLayers
static void fillDescriptions (edm::ParameterSetDescription &desc)
 

Private Types

typedef CombinedHitTripletGenerator::LayerCacheType LayerCacheType
 

Private Attributes

const float dphi
 
const float extraHitRPhitolerance
 
const float extraHitRZtolerance
 
const bool useBend
 
const bool useFixedPreFiltering
 
const bool useMScat
 

Additional Inherited Members

- Public Types inherited from HitTripletGeneratorFromPairAndLayers
typedef LayerHitMapCache LayerCacheType
 
- Protected Attributes inherited from HitTripletGeneratorFromPairAndLayers
LayerCacheTypetheLayerCache
 
const unsigned int theMaxElement
 
std::unique_ptr< HitPairGeneratorFromLayerPairthePairGenerator
 

Detailed Description

A HitTripletGenerator from HitPairGenerator and vector of Layers. The HitPairGenerator provides a set of hit pairs. For each pair the search for compatible hit(s) is done among provided Layers

Definition at line 18 of file PixelTripletLargeTipGenerator.h.

Member Typedef Documentation

Definition at line 19 of file PixelTripletLargeTipGenerator.h.

Constructor & Destructor Documentation

PixelTripletLargeTipGenerator::PixelTripletLargeTipGenerator ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 22 of file PixelTripletLargeTipGenerator.h.

References looper::cfg, fillDescriptions(), and ~PixelTripletLargeTipGenerator().

23  : PixelTripletLargeTipGenerator(cfg, iC) {}
PixelTripletLargeTipGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
PixelTripletLargeTipGenerator::PixelTripletLargeTipGenerator ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)

Definition at line 47 of file PixelTripletLargeTipGenerator.cc.

49  useFixedPreFiltering(cfg.getParameter<bool>("useFixedPreFiltering")),
50  extraHitRZtolerance(cfg.getParameter<double>("extraHitRZtolerance")),
51  extraHitRPhitolerance(cfg.getParameter<double>("extraHitRPhitolerance")),
52  useMScat(cfg.getParameter<bool>("useMultScattering")),
53  useBend(cfg.getParameter<bool>("useBending")),
54  dphi(useFixedPreFiltering ? cfg.getParameter<double>("phiPreFiltering") : 0) {}
T getParameter(std::string const &) const
PixelTripletLargeTipGenerator::~PixelTripletLargeTipGenerator ( )
override

Definition at line 56 of file PixelTripletLargeTipGenerator.cc.

Referenced by PixelTripletLargeTipGenerator().

56 {}

Member Function Documentation

void PixelTripletLargeTipGenerator::fillDescriptions ( edm::ParameterSetDescription desc)
static

Definition at line 58 of file PixelTripletLargeTipGenerator.cc.

References edm::ParameterSetDescription::add(), HitTripletGeneratorFromPairAndLayers::fillDescriptions(), FastTimerService_cff::range, and edm::second().

Referenced by PixelTripletLargeTipGenerator().

58  {
60  // Defaults for the extraHit*tolerance are set to 0 here since that
61  // was already the case in practice in all offline occurrances.
62  desc.add<double>("extraHitRPhitolerance", 0); // default in old python was 0.032
63  desc.add<double>("extraHitRZtolerance", 0); // default in old python was 0.037
64  desc.add<bool>("useMultScattering", true);
65  desc.add<bool>("useBending", true);
66  desc.add<bool>("useFixedPreFiltering", false);
67  desc.add<double>("phiPreFiltering", 0.3);
68 }
static void fillDescriptions(edm::ParameterSetDescription &desc)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static const char* PixelTripletLargeTipGenerator::fillDescriptionsLabel ( )
inlinestatic

Definition at line 29 of file PixelTripletLargeTipGenerator.h.

References HLT_2018_cff::doublets, ev, hitTriplets(), HLT_2018_cff::region, and mps_fire::result.

29 { return "pixelTripletLargeTip"; }
void PixelTripletLargeTipGenerator::hitTriplets ( const TrackingRegion region,
OrderedHitTriplets trs,
const edm::Event ev,
const edm::EventSetup es,
const SeedingLayerSetsHits::SeedingLayerSet pairLayers,
const std::vector< SeedingLayerSetsHits::SeedingLayer > &  thirdLayers 
)
overridevirtual

Implements HitTripletGeneratorFromPairAndLayers.

Definition at line 82 of file PixelTripletLargeTipGenerator.cc.

References HLT_2018_cff::doublets, HitTripletGeneratorFromPairAndLayers::theLayerCache, and HitTripletGeneratorFromPairAndLayers::thePairGenerator.

Referenced by fillDescriptionsLabel(), and hitTriplets().

87  {
88  auto const& doublets = thePairGenerator->doublets(region, ev, es, pairLayers);
89 
90  if (doublets.empty())
91  return;
92 
93  assert(theLayerCache);
94  hitTriplets(region, result, ev, es, doublets, thirdLayers, nullptr, *theLayerCache);
95 }
std::unique_ptr< HitPairGeneratorFromLayerPair > thePairGenerator
void hitTriplets(const TrackingRegion &region, OrderedHitTriplets &trs, const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayerSet &pairLayers, const std::vector< SeedingLayerSetsHits::SeedingLayer > &thirdLayers) override
void PixelTripletLargeTipGenerator::hitTriplets ( const TrackingRegion region,
OrderedHitTriplets trs,
const edm::Event ev,
const edm::EventSetup es,
const HitDoublets doublets,
const std::vector< SeedingLayerSetsHits::SeedingLayer > &  thirdLayers,
std::vector< int > *  tripletLastLayerIndex,
LayerCacheType layerCache 
)

Definition at line 97 of file PixelTripletLargeTipGenerator.cc.

References hitTriplets(), and findQualityFiles::size.

104  {
105  int size = thirdLayers.size();
106  const RecHitsSortedInPhi* thirdHitMap[size];
107  vector<const DetLayer*> thirdLayerDetLayer(size, nullptr);
108  for (int il = 0; il < size; ++il) {
109  thirdHitMap[il] = &layerCache(thirdLayers[il], region, es);
110  thirdLayerDetLayer[il] = thirdLayers[il].detLayer();
111  }
112  hitTriplets(region, result, es, doublets, thirdHitMap, thirdLayerDetLayer, size, tripletLastLayerIndex);
113 }
size
Write out results.
void hitTriplets(const TrackingRegion &region, OrderedHitTriplets &trs, const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayerSet &pairLayers, const std::vector< SeedingLayerSetsHits::SeedingLayer > &thirdLayers) override
void PixelTripletLargeTipGenerator::hitTriplets ( const TrackingRegion region,
OrderedHitTriplets result,
const edm::EventSetup es,
const HitDoublets doublets,
const RecHitsSortedInPhi **  thirdHitMap,
const std::vector< const DetLayer * > &  thirdLayerDetLayer,
const int  nThirdLayers 
)
overridevirtual

Implements HitTripletGeneratorFromPairAndLayers.

Definition at line 115 of file PixelTripletLargeTipGenerator.cc.

References hitTriplets().

121  {
122  hitTriplets(region, result, es, doublets, thirdHitMap, thirdLayerDetLayer, nThirdLayers, nullptr);
123 }
void hitTriplets(const TrackingRegion &region, OrderedHitTriplets &trs, const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayerSet &pairLayers, const std::vector< SeedingLayerSetsHits::SeedingLayer > &thirdLayers) override
void PixelTripletLargeTipGenerator::hitTriplets ( const TrackingRegion region,
OrderedHitTriplets result,
const edm::EventSetup es,
const HitDoublets doublets,
const RecHitsSortedInPhi **  thirdHitMap,
const std::vector< const DetLayer * > &  thirdLayerDetLayer,
const int  nThirdLayers,
std::vector< int > *  tripletLastLayerIndex 
)

Definition at line 125 of file PixelTripletLargeTipGenerator.cc.

References angle(), checkPhiInRange(), constexpr, pfMETCorrectionType0_cfi::correction, PixelRecoUtilities::curvature(), declareDynArray, HitDoublets::detLayer(), dphi, relativeConstraints::empty, runTheMatrix::err, extraHitRPhitolerance, extraHitRZtolerance, f, dqmdumpme::first, dqmMemoryStats::float, fnSigmaRZ, Geom::ftwoPi(), edm::EventSetup::get(), HitDoublets::hit(), hfClusterShapes_cfi::hits, mps_fire::i, HitDoublets::inner, DetLayer::isBarrel(), mps_splice::line, M_PI, SiStripPI::max, ThirdHitPredictionFromCircle::HelixRZ::maxCurvature(), min(), normalizedPhi(), nSigmaPhi, nSigmaRZ, PixelRecoLineRZ::origin(), TrackingRegion::originRBound(), HitDoublets::outer, p3, PV3DBase< T, PVType, FrameType >::perp(), HitDoublets::phi(), GeometricSearchDet::position(), edm::ESHandle< T >::product(), proxim(), TrackingRegion::ptMin(), Basic2DVector< T >::r(), CosmicsPD_Skims::radius, edm::second(), DetLayer::seqNum(), OrderedHitTriplets::size(), HitDoublets::size(), std::swap(), HitTripletGeneratorFromPairAndLayers::theMaxElement, PbPb_ZMuSkimMuonDPG_cff::tracker, useBend, useFixedPreFiltering, useMScat, findQualityFiles::v, PV3DBase< T, PVType, FrameType >::x(), HitDoublets::x(), hybridSuperClusters_cfi::xi, PV3DBase< T, PVType, FrameType >::y(), HitDoublets::y(), PV3DBase< T, PVType, FrameType >::z(), and HitDoublets::z().

132  {
134  es.get<TrackerDigiGeometryRecord>().get(tracker);
135 
136  //Retrieve tracker topology from geometry
138  es.get<TrackerTopologyRcd>().get(tTopoHand);
139  const TrackerTopology* tTopo = tTopoHand.product();
140 
141  auto outSeq = doublets.detLayer(HitDoublets::outer)->seqNum();
142 
143  using NodeInfo = KDTreeNodeInfo<unsigned int, 2>;
144  std::vector<NodeInfo> layerTree; // re-used throughout
145  std::vector<unsigned int> foundNodes; // re-used throughout
146  foundNodes.reserve(100);
147 
148  declareDynArray(KDTreeLinkerAlgo<unsigned int>, nThirdLayers, hitTree);
149  declareDynArray(LayerRZPredictions, nThirdLayers, mapPred);
150 
151  float rzError[nThirdLayers]; //save maximum errors
152 
153  const float maxDelphi = region.ptMin() < 0.3f ? float(M_PI) / 4.f : float(M_PI) / 8.f; // FIXME move to config??
154  const float maxphi = M_PI + maxDelphi, minphi = -maxphi; // increase to cater for any range
155  const float safePhi = M_PI - maxDelphi; // sideband
156 
157  for (int il = 0; il < nThirdLayers; il++) {
158  auto const& hits = *thirdHitMap[il];
159 
160  const DetLayer* layer = thirdLayerDetLayer[il];
161  LayerRZPredictions& predRZ = mapPred[il];
162  predRZ.line.initLayer(layer);
163  predRZ.helix1.initLayer(layer);
164  predRZ.helix2.initLayer(layer);
165  predRZ.line.initTolerance(extraHitRZtolerance);
166  predRZ.helix1.initTolerance(extraHitRZtolerance);
167  predRZ.helix2.initTolerance(extraHitRZtolerance);
168  predRZ.rzPositionFixup = MatchedHitRZCorrectionFromBending(layer, tTopo);
169  predRZ.correction.init(es,
170  region.ptMin(),
171  *doublets.detLayer(HitDoublets::inner),
172  *doublets.detLayer(HitDoublets::outer),
173  *thirdLayerDetLayer[il],
174  useMScat,
175  false);
176 
177  layerTree.clear();
178  float minv = 999999.0;
179  float maxv = -999999.0; // Initialise to extreme values in case no hits
180  float maxErr = 0.0f;
181  for (unsigned int i = 0; i != hits.size(); ++i) {
182  auto angle = hits.phi(i);
183  auto v = hits.gv(i);
184  //use (phi,r) for endcaps rather than (phi,z)
185  minv = std::min(minv, v);
186  maxv = std::max(maxv, v);
187  float myerr = hits.dv[i];
188  maxErr = std::max(maxErr, myerr);
189  layerTree.emplace_back(i, angle, v); // save it
190  // populate side-bands
191  if (angle > safePhi)
192  layerTree.emplace_back(i, angle - Geom::ftwoPi(), v);
193  else if (angle < -safePhi)
194  layerTree.emplace_back(i, angle + Geom::ftwoPi(), v);
195  }
196  KDTreeBox phiZ(minphi, maxphi, minv - 0.01f, maxv + 0.01f); // declare our bounds
197  //add fudge factors in case only one hit and also for floating-point inaccuracy
198  hitTree[il].build(layerTree, phiZ); // make KDtree
199  rzError[il] = maxErr; //save error
200  }
201 
202  double curv = PixelRecoUtilities::curvature(1. / region.ptMin(), es);
203 
204  for (std::size_t ip = 0; ip != doublets.size(); ip++) {
205  auto xi = doublets.x(ip, HitDoublets::inner);
206  auto yi = doublets.y(ip, HitDoublets::inner);
207  auto zi = doublets.z(ip, HitDoublets::inner);
208  // auto rvi = doublets.rv(ip,HitDoublets::inner);
209  auto xo = doublets.x(ip, HitDoublets::outer);
210  auto yo = doublets.y(ip, HitDoublets::outer);
211  auto zo = doublets.z(ip, HitDoublets::outer);
212  // auto rvo = doublets.rv(ip,HitDoublets::outer);
213  GlobalPoint gp1(xi, yi, zi);
214  GlobalPoint gp2(xo, yo, zo);
215 
216  auto toPos = std::signbit(zo - zi);
217 
218  PixelRecoLineRZ line(gp1, gp2);
219  PixelRecoPointRZ point2(gp2.perp(), zo);
220  ThirdHitPredictionFromCircle predictionRPhi(gp1, gp2, extraHitRPhitolerance);
221 
222  Range generalCurvature = predictionRPhi.curvature(region.originRBound());
223  if (!intersect(generalCurvature, Range(-curv, curv)))
224  continue;
225 
226  for (int il = 0; il < nThirdLayers; il++) {
227  if (hitTree[il].empty())
228  continue; // Don't bother if no hits
229  const DetLayer* layer = thirdLayerDetLayer[il];
230  bool barrelLayer = layer->isBarrel();
231 
232  if ((!barrelLayer) & (toPos != std::signbit(layer->position().z())))
233  continue;
234 
235  Range curvature = generalCurvature;
236 
237  LayerRZPredictions& predRZ = mapPred[il];
238  predRZ.line.initPropagator(&line);
239 
240  auto& correction = predRZ.correction;
241  correction.init(line, point2, outSeq);
242 
243  Range rzRange;
244  if (useBend) {
245  // For the barrel region:
246  // swiping the helix passing through the two points across from
247  // negative to positive bending, can give us a sort of U-shaped
248  // projection onto the phi-z (barrel) or r-z plane (forward)
249  // so we checking minimum/maximum of all three possible extrema
250  //
251  // For the endcap region:
252  // Checking minimum/maximum radius of the helix projection
253  // onto an endcap plane, here we have to guard against
254  // looping tracks, when phi(delta z) gets out of control.
255  // HelixRZ::rAtZ should not follow looping tracks, but clamp
256  // to the minimum reachable r with the next-best lower |curvature|.
257  // So same procedure as for the barrel region can be applied.
258  //
259  // In order to avoid looking for potential looping tracks at all
260  // we also clamp the allowed curvature range for this layer,
261  // and potentially fail the layer entirely
262 
263  if (!barrelLayer) {
264  Range z3s = predRZ.line.detRange();
265  double z3 = z3s.first < 0 ? std::max(z3s.first, z3s.second) : std::min(z3s.first, z3s.second);
266  double maxCurvature = HelixRZ::maxCurvature(&predictionRPhi, gp1.z(), gp2.z(), z3);
267  if (!intersect(curvature, Range(-maxCurvature, maxCurvature)))
268  continue;
269  }
270 
271  HelixRZ helix1(&predictionRPhi, gp1.z(), gp2.z(), curvature.first);
272  HelixRZ helix2(&predictionRPhi, gp1.z(), gp2.z(), curvature.second);
273 
274  predRZ.helix1.initPropagator(&helix1);
275  predRZ.helix2.initPropagator(&helix2);
276 
277  Range rzRanges[2] = {predRZ.helix1(), predRZ.helix2()};
278  predRZ.helix1.initPropagator(nullptr);
279  predRZ.helix2.initPropagator(nullptr);
280 
281  rzRange.first = std::min(rzRanges[0].first, rzRanges[1].first);
282  rzRange.second = std::max(rzRanges[0].second, rzRanges[1].second);
283 
284  // if the allowed curvatures include a straight line,
285  // this can give us another extremum for allowed r/z
286  if (curvature.first * curvature.second < 0.0) {
287  Range rzLineRange = predRZ.line();
288  rzRange.first = std::min(rzRange.first, rzLineRange.first);
289  rzRange.second = std::max(rzRange.second, rzLineRange.second);
290  }
291  } else {
292  rzRange = predRZ.line();
293  }
294 
295  if (rzRange.first >= rzRange.second)
296  continue;
297 
298  correction.correctRZRange(rzRange);
299 
300  Range phiRange;
301  if (useFixedPreFiltering) {
302  float phi0 = doublets.phi(ip, HitDoublets::outer);
303  phiRange = Range(phi0 - dphi, phi0 + dphi);
304  } else {
305  Range radius;
306 
307  if (barrelLayer) {
308  radius = predRZ.line.detRange();
309  if (!intersect(rzRange, predRZ.line.detSize()))
310  continue;
311  } else {
312  radius = rzRange;
313  if (!intersect(radius, predRZ.line.detSize()))
314  continue;
315  }
316 
317  //gc: predictionRPhi uses the cosine rule to find the phi of the 3rd point at radius, assuming the pairCurvature range [-c,+c]
318  if ((curvature.first < 0.0f) & (curvature.second < 0.0f)) {
319  radius.swap();
320  } else if ((curvature.first >= 0.0f) & (curvature.second >= 0.0f)) {
321  ;
322  } else {
323  radius.first = radius.second;
324  }
325  auto phi12 = predictionRPhi.phi(curvature.first, radius.first);
326  auto phi22 = predictionRPhi.phi(curvature.second, radius.second);
327  phi12 = normalizedPhi(phi12);
328  phi22 = proxim(phi22, phi12);
329  phiRange = Range(phi12, phi22);
330  phiRange.sort();
331  auto rmean = radius.mean();
332  phiRange.first *= rmean;
333  phiRange.second *= rmean;
334  correction.correctRPhiRange(phiRange);
335  phiRange.first /= rmean;
336  phiRange.second /= rmean;
337  }
338 
339  foundNodes.clear(); // Now recover hits in bounding box...
340  float prmin = phiRange.min(), prmax = phiRange.max(); //get contiguous range
341 
342  if (prmax - prmin > maxDelphi) {
343  auto prm = phiRange.mean();
344  prmin = prm - 0.5f * maxDelphi;
345  prmax = prm + 0.5f * maxDelphi;
346  }
347 
348  if (barrelLayer) {
349  Range regMax = predRZ.line.detRange();
350  Range regMin = predRZ.line(regMax.min());
351  regMax = predRZ.line(regMax.max());
352  correction.correctRZRange(regMin);
353  correction.correctRZRange(regMax);
354  if (regMax.min() < regMin.min()) {
355  std::swap(regMax, regMin);
356  }
357  KDTreeBox phiZ(prmin, prmax, regMin.min() - fnSigmaRZ * rzError[il], regMax.max() + fnSigmaRZ * rzError[il]);
358  hitTree[il].search(phiZ, foundNodes);
359  } else {
360  KDTreeBox phiZ(prmin, prmax, rzRange.min() - fnSigmaRZ * rzError[il], rzRange.max() + fnSigmaRZ * rzError[il]);
361  hitTree[il].search(phiZ, foundNodes);
362  }
363 
364  MatchedHitRZCorrectionFromBending l2rzFixup(doublets.hit(ip, HitDoublets::outer)->det()->geographicalId(), tTopo);
365  MatchedHitRZCorrectionFromBending l3rzFixup = predRZ.rzPositionFixup;
366 
367  auto const& hits = *thirdHitMap[il];
368  for (auto KDdata : foundNodes) {
369  GlobalPoint p3 = hits.gp(KDdata);
370  double p3_r = p3.perp();
371  double p3_z = p3.z();
372  float p3_phi = hits.phi(KDdata);
373 
374  Range rangeRPhi = predictionRPhi(curvature, p3_r);
375  correction.correctRPhiRange(rangeRPhi);
376 
377  float ir = 1.f / p3_r;
378  // limit error to 90 degree
379  constexpr float maxPhiErr = 0.5 * M_PI;
380  float phiErr = nSigmaPhi * hits.drphi[KDdata] * ir;
381  phiErr = std::min(maxPhiErr, phiErr);
382  if (!checkPhiInRange(p3_phi, rangeRPhi.first * ir - phiErr, rangeRPhi.second * ir + phiErr, maxPhiErr))
383  continue;
384 
385  Basic2DVector<double> thc(p3.x(), p3.y());
386 
387  auto curv_ = predictionRPhi.curvature(thc);
388  double p2_r = point2.r();
389  double p2_z = point2.z(); // they will be modified!
390 
391  l2rzFixup(predictionRPhi, curv_, *doublets.hit(ip, HitDoublets::outer), p2_r, p2_z, tTopo);
392  l3rzFixup(predictionRPhi, curv_, *hits.theHits[KDdata].hit(), p3_r, p3_z, tTopo);
393 
394  Range rangeRZ;
395  if (useBend) {
396  HelixRZ updatedHelix(&predictionRPhi, gp1.z(), p2_z, curv_);
397  rangeRZ = predRZ.helix1(barrelLayer ? p3_r : p3_z, updatedHelix);
398  } else {
399  float tIP = predictionRPhi.transverseIP(thc);
400  PixelRecoPointRZ updatedPoint2(p2_r, p2_z);
401  PixelRecoLineRZ updatedLine(line.origin(), point2, tIP);
402  rangeRZ = predRZ.line(barrelLayer ? p3_r : p3_z, line);
403  }
404  correction.correctRZRange(rangeRZ);
405 
406  double err = nSigmaRZ * hits.dv[KDdata];
407 
408  rangeRZ.first -= err, rangeRZ.second += err;
409 
410  if (!rangeRZ.inside(barrelLayer ? p3_z : p3_r))
411  continue;
412 
413  if (theMaxElement != 0 && result.size() >= theMaxElement) {
414  result.clear();
415  if (tripletLastLayerIndex)
416  tripletLastLayerIndex->clear();
417  edm::LogError("TooManyTriplets") << " number of triples exceed maximum. no triplets produced.";
418  return;
419  }
420  result.emplace_back(
421  doublets.hit(ip, HitDoublets::inner), doublets.hit(ip, HitDoublets::outer), hits.theHits[KDdata].hit());
422  // to bookkeep the triplets and 3rd layers in triplet EDProducer
423  if (tripletLastLayerIndex)
424  tripletLastLayerIndex->push_back(il);
425  }
426  }
427  }
428  // std::cout << "found triplets " << result.size() << std::endl;
429 }
#define declareDynArray(T, n, x)
Definition: DynArray.h:91
float originRBound() const
bounds the particle vertex in the transverse plane
std::size_t size() const
T perp() const
Definition: PV3DBase.h:69
constexpr float ftwoPi()
Definition: Pi.h:36
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8
float x(int i, layer l) const
T y() const
Definition: PV3DBase.h:60
T r() const
Radius, same as mag()
constexpr T proxim(T b, T a)
Definition: normalizedPhi.h:14
float z(int i, layer l) const
U second(std::pair< T, U > const &p)
int seqNum() const
Definition: DetLayer.h:35
T curvature(T InversePt, const edm::EventSetup &iSetup)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
T z() const
Definition: PV3DBase.h:61
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
float y(int i, layer l) const
unsigned int size() const override
#define M_PI
bool isBarrel() const
Definition: DetLayer.h:31
static double maxCurvature(const ThirdHitPredictionFromCircle *circle, double z1, double z2, double z3)
float phi(int i, layer l) const
PixelRecoRange< float > Range
virtual const Surface::PositionType & position() const
Returns position of the surface.
float ptMin() const
minimal pt of interest
constexpr bool checkPhiInRange(T phi, T phi1, T phi2, float maxDphi=float(M_PI))
Definition: normalizedPhi.h:33
Hit const & hit(int i, layer l) const
T get() const
Definition: EventSetup.h:73
T x() const
Definition: PV3DBase.h:59
T const * product() const
Definition: ESHandle.h:86
DetLayer const * detLayer(layer l) const
#define constexpr
double p3[4]
Definition: TauolaWrapper.h:91
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

Member Data Documentation

const float PixelTripletLargeTipGenerator::dphi
private

Definition at line 70 of file PixelTripletLargeTipGenerator.h.

Referenced by hitTriplets().

const float PixelTripletLargeTipGenerator::extraHitRPhitolerance
private

Definition at line 67 of file PixelTripletLargeTipGenerator.h.

Referenced by hitTriplets().

const float PixelTripletLargeTipGenerator::extraHitRZtolerance
private

Definition at line 66 of file PixelTripletLargeTipGenerator.h.

Referenced by hitTriplets().

const bool PixelTripletLargeTipGenerator::useBend
private

Definition at line 69 of file PixelTripletLargeTipGenerator.h.

Referenced by hitTriplets().

const bool PixelTripletLargeTipGenerator::useFixedPreFiltering
private

Definition at line 65 of file PixelTripletLargeTipGenerator.h.

Referenced by hitTriplets().

const bool PixelTripletLargeTipGenerator::useMScat
private

Definition at line 68 of file PixelTripletLargeTipGenerator.h.

Referenced by hitTriplets().