CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
LayerTriplets Class Reference

#include <LayerTriplets.h>

Public Types

typedef std::pair
< SeedingLayerPair,
std::vector
< ctfseeding::SeedingLayer > > 
LayerPairAndLayers
 
typedef std::pair
< ctfseeding::SeedingLayer,
ctfseeding::SeedingLayer
SeedingLayerPair
 

Public Member Functions

std::vector< LayerPairAndLayerslayers () const
 
 LayerTriplets (const ctfseeding::SeedingLayerSets &sets)
 

Private Attributes

ctfseeding::SeedingLayerSets theSets
 

Detailed Description

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

Definition at line 14 of file LayerTriplets.h.

Member Typedef Documentation

Definition at line 17 of file LayerTriplets.h.

Definition at line 16 of file LayerTriplets.h.

Constructor & Destructor Documentation

LayerTriplets::LayerTriplets ( const ctfseeding::SeedingLayerSets sets)
inline

Definition at line 19 of file LayerTriplets.h.

19 : theSets(sets) {}
ctfseeding::SeedingLayerSets theSets
Definition: LayerTriplets.h:24

Member Function Documentation

std::vector< LayerTriplets::LayerPairAndLayers > LayerTriplets::layers ( ) const

Definition at line 4 of file LayerTriplets.cc.

References query::result.

Referenced by CombinedHitTripletGenerator::init(), and CombinedMultiHitGenerator::init().

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 }
ctfseeding::SeedingLayerSets theSets
Definition: LayerTriplets.h:24
std::pair< ctfseeding::SeedingLayer, ctfseeding::SeedingLayer > SeedingLayerPair
Definition: LayerTriplets.h:16
tuple result
Definition: query.py:137
std::pair< SeedingLayerPair, std::vector< ctfseeding::SeedingLayer > > LayerPairAndLayers
Definition: LayerTriplets.h:17
std::vector< SeedingLayer > SeedingLayers

Member Data Documentation

ctfseeding::SeedingLayerSets LayerTriplets::theSets
private

Definition at line 24 of file LayerTriplets.h.