CMS 3D CMS Logo

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

#include <SymmetricLayerFinder.h>

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 i.

35 {
36  ConstFDLI middle = find_if( flc.begin(), flc.end(), not1(DetBelowZ(0)));
37 
38  FDLC leftLayers = FDLC( flc.begin(), middle);
39  FDLC rightLayers = FDLC( middle, flc.end());
40  vector<PairType> foundPairs;
41 
42  for ( FDLI i = leftLayers.begin(); i != leftLayers.end(); i++) {
43  ForwardDetLayer* partner = mirrorPartner( *i, rightLayers);
44  //if ( partner == 0) throw DetLogicError("Assymmetric forward layers in Tracker");
45  if ( partner == 0) throw Genexception("Assymmetric forward layers in Tracker");
46 
47  foundPairs.push_back( make_pair( *i, partner));
48  }
49 
50  // fill the map
51  for ( vector<PairType>::iterator ipair = foundPairs.begin();
52  ipair != foundPairs.end(); ipair++) {
53  theForwardMap[ipair->first] = ipair->second;
54  theForwardMap[ipair->second] = ipair->first;
55  }
56 }
int i
Definition: DBlmapReader.cc:9
ForwardDetLayer * mirrorPartner(const ForwardDetLayer *layer, const FDLC &rightLayers)
std::vector< ForwardDetLayer * > FDLC
ForwardMapType theForwardMap
FDLC::const_iterator ConstFDLI

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.

68  {
69  FDLC result;
70  for ( ConstFDLI i = input.begin(); i != input.end(); i++) {
71  result.push_back( mirror(*i));
72  }
73  return result;
74 }
int i
Definition: DBlmapReader.cc:9
std::vector< ForwardDetLayer * > FDLC
tuple result
Definition: query.py:137
tuple input
Definition: collect_tpl.py:10
ForwardDetLayer * mirror(const ForwardDetLayer *layer)
FDLC::const_iterator ConstFDLI
ForwardDetLayer * SymmetricLayerFinder::mirrorPartner ( const ForwardDetLayer layer,
const FDLC rightLayers 
)
private

Definition at line 58 of file SymmetricLayerFinder.cc.

References query::result.

60 {
62  find_if( rightLayers.begin(), rightLayers.end(), ForwardLayerMirrorImage(layer));
63  if ( result == rightLayers.end()) return 0;
64  else return *result;
65 }
tuple result
Definition: query.py:137
FDLC::const_iterator ConstFDLI

Member Data Documentation

ForwardMapType SymmetricLayerFinder::theForwardMap
private

Definition at line 39 of file SymmetricLayerFinder.h.

Referenced by mirror().