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 208 of file IntermediateHitTriplets.h.

Constructor & Destructor Documentation

IntermediateHitTriplets::RegionFiller::RegionFiller ( )
inline

Definition at line 210 of file IntermediateHitTriplets.h.

210 : obj_(nullptr) {}
IntermediateHitTriplets::RegionFiller::RegionFiller ( IntermediateHitTriplets obj)
inlineexplicit

Definition at line 211 of file IntermediateHitTriplets.h.

211 : obj_(obj) {}
IntermediateHitTriplets::RegionFiller::~RegionFiller ( )
default

Member Function Documentation

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 219 of file IntermediateHitTriplets.h.

References mps_fire::i, OrderedHitTriplets::size(), and findQualityFiles::size.

Referenced by hitTripletEDProducerT::ImplIntermediateHitTriplets::fill().

223  {
224  assert(triplets.size() == thirdLayerIndex.size());
225  assert(triplets.size() == permutations.size());
226 
227  if(triplets.empty()) {
228  return;
229  }
230 
231  int prevLayer = -1;
232  for(size_t i=0, size=permutations.size(); i<size; ++i) {
233  // We go through the 'triplets' in the order defined by
234  // 'permutations', which is sorted such that we first go through
235  // triplets from (3rd) layer 0, then layer 1 and so on.
236  const size_t realIndex = permutations[i];
237 
238  const int layer = thirdLayerIndex[realIndex];
239  if(layer != prevLayer) {
240  prevLayer = layer;
241  obj_->layerTriplets_.emplace_back(LayerTriplet(std::get<0>(layerPair), std::get<1>(layerPair), thirdLayers[layer].index()), obj_->hitTriplets_.size());
242  }
243 
244  obj_->hitTriplets_.emplace_back(triplets[realIndex]);
245  obj_->layerTriplets_.back().setTripletsEnd(obj_->hitTriplets_.size());
246  }
247 
248  obj_->regions_.back().setLayerSetsEnd(obj_->layerTriplets_.size());
249  }
size
Write out results.
std::tuple< SeedingLayerSetsHits::LayerIndex, SeedingLayerSetsHits::LayerIndex, SeedingLayerSetsHits::LayerIndex > LayerTriplet
unsigned int size() const override
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_.
LayerHitMapCache& IntermediateHitTriplets::RegionFiller::layerHitMapCache ( )
inline

Definition at line 217 of file IntermediateHitTriplets.h.

217 { return obj_->regions_.back().layerHitMapCache(); }
std::vector< RegionIndex > regions_
Pointer to SeedingLayerSetsHits (owned elsewhere)
bool IntermediateHitTriplets::RegionFiller::valid ( ) const
inline

Definition at line 215 of file IntermediateHitTriplets.h.

215 { return obj_ != nullptr; }

Member Data Documentation

IntermediateHitTriplets* IntermediateHitTriplets::RegionFiller::obj_
private

Definition at line 251 of file IntermediateHitTriplets.h.