CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

LayerTriplets Class Reference

#include <LayerTriplets.h>

List of all members.

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.

: theSets(sets) {}

Member Function Documentation

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

Definition at line 4 of file LayerTriplets.cc.

References query::result, and findQualityFiles::size.

Referenced by CombinedHitTripletGenerator::init().

{
  std::vector<LayerPairAndLayers> result;
  typedef std::vector<LayerPairAndLayers>::iterator IR;

  typedef SeedingLayerSets::const_iterator IL;
  for (IL il=theSets.begin(), ilEnd= theSets.end(); il != ilEnd; ++il) {
    const SeedingLayers & set = *il;
    if (set.size() != 3) continue;
    SeedingLayerPair layerPair = std::make_pair(set[0], set[1]);
    bool added = false;
    for (IR ir = result.begin(); ir < result.end(); ++ir) {
      const SeedingLayerPair & resPair = ir->first;
      if (resPair.first ==layerPair.first && resPair.second == layerPair.second) {
        std::vector<SeedingLayer> & thirds = ir->second;
        thirds.push_back( set[2] );
        added = true;
        break;
      }
    }
    if (!added) {
      LayerPairAndLayers lpl = std::make_pair(layerPair,  std::vector<SeedingLayer>(1, set[2]) );
      result.push_back(lpl);
    }
  }
  return result;
}

Member Data Documentation

Definition at line 24 of file LayerTriplets.h.