CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LayerTriplets.cc
Go to the documentation of this file.
2 
3 namespace LayerTriplets {
4 std::vector<LayerSetAndLayers> layers(const SeedingLayerSetsHits& sets) {
5  std::vector<LayerSetAndLayers> result;
6  if(sets.numberOfLayersInSet() != 3)
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 & resSet = ir->first;
14  if (resSet[0].index() == set[0].index() && resSet[1].index() == set[1].index()) {
15  std::vector<Layer>& thirds = ir->second;
16  thirds.push_back( set[2] );
17  added = true;
18  break;
19  }
20  }
21  if (!added) {
22  LayerSetAndLayers lpl = std::make_pair(set, std::vector<Layer>(1, set[2]) );
23  result.push_back(lpl);
24  }
25  }
26  return result;
27 }
28 }
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
tuple result
Definition: query.py:137
std::pair< LayerSet, std::vector< Layer > > LayerSetAndLayers
Definition: LayerTriplets.h:16