CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
IntermediateHitTriplets::RegionFiller Class Reference

Helper class enforcing correct way of filling the doublets of a region. More...

#include <IntermediateHitTriplets.h>

Public Member Functions

void addTriplets (const LayerPair &layerPair, const std::vector< SeedingLayerSetsHits::SeedingLayer > &thirdLayers, const OrderedHitTriplets &triplets, const std::vector< int > &thirdLayerIndex, const std::vector< size_t > &permutations)
 
LayerHitMapCachelayerHitMapCache ()
 
 RegionFiller ()
 
 RegionFiller (IntermediateHitTriplets *obj)
 
bool valid () const
 
 ~RegionFiller ()=default
 

Private Attributes

IntermediateHitTripletsobj_
 

Detailed Description

Helper class enforcing correct way of filling the doublets of a region.

Definition at line 191 of file IntermediateHitTriplets.h.

Constructor & Destructor Documentation

◆ RegionFiller() [1/2]

IntermediateHitTriplets::RegionFiller::RegionFiller ( )
inline

Definition at line 193 of file IntermediateHitTriplets.h.

193 : obj_(nullptr) {}

◆ RegionFiller() [2/2]

IntermediateHitTriplets::RegionFiller::RegionFiller ( IntermediateHitTriplets obj)
inlineexplicit

Definition at line 194 of file IntermediateHitTriplets.h.

◆ ~RegionFiller()

IntermediateHitTriplets::RegionFiller::~RegionFiller ( )
default

Member Function Documentation

◆ addTriplets()

void IntermediateHitTriplets::RegionFiller::addTriplets ( const LayerPair layerPair,
const std::vector< SeedingLayerSetsHits::SeedingLayer > &  thirdLayers,
const OrderedHitTriplets triplets,
const std::vector< int > &  thirdLayerIndex,
const std::vector< size_t > &  permutations 
)
inline

Definition at line 202 of file IntermediateHitTriplets.h.

References cms::cuda::assert(), IntermediateHitTriplets::hitTriplets_, mps_fire::i, nano_mu_digi_cff::layer, IntermediateHitTriplets::layerTriplets_, obj_, IntermediateHitTriplets::regions_, OrderedHitTriplets::size(), and findQualityFiles::size.

206  {
207  assert(triplets.size() == thirdLayerIndex.size());
208  assert(triplets.size() == permutations.size());
209 
210  if (triplets.empty()) {
211  return;
212  }
213 
214  int prevLayer = -1;
215  for (size_t i = 0, size = permutations.size(); i < size; ++i) {
216  // We go through the 'triplets' in the order defined by
217  // 'permutations', which is sorted such that we first go through
218  // triplets from (3rd) layer 0, then layer 1 and so on.
219  const size_t realIndex = permutations[i];
220 
221  const int layer = thirdLayerIndex[realIndex];
222  if (layer != prevLayer) {
223  prevLayer = layer;
224  obj_->layerTriplets_.emplace_back(
225  LayerTriplet(std::get<0>(layerPair), std::get<1>(layerPair), thirdLayers[layer].index()),
226  obj_->hitTriplets_.size());
227  }
228 
229  obj_->hitTriplets_.emplace_back(triplets[realIndex]);
230  obj_->layerTriplets_.back().setTripletsEnd(obj_->hitTriplets_.size());
231  }
232 
233  obj_->regions_.back().setLayerSetsEnd(obj_->layerTriplets_.size());
234  }
size
Write out results.
std::tuple< SeedingLayerSetsHits::LayerIndex, SeedingLayerSetsHits::LayerIndex, SeedingLayerSetsHits::LayerIndex > LayerTriplet
assert(be >=bs)
std::vector< RegionIndex > regions_
Pointer to SeedingLayerSetsHits (owned elsewhere)
std::vector< PLayerHitTriplets > layerTriplets_
Container of regions, each element has indices pointing to layerTriplets_.
std::vector< OrderedHitTriplet > hitTriplets_
Container of layer triplets, each element has indices pointing to hitTriplets_.
unsigned int size() const override

◆ layerHitMapCache()

LayerHitMapCache& IntermediateHitTriplets::RegionFiller::layerHitMapCache ( )
inline

Definition at line 200 of file IntermediateHitTriplets.h.

References obj_, and IntermediateHitTriplets::regions_.

200 { return obj_->regions_.back().layerHitMapCache(); }
std::vector< RegionIndex > regions_
Pointer to SeedingLayerSetsHits (owned elsewhere)

◆ valid()

bool IntermediateHitTriplets::RegionFiller::valid ( ) const
inline

Definition at line 198 of file IntermediateHitTriplets.h.

References obj_.

198 { return obj_ != nullptr; }

Member Data Documentation

◆ obj_

IntermediateHitTriplets* IntermediateHitTriplets::RegionFiller::obj_
private

Definition at line 237 of file IntermediateHitTriplets.h.

Referenced by addTriplets(), layerHitMapCache(), and valid().