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.

72  {
73  float rinv = rInvFrom2(trk, tkGeometry);
74  return std::abs(local_c_light * B_field / rinv);
75  }

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

Referenced by L1TkElectronTrackProducer::produce().

◆ rInvFrom2()

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

Definition at line 15 of file pTFrom2Stubs.cc.

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  }

References TTStub< T >::clusterRef(), funct::cos(), PixelRecoUtilities::curvature(), reco::deltaPhi(), DetId::det(), HLT_2018_cff::dPhi, TrackerGeometry::idToDet(), TrackerGeometry::idToDetUnit(), dqmiolumiharvest::j, Topology::localPosition(), PV3DBase< T, PVType, FrameType >::phi(), funct::sin(), 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().

TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
Point2DBase
Definition: Point2DBase.h:9
GeomDet
Definition: GeomDet.h:27
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
B_field
static constexpr float B_field
Definition: pTFrom2Stubs.cc:10
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
GeomDet::topology
virtual const Topology & topology() const
Definition: GeomDet.cc:67
Topology::localPosition
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
PixelRecoUtilities::curvature
T curvature(T InversePt, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:42
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::Ref
Definition: AssociativeIterator.h:58
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
align::Tracker
Definition: StructureType.h:70
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: TrackerGeometry.cc:183
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
pTFrom2Stubs::rInvFrom2
float rInvFrom2(std::vector< TTTrack< Ref_Phase2TrackerDigi_ > >::const_iterator trk, const TrackerGeometry *tkGeometry)
Definition: pTFrom2Stubs.cc:15
TTStub::clusterRef
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/SLHCTrackerTriggerSWTo...
Definition: TTStub.h:150
DetId
Definition: DetId.h:17
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
local_c_light
static constexpr float local_c_light
Definition: pTFrom2Stubs.cc:9
TTStub
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
Point3DBase< float, GlobalTag >
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
trklet::rinv
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:167
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17