test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Typedefs | Functions
LayerQuadruplets Namespace Reference

Typedefs

using Layer = SeedingLayerSetsHits::SeedingLayer
 
using LayerSet = SeedingLayerSetsHits::SeedingLayerSet
 
using LayerSetAndLayers = std::pair< LayerSet, std::vector< Layer > >
 

Functions

std::vector< LayerSetAndLayerslayers (const SeedingLayerSetsHits &sets)
 

Detailed Description

A class grouping pixel layers in triplets and associating a vector of layers to each layer pair. The layer triplet is used to generate hit triplets and the associated vector of layers to generate a fourth hit confirming layer triplet

Typedef Documentation

Definition at line 15 of file LayerQuadruplets.h.

Definition at line 16 of file LayerQuadruplets.h.

using LayerQuadruplets::LayerSetAndLayers = typedef std::pair<LayerSet, std::vector<Layer> >

Definition at line 17 of file LayerQuadruplets.h.

Function Documentation

std::vector< LayerSetAndLayers > LayerQuadruplets::layers ( const SeedingLayerSetsHits sets)

Definition at line 4 of file LayerQuadruplets.cc.

References cmsHarvester::index, SeedingLayerSetsHits::numberOfLayersInSet(), and mps_fire::result.

Referenced by CombinedHitQuadrupletGenerator::hitQuadruplets(), and PixelQuadrupletEDProducer::produce().

4  {
5  std::vector<LayerSetAndLayers> result;
6  if(sets.numberOfLayersInSet() != 4)
7  return result;
8 
9  for(LayerSet set: sets) {
10  bool added = false;
11 
12  for(auto ir = result.begin(); ir < result.end(); ++ir) {
13  const LayerSet & resTriplet = ir->first;
14  if(resTriplet[0].index() == set[0].index() &&
15  resTriplet[1].index() == set[1].index() &&
16  resTriplet[2].index() == set[2].index()) {
17  std::vector<Layer>& fourths = ir->second;
18  fourths.push_back( set[3] );
19  added = true;
20  break;
21  }
22  }
23  if (!added) {
24  LayerSetAndLayers ltl = std::make_pair(set, std::vector<Layer>(1, set[3]) );
25  result.push_back(ltl);
26  }
27  }
28  return result;
29 }
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
SeedingLayerSetsHits::SeedingLayerSet LayerSet
Definition: LayerTriplets.h:15
tuple result
Definition: mps_fire.py:84
std::pair< LayerSet, std::vector< Layer > > LayerSetAndLayers
Definition: LayerTriplets.h:16