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 float StripCPEfromTrackAngle::stripErrorSquared(const unsigned N, const float uProj, const SiStripDetId::SubDetector loc ) const {
7  if( loc == SiStripDetId::UNKNOWN)
8  throw cms::Exception("StripCPEfromTrackAngle::stripErrorSquared", "Incompatible sub-detector.");
9 
10  auto fun = [&] (float x) -> float { return mLC_P[0]*x*vdt::fast_expf(-x*mLC_P[1])+mLC_P[2];};
11  auto uerr = (N <= 4) ? fun(uProj) : mHC_P[loc-3][0]+float(N)*mHC_P[loc-3][1];
12  return uerr*uerr;
13 }
14 
15 float StripCPEfromTrackAngle::legacyStripErrorSquared(const unsigned N, const float uProj) const {
16  if( (float(N)-uProj) > 3.5f )
17  return float(N*N)/12.f;
18  else {
19  static constexpr float P1=-0.339;
20  static constexpr float P2=0.90;
21  static constexpr float P3=0.279;
22  const float uerr = P1*uProj*vdt::fast_expf(-uProj*P2)+P3;
23  return uerr*uerr;
24  }
25 }
26 
28 localParameters( const SiStripCluster& cluster, const GeomDetUnit& det, const LocalTrajectoryParameters& ltp) const {
29 
30  StripCPE::Param const & p = param(det);
31  SiStripDetId ssdid = SiStripDetId( det.geographicalId() );
32 
33  LocalVector track = ltp.momentum();
34  track *=
35  (track.z()<0) ? std::abs(p.thickness/track.z()) :
36  (track.z()>0) ? -std::abs(p.thickness/track.z()) :
37  p.maxLength/track.mag() ;
38 
39  const unsigned N = cluster.amplitudes().size();
40  const float fullProjection = p.coveredStrips( track+p.drift, ltp.position());
41  const float uerr2 = useLegacyError ? legacyStripErrorSquared(N,std::abs(fullProjection)) : stripErrorSquared( N, std::abs(fullProjection),ssdid.subDetector() );
42  const float strip = cluster.barycenter() - 0.5f*(1.f-p.backplanecorrection) * fullProjection
43  + 0.5f*p.coveredStrips(track, ltp.position());
44 
45  return std::make_pair( p.topology->localPosition(strip, ltp.vector()),
46  p.topology->localError(strip, uerr2, ltp.vector()) );
47 }
48 
float legacyStripErrorSquared(const unsigned N, const float uProj) const
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
AlgebraicVector5 vector() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
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
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
SubDetector subDetector() const
Definition: SiStripDetId.h:114
#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
Definition: DDAxes.h:10
const std::vector< uint8_t > & amplitudes() const
#define constexpr
float stripErrorSquared(const unsigned N, const float uProj, const SiStripDetId::SubDetector loc) const