CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
StripCPE Class Reference

#include <StripCPE.h>

Inheritance diagram for StripCPE:
StripClusterParameterEstimator StripCPEfromTrackAngle StripCPEgeometric

Classes

struct  AlgoParam
 
struct  Param
 

Public Member Functions

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
 
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
 
 StripCPE (edm::ParameterSet &conf, const MagneticField &, const TrackerGeometry &, const SiStripLorentzAngle &, const SiStripBackPlaneCorrection &, const SiStripConfObject &, const SiStripLatency &)
 
- Public Member Functions inherited from StripClusterParameterEstimator
virtual void localParameters (AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
 
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
 
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 ()
 

Protected Member Functions

Param const & param (const GeomDetUnit &det) const
 

Protected Attributes

const SiStripBackPlaneCorrectionBackPlaneCorrectionMap_
 
const TrackerGeometrygeom_
 
const SiStripLorentzAngleLorentzAngleMap_
 
const MagneticFieldmagfield_
 
const bool peakMode_
 
std::vector< float > xtalk1
 
std::vector< float > xtalk2
 

Private Types

typedef std::vector< ParamParams
 

Private Member Functions

void fillParams ()
 

Private Attributes

unsigned int m_off
 
Params m_Params
 

Additional Inherited Members

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

Detailed Description

Definition at line 17 of file StripCPE.h.

Member Typedef Documentation

◆ Params

typedef std::vector<Param> StripCPE::Params
private

Definition at line 85 of file StripCPE.h.

Constructor & Destructor Documentation

◆ StripCPE()

StripCPE::StripCPE ( edm::ParameterSet conf,
const MagneticField mag,
const TrackerGeometry geom,
const SiStripLorentzAngle LorentzAngle,
const SiStripBackPlaneCorrection BackPlaneCorrection,
const SiStripConfObject confObj,
const SiStripLatency latency 
)

Definition at line 9 of file StripCPE.cc.

16  : peakMode_(latency.singleReadOutMode() == 1),
17  geom_(geom),
18  magfield_(mag),
20  BackPlaneCorrectionMap_(BackPlaneCorrection) {
21  typedef std::map<std::string, SiStripModuleGeometry> map_t;
22  map_t modules;
37 
38  const unsigned size =
39  static_cast<unsigned int>(
40  max_element(modules.begin(), modules.end(), [&](auto& arg1, auto& arg2) { return arg1.second < arg2.second; })
41  ->second) +
42  1;
43  xtalk1.resize(size);
44  xtalk2.resize(size);
45 
46  for (map_t::const_iterator it = modules.begin(); it != modules.end(); it++) {
47  const std::string modeS(peakMode_ ? "Peak" : "Deco"), xtalk1S("xtalk1_" + it->first + modeS),
48  xtalk2S("xtalk2_" + it->first + modeS);
49 
50  if (!confObj.isParameter(xtalk1S))
51  throw cms::Exception("SiStripConfObject does not contain: ") << xtalk1S;
52  if (!confObj.isParameter(xtalk2S))
53  throw cms::Exception("SiStripConfObject does not contain: ") << xtalk2S;
54 
55  xtalk1[static_cast<int>(it->second)] = confObj.get<double>(xtalk1S);
56  xtalk2[static_cast<int>(it->second)] = confObj.get<double>(xtalk2S);
57  }
58 
59  fillParams();
60 }

References fillParams(), SiStripConfObject::get(), IB1, IB2, SiStripConfObject::isParameter(), LogMessageMonitor_cff::modules, OB1, OB2, peakMode_, edm::second(), findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, W1A, W1B, W2A, W2B, W3A, W3B, W4, W5, W6, W7, xtalk1, and xtalk2.

Member Function Documentation

◆ driftDirection()

LocalVector StripCPE::driftDirection ( const StripGeomDetUnit det) const
overridevirtual

Implements StripClusterParameterEstimator.

Definition at line 77 of file StripCPE.cc.

77  {
78  LocalVector lbfield = (det->surface()).toLocal(magfield_.inTesla(det->surface().position()));
79 
80  float tanLorentzAnglePerTesla = LorentzAngleMap_.getLorentzAngle(det->geographicalId().rawId());
81 
82  float dir_x = -tanLorentzAnglePerTesla * lbfield.y();
83  float dir_y = tanLorentzAnglePerTesla * lbfield.x();
84  float dir_z = 1.f; // E field always in z direction
85 
86  return LocalVector(dir_x, dir_y, dir_z);
87 }

References GeomDet::geographicalId(), SiStripLorentzAngle::getLorentzAngle(), MagneticField::inTesla(), LorentzAngleMap_, magfield_, GloballyPositioned< T >::position(), DetId::rawId(), GeomDet::surface(), toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by fillParams().

◆ fillParams()

void StripCPE::fillParams ( )
private

Definition at line 89 of file StripCPE.cc.

89  {
90  auto const& dus = geom_.detUnits();
91  m_off = dus.size();
92  for (unsigned int i = 1; i < 7; ++i) {
93  LogDebug("LookingForFirstStrip")
94  << "Subdetector " << i << " GeomDetEnumerator " << GeomDetEnumerators::tkDetEnum[i] << " offset "
95  << geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) << " is it strip? "
96  << (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size()
97  ? dus[geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])]->type().isTrackerStrip()
98  : false);
99  if (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size() &&
100  dus[geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])]->type().isTrackerStrip()) {
103  }
104  }
105  LogDebug("LookingForFirstStrip") << " Chosen offset: " << m_off;
106  m_Params.resize(dus.size() - m_off);
107  for (auto i = m_off; i != dus.size(); ++i) {
108  auto& p = m_Params[i - m_off];
109  const StripGeomDetUnit* stripdet = (const StripGeomDetUnit*)(dus[i]);
110  assert(stripdet->index() == int(i));
111  // assert(stripdet->geographicalId().subdetId()>1); // not pixel..
112  assert(stripdet->type().isTrackerStrip()); // not pixel
113 
114  const Bounds& bounds = stripdet->specificSurface().bounds();
115  p.maxLength = std::sqrt(std::pow(bounds.length(), 2.f) + std::pow(bounds.width(), 2.f));
116  p.thickness = bounds.thickness();
117  p.invThickness = 1.f / p.thickness;
118  p.drift = driftDirection(stripdet) * p.thickness;
119  p.topology = (StripTopology*)(&stripdet->topology());
120  p.nstrips = p.topology->nstrips();
121  p.moduleGeom = SiStripDetId(stripdet->geographicalId()).moduleGeometry();
122  p.backplanecorrection = BackPlaneCorrectionMap_.getBackPlaneCorrection(stripdet->geographicalId().rawId());
123 
124  const TkRadialStripTopology* rtop =
125  dynamic_cast<const TkRadialStripTopology*>(&stripdet->specificType().specificTopology());
126  p.pitch_rel_err2 =
127  (rtop)
128  ? pow(0.5f * rtop->angularWidth() * rtop->stripLength() / rtop->localPitch(LocalPoint(0, 0, 0)), 2.f) / 12.f
129  : 0.f;
130  }
131 }

References TkRadialStripTopology::angularWidth(), cms::cuda::assert(), BackPlaneCorrectionMap_, Surface::bounds(), TrackerGeometry::detUnits(), driftDirection(), f, GeomDet::geographicalId(), geom_, SiStripBackPlaneCorrection::getBackPlaneCorrection(), mps_fire::i, GeomDet::index(), createfilelist::int, GeomDetType::isTrackerStrip(), TkRadialStripTopology::localPitch(), LogDebug, m_off, m_Params, TrackerGeometry::offsetDU(), AlCaHLTBitMon_ParallelJobs::p, funct::pow(), DetId::rawId(), GeomDet::specificSurface(), StripGeomDetType::specificTopology(), StripGeomDetUnit::specificType(), mathSSE::sqrt(), TkRadialStripTopology::stripLength(), GeomDetEnumerators::tkDetEnum, StripGeomDetUnit::topology(), and StripGeomDetUnit::type().

Referenced by StripCPE().

◆ getAlgoParam()

AlgoParam StripCPE::getAlgoParam ( const GeomDetUnit det,
const LocalTrajectoryParameters ltp 
) const
inline

Definition at line 57 of file StripCPE.h.

57  {
58  StripCPE::Param const& p = param(det);
59  SiStripDetId::SubDetector loc = SiStripDetId(det.geographicalId()).subDetector();
60 
62  track *= -p.thickness;
63 
64  const float fullProjection = p.coveredStrips(track + p.drift, ltp.position());
65 
66  auto const corr =
67  -0.5f * (1.f - p.backplanecorrection) * fullProjection + 0.5f * p.coveredStrips(track, ltp.position());
68 
69  return AlgoParam{p, ltp, loc, std::abs(fullProjection), corr};
70  }

References funct::abs(), alignCSCRings::corr, LocalTrajectoryParameters::directionNotNormalized(), f, GeomDet::geographicalId(), AlCaHLTBitMon_ParallelJobs::p, param(), LocalTrajectoryParameters::position(), and HLT_FULL_cff::track.

Referenced by StripCPEfromTrackAngle::localParameters(), TkStripMeasurementDet::recHits(), and TkStripMeasurementDet::simpleRecHits().

◆ localParameters() [1/6]

virtual void StripClusterParameterEstimator::localParameters
inline

Definition at line 32 of file StripClusterParameterEstimator.h.

35  {}

◆ localParameters() [2/6]

virtual LocalValues StripClusterParameterEstimator::localParameters
inline

Definition at line 37 of file StripClusterParameterEstimator.h.

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

◆ localParameters() [3/6]

virtual StripClusterParameterEstimator::LocalValues StripCPE::localParameters ( const SiStripCluster cl,
AlgoParam const &  ap 
) const
inlinevirtual

Reimplemented in StripCPEfromTrackAngle.

Definition at line 52 of file StripCPE.h.

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

◆ localParameters() [4/6]

StripClusterParameterEstimator::LocalValues StripCPE::localParameters ( const SiStripCluster cl,
const GeomDetUnit det 
) const
overridevirtual

Reimplemented from StripClusterParameterEstimator.

Definition at line 62 of file StripCPE.cc.

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

References SiStripCluster::barycenter(), f, AlCaHLTBitMon_ParallelJobs::p, param(), and digitizers_cfi::strip.

Referenced by TkStripMeasurementDet::hit().

◆ localParameters() [5/6]

virtual LocalValues StripClusterParameterEstimator::localParameters
inline

Definition at line 40 of file StripClusterParameterEstimator.h.

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

◆ localParameters() [6/6]

virtual LocalValues StripClusterParameterEstimator::localParameters
inline

Definition at line 45 of file StripClusterParameterEstimator.h.

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

◆ param()

Param const& StripCPE::param ( const GeomDetUnit det) const
inlineprotected

Definition at line 81 of file StripCPE.h.

81 { return m_Params[det.index() - m_off]; }

References GeomDet::index(), m_off, and m_Params.

Referenced by getAlgoParam(), StripCPEgeometric::localParameters(), and localParameters().

Member Data Documentation

◆ BackPlaneCorrectionMap_

const SiStripBackPlaneCorrection& StripCPE::BackPlaneCorrectionMap_
protected

Definition at line 77 of file StripCPE.h.

Referenced by fillParams().

◆ geom_

const TrackerGeometry& StripCPE::geom_
protected

Definition at line 74 of file StripCPE.h.

Referenced by fillParams().

◆ LorentzAngleMap_

const SiStripLorentzAngle& StripCPE::LorentzAngleMap_
protected

Definition at line 76 of file StripCPE.h.

Referenced by driftDirection().

◆ m_off

unsigned int StripCPE::m_off
private

Definition at line 87 of file StripCPE.h.

Referenced by fillParams(), and param().

◆ m_Params

Params StripCPE::m_Params
private

Definition at line 86 of file StripCPE.h.

Referenced by fillParams(), and param().

◆ magfield_

const MagneticField& StripCPE::magfield_
protected

Definition at line 75 of file StripCPE.h.

Referenced by driftDirection().

◆ peakMode_

const bool StripCPE::peakMode_
protected

Definition at line 73 of file StripCPE.h.

Referenced by StripCPE().

◆ xtalk1

std::vector<float> StripCPE::xtalk1
protected

Definition at line 78 of file StripCPE.h.

Referenced by StripCPEgeometric::localParameters(), and StripCPE().

◆ xtalk2

std::vector<float> StripCPE::xtalk2
protected

Definition at line 79 of file StripCPE.h.

Referenced by StripCPE().

Vector3DBase< float, LocalTag >
SiStripModuleGeometry::W4
StripCPE::xtalk2
std::vector< float > xtalk2
Definition: StripCPE.h:79
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11776
SiStripModuleGeometry::W7
LogMessageMonitor_cff.modules
modules
Definition: LogMessageMonitor_cff.py:7
StripCPE::driftDirection
LocalVector driftDirection(const StripGeomDetUnit *det) const override
Definition: StripCPE.cc:77
StripGeomDetUnit::topology
const Topology & topology() const override
Returns a reference to the strip proxy topology.
Definition: StripGeomDetUnit.cc:15
TkRadialStripTopology::localPitch
float localPitch(const LocalPoint &) const override
Definition: TkRadialStripTopology.cc:214
SiStripSimParameters_cfi.LorentzAngle
LorentzAngle
Definition: SiStripSimParameters_cfi.py:93
StripCPE::m_Params
Params m_Params
Definition: StripCPE.h:86
config_102169_raw_cff.latency
latency
Definition: config_102169_raw_cff.py:29
StripCPE::peakMode_
const bool peakMode_
Definition: StripCPE.h:73
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
StripGeomDetUnit::type
const GeomDetType & type() const override
Definition: StripGeomDetUnit.cc:11
modules
Definition: ZHLTMatchFilter.cc:17
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
TkRadialStripTopology
Definition: TkRadialStripTopology.h:28
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Bounds
Definition: Bounds.h:18
SiStripModuleGeometry::W3B
cms::cuda::assert
assert(be >=bs)
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
SiStripModuleGeometry::IB1
GeomDet::index
int index() const
Definition: GeomDet.h:83
SiStripConfObject::isParameter
bool isParameter(const std::string &name) const
Definition: SiStripConfObject.h:76
StripCPE::param
Param const & param(const GeomDetUnit &det) const
Definition: StripCPE.h:81
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
SiStripBackPlaneCorrection::getBackPlaneCorrection
float getBackPlaneCorrection(const uint32_t &) const
Definition: SiStripBackPlaneCorrection.cc:15
SiStripModuleGeometry::W3A
StripCPE::fillParams
void fillParams()
Definition: StripCPE.cc:89
SiStripModuleGeometry::W6
SiStripModuleGeometry::OB1
StripCPE::xtalk1
std::vector< float > xtalk1
Definition: StripCPE.h:78
StripCPE::geom_
const TrackerGeometry & geom_
Definition: StripCPE.h:74
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
SiStripModuleGeometry::W5
LocalTrajectoryParameters::position
LocalPoint position() const
Local x and y position coordinates.
Definition: LocalTrajectoryParameters.h:85
TrackerGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: TrackerGeometry.h:61
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
GeomDetEnumerators::tkDetEnum
constexpr SubDetector tkDetEnum[8]
Definition: GeomDetEnumerators.h:37
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
StripCPE::BackPlaneCorrectionMap_
const SiStripBackPlaneCorrection & BackPlaneCorrectionMap_
Definition: StripCPE.h:77
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
SiStripModuleGeometry::W1B
StripCPE::LorentzAngleMap_
const SiStripLorentzAngle & LorentzAngleMap_
Definition: StripCPE.h:76
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripModuleGeometry::IB2
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
SiStripModuleGeometry::W1A
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
StripCPE::m_off
unsigned int m_off
Definition: StripCPE.h:87
LocalTrajectoryParameters::directionNotNormalized
LocalVector directionNotNormalized() const
Momentum vector unit in the local frame.
Definition: LocalTrajectoryParameters.h:107
LocalError
Definition: LocalError.h:12
SiStripModuleGeometry::W2A
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
LocalVector
Local3DVector LocalVector
Definition: LocalVector.h:12
createfilelist.int
int
Definition: createfilelist.py:10
StripCPE::Param
Definition: StripCPE.h:33
SiStripModuleGeometry::W2B
StripCPE::magfield_
const MagneticField & magfield_
Definition: StripCPE.h:75
GeomDet::specificSurface
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
StripCPE::localParameters
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:62
GeomDetType::isTrackerStrip
bool isTrackerStrip() const
Definition: GeomDetType.cc:13
SiStripLorentzAngle::getLorentzAngle
float getLorentzAngle(const uint32_t &) const
Definition: SiStripLorentzAngle.cc:15
SiStripConfObject::get
valueType get(const std::string &name) const
Definition: SiStripConfObject.h:63
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
StripGeomDetUnit::specificType
virtual StripGeomDetType const & specificType() const
Definition: StripGeomDetUnit.cc:13
toLocal
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
Definition: ConversionProducer.h:199
StripGeomDetType::specificTopology
virtual const TopologyType & specificTopology() const
Definition: StripGeomDetType.h:23
SiStripModuleGeometry::OB2
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
cms::Exception
Definition: Exception.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
TkRadialStripTopology::stripLength
float stripLength() const override
Definition: TkRadialStripTopology.h:132
TkRadialStripTopology::angularWidth
float angularWidth() const override
Definition: TkRadialStripTopology.h:164
SiStripSubdetector::Subdetector
Subdetector
Definition: SiStripEnums.h:5
TrackerGeometry::offsetDU
unsigned int offsetDU(SubDetector sid) const
Definition: TrackerGeometry.h:72
StripTopology
Definition: StripTopology.h:11
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
StripGeomDetUnit
Definition: StripGeomDetUnit.h:15