CMS 3D CMS Logo

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  // 3rd layer can already be there if we are dealing with quadruplet layer sets
17  auto found =
18  std::find_if(thirds.begin(), thirds.end(), [&](const Layer& l) { return l.index() == set[2].index(); });
19  if (found == thirds.end())
20  thirds.push_back(set[2]);
21  added = true;
22  break;
23  }
24  }
25  if (!added) {
26  LayerSetAndLayers lpl = std::make_pair(set, std::vector<Layer>(1, set[2]));
27  result.push_back(lpl);
28  }
29  }
30  return result;
31  }
32 } // namespace LayerTriplets
SeedingLayerSetsHits
Definition: SeedingLayerSetsHits.h:18
LayerTriplets
Definition: LayerTriplets.h:13
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
SeedingLayerSetsHits::numberOfLayersInSet
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
Definition: SeedingLayerSetsHits.h:197
SeedingLayerSetsHits::SeedingLayer
Definition: SeedingLayerSetsHits.h:37
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
LayerTriplets::LayerSetAndLayers
std::pair< LayerSet, std::vector< Layer > > LayerSetAndLayers
Definition: LayerTriplets.h:16
LayerTriplets.h
SeedingLayerSetsHits::SeedingLayerSet
Definition: SeedingLayerSetsHits.h:65
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
mps_fire.result
result
Definition: mps_fire.py:311
LayerTriplets::layers
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4