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 28 of file TTGeometryTranslator.h.

Constructor & Destructor Documentation

TTGeometryTranslator::TTGeometryTranslator ( )

Definition at line 23 of file TTGeometryTranslator.cc.

23  :
25 }
TTGeometryTranslator::~TTGeometryTranslator ( )

Definition at line 27 of file TTGeometryTranslator.cc.

27  {
28 }

Member Function Documentation

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

Definition at line 183 of file TTGeometryTranslator.cc.

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

Referenced by calculateGlobalEta().

183  {
184  return getTTSpecificPoint(tp).eta();
185 }
GlobalPoint getTTSpecificPoint(const TTTriggerPrimitive &) const
T eta() const
Definition: PV3DBase.h:76
double TTGeometryTranslator::calcTTSpecificPhi ( const TTTriggerPrimitive tp) const
private

Definition at line 188 of file TTGeometryTranslator.cc.

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

Referenced by calculateGlobalPhi().

188  {
189  return getTTSpecificPoint(tp).phi();
190 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint getTTSpecificPoint(const TTTriggerPrimitive &) const
double TTGeometryTranslator::calculateBendAngle ( const TTTriggerPrimitive tp) const

Definition at line 123 of file TTGeometryTranslator.cc.

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

123  {
124  switch(tp.subsystem()) {
126  return calcTTSpecificBend(tp);
127  break;
128  default:
129  return std::nan("Invalid TP type!");
130  break;
131  }
132 }
const subsystem_type subsystem() const
double calcTTSpecificBend(const TTTriggerPrimitive &) const
double TTGeometryTranslator::calculateGlobalEta ( const TTTriggerPrimitive tp) const

Definition at line 99 of file TTGeometryTranslator.cc.

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

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

Definition at line 111 of file TTGeometryTranslator.cc.

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

111  {
112  switch(tp.subsystem()) {
114  return calcTTSpecificPhi(tp);
115  break;
116  default:
117  return std::nan("Invalid TP type!");
118  break;
119  }
120 }
double calcTTSpecificPhi(const TTTriggerPrimitive &) const
const subsystem_type subsystem() const
void TTGeometryTranslator::checkAndUpdateGeometry ( const edm::EventSetup es)

Definition at line 147 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(), and edm::eventsetup::EventSetupRecord::get().

147  {
149  unsigned long long geomid = geom.cacheIdentifier();
150  if( _geom_cache_id != geomid ) {
151  geom.get(_geom);
152  _geom_cache_id = geomid;
153  }
154 
155  const TrackerTopologyRcd& topo = es.get<TrackerTopologyRcd>();
156  unsigned long long topoid = topo.cacheIdentifier();
157  if( _topo_cache_id != topoid ) {
158  topo.get(_topo);
159  _topo_cache_id = topoid;
160  }
161 
162  const IdealMagneticFieldRecord& magfield = es.get<IdealMagneticFieldRecord>();
163  unsigned long long magfieldid = magfield.cacheIdentifier();
164  if( _magfield_cache_id != magfieldid ) {
165  magfield.get(_magfield);
166  _magfield_cache_id = magfieldid;
167  }
168 }
unsigned long long cacheIdentifier() const
edm::ESHandle< TrackerGeometry > _geom
edm::ESHandle< MagneticField > _magfield
void get(HolderT &iHolder) const
edm::ESHandle< TrackerTopology > _topo
T get() const
Definition: EventSetup.h:62
GlobalPoint TTGeometryTranslator::getGlobalPoint ( const TTTriggerPrimitive tp) const

Definition at line 135 of file TTGeometryTranslator.cc.

References getTTSpecificPoint(), L1TMuon::TTTriggerPrimitive::kTT, and L1TMuon::TTTriggerPrimitive::subsystem().

Referenced by TTPrimitiveConversion::convert_tt().

135  {
136  switch(tp.subsystem()) {
138  return getTTSpecificPoint(tp);
139  break;
140  default:
141  GlobalPoint ret(GlobalPoint::Polar(std::nan("Invalid TP type!"), std::nan("Invalid TP type!"), std::nan("Invalid TP type!")));
142  return ret;
143  break;
144  }
145 }
const subsystem_type subsystem() const
GlobalPoint getTTSpecificPoint(const TTTriggerPrimitive &) const
const MagneticField& L1TMuon::TTGeometryTranslator::getMagneticField ( ) const
inline

Definition at line 54 of file TTGeometryTranslator.h.

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

Definition at line 52 of file TTGeometryTranslator.h.

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

Definition at line 53 of file TTGeometryTranslator.h.

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

Definition at line 171 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().

171  {
172  // Check L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc
173  const DetId detId = tp.detId();
174  const GeomDetUnit* geoUnit = _geom->idToDetUnit(detId+1); // det0
175  //const GeomDetUnit* geoUnit = _geom->idToDetUnit(detId+2); // det1
176  const Phase2TrackerGeomDetUnit* ph2TkGeoUnit = dynamic_cast<const Phase2TrackerGeomDetUnit*>(geoUnit);
177  const MeasurementPoint mp(tp.getTTData().row_f, tp.getTTData().col_f);
178  const GlobalPoint gp = ph2TkGeoUnit->surface().toGlobal(ph2TkGeoUnit->specificTopology().localPosition(mp));
179  return gp;
180 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
edm::ESHandle< TrackerGeometry > _geom
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: DetId.h:18
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 30 of file TTGeometryTranslator.cc.

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

Referenced by isBarrel().

30  {
31  const DetId detId = tp.detId();
32  bool isBarrel = (detId.subdetId() == StripSubdetector::TOB);
33  //bool isEndcap = (detId.subdetId() == StripSubdetector::TID);
34  return isBarrel;
35 }
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:41
Definition: DetId.h:18
bool TTGeometryTranslator::isPSModule ( const TTTriggerPrimitive tp) const

Definition at line 37 of file TTGeometryTranslator.cc.

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

37  {
38  const DetId detId = tp.detId();
39  const TrackerGeometry::ModuleType moduleType = _geom->getDetectorType(detId);
41  //bool isSSModule = (moduleType == TrackerGeometry::ModuleType::Ph2SS);
42  return isPSModule;
43 }
edm::ESHandle< TrackerGeometry > _geom
ModuleType getDetectorType(DetId) const
Definition: DetId.h:18
bool isPSModule(const TTTriggerPrimitive &) const
int TTGeometryTranslator::layer ( const TTTriggerPrimitive tp) const

Definition at line 62 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().

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

Definition at line 86 of file TTGeometryTranslator.cc.

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

Referenced by TTPrimitiveConversion::convert_tt().

86  {
87  int module = 0;
88 
89  const DetId detId = tp.detId();
90  if (detId.subdetId() == StripSubdetector::TOB) { // barrel
91  module = static_cast<int>(_topo->module(detId));
92  } else if (detId.subdetId() == StripSubdetector::TID) { // endcap
93  module = static_cast<int>(_topo->module(detId));
94  }
95  return module;
96 }
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:41
edm::ESHandle< TrackerTopology > _topo
Definition: DetId.h:18
Definition: vlib.h:208
int TTGeometryTranslator::region ( const TTTriggerPrimitive tp) const

Definition at line 45 of file TTGeometryTranslator.cc.

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

Referenced by TTPrimitiveConversion::convert_tt().

45  {
46  int region = 0;
47 
48  const DetId detId = tp.detId();
49  if (detId.subdetId() == StripSubdetector::TOB) { // barrel
50  region = 0;
51  } else if (detId.subdetId() == StripSubdetector::TID) { // endcap
52  int type = _topo->tidSide(detId); // 1=-ve 2=+ve
53  if (type == 1) {
54  region = -1;
55  } else if (type == 2) {
56  region = +1;
57  }
58  }
59  return region;
60 }
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:41
edm::ESHandle< TrackerTopology > _topo
Definition: DetId.h:18
int TTGeometryTranslator::ring ( const TTTriggerPrimitive tp) const

Definition at line 74 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().

74  {
75  int ring = 0;
76 
77  const DetId detId = tp.detId();
78  if (detId.subdetId() == StripSubdetector::TOB) { // barrel
79  ring = static_cast<int>(_topo->tobRod(detId));
80  } else if (detId.subdetId() == StripSubdetector::TID) { // endcap
81  ring = static_cast<int>(_topo->tidRing(detId));
82  }
83  return ring;
84 }
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:41
edm::ESHandle< TrackerTopology > _topo
Definition: DetId.h:18
int ring(const TTTriggerPrimitive &) const
unsigned int tobRod(const DetId &id) const

Member Data Documentation

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

Definition at line 59 of file TTGeometryTranslator.h.

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

unsigned long long L1TMuon::TTGeometryTranslator::_geom_cache_id
private

Definition at line 58 of file TTGeometryTranslator.h.

Referenced by checkAndUpdateGeometry().

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

Definition at line 65 of file TTGeometryTranslator.h.

Referenced by checkAndUpdateGeometry().

unsigned long long L1TMuon::TTGeometryTranslator::_magfield_cache_id
private

Definition at line 64 of file TTGeometryTranslator.h.

Referenced by checkAndUpdateGeometry().

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

Definition at line 62 of file TTGeometryTranslator.h.

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

unsigned long long L1TMuon::TTGeometryTranslator::_topo_cache_id
private

Definition at line 61 of file TTGeometryTranslator.h.

Referenced by checkAndUpdateGeometry().