CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
StripCPEfromTrackAngle Class Reference

#include <StripCPEfromTrackAngle.h>

Inheritance diagram for StripCPEfromTrackAngle:
StripCPE StripClusterParameterEstimator

Public Types

using AClusters = StripClusterParameterEstimator::AClusters
 
using AlgoParam = StripCPE::AlgoParam
 
using ALocalValues = StripClusterParameterEstimator::ALocalValues
 
- Public Types inherited from StripClusterParameterEstimator
using AClusters = DynArray< SiStripCluster const * >
 
using ALocalValues = DynArray< LocalValues >
 
using LocalValues = std::pair< LocalPoint, LocalError >
 
typedef std::vector< LocalValuesVLocalValues
 

Public Member Functions

float legacyStripErrorSquared (const unsigned N, const float uProj) const
 
void localParameters (AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const override
 
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &, const GeomDetUnit &, const LocalTrajectoryParameters &) const override
 
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl, AlgoParam const &ap) const override
 
 StripCPEfromTrackAngle (edm::ParameterSet &conf, const MagneticField &mag, const TrackerGeometry &geom, const SiStripLorentzAngle &lorentz, const SiStripBackPlaneCorrection &backPlaneCorrection, const SiStripConfObject &confObj, const SiStripLatency &latency)
 
float stripErrorSquared (const unsigned N, const float uProj, const SiStripDetId::SubDetector loc) const
 
- Public Member Functions inherited from StripCPE
LocalVector driftDirection (const StripGeomDetUnit *det) const override
 
AlgoParam getAlgoParam (const GeomDetUnit &det, const LocalTrajectoryParameters &ltp) const
 
virtual void localParameters (AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
 
virtual LocalValues localParameters (const SiStripCluster &, const GeomDetUnit &) const
 
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl, const GeomDetUnit &) const override
 
virtual LocalValues localParameters (const SiStripCluster &cluster, const GeomDetUnit &gd, const LocalTrajectoryParameters &) const
 
virtual LocalValues localParameters (const SiStripCluster &cluster, const GeomDetUnit &gd, const TrajectoryStateOnSurface &tsos) const
 
 StripCPE (edm::ParameterSet &conf, const MagneticField &, const TrackerGeometry &, const SiStripLorentzAngle &, const SiStripBackPlaneCorrection &, const SiStripConfObject &, const SiStripLatency &)
 
- Public Member Functions inherited from StripClusterParameterEstimator
virtual LocalValues localParameters (const SiStripCluster &cluster, const GeomDetUnit &gd, const TrajectoryStateOnSurface &tsos) const
 
virtual VLocalValues localParametersV (const SiStripCluster &cluster, const GeomDetUnit &gd) const
 
virtual VLocalValues localParametersV (const SiStripCluster &cluster, const GeomDetUnit &gd, const TrajectoryStateOnSurface &tsos) const
 
virtual ~StripClusterParameterEstimator ()
 

Private Types

enum  Algo { Algo::legacy, Algo::mergeCK, Algo::chargeCK }
 

Private Member Functions

virtual void localParameters (AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
 
virtual LocalValues localParameters (const SiStripCluster &, const GeomDetUnit &) const
 
virtual StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl, AlgoParam const &ap) const
 
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl, const GeomDetUnit &) const override
 
virtual LocalValues localParameters (const SiStripCluster &cluster, const GeomDetUnit &gd, const LocalTrajectoryParameters &) const
 
virtual LocalValues localParameters (const SiStripCluster &cluster, const GeomDetUnit &gd, const TrajectoryStateOnSurface &tsos) const
 

Private Attributes

Algo m_algo
 
const float maxChgOneMIP
 
float mHC_P [4][2]
 
std::map< SiStripDetId::SubDetector, float > mHC_P0
 
std::map< SiStripDetId::SubDetector, float > mHC_P1
 
float mLC_P [3]
 
const bool useLegacyError
 

Additional Inherited Members

- Protected Member Functions inherited from StripCPE
Param const & param (const GeomDetUnit &det) const
 
- Protected Attributes inherited from StripCPE
const SiStripBackPlaneCorrectionBackPlaneCorrectionMap_
 
const TrackerGeometrygeom_
 
const SiStripLorentzAngleLorentzAngleMap_
 
const MagneticFieldmagfield_
 
const bool peakMode_
 
std::vector< float > xtalk1
 
std::vector< float > xtalk2
 

Detailed Description

Definition at line 6 of file StripCPEfromTrackAngle.h.

Member Typedef Documentation

◆ AClusters

Definition at line 31 of file StripCPEfromTrackAngle.h.

◆ AlgoParam

Definition at line 30 of file StripCPEfromTrackAngle.h.

◆ ALocalValues

Definition at line 32 of file StripCPEfromTrackAngle.h.

Member Enumeration Documentation

◆ Algo

enum StripCPEfromTrackAngle::Algo
strongprivate
Enumerator
legacy 
mergeCK 
chargeCK 

Definition at line 25 of file StripCPEfromTrackAngle.h.

25 { legacy, mergeCK, chargeCK };

Constructor & Destructor Documentation

◆ StripCPEfromTrackAngle()

StripCPEfromTrackAngle::StripCPEfromTrackAngle ( edm::ParameterSet conf,
const MagneticField mag,
const TrackerGeometry geom,
const SiStripLorentzAngle lorentz,
const SiStripBackPlaneCorrection backPlaneCorrection,
const SiStripConfObject confObj,
const SiStripLatency latency 
)

Definition at line 7 of file StripCPEfromTrackAngle.cc.

14  : StripCPE(conf, mag, geom, lorentz, backPlaneCorrection, confObj, latency),
15  useLegacyError(conf.existsAs<bool>("useLegacyError") ? conf.getParameter<bool>("useLegacyError") : true),
16  maxChgOneMIP(conf.existsAs<float>("maxChgOneMIP") ? conf.getParameter<double>("maxChgOneMIP") : -6000.),
18  mLC_P[0] = conf.existsAs<double>("mLC_P0") ? conf.getParameter<double>("mLC_P0") : -.326;
19  mLC_P[1] = conf.existsAs<double>("mLC_P1") ? conf.getParameter<double>("mLC_P1") : .618;
20  mLC_P[2] = conf.existsAs<double>("mLC_P2") ? conf.getParameter<double>("mLC_P2") : .300;
21 
22  mHC_P[SiStripDetId::TIB - 3][0] = conf.existsAs<double>("mTIB_P0") ? conf.getParameter<double>("mTIB_P0") : -.742;
23  mHC_P[SiStripDetId::TIB - 3][1] = conf.existsAs<double>("mTIB_P1") ? conf.getParameter<double>("mTIB_P1") : .202;
24  mHC_P[SiStripDetId::TID - 3][0] = conf.existsAs<double>("mTID_P0") ? conf.getParameter<double>("mTID_P0") : -1.026;
25  mHC_P[SiStripDetId::TID - 3][1] = conf.existsAs<double>("mTID_P1") ? conf.getParameter<double>("mTID_P1") : .253;
26  mHC_P[SiStripDetId::TOB - 3][0] = conf.existsAs<double>("mTOB_P0") ? conf.getParameter<double>("mTOB_P0") : -1.427;
27  mHC_P[SiStripDetId::TOB - 3][1] = conf.existsAs<double>("mTOB_P1") ? conf.getParameter<double>("mTOB_P1") : .433;
28  mHC_P[SiStripDetId::TEC - 3][0] = conf.existsAs<double>("mTEC_P0") ? conf.getParameter<double>("mTEC_P0") : -1.885;
29  mHC_P[SiStripDetId::TEC - 3][1] = conf.existsAs<double>("mTEC_P1") ? conf.getParameter<double>("mTEC_P1") : .471;
30 }

References edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), mHC_P, mLC_P, SiStripDetId::TEC, SiStripDetId::TIB, SiStripDetId::TID, and SiStripDetId::TOB.

Member Function Documentation

◆ legacyStripErrorSquared()

float StripCPEfromTrackAngle::legacyStripErrorSquared ( const unsigned  N,
const float  uProj 
) const

Definition at line 40 of file StripCPEfromTrackAngle.cc.

40  {
41  if
42  UNLIKELY((float(N) - uProj) > 3.5f)
43  return float(N * N) / 12.f;
44  else {
45  static constexpr float P1 = -0.339;
46  static constexpr float P2 = 0.90;
47  static constexpr float P3 = 0.279;
48  const float uerr = P1 * uProj * vdt::fast_expf(-uProj * P2) + P3;
49  return uerr * uerr;
50  }
51 }

References f, myMath::fast_expf(), dqmMemoryStats::float, N, and UNLIKELY.

Referenced by localParameters().

◆ localParameters() [1/9]

virtual void StripClusterParameterEstimator::localParameters
inlineprivate

Definition at line 32 of file StripClusterParameterEstimator.h.

35  {}

◆ localParameters() [2/9]

void StripCPEfromTrackAngle::localParameters ( AClusters const &  clusters,
ALocalValues retValues,
const GeomDetUnit gd,
const LocalTrajectoryParameters ltp 
) const
overridevirtual

Reimplemented from StripClusterParameterEstimator.

Definition at line 53 of file StripCPEfromTrackAngle.cc.

56  {
57  auto const& par = getAlgoParam(det, ltp);
58  auto const& p = par.p;
59  auto loc = par.loc;
60  auto corr = par.corr;
61  auto afp = par.afullProjection;
62 
63  auto fill = [&](unsigned int i, float uerr2) {
64  const float strip = clusters[i]->barycenter() + corr;
65  retValues[i].first = p.topology->localPosition(strip, ltp.vector());
66  retValues[i].second = p.topology->localError(strip, uerr2, ltp.vector());
67  };
68 
69  switch (m_algo) {
70  case Algo::chargeCK:
71  for (auto i = 0U; i < clusters.size(); ++i) {
72  auto dQdx = siStripClusterTools::chargePerCM(*clusters[i], ltp, p.invThickness);
73  auto N = clusters[i]->amplitudes().size();
74  auto uerr2 = dQdx > maxChgOneMIP ? legacyStripErrorSquared(N, afp) : stripErrorSquared(N, afp, loc);
75  fill(i, uerr2);
76  }
77  break;
78  case Algo::legacy:
79  for (auto i = 0U; i < clusters.size(); ++i) {
80  auto N = clusters[i]->amplitudes().size();
81  auto uerr2 = legacyStripErrorSquared(N, afp);
82  fill(i, uerr2);
83  }
84  break;
85  case Algo::mergeCK:
86  for (auto i = 0U; i < clusters.size(); ++i) {
87  auto N = clusters[i]->amplitudes().size();
88  auto uerr2 = clusters[i]->isMerged() ? legacyStripErrorSquared(N, afp) : stripErrorSquared(N, afp, loc);
89  fill(i, uerr2);
90  }
91  break;
92  }
93 }

References chargeCK, siStripClusterTools::chargePerCM(), bsc_activity_cfg::clusters, alignCSCRings::corr, ntuplemaker::fill, StripCPE::getAlgoParam(), mps_fire::i, legacy, legacyStripErrorSquared(), m_algo, maxChgOneMIP, mergeCK, N, AlCaHLTBitMon_ParallelJobs::p, digitizers_cfi::strip, stripErrorSquared(), mitigatedMETSequence_cff::U, and LocalTrajectoryParameters::vector().

Referenced by localParameters().

◆ localParameters() [3/9]

virtual LocalValues StripClusterParameterEstimator::localParameters
inlineprivate

Definition at line 37 of file StripClusterParameterEstimator.h.

37  {
38  return std::make_pair(LocalPoint(), LocalError());
39  }

◆ localParameters() [4/9]

StripClusterParameterEstimator::LocalValues StripCPEfromTrackAngle::localParameters ( const SiStripCluster cluster,
const GeomDetUnit det,
const LocalTrajectoryParameters ltp 
) const
overridevirtual

Reimplemented from StripClusterParameterEstimator.

Definition at line 126 of file StripCPEfromTrackAngle.cc.

127  {
128  auto const& par = getAlgoParam(det, ltp);
129  return localParameters(cluster, par);
130 }

References StripCPE::getAlgoParam(), and localParameters().

◆ localParameters() [5/9]

virtual StripClusterParameterEstimator::LocalValues StripCPE::localParameters
inlineprivate

Definition at line 52 of file StripCPE.h.

53  {
54  return std::make_pair(LocalPoint(), LocalError());
55  }

◆ localParameters() [6/9]

StripClusterParameterEstimator::LocalValues StripCPEfromTrackAngle::localParameters ( const SiStripCluster cl,
AlgoParam const &  ap 
) const
overridevirtual

Reimplemented from StripCPE.

Definition at line 95 of file StripCPEfromTrackAngle.cc.

96  {
97  auto const& p = par.p;
98  auto const& ltp = par.ltp;
99  auto loc = par.loc;
100  auto corr = par.corr;
101  auto afp = par.afullProjection;
102 
103  float uerr2 = 0;
104 
105  auto N = cluster.amplitudes().size();
106 
107  switch (m_algo) {
108  case Algo::chargeCK: {
109  auto dQdx = siStripClusterTools::chargePerCM(cluster, ltp, p.invThickness);
110  uerr2 = dQdx > maxChgOneMIP ? legacyStripErrorSquared(N, afp) : stripErrorSquared(N, afp, loc);
111  } break;
112  case Algo::legacy:
113  uerr2 = legacyStripErrorSquared(N, afp);
114  break;
115  case Algo::mergeCK:
116  uerr2 = cluster.isMerged() ? legacyStripErrorSquared(N, afp) : stripErrorSquared(N, afp, loc);
117  break;
118  }
119 
120  const float strip = cluster.barycenter() + corr;
121 
122  return std::make_pair(p.topology->localPosition(strip, ltp.vector()),
123  p.topology->localError(strip, uerr2, ltp.vector()));
124 }

References StripCPE::AlgoParam::afullProjection, SiStripCluster::amplitudes(), SiStripCluster::barycenter(), chargeCK, siStripClusterTools::chargePerCM(), StripCPE::AlgoParam::corr, alignCSCRings::corr, SiStripCluster::isMerged(), legacy, legacyStripErrorSquared(), StripCPE::AlgoParam::loc, StripCPE::AlgoParam::ltp, m_algo, maxChgOneMIP, mergeCK, N, StripCPE::AlgoParam::p, AlCaHLTBitMon_ParallelJobs::p, digitizers_cfi::strip, and stripErrorSquared().

◆ localParameters() [7/9]

StripClusterParameterEstimator::LocalValues StripCPE::localParameters
overrideprivate

Definition at line 66 of file StripCPE.cc.

67  {
68  StripCPE::Param const& p = param(det);
69  const float barycenter = cluster.barycenter();
70  const float fullProjection =
71  p.coveredStrips(p.drift + LocalVector(0, 0, -p.thickness), p.topology->localPosition(barycenter));
72  const float strip = barycenter - 0.5f * (1.f - p.backplanecorrection) * fullProjection;
73 
74  return std::make_pair(p.topology->localPosition(strip), p.topology->localError(strip, 1.f / 12.f));
75 }

◆ localParameters() [8/9]

virtual LocalValues StripClusterParameterEstimator::localParameters
inlineprivate

Definition at line 40 of file StripClusterParameterEstimator.h.

42  {
43  return localParameters(cluster, gd);
44  }

◆ localParameters() [9/9]

virtual LocalValues StripClusterParameterEstimator::localParameters
inlineprivate

Definition at line 45 of file StripClusterParameterEstimator.h.

47  {
48  return localParameters(cluster, gd, tsos.localParameters());
49  }

◆ stripErrorSquared()

float StripCPEfromTrackAngle::stripErrorSquared ( const unsigned  N,
const float  uProj,
const SiStripDetId::SubDetector  loc 
) const

Definition at line 32 of file StripCPEfromTrackAngle.cc.

34  {
35  auto fun = [&](float x) -> float { return mLC_P[0] * x * vdt::fast_expf(-x * mLC_P[1]) + mLC_P[2]; };
36  auto uerr = (N <= 4) ? fun(uProj) : mHC_P[loc - 3][0] + float(N) * mHC_P[loc - 3][1];
37  return uerr * uerr;
38 }

References myMath::fast_expf(), dqmMemoryStats::float, mHC_P, mLC_P, N, and x.

Referenced by localParameters().

Member Data Documentation

◆ m_algo

Algo StripCPEfromTrackAngle::m_algo
private

Definition at line 27 of file StripCPEfromTrackAngle.h.

Referenced by localParameters().

◆ maxChgOneMIP

const float StripCPEfromTrackAngle::maxChgOneMIP
private

Definition at line 23 of file StripCPEfromTrackAngle.h.

Referenced by localParameters().

◆ mHC_P

float StripCPEfromTrackAngle::mHC_P[4][2]
private

Definition at line 12 of file StripCPEfromTrackAngle.h.

Referenced by StripCPEfromTrackAngle(), and stripErrorSquared().

◆ mHC_P0

std::map<SiStripDetId::SubDetector, float> StripCPEfromTrackAngle::mHC_P0
private

Definition at line 15 of file StripCPEfromTrackAngle.h.

◆ mHC_P1

std::map<SiStripDetId::SubDetector, float> StripCPEfromTrackAngle::mHC_P1
private

Definition at line 16 of file StripCPEfromTrackAngle.h.

◆ mLC_P

float StripCPEfromTrackAngle::mLC_P[3]
private

Definition at line 11 of file StripCPEfromTrackAngle.h.

Referenced by StripCPEfromTrackAngle(), and stripErrorSquared().

◆ useLegacyError

const bool StripCPEfromTrackAngle::useLegacyError
private

Definition at line 19 of file StripCPEfromTrackAngle.h.

Vector3DBase< float, LocalTag >
StripCPEfromTrackAngle::mLC_P
float mLC_P[3]
Definition: StripCPEfromTrackAngle.h:11
mps_fire.i
i
Definition: mps_fire.py:355
StripCPEfromTrackAngle::localParameters
void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const override
Definition: StripCPEfromTrackAngle.cc:53
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
config_102169_raw_cff.latency
latency
Definition: config_102169_raw_cff.py:29
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
siStripClusterTools::chargePerCM
float chargePerCM(DetId detid, Iter a, Iter b)
Definition: SiStripClusterTools.h:29
DDAxes::x
StripCPE::param
Param const & param(const GeomDetUnit &det) const
Definition: StripCPE.h:81
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
StripCPE::StripCPE
StripCPE(edm::ParameterSet &conf, const MagneticField &, const TrackerGeometry &, const SiStripLorentzAngle &, const SiStripBackPlaneCorrection &, const SiStripConfObject &, const SiStripLatency &)
Definition: StripCPE.cc:11
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
myMath::fast_expf
float fast_expf(float x)
Definition: EcalUncalibRecHitRatioMethodAlgo.h:27
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
StripCPEfromTrackAngle::maxChgOneMIP
const float maxChgOneMIP
Definition: StripCPEfromTrackAngle.h:23
N
#define N
Definition: blowfish.cc:9
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
LocalTrajectoryParameters::vector
AlgebraicVector5 vector() const
Definition: LocalTrajectoryParameters.h:120
SiStripDetId::TEC
static constexpr auto TEC
Definition: SiStripDetId.h:40
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
StripCPE::getAlgoParam
AlgoParam getAlgoParam(const GeomDetUnit &det, const LocalTrajectoryParameters &ltp) const
Definition: StripCPE.h:57
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
StripCPEfromTrackAngle::Algo::mergeCK
LocalError
Definition: LocalError.h:12
StripCPEfromTrackAngle::stripErrorSquared
float stripErrorSquared(const unsigned N, const float uProj, const SiStripDetId::SubDetector loc) const
Definition: StripCPEfromTrackAngle.cc:32
StripCPEfromTrackAngle::legacyStripErrorSquared
float legacyStripErrorSquared(const unsigned N, const float uProj) const
Definition: StripCPEfromTrackAngle.cc:40
StripCPEfromTrackAngle::m_algo
Algo m_algo
Definition: StripCPEfromTrackAngle.h:27
StripCPE::Param
Definition: StripCPE.h:33
SiStripDetId::TOB
static constexpr auto TOB
Definition: SiStripDetId.h:39
SiStripDetId::TID
static constexpr auto TID
Definition: SiStripDetId.h:38
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
StripCPEfromTrackAngle::Algo::chargeCK
SiStripDetId::TIB
static constexpr auto TIB
Definition: SiStripDetId.h:37
StripCPEfromTrackAngle::Algo::legacy
StripCPEfromTrackAngle::mHC_P
float mHC_P[4][2]
Definition: StripCPEfromTrackAngle.h:12
StripCPEfromTrackAngle::useLegacyError
const bool useLegacyError
Definition: StripCPEfromTrackAngle.h:19