CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1TMuon::TTGeometryTranslator Class Reference

#include <TTGeometryTranslator.h>

Public Member Functions

double calculateBendAngle (const TTTriggerPrimitive &) const
 
double calculateGlobalEta (const TTTriggerPrimitive &) const
 
double calculateGlobalPhi (const TTTriggerPrimitive &) const
 
void checkAndUpdateGeometry (const edm::EventSetup &)
 
GlobalPoint getGlobalPoint (const TTTriggerPrimitive &) const
 
const MagneticFieldgetMagneticField () const
 
const TrackerGeometrygetTrackerGeometry () const
 
const TrackerTopologygetTrackerTopology () const
 
bool isBarrel (const TTTriggerPrimitive &) const
 
bool isPSModule (const TTTriggerPrimitive &) const
 
int layer (const TTTriggerPrimitive &) const
 
int module (const TTTriggerPrimitive &) const
 
int region (const TTTriggerPrimitive &) const
 
int ring (const TTTriggerPrimitive &) const
 
 TTGeometryTranslator ()
 
 ~TTGeometryTranslator ()
 

Private Member Functions

double calcTTSpecificBend (const TTTriggerPrimitive &) const
 
double calcTTSpecificEta (const TTTriggerPrimitive &) const
 
double calcTTSpecificPhi (const TTTriggerPrimitive &) const
 
GlobalPoint getTTSpecificPoint (const TTTriggerPrimitive &) const
 

Private Attributes

edm::ESHandle< TrackerGeometry_geom
 
unsigned long long _geom_cache_id
 
edm::ESHandle< MagneticField_magfield
 
unsigned long long _magfield_cache_id
 
edm::ESHandle< TrackerTopology_topo
 
unsigned long long _topo_cache_id
 

Detailed Description

Definition at line 27 of file TTGeometryTranslator.h.

Constructor & Destructor Documentation

TTGeometryTranslator::TTGeometryTranslator ( )

Definition at line 22 of file TTGeometryTranslator.cc.

22 : _geom_cache_id(0ULL), _topo_cache_id(0ULL), _magfield_cache_id(0ULL) {}
TTGeometryTranslator::~TTGeometryTranslator ( )

Definition at line 24 of file TTGeometryTranslator.cc.

24 {}

Member Function Documentation

double TTGeometryTranslator::calcTTSpecificBend ( const TTTriggerPrimitive tp) const
private
double TTGeometryTranslator::calcTTSpecificEta ( const TTTriggerPrimitive tp) const
private

Definition at line 175 of file TTGeometryTranslator.cc.

References PV3DBase< T, PVType, FrameType >::eta(), and getTTSpecificPoint().

Referenced by calculateGlobalEta().

175  {
176  return getTTSpecificPoint(tp).eta();
177 }
GlobalPoint getTTSpecificPoint(const TTTriggerPrimitive &) const
T eta() const
Definition: PV3DBase.h:73
double TTGeometryTranslator::calcTTSpecificPhi ( const TTTriggerPrimitive tp) const
private

Definition at line 179 of file TTGeometryTranslator.cc.

References getTTSpecificPoint(), and PV3DBase< T, PVType, FrameType >::phi().

Referenced by calculateGlobalPhi().

179  {
180  return getTTSpecificPoint(tp).phi();
181 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
GlobalPoint getTTSpecificPoint(const TTTriggerPrimitive &) const
double TTGeometryTranslator::calculateBendAngle ( const TTTriggerPrimitive tp) const

Definition at line 117 of file TTGeometryTranslator.cc.

References calcTTSpecificBend(), L1TMuon::TTTriggerPrimitive::kTT, dqmiodatasetharvest::nan, and L1TMuon::TTTriggerPrimitive::subsystem().

117  {
118  switch (tp.subsystem()) {
120  return calcTTSpecificBend(tp);
121  break;
122  default:
123  return std::nan("Invalid TP type!");
124  break;
125  }
126 }
const subsystem_type subsystem() const
double calcTTSpecificBend(const TTTriggerPrimitive &) const
double TTGeometryTranslator::calculateGlobalEta ( const TTTriggerPrimitive tp) const

Definition at line 95 of file TTGeometryTranslator.cc.

References calcTTSpecificEta(), L1TMuon::TTTriggerPrimitive::kTT, dqmiodatasetharvest::nan, and L1TMuon::TTTriggerPrimitive::subsystem().

95  {
96  switch (tp.subsystem()) {
98  return calcTTSpecificEta(tp);
99  break;
100  default:
101  return std::nan("Invalid TP type!");
102  break;
103  }
104 }
double calcTTSpecificEta(const TTTriggerPrimitive &) const
const subsystem_type subsystem() const
double TTGeometryTranslator::calculateGlobalPhi ( const TTTriggerPrimitive tp) const

Definition at line 106 of file TTGeometryTranslator.cc.

References calcTTSpecificPhi(), L1TMuon::TTTriggerPrimitive::kTT, dqmiodatasetharvest::nan, and L1TMuon::TTTriggerPrimitive::subsystem().

106  {
107  switch (tp.subsystem()) {
109  return calcTTSpecificPhi(tp);
110  break;
111  default:
112  return std::nan("Invalid TP type!");
113  break;
114  }
115 }
double calcTTSpecificPhi(const TTTriggerPrimitive &) const
const subsystem_type subsystem() const
void TTGeometryTranslator::checkAndUpdateGeometry ( const edm::EventSetup es)

Definition at line 141 of file TTGeometryTranslator.cc.

References _geom, _geom_cache_id, _magfield, _magfield_cache_id, _topo, _topo_cache_id, edm::eventsetup::EventSetupRecord::cacheIdentifier(), relativeConstraints::geom, edm::EventSetup::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), and volumeBasedMagneticField_1103l_cfi::magfield.

141  {
143  unsigned long long geomid = geom.cacheIdentifier();
144  if (_geom_cache_id != geomid) {
145  geom.get(_geom);
146  _geom_cache_id = geomid;
147  }
148 
149  const TrackerTopologyRcd& topo = es.get<TrackerTopologyRcd>();
150  unsigned long long topoid = topo.cacheIdentifier();
151  if (_topo_cache_id != topoid) {
152  topo.get(_topo);
153  _topo_cache_id = topoid;
154  }
155 
157  unsigned long long magfieldid = magfield.cacheIdentifier();
158  if (_magfield_cache_id != magfieldid) {
159  magfield.get(_magfield);
160  _magfield_cache_id = magfieldid;
161  }
162 }
unsigned long long cacheIdentifier() const
edm::ESHandle< TrackerGeometry > _geom
edm::ESHandle< MagneticField > _magfield
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESHandle< TrackerTopology > _topo
T get() const
Definition: EventSetup.h:73
GlobalPoint TTGeometryTranslator::getGlobalPoint ( const TTTriggerPrimitive tp) const

Definition at line 128 of file TTGeometryTranslator.cc.

References getTTSpecificPoint(), L1TMuon::TTTriggerPrimitive::kTT, dqmiodatasetharvest::nan, runTheMatrix::ret, and L1TMuon::TTTriggerPrimitive::subsystem().

Referenced by TTPrimitiveConversion::convert_tt().

128  {
129  switch (tp.subsystem()) {
131  return getTTSpecificPoint(tp);
132  break;
133  default:
135  GlobalPoint::Polar(std::nan("Invalid TP type!"), std::nan("Invalid TP type!"), std::nan("Invalid TP type!")));
136  return ret;
137  break;
138  }
139 }
ret
prodAgent to be discontinued
const subsystem_type subsystem() const
GlobalPoint getTTSpecificPoint(const TTTriggerPrimitive &) const
const MagneticField& L1TMuon::TTGeometryTranslator::getMagneticField ( ) const
inline

Definition at line 53 of file TTGeometryTranslator.h.

53 { return *_magfield; }
edm::ESHandle< MagneticField > _magfield
const TrackerGeometry& L1TMuon::TTGeometryTranslator::getTrackerGeometry ( ) const
inline

Definition at line 51 of file TTGeometryTranslator.h.

51 { return *_geom; }
edm::ESHandle< TrackerGeometry > _geom
const TrackerTopology& L1TMuon::TTGeometryTranslator::getTrackerTopology ( ) const
inline

Definition at line 52 of file TTGeometryTranslator.h.

52 { return *_topo; }
edm::ESHandle< TrackerTopology > _topo
GlobalPoint TTGeometryTranslator::getTTSpecificPoint ( const TTTriggerPrimitive tp) const
private

Definition at line 164 of file TTGeometryTranslator.cc.

References _geom, L1TMuon::TTTriggerPrimitive::TTData::col_f, L1TMuon::TTTriggerPrimitive::detId(), L1TMuon::TTTriggerPrimitive::getTTData(), runTauDisplay::gp, TrackerGeometry::idToDetUnit(), Topology::localPosition(), L1TMuon::TTTriggerPrimitive::TTData::row_f, PixelGeomDetUnit::specificTopology(), GeomDet::surface(), and Surface::toGlobal().

Referenced by calcTTSpecificEta(), calcTTSpecificPhi(), and getGlobalPoint().

164  {
165  // Check L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc
166  const DetId detId = tp.detId();
167  const GeomDetUnit* geoUnit = _geom->idToDetUnit(detId + 1); // det0
168  //const GeomDetUnit* geoUnit = _geom->idToDetUnit(detId+2); // det1
169  const Phase2TrackerGeomDetUnit* ph2TkGeoUnit = dynamic_cast<const Phase2TrackerGeomDetUnit*>(geoUnit);
170  const MeasurementPoint mp(tp.getTTData().row_f, tp.getTTData().col_f);
171  const GlobalPoint gp = ph2TkGeoUnit->surface().toGlobal(ph2TkGeoUnit->specificTopology().localPosition(mp));
172  return gp;
173 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:81
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
edm::ESHandle< TrackerGeometry > _geom
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: DetId.h:17
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
bool TTGeometryTranslator::isBarrel ( const TTTriggerPrimitive tp) const

Definition at line 26 of file TTGeometryTranslator.cc.

References L1TMuon::TTTriggerPrimitive::detId(), DetId::subdetId(), and StripSubdetector::TOB.

26  {
27  const DetId detId = tp.detId();
28  bool isBarrel = (detId.subdetId() == StripSubdetector::TOB);
29  //bool isEndcap = (detId.subdetId() == StripSubdetector::TID);
30  return isBarrel;
31 }
bool isBarrel(const TTTriggerPrimitive &) const
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
Definition: DetId.h:17
bool TTGeometryTranslator::isPSModule ( const TTTriggerPrimitive tp) const

Definition at line 33 of file TTGeometryTranslator.cc.

References _geom, L1TMuon::TTTriggerPrimitive::detId(), TrackerGeometry::getDetectorType(), TrackerGeometry::Ph2PSP, and TrackerGeometry::Ph2PSS.

33  {
34  const DetId detId = tp.detId();
35  const TrackerGeometry::ModuleType moduleType = _geom->getDetectorType(detId);
36  bool isPSModule =
38  //bool isSSModule = (moduleType == TrackerGeometry::ModuleType::Ph2SS);
39  return isPSModule;
40 }
edm::ESHandle< TrackerGeometry > _geom
ModuleType getDetectorType(DetId) const
Definition: DetId.h:17
bool isPSModule(const TTTriggerPrimitive &) const
int TTGeometryTranslator::layer ( const TTTriggerPrimitive tp) const

Definition at line 59 of file TTGeometryTranslator.cc.

References _topo, L1TMuon::TTTriggerPrimitive::detId(), TrackerTopology::layer(), DetId::subdetId(), StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by TTPrimitiveConversion::convert_tt(), geometryXMLparser.DTAlignable::index(), and geometryXMLparser.CSCAlignable::index().

59  {
60  int layer = 0;
61 
62  const DetId detId = tp.detId();
63  if (detId.subdetId() == StripSubdetector::TOB) { // barrel
64  layer = static_cast<int>(_topo->layer(detId));
65  } else if (detId.subdetId() == StripSubdetector::TID) { // endcap
66  layer = static_cast<int>(_topo->layer(detId));
67  }
68  return layer;
69 }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
edm::ESHandle< TrackerTopology > _topo
static constexpr auto TOB
Definition: DetId.h:17
unsigned int layer(const DetId &id) const
int layer(const TTTriggerPrimitive &) const
static constexpr auto TID
int TTGeometryTranslator::module ( const TTTriggerPrimitive tp) const

Definition at line 83 of file TTGeometryTranslator.cc.

References _topo, L1TMuon::TTTriggerPrimitive::detId(), TrackerTopology::module(), DetId::subdetId(), StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by TTPrimitiveConversion::convert_tt().

83  {
84  int module = 0;
85 
86  const DetId detId = tp.detId();
87  if (detId.subdetId() == StripSubdetector::TOB) { // barrel
88  module = static_cast<int>(_topo->module(detId));
89  } else if (detId.subdetId() == StripSubdetector::TID) { // endcap
90  module = static_cast<int>(_topo->module(detId));
91  }
92  return module;
93 }
int module(const TTTriggerPrimitive &) const
unsigned int module(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
edm::ESHandle< TrackerTopology > _topo
static constexpr auto TOB
Definition: DetId.h:17
static constexpr auto TID
Definition: vlib.h:198
int TTGeometryTranslator::region ( const TTTriggerPrimitive tp) const

Definition at line 42 of file TTGeometryTranslator.cc.

References _topo, L1TMuon::TTTriggerPrimitive::detId(), DetId::subdetId(), StripSubdetector::TID, TrackerTopology::tidSide(), and StripSubdetector::TOB.

Referenced by TTPrimitiveConversion::convert_tt().

42  {
43  int region = 0;
44 
45  const DetId detId = tp.detId();
46  if (detId.subdetId() == StripSubdetector::TOB) { // barrel
47  region = 0;
48  } else if (detId.subdetId() == StripSubdetector::TID) { // endcap
49  int type = _topo->tidSide(detId); // 1=-ve 2=+ve
50  if (type == 1) {
51  region = -1;
52  } else if (type == 2) {
53  region = +1;
54  }
55  }
56  return region;
57 }
type
Definition: HCALResponse.h:21
int region(const TTTriggerPrimitive &) const
unsigned int tidSide(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
edm::ESHandle< TrackerTopology > _topo
static constexpr auto TOB
Definition: DetId.h:17
static constexpr auto TID
int TTGeometryTranslator::ring ( const TTTriggerPrimitive tp) const

Definition at line 71 of file TTGeometryTranslator.cc.

References _topo, L1TMuon::TTTriggerPrimitive::detId(), DetId::subdetId(), StripSubdetector::TID, TrackerTopology::tidRing(), StripSubdetector::TOB, and TrackerTopology::tobRod().

Referenced by TTPrimitiveConversion::convert_tt(), and geometryXMLparser.CSCAlignable::index().

71  {
72  int ring = 0;
73 
74  const DetId detId = tp.detId();
75  if (detId.subdetId() == StripSubdetector::TOB) { // barrel
76  ring = static_cast<int>(_topo->tobRod(detId));
77  } else if (detId.subdetId() == StripSubdetector::TID) { // endcap
78  ring = static_cast<int>(_topo->tidRing(detId));
79  }
80  return ring;
81 }
unsigned int tidRing(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
edm::ESHandle< TrackerTopology > _topo
static constexpr auto TOB
Definition: DetId.h:17
int ring(const TTTriggerPrimitive &) const
unsigned int tobRod(const DetId &id) const
static constexpr auto TID

Member Data Documentation

edm::ESHandle<TrackerGeometry> L1TMuon::TTGeometryTranslator::_geom
private

Definition at line 58 of file TTGeometryTranslator.h.

Referenced by checkAndUpdateGeometry(), getTTSpecificPoint(), and isPSModule().

unsigned long long L1TMuon::TTGeometryTranslator::_geom_cache_id
private

Definition at line 57 of file TTGeometryTranslator.h.

Referenced by checkAndUpdateGeometry().

edm::ESHandle<MagneticField> L1TMuon::TTGeometryTranslator::_magfield
private

Definition at line 64 of file TTGeometryTranslator.h.

Referenced by checkAndUpdateGeometry().

unsigned long long L1TMuon::TTGeometryTranslator::_magfield_cache_id
private

Definition at line 63 of file TTGeometryTranslator.h.

Referenced by checkAndUpdateGeometry().

edm::ESHandle<TrackerTopology> L1TMuon::TTGeometryTranslator::_topo
private

Definition at line 61 of file TTGeometryTranslator.h.

Referenced by checkAndUpdateGeometry(), layer(), module(), region(), and ring().

unsigned long long L1TMuon::TTGeometryTranslator::_topo_cache_id
private

Definition at line 60 of file TTGeometryTranslator.h.

Referenced by checkAndUpdateGeometry().