CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StripCPEfromTrackAngle.cc
Go to the documentation of this file.
3 
4 #include "vdt/vdtMath.h"
5 
6 namespace {
7  inline
8  float stripErrorSquared(const unsigned N, const float uProj) {
9  if( (float(N)-uProj) > 3.5f )
10  return float(N*N)/12.f;
11  else {
12  typedef float Float;
13  constexpr Float P1=-0.339;
14  constexpr Float P2=0.90;
15  constexpr Float P3=0.279;
16  const float uerr = P1*uProj*vdt::fast_expf(-uProj*P2)+P3;
17  // const Float uerr = P1*uProj*std::exp(-uProj*P2)+P3;
18  return uerr*uerr;
19  }
20  }
21 }
22 
24 localParameters( const SiStripCluster& cluster, const GeomDetUnit& det, const LocalTrajectoryParameters& ltp) const {
25 
26  StripCPE::Param const & p = param(det);
27 
28  LocalVector track = ltp.momentum();
29  track *=
30  (track.z()<0) ? std::abs(p.thickness/track.z()) :
31  (track.z()>0) ? -std::abs(p.thickness/track.z()) :
32  p.maxLength/track.mag() ;
33 
34  const unsigned N = cluster.amplitudes().size();
35  const float fullProjection = p.coveredStrips( track+p.drift, ltp.position());
36  const float uerr2 = stripErrorSquared( N, std::abs(fullProjection) );
37  const float strip = cluster.barycenter() - 0.5f*(1.f-p.backplanecorrection) * fullProjection
38  + 0.5f*p.coveredStrips(track, ltp.position());
39 
40  return std::make_pair( p.topology->localPosition(strip, ltp.vector()),
41  p.topology->localError(strip, uerr2, ltp.vector()) );
42 }
43 
LocalPoint position() const
Local x and y position coordinates.
float thickness
Definition: StripCPE.h:45
StripTopology const * topology
Definition: StripCPE.h:43
float backplanecorrection
Definition: StripCPE.h:47
#define constexpr
AlgebraicVector5 vector() const
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float barycenter() const
double f[11][100]
LocalVector momentum() const
Momentum vector in the local frame.
float coveredStrips(const LocalVector &, const LocalPoint &) const
Definition: StripCPE.cc:76
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &, const GeomDetUnit &, const LocalTrajectoryParameters &) const
#define N
Definition: blowfish.cc:9
std::pair< LocalPoint, LocalError > LocalValues
virtual LocalError localError(float strip, float stripErr2) const =0
float maxLength
Definition: StripCPE.h:45
Param const & param(const GeomDetUnit &det) const
Definition: StripCPE.h:51
float fast_expf(float x)
LocalVector drift
Definition: StripCPE.h:44
virtual LocalPoint localPosition(float strip) const =0
const std::vector< uint8_t > & amplitudes() const