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.

194 : obj_(obj) {}

◆ ~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.

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  }

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

◆ layerHitMapCache()

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

Definition at line 200 of file IntermediateHitTriplets.h.

200 { return obj_->regions_.back().layerHitMapCache(); }

References obj_, and IntermediateHitTriplets::regions_.

◆ valid()

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

Definition at line 198 of file IntermediateHitTriplets.h.

198 { return obj_ != nullptr; }

References obj_.

Member Data Documentation

◆ obj_

IntermediateHitTriplets* IntermediateHitTriplets::RegionFiller::obj_
private

Definition at line 237 of file IntermediateHitTriplets.h.

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

IntermediateHitTriplets::layerTriplets_
std::vector< PLayerHitTriplets > layerTriplets_
Container of regions, each element has indices pointing to layerTriplets_.
Definition: IntermediateHitTriplets.h:292
mps_fire.i
i
Definition: mps_fire.py:355
IntermediateHitTriplets::hitTriplets_
std::vector< OrderedHitTriplet > hitTriplets_
Container of layer triplets, each element has indices pointing to hitTriplets_.
Definition: IntermediateHitTriplets.h:293
IntermediateHitTriplets::LayerTriplet
std::tuple< SeedingLayerSetsHits::LayerIndex, SeedingLayerSetsHits::LayerIndex, SeedingLayerSetsHits::LayerIndex > LayerTriplet
Definition: IntermediateHitTriplets.h:26
cms::cuda::assert
assert(be >=bs)
IntermediateHitTriplets::RegionFiller::obj_
IntermediateHitTriplets * obj_
Definition: IntermediateHitTriplets.h:237
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
IntermediateHitTriplets::regions_
std::vector< RegionIndex > regions_
Pointer to SeedingLayerSetsHits (owned elsewhere)
Definition: IntermediateHitTriplets.h:290
OrderedHitTriplets::size
unsigned int size() const override
Definition: OrderedHitTriplets.h:13
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443