CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
SymmetricLayerFinder Class Reference

#include <SymmetricLayerFinder.h>

Public Member Functions

FDLC mirror (const FDLC &input)
 
const ForwardDetLayermirror (const ForwardDetLayer *layer)
 
 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

◆ ConstFDLI

typedef FDLC::const_iterator SymmetricLayerFinder::ConstFDLI
private

Definition at line 20 of file SymmetricLayerFinder.h.

◆ FDLC

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

Definition at line 18 of file SymmetricLayerFinder.h.

◆ FDLI

typedef FDLC::iterator SymmetricLayerFinder::FDLI
private

Definition at line 19 of file SymmetricLayerFinder.h.

◆ ForwardMapType

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

Definition at line 32 of file SymmetricLayerFinder.h.

◆ PairType

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

Definition at line 21 of file SymmetricLayerFinder.h.

Constructor & Destructor Documentation

◆ SymmetricLayerFinder()

SymmetricLayerFinder::SymmetricLayerFinder ( const FDLC flc)

Definition at line 12 of file SymmetricLayerFinder.cc.

12  {
13  ConstFDLI middle =
14  find_if(flc.begin(), flc.end(), [](const GeometricSearchDet* a) { return a->position().z() >= 0.0; });
15 
16  FDLC leftLayers = FDLC(flc.begin(), middle);
17  FDLC rightLayers = FDLC(middle, flc.end());
18  vector<PairType> foundPairs;
19 
20  for (FDLI i = leftLayers.begin(); i != leftLayers.end(); i++) {
21  const ForwardDetLayer* partner = mirrorPartner(*i, rightLayers);
22  //if ( partner == 0) throw DetLogicError("Assymmetric forward layers in Tracker");
23  if (partner == nullptr)
24  throw cms::Exception("SymmetricLayerFinder", "Assymmetric forward layers in Tracker");
25 
26  foundPairs.push_back(make_pair(*i, partner));
27  }
28 
29  // fill the map
30  for (vector<PairType>::iterator ipair = foundPairs.begin(); ipair != foundPairs.end(); ipair++) {
31  theForwardMap[ipair->first] = ipair->second;
32  theForwardMap[ipair->second] = ipair->first;
33  }
34 }

References a, Exception, and mps_fire::i.

Member Function Documentation

◆ mirror() [1/2]

SymmetricLayerFinder::FDLC SymmetricLayerFinder::mirror ( const FDLC input)

Definition at line 52 of file SymmetricLayerFinder.cc.

52  {
53  FDLC result;
54  for (ConstFDLI i = input.begin(); i != input.end(); i++) {
55  result.push_back(mirror(*i));
56  }
57  return result;
58 }

References mps_fire::i, input, EmbeddingLHEProducer_cfi::mirror, and mps_fire::result.

◆ mirror() [2/2]

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

◆ mirrorPartner()

const ForwardDetLayer * SymmetricLayerFinder::mirrorPartner ( const ForwardDetLayer layer,
const FDLC rightLayers 
)
private

Definition at line 36 of file SymmetricLayerFinder.cc.

36  {
37  auto mirrorImage = [=](const ForwardDetLayer* a) -> bool {
38  auto zdiff = a->position().z() + layer->position().z();
39  auto rdiff = a->specificSurface().innerRadius() - layer->specificSurface().innerRadius();
40 
41  // equality based on z position and inner radius
42  return std::abs(zdiff) < 2.f && std::abs(rdiff) < 1.f; // units are cm
43  };
44 
45  ConstFDLI result = find_if(rightLayers.begin(), rightLayers.end(), mirrorImage);
46  if (result == rightLayers.end())
47  return nullptr;
48  else
49  return *result;
50 }

References a, funct::abs(), phase1PixelTopology::layer, and mps_fire::result.

Member Data Documentation

◆ theForwardMap

ForwardMapType SymmetricLayerFinder::theForwardMap
private

Definition at line 34 of file SymmetricLayerFinder.h.

SymmetricLayerFinder::ConstFDLI
FDLC::const_iterator ConstFDLI
Definition: SymmetricLayerFinder.h:20
mps_fire.i
i
Definition: mps_fire.py:428
input
static const std::string input
Definition: EdmProvDump.cc:48
SymmetricLayerFinder::FDLC
std::vector< const ForwardDetLayer * > FDLC
Definition: SymmetricLayerFinder.h:18
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
a
double a
Definition: hdecay.h:119
SymmetricLayerFinder::mirror
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
Definition: SymmetricLayerFinder.h:26
SymmetricLayerFinder::mirrorPartner
const ForwardDetLayer * mirrorPartner(const ForwardDetLayer *layer, const FDLC &rightLayers)
Definition: SymmetricLayerFinder.cc:36
SymmetricLayerFinder::FDLI
FDLC::iterator FDLI
Definition: SymmetricLayerFinder.h:19
SymmetricLayerFinder::theForwardMap
ForwardMapType theForwardMap
Definition: SymmetricLayerFinder.h:34
ForwardDetLayer
Definition: ForwardDetLayer.h:22
Exception
Definition: hltDiff.cc:245
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GeometricSearchDet
Definition: GeometricSearchDet.h:17