CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

reco::InverseCrosstalkMatrix Class Reference

#include <CrosstalkInversion.h>

List of all members.

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 std::vector< uint8_t > &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 11 of file CrosstalkInversion.h.


Constructor & Destructor Documentation

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

Definition at line 42 of file CrosstalkInversion.cc.

  : N( x>0 ? N : 0 ),
    sq( sqrt(-x*4+1)),
    lambdaP( 1+(1+sq)/(-x*2) ),
    lambdaM( 1+(1-sq)/(-x*2) ),
    denominator( sq * ( pow(lambdaP,N+1) - pow(lambdaM,N+1) ) )
{}

Member Function Documentation

float reco::InverseCrosstalkMatrix::element ( const unsigned  i,
const unsigned  j 
) const [inline, private]

Definition at line 56 of file CrosstalkInversion.cc.

References denominator, lambdaM, lambdaP, N, and funct::pow().

Referenced by operator()().

{ return ( pow(lambdaM,N+1-i) - pow(lambdaP,N+1-i) ) * ( pow(lambdaM,j) - pow(lambdaP,j) ) / denominator; }
float reco::InverseCrosstalkMatrix::operator() ( const unsigned  i,
const unsigned  j 
) const

Definition at line 51 of file CrosstalkInversion.cc.

References denominator, element(), and N.

{ return N==0 || std::isinf(denominator) ? i==j : i>=j ? element(i,j) : element(j,i) ; }
std::vector< stats_t< float > > reco::InverseCrosstalkMatrix::unfold ( const std::vector< uint8_t > &  q,
const float  x 
) [static]

Definition at line 6 of file CrosstalkInversion.cc.

References funct::A, i, j, N, q1, STATS, and ExpressReco_HICollisions_FallBack::x.

Referenced by StripCPEgeometric::localParameters().

                                                   {
  const stats_t<float> suppressed(-5,100);
  const stats_t<float> saturated(254,400);
  #define STATS(value) ( (value<254) ? stats_t<float>(value) : saturated )

  const unsigned N=q.size();
  std::vector<stats_t<float> > Q(N+2,stats_t<float>(0));
  Q[0] = Q[N+1] = suppressed;

  if(N==1)                                 //optimize N==1
    Q[1] = STATS(q[0])/(1-2*x);  
  else if(N==2) {                          //optimize N==2
    const double A=1-2*x; 
    const stats_t<float> q0 = STATS(q[0]);
    const stats_t<float> q1 = STATS(q[1]);
    Q[1] = ( A*q0 -x*q1 ) / (A*A-x*x);
    Q[2] = ( A*q1 -x*q0 ) / (A*A-x*x);
  } 
  else {                                   //general case
    const InverseCrosstalkMatrix inverse(N,x);  
    for(unsigned i=0; i<(N+1)/2; i++) {
      for(unsigned j=i; j<N-i; j++) {
        const float Cij = inverse(i+1,j+1);
        Q[i+1] += Cij * STATS(q[  j  ]) ;  if( i!=j)   
        Q[j+1] += Cij * STATS(q[  i  ]) ;  if( N!=i+j+1) {
        Q[N-i] += Cij * STATS(q[N-j-1]) ;  if( i!=j)
        Q[N-j] += Cij * STATS(q[N-i-1]) ;
        }
      }
    }
  }
  #undef STATS
  return Q;
}

Member Data Documentation

Definition at line 19 of file CrosstalkInversion.h.

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

const double reco::InverseCrosstalkMatrix::lambdaM [private]

Definition at line 19 of file CrosstalkInversion.h.

Referenced by element().

const double reco::InverseCrosstalkMatrix::lambdaP [private]

Definition at line 19 of file CrosstalkInversion.h.

Referenced by element().

const unsigned reco::InverseCrosstalkMatrix::N [private]

Definition at line 18 of file CrosstalkInversion.h.

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

const double reco::InverseCrosstalkMatrix::sq [private]

Definition at line 19 of file CrosstalkInversion.h.