CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

SymmetricLayerFinder Class Reference

#include <SymmetricLayerFinder.h>

List of all members.

Public Member Functions

ForwardDetLayermirror (const ForwardDetLayer *layer)
FDLC mirror (const FDLC &input)
 SymmetricLayerFinder (const FDLC &)

Private Types

typedef FDLC::const_iterator ConstFDLI
typedef std::vector
< ForwardDetLayer * > 
FDLC
typedef FDLC::iterator FDLI
typedef std::map< const
ForwardDetLayer
*, ForwardDetLayer
*, std::less< const
ForwardDetLayer * > > 
ForwardMapType
typedef std::pair
< ForwardDetLayer
*, ForwardDetLayer * > 
PairType

Private Member Functions

ForwardDetLayermirrorPartner (const ForwardDetLayer *layer, const FDLC &rightLayers)

Private Attributes

ForwardMapType theForwardMap

Detailed Description

A symmetrisation algorithm for layer navigation. For every ForwardDetLayer returns a pointer to the symmetric one with respect to origin.

Definition at line 16 of file SymmetricLayerFinder.h.


Member Typedef Documentation

typedef FDLC::const_iterator SymmetricLayerFinder::ConstFDLI [private]

Definition at line 20 of file SymmetricLayerFinder.h.

typedef std::vector<ForwardDetLayer*> SymmetricLayerFinder::FDLC [private]

Definition at line 18 of file SymmetricLayerFinder.h.

typedef FDLC::iterator SymmetricLayerFinder::FDLI [private]

Definition at line 19 of file SymmetricLayerFinder.h.

typedef std::map< const ForwardDetLayer*, ForwardDetLayer*, std::less<const ForwardDetLayer*> > SymmetricLayerFinder::ForwardMapType [private]

Definition at line 37 of file SymmetricLayerFinder.h.

Definition at line 21 of file SymmetricLayerFinder.h.


Constructor & Destructor Documentation

SymmetricLayerFinder::SymmetricLayerFinder ( const FDLC flc)

Definition at line 34 of file SymmetricLayerFinder.cc.

References Exception, and i.

{
  ConstFDLI middle = find_if( flc.begin(), flc.end(), not1(DetBelowZ(0)));

  FDLC leftLayers = FDLC( flc.begin(),  middle);
  FDLC rightLayers = FDLC( middle, flc.end());
  vector<PairType> foundPairs;

  for ( FDLI i = leftLayers.begin(); i != leftLayers.end(); i++) {
    ForwardDetLayer* partner = mirrorPartner( *i, rightLayers);
    //if ( partner == 0) throw DetLogicError("Assymmetric forward layers in Tracker");
    if ( partner == 0) throw cms::Exception("SymmetricLayerFinder", "Assymmetric forward layers in Tracker");

    foundPairs.push_back( make_pair( *i, partner));
  }

  // fill the map
  for ( vector<PairType>::iterator ipair = foundPairs.begin();
        ipair != foundPairs.end(); ipair++) {
    theForwardMap[ipair->first]  = ipair->second;
    theForwardMap[ipair->second] = ipair->first;
  }
}

Member Function Documentation

ForwardDetLayer* SymmetricLayerFinder::mirror ( const ForwardDetLayer layer) [inline]
SymmetricLayerFinder::FDLC SymmetricLayerFinder::mirror ( const FDLC input)

Definition at line 68 of file SymmetricLayerFinder.cc.

References i, and query::result.

                                               {
  FDLC result;
  for ( ConstFDLI  i = input.begin(); i != input.end(); i++) {
    result.push_back( mirror(*i));
  }
  return result;
}
ForwardDetLayer * SymmetricLayerFinder::mirrorPartner ( const ForwardDetLayer layer,
const FDLC rightLayers 
) [private]

Definition at line 58 of file SymmetricLayerFinder.cc.

References query::result.

{
  ConstFDLI result =
    find_if( rightLayers.begin(), rightLayers.end(), ForwardLayerMirrorImage(layer));
  if ( result == rightLayers.end()) return 0;
  else return *result;
}

Member Data Documentation

Definition at line 39 of file SymmetricLayerFinder.h.

Referenced by mirror().