CMS 3D CMS Logo

Phase2StripCPE.cc
Go to the documentation of this file.
1 
4 
5 
7 {
8  magfield_ = &magf;
9  use_LorentzAngle_DB_ = conf.getParameter<bool>("LorentzAngle_DB");
11  throw cms::Exception("Lorentz Angle from DB not implemented yet");
13  // old code: LorentzAngleMap_.getLorentzAngle(det->geographicalId().rawId());
14  } else {
15  tanLorentzAnglePerTesla_ = conf.getParameter<double>("TanLorentzAnglePerTesla");
16  }
17 }
18 
19 
21  const Phase2TrackerCluster1D & cluster,
22  const GeomDetUnit & detunit) const
23 {
24  const Phase2TrackerGeomDetUnit & det = (const Phase2TrackerGeomDetUnit &) detunit;
25  const Phase2TrackerTopology * topo = &det.specificTopology();
26 
27  float pitch_x = topo->pitch().first;
28  float pitch_y = topo->pitch().second;
29 
30  // see https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/RecoLocalTracker/SiStripRecHitConverter/src/StripCPE.cc
31 
32  float thickness = det.specificSurface().bounds().thickness();
33  LocalVector drift = driftDirection(det) * thickness;
34  LocalVector lvec = drift + LocalVector(0,0,-thickness);
35  float coveredStrips = lvec.x() / pitch_x; // simplifies wrt Phase0 tracker because only rectangular modules
36 
37  float ix = cluster.center() - 0.5 * coveredStrips;
38  float iy = cluster.column()+0.5; // halfway the column
39 
40  LocalPoint lp( topo->localX(ix), topo->localY(iy), 0 ); // x, y, z
41  LocalError le( pow(pitch_x, 2) / 12, 0, pow(pitch_y, 2) / 12); // e2_xx, e2_xy, e2_yy
42 
43  return std::make_pair( lp, le );
44 }
45 
46 
48  const Phase2TrackerGeomDetUnit & det) const
49 {
50  LocalVector lbfield = (det.surface()).toLocal(magfield_->inTesla(det.surface().position()));
51 
52  float dir_x = -tanLorentzAnglePerTesla_ * lbfield.y();
53  float dir_y = tanLorentzAnglePerTesla_ * lbfield.x();
54  float dir_z = 1.f; // E field always in z direction
55 
56  return LocalVector(dir_x,dir_y,dir_z);
57 }
T getParameter(std::string const &) const
Local3DVector LocalVector
Definition: LocalVector.h:12
const MagneticField * magfield_
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:38
T y() const
Definition: PV3DBase.h:63
virtual std::pair< float, float > pitch() const =0
const Bounds & bounds() const
Definition: Surface.h:120
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
LocalVector driftDirection(const Phase2TrackerGeomDetUnit &det) const
double tanLorentzAnglePerTesla_
virtual float localX(const float mpX) const =0
unsigned int column() const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
virtual float thickness() const =0
LocalValues localParameters(const Phase2TrackerCluster1D &cluster, const GeomDetUnit &det) const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
bool use_LorentzAngle_DB_
virtual float localY(const float mpY) const =0
T x() const
Definition: PV3DBase.h:62
const PositionType & position() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:45