#include <SymmetricLayerFinder.h>
Public Member Functions | |
ForwardDetLayer * | mirror (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 | |
ForwardDetLayer * | mirrorPartner (const ForwardDetLayer *layer, const FDLC &rightLayers) |
Private Attributes | |
ForwardMapType | theForwardMap |
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.
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.
typedef std::pair< ForwardDetLayer*, ForwardDetLayer*> SymmetricLayerFinder::PairType [private] |
Definition at line 21 of file SymmetricLayerFinder.h.
SymmetricLayerFinder::SymmetricLayerFinder | ( | const FDLC & | flc | ) |
Definition at line 34 of file SymmetricLayerFinder.cc.
{ 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; } }
ForwardDetLayer* SymmetricLayerFinder::mirror | ( | const ForwardDetLayer * | layer | ) | [inline] |
Definition at line 27 of file SymmetricLayerFinder.h.
References theForwardMap.
Referenced by CosmicNavigationSchool::buildAdditionalForwardLinks(), CosmicNavigationSchool::linkBarrelLayers(), SimpleNavigationSchool::linkBarrelLayers(), SimpleNavigationSchool::linkForwardLayers(), and BeamHaloNavigationSchool::linkOtherEndLayers().
{ return theForwardMap[layer]; }
SymmetricLayerFinder::FDLC SymmetricLayerFinder::mirror | ( | const FDLC & | input | ) |
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; }
Definition at line 39 of file SymmetricLayerFinder.h.
Referenced by mirror().