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.
1 #include "LayerTriplets.h"
2 
3 using namespace ctfseeding;
4 std::vector<LayerTriplets::LayerPairAndLayers> LayerTriplets::layers() const
5 {
6  std::vector<LayerPairAndLayers> result;
7  typedef std::vector<LayerPairAndLayers>::iterator IR;
8 
9  typedef SeedingLayerSets::const_iterator IL;
10  for (IL il=theSets.begin(), ilEnd= theSets.end(); il != ilEnd; ++il) {
11  const SeedingLayers & set = *il;
12  if (set.size() != 3) continue;
13  SeedingLayerPair layerPair = std::make_pair(set[0], set[1]);
14  bool added = false;
15  for (IR ir = result.begin(); ir < result.end(); ++ir) {
16  const SeedingLayerPair & resPair = ir->first;
17  if (resPair.first ==layerPair.first && resPair.second == layerPair.second) {
18  std::vector<SeedingLayer> & thirds = ir->second;
19  thirds.push_back( set[2] );
20  added = true;
21  break;
22  }
23  }
24  if (!added) {
25  LayerPairAndLayers lpl = std::make_pair(layerPair, std::vector<SeedingLayer>(1, set[2]) );
26  result.push_back(lpl);
27  }
28  }
29  return result;
30 }
std::pair< ctfseeding::SeedingLayer, ctfseeding::SeedingLayer > SeedingLayerPair
Definition: LayerTriplets.h:16
tuple result
Definition: query.py:137
std::vector< LayerPairAndLayers > layers() const
Definition: LayerTriplets.cc:4
std::pair< SeedingLayerPair, std::vector< ctfseeding::SeedingLayer > > LayerPairAndLayers
Definition: LayerTriplets.h:17
std::vector< SeedingLayer > SeedingLayers
void set(const std::string &name, int value)
set the flag, with a run-time name