CMS 3D CMS Logo

Functions
pTFrom2Stubs Namespace Reference

Functions

float pTFrom2 (std::vector< TTTrack< Ref_Phase2TrackerDigi_ > >::const_iterator trk, const TrackerGeometry *tkGeometry)
 
float rInvFrom2 (std::vector< TTTrack< Ref_Phase2TrackerDigi_ > >::const_iterator trk, const TrackerGeometry *tkGeometry)
 

Function Documentation

◆ pTFrom2()

float pTFrom2Stubs::pTFrom2 ( std::vector< TTTrack< Ref_Phase2TrackerDigi_ > >::const_iterator  trk,
const TrackerGeometry tkGeometry 
)

Definition at line 72 of file pTFrom2Stubs.cc.

References funct::abs(), B_field, local_c_light, trklet::rinv(), and rInvFrom2().

72  {
73  float rinv = rInvFrom2(trk, tkGeometry);
74  return std::abs(local_c_light * B_field / rinv);
75  }
static constexpr float B_field
Definition: pTFrom2Stubs.cc:10
float rInvFrom2(std::vector< TTTrack< Ref_Phase2TrackerDigi_ > >::const_iterator trk, const TrackerGeometry *tkGeometry)
Definition: pTFrom2Stubs.cc:15
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:66
static constexpr float local_c_light
Definition: pTFrom2Stubs.cc:9

◆ rInvFrom2()

float pTFrom2Stubs::rInvFrom2 ( std::vector< TTTrack< Ref_Phase2TrackerDigi_ > >::const_iterator  trk,
const TrackerGeometry tkGeometry 
)

Definition at line 15 of file pTFrom2Stubs.cc.

References TTStub< T >::clusterRef(), funct::cos(), PixelRecoUtilities::curvature(), reco::deltaPhi(), DetId::det(), TrackerGeometry::idToDet(), TrackerGeometry::idToDetUnit(), dqmiolumiharvest::j, Topology::localPosition(), PV3DBase< T, PVType, FrameType >::phi(), funct::sin(), jetUpdater_cfi::sort, mathSSE::sqrt(), DetId::subdetId(), GeomDet::surface(), StripSubdetector::TID, createJobs::tmp, StripSubdetector::TOB, Surface::toGlobal(), GeomDet::topology(), align::Tracker, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by pTFrom2().

16  {
17  //vector of R, r and phi for each stub
18  std::vector<std::vector<float> > riPhiStubs(0);
19  //get stub reference
20  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_> >, TTStub<Ref_Phase2TrackerDigi_> > >
21  vecStubRefs = trk->getStubRefs();
22 
23  //loop over L1Track's stubs
24  int rsize = vecStubRefs.size();
25  for (int j = 0; j < rsize; ++j) {
27  vecStubRefs.at(j);
28  const TTStub<Ref_Phase2TrackerDigi_>* stub = &(*stubRef);
29  MeasurementPoint localPos = stub->clusterRef(0)->findAverageLocalCoordinates();
30 
31  DetId detid = stub->clusterRef(0)->getDetId();
32 
33  if (detid.det() != DetId::Detector::Tracker)
34  continue;
35  if (detid.subdetId() != StripSubdetector::TOB && detid.subdetId() != StripSubdetector::TID)
36  continue;
37  const GeomDet* geomDet = tkGeometry->idToDet(detid);
38  if (geomDet) {
39  const GeomDetUnit* gDetUnit = tkGeometry->idToDetUnit(detid);
40  GlobalPoint stubPosition = geomDet->surface().toGlobal(gDetUnit->topology().localPosition(localPos));
41 
42  std::vector<float> tmp(0);
43  float Rad = sqrt(stubPosition.x() * stubPosition.x() + stubPosition.y() * stubPosition.y() + stubPosition.z() +
44  stubPosition.z());
45  float r_i = sqrt(stubPosition.x() * stubPosition.x() + stubPosition.y() * stubPosition.y());
46  float phi_i = stubPosition.phi();
47 
48  tmp.push_back(Rad);
49  tmp.push_back(r_i);
50  tmp.push_back(phi_i);
51 
52  riPhiStubs.push_back(tmp);
53  }
54  }
55 
56  std::sort(riPhiStubs.begin(), riPhiStubs.end());
57  //now calculate the curvature from first 2 stubs
58  float nr1 = (riPhiStubs[0])[1];
59  float nphi1 = (riPhiStubs[0])[2];
60 
61  float nr2 = (riPhiStubs[1])[1];
62  float nphi2 = (riPhiStubs[1])[2];
63 
64  float dPhi = reco::deltaPhi(nphi1, nphi2);
65 
66  float ndist = sqrt(nr2 * nr2 + nr1 * nr1 - 2 * nr1 * nr2 * cos(dPhi));
67 
68  float curvature = 2 * sin(dPhi) / ndist;
69  return curvature;
70  }
const edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > & clusterRef(unsigned int hitStackMember) const
Clusters composing the Stub – see https://twiki.cern.ch/twiki/bin/viewauth/CMS/SLHCTrackerTriggerSWT...
Definition: TTStub.h:150
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
T z() const
Definition: PV3DBase.h:61
virtual const Topology & topology() const
Definition: GeomDet.cc:67
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
T curvature(T InversePt, const MagneticField &field)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
const TrackerGeomDet * idToDet(DetId) const override
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
Definition: DetId.h:17
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
tmp
align.sh
Definition: createJobs.py:716
static constexpr auto TID