CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
reco::InverseCrosstalkMatrix Class Reference

#include <CrosstalkInversion.h>

Public Member Functions

 InverseCrosstalkMatrix (const unsigned N, const float x)
 
float operator() (const unsigned i, const unsigned j) const
 

Static Public Member Functions

static std::vector< stats_t< float > > unfold (const SiStripCluster &q, const float x)
 

Private Member Functions

float element (const unsigned, const unsigned) const
 

Private Attributes

const double denominator
 
const double lambdaM
 
const double lambdaP
 
const unsigned N
 
const double sq
 

Detailed Description

Definition at line 13 of file CrosstalkInversion.h.

Constructor & Destructor Documentation

◆ InverseCrosstalkMatrix()

reco::InverseCrosstalkMatrix::InverseCrosstalkMatrix ( const unsigned  N,
const float  x 
)

Definition at line 45 of file CrosstalkInversion.cc.

References x.

46  : N(x > 0 ? N : 0),
47  sq(sqrt(-x * 4 + 1)),
48  lambdaP(1 + (1 + sq) / (-x * 2)),
49  lambdaM(1 + (1 - sq) / (-x * 2)),
50  denominator(sq * (pow(lambdaP, N + 1) - pow(lambdaM, N + 1))) {}
constexpr int pow(int x)
Definition: conifer.h:24
T sqrt(T t)
Definition: SSEVec.h:19

Member Function Documentation

◆ element()

float reco::InverseCrosstalkMatrix::element ( const unsigned  i,
const unsigned  j 
) const
inlineprivate

Definition at line 56 of file CrosstalkInversion.cc.

References denominator, mps_fire::i, dqmiolumiharvest::j, lambdaM, lambdaP, N, and conifer::pow().

Referenced by operator()().

56  {
57  return (pow(lambdaM, N + 1 - i) - pow(lambdaP, N + 1 - i)) * (pow(lambdaM, j) - pow(lambdaP, j)) / denominator;
58  }
constexpr int pow(int x)
Definition: conifer.h:24

◆ operator()()

float reco::InverseCrosstalkMatrix::operator() ( const unsigned  i,
const unsigned  j 
) const

Definition at line 52 of file CrosstalkInversion.cc.

References denominator, element(), mps_fire::i, edm::isNotFinite(), dqmiolumiharvest::j, and N.

52  {
53  return N == 0 || edm::isNotFinite(denominator) ? i == j : i >= j ? element(i, j) : element(j, i);
54  }
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
float element(const unsigned, const unsigned) const

◆ unfold()

std::vector< stats_t< float > > reco::InverseCrosstalkMatrix::unfold ( const SiStripCluster q,
const float  x 
)
static

Definition at line 7 of file CrosstalkInversion.cc.

References A, SiStripCluster::amplitudes(), mps_fire::i, dqmiolumiharvest::j, N, submitPVResolutionJobs::q, SiStripMonitorCluster_cfi::q0, STATS, and x.

Referenced by StripCPEgeometric::localParameters().

7  {
8  auto const& q = clus.amplitudes();
9  const stats_t<float> suppressed(-5, 100);
10  const stats_t<float> saturated(254, 400);
11 #define STATS(value) ((value < 254) ? stats_t<float>(value) : saturated)
12 
13  const unsigned N = q.size();
14  std::vector<stats_t<float> > Q(N + 2, stats_t<float>(0));
15  Q[0] = Q[N + 1] = suppressed;
16 
17  if (N == 1) //optimize N==1
18  Q[1] = STATS(q[0]) / (1 - 2 * x);
19  else if (N == 2) { //optimize N==2
20  const double A = 1 - 2 * x;
21  const stats_t<float> q0 = STATS(q[0]);
22  const stats_t<float> q1 = STATS(q[1]);
23  Q[1] = (A * q0 - x * q1) / (A * A - x * x);
24  Q[2] = (A * q1 - x * q0) / (A * A - x * x);
25  } else { //general case
26  const InverseCrosstalkMatrix inverse(N, x);
27  for (unsigned i = 0; i < (N + 1) / 2; i++) {
28  for (unsigned j = i; j < N - i; j++) {
29  const float Cij = inverse(i + 1, j + 1);
30  Q[i + 1] += Cij * STATS(q[j]);
31  if (i != j)
32  Q[j + 1] += Cij * STATS(q[i]);
33  if (N != i + j + 1) {
34  Q[N - i] += Cij * STATS(q[N - j - 1]);
35  if (i != j)
36  Q[N - j] += Cij * STATS(q[N - i - 1]);
37  }
38  }
39  }
40  }
41 #undef STATS
42  return Q;
43  }
#define STATS(value)
InverseCrosstalkMatrix(const unsigned N, const float x)
Definition: APVGainStruct.h:7

Member Data Documentation

◆ denominator

const double reco::InverseCrosstalkMatrix::denominator
private

Definition at line 21 of file CrosstalkInversion.h.

Referenced by element(), and operator()().

◆ lambdaM

const double reco::InverseCrosstalkMatrix::lambdaM
private

Definition at line 21 of file CrosstalkInversion.h.

Referenced by element().

◆ lambdaP

const double reco::InverseCrosstalkMatrix::lambdaP
private

Definition at line 21 of file CrosstalkInversion.h.

Referenced by element().

◆ N

const unsigned reco::InverseCrosstalkMatrix::N
private

Definition at line 20 of file CrosstalkInversion.h.

Referenced by element(), operator()(), and unfold().

◆ sq

const double reco::InverseCrosstalkMatrix::sq
private

Definition at line 21 of file CrosstalkInversion.h.