ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Trk::ProjectionMatricesSet Class Reference

the matrices to access the variably-dimensioned local parameters and map them to the defined five track parameters. More...

#include <ProjectionMatricesSet.h>

Collaboration diagram for Trk::ProjectionMatricesSet:

Public Member Functions

 ProjectionMatricesSet (int maxdim)
 Explicit constructor for 1-dimensional vector. More...
 
const Amg::MatrixXexpansionMatrix (int mtx) const
 Expansion matrix return. More...
 
const Amg::MatrixXreductionMatrix (int mtx) const
 Reduction matrix return. More...
 
int accessor (int mtx, ParamDefs par) const
 Accessors for members. More...
 

Private Attributes

int m_maxdim
 
std::vector< Amg::MatrixXm_expansions
 
std::vector< Amg::MatrixXm_reductions
 
std::vector< std::vector< int > > m_accessors
 

Detailed Description

the matrices to access the variably-dimensioned local parameters and map them to the defined five track parameters.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 29 of file ProjectionMatricesSet.h.

Constructor & Destructor Documentation

◆ ProjectionMatricesSet()

Trk::ProjectionMatricesSet::ProjectionMatricesSet ( int  maxdim)

Explicit constructor for 1-dimensional vector.

Definition at line 12 of file ProjectionMatricesSet.cxx.

12  :
13  m_maxdim(maxdim)
14 {
15 
16  // the number of projection matrices is 2**(maxdim),
17  // it is the possible number of binary numbers of with maxdim digits
18  int numMatrices = int(pow(2,m_maxdim));
19 
20  for (int imatx=0; imatx<numMatrices; ++imatx){
21 
22  std::vector<int> accessorInt(m_maxdim);
23  std::vector<bool> parameterTag(m_maxdim);
24  unsigned int cols = 0;
25  for (int itag = 0, ipos = 1; itag < m_maxdim; ++itag, ipos *= 2) {
26  bool bit = (imatx & ipos);
27  parameterTag[itag] = bit;
28  if (bit) {
29  ++cols;
30  }
31  }
32 
33  //By default set zero
34  Amg::MatrixX reduction;
35  reduction.setZero();
36  Amg::MatrixX expansion;
37  expansion.setZero();
38  if (cols){
39  // rows and cols - initialized to zero
40  reduction = Amg::MatrixX(m_maxdim, cols);
41  reduction.setZero();
42  // go through the rows and fill them
43  int reduc = 0;
44  for (int irow = 0; irow<m_maxdim; irow++)
45  {
46  int icol = irow - reduc;
47  // avoids couting to col 4 for int(0b01111) = 15 matrix
48  icol = (icol < int(cols)) ? icol : cols-1;
49  reduction(irow,icol) = parameterTag[irow] ? 1. : 0.;
50  if (!parameterTag[irow])
51  {
52  accessorInt[irow] = -100;
53  ++reduc;
54  } else {
55  accessorInt[irow] = reduc;
56  }
57  }
58  // the expansion matrix is the transposed reduction matrix
59  expansion = Amg::MatrixX(reduction.transpose());
60  }
61  // store them
62  m_reductions.push_back(reduction);
63  m_expansions.push_back(expansion);
64  m_accessors.push_back(accessorInt);
65  }
66 
67 }

Member Function Documentation

◆ accessor()

int Trk::ProjectionMatricesSet::accessor ( int  mtx,
ParamDefs  par 
) const
inline

Accessors for members.

Definition at line 56 of file ProjectionMatricesSet.h.

56 { return (par-(m_accessors[mtx])[par]); }

◆ expansionMatrix()

const Amg::MatrixX & Trk::ProjectionMatricesSet::expansionMatrix ( int  mtx) const
inline

Expansion matrix return.

Definition at line 52 of file ProjectionMatricesSet.h.

52 { return m_expansions[mtx]; }

◆ reductionMatrix()

const Amg::MatrixX & Trk::ProjectionMatricesSet::reductionMatrix ( int  mtx) const
inline

Reduction matrix return.

Definition at line 54 of file ProjectionMatricesSet.h.

54 { return m_reductions[mtx]; }

Member Data Documentation

◆ m_accessors

std::vector<std::vector<int> > Trk::ProjectionMatricesSet::m_accessors
private

Definition at line 48 of file ProjectionMatricesSet.h.

◆ m_expansions

std::vector<Amg::MatrixX> Trk::ProjectionMatricesSet::m_expansions
private

Definition at line 46 of file ProjectionMatricesSet.h.

◆ m_maxdim

int Trk::ProjectionMatricesSet::m_maxdim
private

Definition at line 45 of file ProjectionMatricesSet.h.

◆ m_reductions

std::vector<Amg::MatrixX> Trk::ProjectionMatricesSet::m_reductions
private

Definition at line 47 of file ProjectionMatricesSet.h.


The documentation for this class was generated from the following files:
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
Trk::ProjectionMatricesSet::m_expansions
std::vector< Amg::MatrixX > m_expansions
Definition: ProjectionMatricesSet.h:46
atlasStyleMacro.icol
int icol
Definition: atlasStyleMacro.py:13
beamspotnt.cols
list cols
Definition: bin/beamspotnt.py:1114
Trk::ProjectionMatricesSet::m_reductions
std::vector< Amg::MatrixX > m_reductions
Definition: ProjectionMatricesSet.h:47
Trk::ProjectionMatricesSet::m_maxdim
int m_maxdim
Definition: ProjectionMatricesSet.h:45
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
Trk::ProjectionMatricesSet::m_accessors
std::vector< std::vector< int > > m_accessors
Definition: ProjectionMatricesSet.h:48