CMS 3D CMS Logo

Phase2StripCPE.cc
Go to the documentation of this file.
4 
6  : magfield_(magf), geom_(geom), tanLorentzAnglePerTesla_(conf.getParameter<double>("TanLorentzAnglePerTesla")) {
7  use_LorentzAngle_DB_ = conf.getParameter<bool>("LorentzAngle_DB");
9  throw cms::Exception("Lorentz Angle from DB not implemented yet");
11  // old code: LorentzAngleMap_.getLorentzAngle(det->geographicalId().rawId());
12  }
13  fillParam();
14 }
15 
17  const GeomDetUnit& detunit) const {
18  auto const& p = m_Params[detunit.index() - m_off];
19  auto const& topo = *p.topology;
20  float ix = cluster.center() - 0.5f * p.coveredStrips;
21  float iy = float(cluster.column()) + 0.5f; // halfway the column
22 
23  LocalPoint lp(topo.localX(ix), topo.localY(iy), 0); // x, y, z
24 
25  return std::make_pair(lp, p.localErr);
26 }
27 
29  LocalVector lbfield = (det.surface()).toLocal(magfield_.inTesla(det.surface().position()));
30 
31  float dir_x = -tanLorentzAnglePerTesla_ * lbfield.y();
32  float dir_y = tanLorentzAnglePerTesla_ * lbfield.x();
33  float dir_z = 1.f; // E field always in z direction
34 
35  return LocalVector(dir_x, dir_y, dir_z);
36 }
37 
39  // in phase 2 they are all pixel topologies...
40  auto const& dus = geom_.detUnits();
41  m_off = dus.size();
42  // skip Barrel and Foward pixels...
43  for (unsigned int i = 3; i < 7; ++i) {
44  LogDebug("LookingForFirstPhase2OT") << " Subdetector " << i << " GeomDetEnumerator "
45  << GeomDetEnumerators::tkDetEnum[i] << " offset "
47  if (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size()) {
50  }
51  }
52  LogDebug("LookingForFirstPhase2OT") << " Chosen offset: " << m_off;
53 
54  m_Params.resize(dus.size() - m_off);
55  // very very minimal, for sure it will need to expand...
56  for (auto i = m_off; i != dus.size(); ++i) {
57  auto& p = m_Params[i - m_off];
58 
59  const Phase2TrackerGeomDetUnit& det = (const Phase2TrackerGeomDetUnit&)(*dus[i]);
60  assert(det.index() == int(i));
61  p.topology = &det.specificTopology();
62 
63  auto pitch_x = p.topology->pitch().first;
64  auto pitch_y = p.topology->pitch().second;
65 
66  // see https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/RecoLocalTracker/SiStripRecHitConverter/src/StripCPE.cc
67  auto thickness = det.specificSurface().bounds().thickness();
68  auto drift = driftDirection(det) * thickness;
69  auto lvec = drift + LocalVector(0, 0, -thickness);
70  p.coveredStrips = lvec.x() / pitch_x; // simplifies wrt Phase0 tracker because only rectangular modules
71 
72  constexpr float o12 = 1. / 12;
73  p.localErr = LocalError(o12 * pitch_x * pitch_x, 0, o12 * pitch_y * pitch_y); // e2_xx, e2_xy, e2_yy
74  }
75 }
Vector3DBase< float, LocalTag >
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:355
MessageLogger.h
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
GeomDet
Definition: GeomDet.h:27
PixelTopology.h
Phase2TrackerCluster1D
Definition: Phase2TrackerCluster1D.h:10
Phase2TrackerCluster1D::column
unsigned int column() const
Definition: Phase2TrackerCluster1D.h:26
Phase2StripCPE::localParameters
LocalValues localParameters(const Phase2TrackerCluster1D &cluster, const GeomDetUnit &det) const override
Definition: Phase2StripCPE.cc:16
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ClusterParameterEstimator< Phase2TrackerCluster1D >::LocalValues
std::pair< LocalPoint, LocalError > LocalValues
Definition: ClusterParameterEstimator.h:14
Phase2StripCPE::tanLorentzAnglePerTesla_
float tanLorentzAnglePerTesla_
Definition: Phase2StripCPE.h:37
cms::cuda::assert
assert(be >=bs)
GeomDet::index
int index() const
Definition: GeomDet.h:83
Phase2TrackerCluster1D::center
float center() const
Definition: Phase2TrackerCluster1D.h:29
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
shallow::drift
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:36
TrackerGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: TrackerGeometry.h:61
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
GeomDetEnumerators::tkDetEnum
constexpr SubDetector tkDetEnum[8]
Definition: GeomDetEnumerators.h:37
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
Phase2StripCPE.h
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Point3DBase< float, LocalTag >
Phase2StripCPE::m_off
unsigned int m_off
Definition: Phase2StripCPE.h:38
Bounds::thickness
virtual float thickness() const =0
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
LocalError
Definition: LocalError.h:12
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
LocalVector
Local3DVector LocalVector
Definition: LocalVector.h:12
createfilelist.int
int
Definition: createfilelist.py:10
GeomDet::specificSurface
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
Phase2StripCPE::geom_
const TrackerGeometry & geom_
Definition: Phase2StripCPE.h:36
Phase2StripCPE::fillParam
void fillParam()
Definition: Phase2StripCPE.cc:38
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
Phase2StripCPE::driftDirection
LocalVector driftDirection(const Phase2TrackerGeomDetUnit &det) const
Definition: Phase2StripCPE.cc:28
Exception
Definition: hltDiff.cc:246
toLocal
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
Definition: ConversionProducer.h:192
Phase2StripCPE::m_Params
std::vector< Param > m_Params
Definition: Phase2StripCPE.h:33
Phase2StripCPE::Phase2StripCPE
Phase2StripCPE(edm::ParameterSet &conf, const MagneticField &, const TrackerGeometry &)
Definition: Phase2StripCPE.cc:5
MagneticField
Definition: MagneticField.h:19
TrackerGeometry::offsetDU
unsigned int offsetDU(SubDetector sid) const
Definition: TrackerGeometry.h:72
Phase2StripCPE::magfield_
const MagneticField & magfield_
Definition: Phase2StripCPE.h:35
Phase2StripCPE::use_LorentzAngle_DB_
bool use_LorentzAngle_DB_
Definition: Phase2StripCPE.h:40
TrackerGeometry
Definition: TrackerGeometry.h:14