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.

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))) {}

Member Function Documentation

◆ element()

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

Definition at line 56 of file CrosstalkInversion.cc.

56  {
57  return (pow(lambdaM, N + 1 - i) - pow(lambdaP, N + 1 - i)) * (pow(lambdaM, j) - pow(lambdaP, j)) / denominator;
58  }

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

Referenced by operator()().

◆ operator()()

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

Definition at line 52 of file CrosstalkInversion.cc.

52  {
53  return N == 0 || edm::isNotFinite(denominator) ? i == j : i >= j ? element(i, j) : element(j, i);
54  }

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

◆ unfold()

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

Definition at line 7 of file CrosstalkInversion.cc.

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  }

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

Referenced by StripCPEgeometric::localParameters().

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.

mps_fire.i
i
Definition: mps_fire.py:428
STATS
#define STATS(value)
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
stats_t
Definition: ErrorPropogationTypes.h:38
reco::InverseCrosstalkMatrix::N
const unsigned N
Definition: CrosstalkInversion.h:20
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::InverseCrosstalkMatrix::lambdaP
const double lambdaP
Definition: CrosstalkInversion.h:21
reco::InverseCrosstalkMatrix::InverseCrosstalkMatrix
InverseCrosstalkMatrix(const unsigned N, const float x)
Definition: CrosstalkInversion.cc:45
q1
double q1[4]
Definition: TauolaWrapper.h:87
A
reco::InverseCrosstalkMatrix::lambdaM
const double lambdaM
Definition: CrosstalkInversion.h:21
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
reco::InverseCrosstalkMatrix::denominator
const double denominator
Definition: CrosstalkInversion.h:21
reco::InverseCrosstalkMatrix::sq
const double sq
Definition: CrosstalkInversion.h:21
genVertex_cff.x
x
Definition: genVertex_cff.py:13
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
reco::InverseCrosstalkMatrix::element
float element(const unsigned, const unsigned) const
Definition: CrosstalkInversion.cc:56
SiStripMonitorCluster_cfi.q0
q0
Definition: SiStripMonitorCluster_cfi.py:241