test
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

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

Private Types

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

Private Member Functions

const 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 17 of file SymmetricLayerFinder.h.

Member Typedef Documentation

typedef FDLC::const_iterator SymmetricLayerFinder::ConstFDLI
private

Definition at line 21 of file SymmetricLayerFinder.h.

typedef std::vector<const ForwardDetLayer*> SymmetricLayerFinder::FDLC
private

Definition at line 19 of file SymmetricLayerFinder.h.

typedef FDLC::iterator SymmetricLayerFinder::FDLI
private

Definition at line 20 of file SymmetricLayerFinder.h.

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

Definition at line 38 of file SymmetricLayerFinder.h.

typedef std::pair< const ForwardDetLayer*, const ForwardDetLayer*> SymmetricLayerFinder::PairType
private

Definition at line 22 of file SymmetricLayerFinder.h.

Constructor & Destructor Documentation

SymmetricLayerFinder::SymmetricLayerFinder ( const FDLC flc)

Definition at line 15 of file SymmetricLayerFinder.cc.

References Exception, and i.

16 {
17  ConstFDLI middle = find_if( flc.begin(), flc.end(), not1(DetBelowZ(0)));
18 
19  FDLC leftLayers = FDLC( flc.begin(), middle);
20  FDLC rightLayers = FDLC( middle, flc.end());
21  vector<PairType> foundPairs;
22 
23  for ( FDLI i = leftLayers.begin(); i != leftLayers.end(); i++) {
24  const ForwardDetLayer* partner = mirrorPartner( *i, rightLayers);
25  //if ( partner == 0) throw DetLogicError("Assymmetric forward layers in Tracker");
26  if ( partner == 0) throw cms::Exception("SymmetricLayerFinder", "Assymmetric forward layers in Tracker");
27 
28  foundPairs.push_back( make_pair( *i, partner));
29  }
30 
31  // fill the map
32  for ( vector<PairType>::iterator ipair = foundPairs.begin();
33  ipair != foundPairs.end(); ipair++) {
34  theForwardMap[ipair->first] = ipair->second;
35  theForwardMap[ipair->second] = ipair->first;
36  }
37 }
int i
Definition: DBlmapReader.cc:9
const ForwardDetLayer * mirrorPartner(const ForwardDetLayer *layer, const FDLC &rightLayers)
ForwardMapType theForwardMap
std::vector< const ForwardDetLayer * > FDLC
FDLC::const_iterator ConstFDLI

Member Function Documentation

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

Definition at line 60 of file SymmetricLayerFinder.cc.

References i, and mps_fire::result.

60  {
61  FDLC result;
62  for ( ConstFDLI i = input.begin(); i != input.end(); i++) {
63  result.push_back( mirror(*i));
64  }
65  return result;
66 }
int i
Definition: DBlmapReader.cc:9
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
static std::string const input
Definition: EdmProvDump.cc:44
tuple result
Definition: mps_fire.py:83
std::vector< const ForwardDetLayer * > FDLC
FDLC::const_iterator ConstFDLI
const ForwardDetLayer * SymmetricLayerFinder::mirrorPartner ( const ForwardDetLayer layer,
const FDLC rightLayers 
)
private

Definition at line 39 of file SymmetricLayerFinder.cc.

References a, funct::abs(), GeometricSearchDet::position(), mps_fire::result, ForwardDetLayer::specificSurface(), and PV3DBase< T, PVType, FrameType >::z().

41 {
42 
43  auto mirrorImage = [=]( const ForwardDetLayer* a) ->bool {
44  auto zdiff = a->position().z() + layer->position().z();
45  auto rdiff = a->specificSurface().innerRadius() -
46  layer->specificSurface().innerRadius();
47 
48  // equality based on z position and inner radius
49  return std::abs(zdiff) < 2.f && std::abs(rdiff) < 1.f; // units are cm
50  };
51 
52 
54  find_if( rightLayers.begin(), rightLayers.end(), mirrorImage);
55  if ( result == rightLayers.end()) return 0;
56  else return *result;
57 }
tuple result
Definition: mps_fire.py:83
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual const Surface::PositionType & position() const
Returns position of the surface.
double a
Definition: hdecay.h:121
virtual const BoundDisk & specificSurface() const final
FDLC::const_iterator ConstFDLI

Member Data Documentation

ForwardMapType SymmetricLayerFinder::theForwardMap
private

Definition at line 40 of file SymmetricLayerFinder.h.