CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl, const GeomDetUnit &) const override
 
virtual StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl, AlgoParam const &ap) 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

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

Definition at line 85 of file StripCPE.h.

Constructor & Destructor Documentation

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 11 of file StripCPE.cc.

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.

18  : peakMode_(latency.singleReadOutMode() == 1),
19  geom_(geom),
20  magfield_(mag),
21  LorentzAngleMap_(LorentzAngle),
22  BackPlaneCorrectionMap_(BackPlaneCorrection) {
23  typedef std::map<std::string, SiStripModuleGeometry> map_t;
24  map_t modules;
25  modules["IB1"] = SiStripModuleGeometry::IB1;
26  modules["IB2"] = SiStripModuleGeometry::IB2;
27  modules["OB1"] = SiStripModuleGeometry::OB1;
28  modules["OB2"] = SiStripModuleGeometry::OB2;
29  modules["W1A"] = SiStripModuleGeometry::W1A;
30  modules["W2A"] = SiStripModuleGeometry::W2A;
31  modules["W3A"] = SiStripModuleGeometry::W3A;
32  modules["W1B"] = SiStripModuleGeometry::W1B;
33  modules["W2B"] = SiStripModuleGeometry::W2B;
34  modules["W3B"] = SiStripModuleGeometry::W3B;
35  modules["W4"] = SiStripModuleGeometry::W4;
36  modules["W5"] = SiStripModuleGeometry::W5;
37  modules["W6"] = SiStripModuleGeometry::W6;
38  modules["W7"] = SiStripModuleGeometry::W7;
39 
40  const unsigned size =
41  static_cast<unsigned int>(max_element(modules.begin(),
42  modules.end(),
43  boost::bind(&map_t::value_type::second, boost::lambda::_1) <
44  boost::bind(&map_t::value_type::second, boost::lambda::_2))
45  ->second) +
46  1;
47  xtalk1.resize(size);
48  xtalk2.resize(size);
49 
50  for (map_t::const_iterator it = modules.begin(); it != modules.end(); it++) {
51  const std::string modeS(peakMode_ ? "Peak" : "Deco"), xtalk1S("xtalk1_" + it->first + modeS),
52  xtalk2S("xtalk2_" + it->first + modeS);
53 
54  if (!confObj.isParameter(xtalk1S))
55  throw cms::Exception("SiStripConfObject does not contain: ") << xtalk1S;
56  if (!confObj.isParameter(xtalk2S))
57  throw cms::Exception("SiStripConfObject does not contain: ") << xtalk2S;
58 
59  xtalk1[static_cast<int>(it->second)] = confObj.get<double>(xtalk1S);
60  xtalk2[static_cast<int>(it->second)] = confObj.get<double>(xtalk2S);
61  }
62 
63  fillParams();
64 }
size
Write out results.
const bool peakMode_
Definition: StripCPE.h:73
int16_t singleReadOutMode() const
void fillParams()
Definition: StripCPE.cc:93
const TrackerGeometry & geom_
Definition: StripCPE.h:74
U second(std::pair< T, U > const &p)
const SiStripLorentzAngle & LorentzAngleMap_
Definition: StripCPE.h:76
std::vector< float > xtalk1
Definition: StripCPE.h:78
const MagneticField & magfield_
Definition: StripCPE.h:75
const SiStripBackPlaneCorrection & BackPlaneCorrectionMap_
Definition: StripCPE.h:77
valueType get(const std::string &name) const
std::vector< float > xtalk2
Definition: StripCPE.h:79
bool isParameter(const std::string &name) const

Member Function Documentation

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

Implements StripClusterParameterEstimator.

Definition at line 81 of file StripCPE.cc.

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().

81  {
82  LocalVector lbfield = (det->surface()).toLocal(magfield_.inTesla(det->surface().position()));
83 
84  float tanLorentzAnglePerTesla = LorentzAngleMap_.getLorentzAngle(det->geographicalId().rawId());
85 
86  float dir_x = -tanLorentzAnglePerTesla * lbfield.y();
87  float dir_y = tanLorentzAnglePerTesla * lbfield.x();
88  float dir_z = 1.f; // E field always in z direction
89 
90  return LocalVector(dir_x, dir_y, dir_z);
91 }
Local3DVector LocalVector
Definition: LocalVector.h:12
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
T y() const
Definition: PV3DBase.h:60
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const SiStripLorentzAngle & LorentzAngleMap_
Definition: StripCPE.h:76
float getLorentzAngle(const uint32_t &) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const MagneticField & magfield_
Definition: StripCPE.h:75
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
T x() const
Definition: PV3DBase.h:59
const PositionType & position() const
void StripCPE::fillParams ( )
private

Definition at line 93 of file StripCPE.cc.

References TkRadialStripTopology::angularWidth(), 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 param(), and StripCPE().

93  {
94  auto const& dus = geom_.detUnits();
95  m_off = dus.size();
96  for (unsigned int i = 1; i < 7; ++i) {
97  LogDebug("LookingForFirstStrip")
98  << "Subdetector " << i << " GeomDetEnumerator " << GeomDetEnumerators::tkDetEnum[i] << " offset "
99  << geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) << " is it strip? "
100  << (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size()
101  ? dus[geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])]->type().isTrackerStrip()
102  : false);
103  if (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size() &&
104  dus[geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])]->type().isTrackerStrip()) {
107  }
108  }
109  LogDebug("LookingForFirstStrip") << " Chosen offset: " << m_off;
110  m_Params.resize(dus.size() - m_off);
111  for (auto i = m_off; i != dus.size(); ++i) {
112  auto& p = m_Params[i - m_off];
113  const StripGeomDetUnit* stripdet = (const StripGeomDetUnit*)(dus[i]);
114  assert(stripdet->index() == int(i));
115  // assert(stripdet->geographicalId().subdetId()>1); // not pixel..
116  assert(stripdet->type().isTrackerStrip()); // not pixel
117 
118  const Bounds& bounds = stripdet->specificSurface().bounds();
119  p.maxLength = std::sqrt(std::pow(bounds.length(), 2.f) + std::pow(bounds.width(), 2.f));
120  p.thickness = bounds.thickness();
121  p.invThickness = 1.f / p.thickness;
122  p.drift = driftDirection(stripdet) * p.thickness;
123  p.topology = (StripTopology*)(&stripdet->topology());
124  p.nstrips = p.topology->nstrips();
125  p.moduleGeom = SiStripDetId(stripdet->geographicalId()).moduleGeometry();
126  p.backplanecorrection = BackPlaneCorrectionMap_.getBackPlaneCorrection(stripdet->geographicalId().rawId());
127 
128  const TkRadialStripTopology* rtop =
129  dynamic_cast<const TkRadialStripTopology*>(&stripdet->specificType().specificTopology());
130  p.pitch_rel_err2 =
131  (rtop)
132  ? pow(0.5f * rtop->angularWidth() * rtop->stripLength() / rtop->localPitch(LocalPoint(0, 0, 0)), 2.f) / 12.f
133  : 0.f;
134  }
135 }
#define LogDebug(id)
Params m_Params
Definition: StripCPE.h:86
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
float localPitch(const LocalPoint &) const override
const Bounds & bounds() const
Definition: Surface.h:89
float angularWidth() const override
const TrackerGeometry & geom_
Definition: StripCPE.h:74
unsigned int m_off
Definition: StripCPE.h:87
bool isTrackerStrip() const
Definition: GeomDetType.cc:13
virtual StripGeomDetType const & specificType() const
T sqrt(T t)
Definition: SSEVec.h:19
unsigned int offsetDU(SubDetector sid) const
virtual const TopologyType & specificTopology() const
float getBackPlaneCorrection(const uint32_t &) const
LocalVector driftDirection(const StripGeomDetUnit *det) const override
Definition: StripCPE.cc:81
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
double f[11][100]
int index() const
Definition: GeomDet.h:83
SubDetector tkDetEnum[8]
float stripLength() const override
const GeomDetType & type() const override
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
const SiStripBackPlaneCorrection & BackPlaneCorrectionMap_
Definition: StripCPE.h:77
const Topology & topology() const override
Returns a reference to the strip proxy topology.
Definition: Bounds.h:20
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
AlgoParam StripCPE::getAlgoParam ( const GeomDetUnit det,
const LocalTrajectoryParameters ltp 
) const
inline

Definition at line 57 of file StripCPE.h.

References funct::abs(), StripCPE::Param::backplanecorrection, corr, StripCPE::Param::coveredStrips(), LocalTrajectoryParameters::directionNotNormalized(), StripCPE::Param::drift, f, GeomDet::geographicalId(), AlCaHLTBitMon_ParallelJobs::p, param(), LocalTrajectoryParameters::position(), StripCPE::Param::thickness, and HLT_2018_cff::track.

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

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  }
LocalPoint position() const
Local x and y position coordinates.
float thickness
Definition: StripCPE.h:37
float backplanecorrection
Definition: StripCPE.h:39
LocalVector directionNotNormalized() const
Momentum vector unit in the local frame.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
double f[11][100]
float coveredStrips(const LocalVector &, const LocalPoint &) const
Definition: StripCPE.cc:77
JetCorrectorParameters corr
Definition: classes.h:5
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
Param const & param(const GeomDetUnit &det) const
Definition: StripCPE.h:81
LocalVector drift
Definition: StripCPE.h:36
StripClusterParameterEstimator::LocalValues StripCPE::localParameters ( const SiStripCluster cl,
const GeomDetUnit det 
) const
overridevirtual

Reimplemented from StripClusterParameterEstimator.

Definition at line 66 of file StripCPE.cc.

References StripCPE::Param::backplanecorrection, SiStripCluster::barycenter(), StripCPE::Param::coveredStrips(), StripCPE::Param::drift, f, StripTopology::localError(), StripTopology::localPosition(), AlCaHLTBitMon_ParallelJobs::p, param(), digitizers_cfi::strip, StripCPE::Param::thickness, and StripCPE::Param::topology.

Referenced by TkStripMeasurementDet::hit().

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 }
float thickness
Definition: StripCPE.h:37
virtual LocalError localError(float strip, float stripErr2) const =0
StripTopology const * topology
Definition: StripCPE.h:35
float backplanecorrection
Definition: StripCPE.h:39
virtual LocalPoint localPosition(float strip) const =0
double f[11][100]
float coveredStrips(const LocalVector &, const LocalPoint &) const
Definition: StripCPE.cc:77
Param const & param(const GeomDetUnit &det) const
Definition: StripCPE.h:81
LocalVector drift
Definition: StripCPE.h:36
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  }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
Param const& StripCPE::param ( const GeomDetUnit det) const
inlineprotected

Definition at line 81 of file StripCPE.h.

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

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

81 { return m_Params[det.index() - m_off]; }
Params m_Params
Definition: StripCPE.h:86
unsigned int m_off
Definition: StripCPE.h:87
int index() const
Definition: GeomDet.h:83

Member Data Documentation

const SiStripBackPlaneCorrection& StripCPE::BackPlaneCorrectionMap_
protected

Definition at line 77 of file StripCPE.h.

Referenced by fillParams().

const TrackerGeometry& StripCPE::geom_
protected

Definition at line 74 of file StripCPE.h.

Referenced by fillParams().

const SiStripLorentzAngle& StripCPE::LorentzAngleMap_
protected

Definition at line 76 of file StripCPE.h.

Referenced by driftDirection().

unsigned int StripCPE::m_off
private

Definition at line 87 of file StripCPE.h.

Referenced by fillParams(), and param().

Params StripCPE::m_Params
private

Definition at line 86 of file StripCPE.h.

Referenced by fillParams(), and param().

const MagneticField& StripCPE::magfield_
protected

Definition at line 75 of file StripCPE.h.

Referenced by driftDirection().

const bool StripCPE::peakMode_
protected

Definition at line 73 of file StripCPE.h.

Referenced by StripCPE().

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

Definition at line 78 of file StripCPE.h.

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

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

Definition at line 79 of file StripCPE.h.

Referenced by StripCPE().