CMS 3D CMS Logo

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

#include <GeometryTranslator.h>

Public Member Functions

double calculateBendAngle (const TriggerPrimitive &) const
 
double calculateGlobalEta (const TriggerPrimitive &) const
 
double calculateGlobalPhi (const TriggerPrimitive &) const
 
void checkAndUpdateGeometry (const edm::EventSetup &)
 
 GeometryTranslator ()
 
const CSCGeometrygetCSCGeometry () const
 
const DTGeometrygetDTGeometry () const
 
const GEMGeometrygetGEMGeometry () const
 
GlobalPoint getGlobalPoint (const TriggerPrimitive &) const
 
const MagneticFieldgetMagneticField () const
 
const ME0GeometrygetME0Geometry () const
 
const RPCGeometrygetRPCGeometry () const
 
 ~GeometryTranslator ()
 

Private Member Functions

double calcCSCSpecificBend (const TriggerPrimitive &) const
 
double calcCSCSpecificEta (const TriggerPrimitive &) const
 
double calcCSCSpecificPhi (const TriggerPrimitive &) const
 
double calcDTSpecificBend (const TriggerPrimitive &) const
 
double calcDTSpecificEta (const TriggerPrimitive &) const
 
double calcDTSpecificPhi (const TriggerPrimitive &) const
 
GlobalPoint calcDTSpecificPoint (const TriggerPrimitive &) const
 
double calcGEMSpecificBend (const TriggerPrimitive &) const
 
double calcGEMSpecificEta (const TriggerPrimitive &) const
 
double calcGEMSpecificPhi (const TriggerPrimitive &) const
 
double calcRPCSpecificBend (const TriggerPrimitive &) const
 
double calcRPCSpecificEta (const TriggerPrimitive &) const
 
double calcRPCSpecificPhi (const TriggerPrimitive &) const
 
GlobalPoint getCSCSpecificPoint (const TriggerPrimitive &) const
 
GlobalPoint getGEMSpecificPoint (const TriggerPrimitive &) const
 
GlobalPoint getRPCSpecificPoint (const TriggerPrimitive &) const
 
bool isCSCCounterClockwise (const std::unique_ptr< const CSCLayer > &) const
 

Private Attributes

edm::ESHandle< CSCGeometry_geocsc
 
edm::ESHandle< DTGeometry_geodt
 
edm::ESHandle< GEMGeometry_geogem
 
unsigned long long _geom_cache_id
 
edm::ESHandle< ME0Geometry_geome0
 
edm::ESHandle< RPCGeometry_georpc
 
edm::ESHandle< MagneticField_magfield
 
unsigned long long _magfield_cache_id
 

Detailed Description

Definition at line 39 of file GeometryTranslator.h.

Constructor & Destructor Documentation

GeometryTranslator::GeometryTranslator ( )

Definition at line 25 of file GeometryTranslator.cc.

25  :
26  _geom_cache_id(0ULL), _magfield_cache_id(0ULL) {
27 }
unsigned long long _geom_cache_id
unsigned long long _magfield_cache_id
GeometryTranslator::~GeometryTranslator ( )

Definition at line 29 of file GeometryTranslator.cc.

29  {
30 }

Member Function Documentation

double GeometryTranslator::calcCSCSpecificBend ( const TriggerPrimitive tp) const
private
double GeometryTranslator::calcCSCSpecificEta ( const TriggerPrimitive tp) const
private

Definition at line 288 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalEta().

288  {
289  return getCSCSpecificPoint(tp).eta();
290 }
GlobalPoint getCSCSpecificPoint(const TriggerPrimitive &) const
T eta() const
Definition: PV3DBase.h:76
double GeometryTranslator::calcCSCSpecificPhi ( const TriggerPrimitive tp) const
private

Definition at line 293 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalPhi().

293  {
294  return getCSCSpecificPoint(tp).phi();
295 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint getCSCSpecificPoint(const TriggerPrimitive &) const
double GeometryTranslator::calcDTSpecificBend ( const TriggerPrimitive tp) const
private

Definition at line 352 of file GeometryTranslator.cc.

References L1TMuon::TriggerPrimitive::DTData::bendingAngle, L1TMuon::TriggerPrimitive::getDTData(), and isCSCCounterClockwise().

Referenced by calculateBendAngle().

352  {
353  int bend = tp.getDTData().bendingAngle;
354  double bendf = bend/512.0;
355  return bendf;
356 }
const DTData getDTData() const
double GeometryTranslator::calcDTSpecificEta ( const TriggerPrimitive tp) const
private

Definition at line 341 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalEta().

341  {
342  return calcDTSpecificPoint(tp).eta();
343 }
GlobalPoint calcDTSpecificPoint(const TriggerPrimitive &) const
T eta() const
Definition: PV3DBase.h:76
double GeometryTranslator::calcDTSpecificPhi ( const TriggerPrimitive tp) const
private

Definition at line 346 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalPhi().

346  {
347  return calcDTSpecificPoint(tp).phi();
348 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint calcDTSpecificPoint(const TriggerPrimitive &) const
GlobalPoint GeometryTranslator::calcDTSpecificPoint ( const TriggerPrimitive tp) const
private

Definition at line 303 of file GeometryTranslator.cc.

References _geodt, DTGeometry::chamber(), L1TMuon::TriggerPrimitive::detId(), L1TMuon::TriggerPrimitive::getDTData(), M_PI, PV3DBase< T, PVType, FrameType >::mag(), L1TMuon::TriggerPrimitive::DTData::radialAngle, L1TMuon::TriggerPrimitive::DTData::sector, DTChamberId::station(), PV3DBase< T, PVType, FrameType >::theta(), and L1TMuon::TriggerPrimitive::DTData::theta_bti_group.

Referenced by calcDTSpecificEta(), calcDTSpecificPhi(), and getGlobalPoint().

303  {
304  const DTChamberId baseid(tp.detId<DTChamberId>());
305  // do not use this pointer for anything other than creating a trig geom
306  std::unique_ptr<DTChamber> chamb(
307  const_cast<DTChamber*>(_geodt->chamber(baseid))
308  );
309  std::unique_ptr<DTTrigGeom> trig_geom( new DTTrigGeom(chamb.get(),false) );
310  chamb.release(); // release it here so no one gets funny ideas
311  // super layer one is the theta superlayer in a DT chamber
312  // station 4 does not have a theta super layer
313  // the BTI index from the theta trigger is an OR of some BTI outputs
314  // so, we choose the BTI that's in the middle of the group
315  // as the BTI that we get theta from
316  // TODO:::::>>> need to make sure this ordering doesn't flip under wheel sign
317  const int NBTI_theta = ( (baseid.station() != 4) ?
318  trig_geom->nCell(2) : trig_geom->nCell(3) );
319  const int bti_group = tp.getDTData().theta_bti_group;
320  const unsigned bti_actual = bti_group*NBTI_theta/7 + NBTI_theta/14 + 1;
321  DTBtiId thetaBTI;
322  if ( baseid.station() != 4 && bti_group != -1) {
323  thetaBTI = DTBtiId(baseid,2,bti_actual);
324  } else {
325  // since this is phi oriented it'll give us theta in the middle
326  // of the chamber
327  thetaBTI = DTBtiId(baseid,3,1);
328  }
329  const GlobalPoint theta_gp = trig_geom->CMSPosition(thetaBTI);
330 
331  // local phi in sector -> global phi
332  double phi = ((double)tp.getDTData().radialAngle)/4096.0;
333  phi += tp.getDTData().sector*M_PI/6.0; // add sector offset
334 
335  return GlobalPoint( GlobalPoint::Polar( theta_gp.theta(),
336  phi,
337  theta_gp.mag() ) );
338 }
edm::ESHandle< DTGeometry > _geodt
const DTData getDTData() const
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:99
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
T mag() const
Definition: PV3DBase.h:67
#define M_PI
double GeometryTranslator::calcGEMSpecificBend ( const TriggerPrimitive tp) const
private
double GeometryTranslator::calcGEMSpecificEta ( const TriggerPrimitive tp) const
private

Definition at line 171 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalEta().

171  {
172  return getGEMSpecificPoint(tp).eta();
173 }
T eta() const
Definition: PV3DBase.h:76
GlobalPoint getGEMSpecificPoint(const TriggerPrimitive &) const
double GeometryTranslator::calcGEMSpecificPhi ( const TriggerPrimitive tp) const
private

Definition at line 176 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalPhi().

176  {
177  return getGEMSpecificPoint(tp).phi();
178 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint getGEMSpecificPoint(const TriggerPrimitive &) const
double GeometryTranslator::calcRPCSpecificBend ( const TriggerPrimitive tp) const
private

Definition at line 215 of file GeometryTranslator.cc.

Referenced by calculateBendAngle().

215  {
216  return 0.0;
217 }
double GeometryTranslator::calcRPCSpecificEta ( const TriggerPrimitive tp) const
private

Definition at line 203 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalEta().

203  {
204  return getRPCSpecificPoint(tp).eta();
205 }
GlobalPoint getRPCSpecificPoint(const TriggerPrimitive &) const
T eta() const
Definition: PV3DBase.h:76
double GeometryTranslator::calcRPCSpecificPhi ( const TriggerPrimitive tp) const
private

Definition at line 208 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalPhi().

208  {
209  return getRPCSpecificPoint(tp).phi();
210 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint getRPCSpecificPoint(const TriggerPrimitive &) const
double GeometryTranslator::calculateBendAngle ( const TriggerPrimitive tp) const

Definition at line 75 of file GeometryTranslator.cc.

References calcCSCSpecificBend(), calcDTSpecificBend(), calcGEMSpecificBend(), calcRPCSpecificBend(), L1TMuon::TriggerPrimitive::kCSC, L1TMuon::TriggerPrimitive::kDT, L1TMuon::TriggerPrimitive::kGEM, L1TMuon::TriggerPrimitive::kRPC, and L1TMuon::TriggerPrimitive::subsystem().

75  {
76  switch(tp.subsystem()) {
78  return calcDTSpecificBend(tp);
79  break;
81  return calcCSCSpecificBend(tp);
82  break;
84  return calcRPCSpecificBend(tp);
85  break;
87  return calcGEMSpecificBend(tp);
88  break;
89  default:
90  return std::nan("Invalid TP type!");
91  break;
92  }
93 }
const subsystem_type subsystem() const
double calcRPCSpecificBend(const TriggerPrimitive &) const
double calcDTSpecificBend(const TriggerPrimitive &) const
double calcGEMSpecificBend(const TriggerPrimitive &) const
double calcCSCSpecificBend(const TriggerPrimitive &) const
double GeometryTranslator::calculateGlobalEta ( const TriggerPrimitive tp) const

Definition at line 33 of file GeometryTranslator.cc.

References calcCSCSpecificEta(), calcDTSpecificEta(), calcGEMSpecificEta(), calcRPCSpecificEta(), L1TMuon::TriggerPrimitive::kCSC, L1TMuon::TriggerPrimitive::kDT, L1TMuon::TriggerPrimitive::kGEM, L1TMuon::TriggerPrimitive::kRPC, and L1TMuon::TriggerPrimitive::subsystem().

33  {
34  switch(tp.subsystem()) {
36  return calcDTSpecificEta(tp);
37  break;
39  return calcCSCSpecificEta(tp);
40  break;
42  return calcRPCSpecificEta(tp);
43  break;
45  return calcGEMSpecificEta(tp);
46  break;
47  default:
48  return std::nan("Invalid TP type!");
49  break;
50  }
51 }
const subsystem_type subsystem() const
double calcDTSpecificEta(const TriggerPrimitive &) const
double calcGEMSpecificEta(const TriggerPrimitive &) const
double calcCSCSpecificEta(const TriggerPrimitive &) const
double calcRPCSpecificEta(const TriggerPrimitive &) const
double GeometryTranslator::calculateGlobalPhi ( const TriggerPrimitive tp) const

Definition at line 54 of file GeometryTranslator.cc.

References calcCSCSpecificPhi(), calcDTSpecificPhi(), calcGEMSpecificPhi(), calcRPCSpecificPhi(), L1TMuon::TriggerPrimitive::kCSC, L1TMuon::TriggerPrimitive::kDT, L1TMuon::TriggerPrimitive::kGEM, L1TMuon::TriggerPrimitive::kRPC, and L1TMuon::TriggerPrimitive::subsystem().

54  {
55  switch(tp.subsystem()) {
57  return calcDTSpecificPhi(tp);
58  break;
60  return calcCSCSpecificPhi(tp);
61  break;
63  return calcRPCSpecificPhi(tp);
64  break;
66  return calcGEMSpecificPhi(tp);
67  break;
68  default:
69  return std::nan("Invalid TP type!");
70  break;
71  }
72 }
const subsystem_type subsystem() const
double calcGEMSpecificPhi(const TriggerPrimitive &) const
double calcRPCSpecificPhi(const TriggerPrimitive &) const
double calcCSCSpecificPhi(const TriggerPrimitive &) const
double calcDTSpecificPhi(const TriggerPrimitive &) const
void GeometryTranslator::checkAndUpdateGeometry ( const edm::EventSetup es)

Definition at line 117 of file GeometryTranslator.cc.

References _geocsc, _geodt, _geogem, _geom_cache_id, _geome0, _georpc, _magfield, _magfield_cache_id, edm::eventsetup::EventSetupRecord::cacheIdentifier(), relativeConstraints::geom, edm::EventSetup::get(), and edm::eventsetup::EventSetupRecord::get().

Referenced by TrackFinder::process().

117  {
119  unsigned long long geomid = geom.cacheIdentifier();
120  if( _geom_cache_id != geomid ) {
121  geom.get(_geome0);
122  geom.get(_geogem);
123  geom.get(_georpc);
124  geom.get(_geocsc);
125  geom.get(_geodt);
126  _geom_cache_id = geomid;
127  }
128 
129  const IdealMagneticFieldRecord& magfield = es.get<IdealMagneticFieldRecord>();
130  unsigned long long magfieldid = magfield.cacheIdentifier();
131  if( _magfield_cache_id != magfieldid ) {
132  magfield.get(_magfield);
133  _magfield_cache_id = magfieldid;
134  }
135 }
unsigned long long cacheIdentifier() const
edm::ESHandle< DTGeometry > _geodt
unsigned long long _geom_cache_id
edm::ESHandle< RPCGeometry > _georpc
edm::ESHandle< GEMGeometry > _geogem
edm::ESHandle< ME0Geometry > _geome0
edm::ESHandle< MagneticField > _magfield
edm::ESHandle< CSCGeometry > _geocsc
void get(HolderT &iHolder) const
T get() const
Definition: EventSetup.h:63
unsigned long long _magfield_cache_id
const CSCGeometry& L1TMuon::GeometryTranslator::getCSCGeometry ( ) const
inline

Definition at line 55 of file GeometryTranslator.h.

55 { return *_geocsc; }
edm::ESHandle< CSCGeometry > _geocsc
GlobalPoint GeometryTranslator::getCSCSpecificPoint ( const TriggerPrimitive tp) const
private

Definition at line 225 of file GeometryTranslator.cc.

References _geocsc, CSCGeometry::chamber(), L1TMuon::TriggerPrimitive::detId(), CSCPatternLUT::get2007Position(), L1TMuon::TriggerPrimitive::getCSCData(), triggerObjects_cff::id, isCSCCounterClockwise(), CSCConstants::KEY_ALCT_LAYER, L1TMuon::TriggerPrimitive::CSCData::keywire, PV3DBase< T, PVType, FrameType >::mag(), PFRecoTauDiscriminationByIsolation_cfi::offset, listBenchmarks::pattern, L1TMuon::TriggerPrimitive::CSCData::pattern, PV3DBase< T, PVType, FrameType >::phi(), digitizers_cfi::strip, L1TMuon::TriggerPrimitive::CSCData::strip, and PV3DBase< T, PVType, FrameType >::theta().

Referenced by calcCSCSpecificEta(), calcCSCSpecificPhi(), and getGlobalPoint().

225  {
226  const CSCDetId id(tp.detId<CSCDetId>());
227  // we should change this to weak_ptrs at some point
228  // requires introducing std::shared_ptrs to geometry
229  std::unique_ptr<const CSCChamber> chamb(_geocsc->chamber(id));
230  std::unique_ptr<const CSCLayerGeometry> layer_geom(
231  chamb->layer(CSCConstants::KEY_ALCT_LAYER)->geometry()
232  );
233  std::unique_ptr<const CSCLayer> layer(
234  chamb->layer(CSCConstants::KEY_ALCT_LAYER)
235  );
236 
237  const uint16_t halfstrip = tp.getCSCData().strip;
238  const uint16_t pattern = tp.getCSCData().pattern;
239  const uint16_t keyWG = tp.getCSCData().keywire;
240  //const unsigned maxStrips = layer_geom->numberOfStrips();
241 
242  // so we can extend this later
243  // assume TMB2007 half-strips only as baseline
244  double offset = 0.0;
245  switch(1) {
246  case 1:
247  offset = CSCPatternLUT::get2007Position(pattern);
248  }
249  const unsigned halfstrip_offs = unsigned(0.5 + halfstrip + offset);
250  const unsigned strip = halfstrip_offs/2 + 1; // geom starts from 1
251 
252  // the rough location of the hit at the ALCT key layer
253  // we will refine this using the half strip information
254  const LocalPoint coarse_lp =
255  layer_geom->stripWireGroupIntersection(strip,keyWG);
256  const GlobalPoint coarse_gp = layer->surface().toGlobal(coarse_lp);
257 
258  // the strip width/4.0 gives the offset of the half-strip
259  // center with respect to the strip center
260  const double hs_offset = layer_geom->stripPhiPitch()/4.0;
261 
262  // determine handedness of the chamber
263  const bool ccw = isCSCCounterClockwise(layer);
264  // we need to subtract the offset of even half strips and add the odd ones
265  const double phi_offset = ( ( halfstrip_offs%2 ? 1 : -1)*
266  ( ccw ? -hs_offset : hs_offset ) );
267 
268  // the global eta calculation uses the middle of the strip
269  // so no need to increment it
270  const GlobalPoint final_gp( GlobalPoint::Polar( coarse_gp.theta(),
271  (coarse_gp.phi().value() +
272  phi_offset),
273  coarse_gp.mag() ) );
274 
275  // We need to add in some notion of the 'error' on trigger primitives
276  // like the width of the wire group by the width of the strip
277  // or something similar
278 
279  // release ownership of the pointers
280  chamb.release();
281  layer_geom.release();
282  layer.release();
283 
284  return final_gp;
285 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const CSCData getCSCData() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
T mag() const
Definition: PV3DBase.h:67
edm::ESHandle< CSCGeometry > _geocsc
static double get2007Position(int pattern)
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:118
bool isCSCCounterClockwise(const std::unique_ptr< const CSCLayer > &) const
const DTGeometry& L1TMuon::GeometryTranslator::getDTGeometry ( ) const
inline

Definition at line 56 of file GeometryTranslator.h.

56 { return *_geodt; }
edm::ESHandle< DTGeometry > _geodt
const GEMGeometry& L1TMuon::GeometryTranslator::getGEMGeometry ( ) const
inline

Definition at line 53 of file GeometryTranslator.h.

53 { return *_geogem; }
edm::ESHandle< GEMGeometry > _geogem
GlobalPoint GeometryTranslator::getGEMSpecificPoint ( const TriggerPrimitive tp) const
private

Definition at line 138 of file GeometryTranslator.cc.

References _geogem, _geome0, GEMEtaPartition::centreOfPad(), ME0EtaPartition::centreOfStrip(), L1TMuon::TriggerPrimitive::detId(), ME0Geometry::etaPartition(), GEMGeometry::etaPartition(), L1TMuon::TriggerPrimitive::getGEMData(), runTauDisplay::gp, triggerObjects_cff::id, L1TMuon::TriggerPrimitive::GEMData::isME0, L1TMuon::TriggerPrimitive::GEMData::pad_hi, L1TMuon::TriggerPrimitive::GEMData::pad_low, digitizers_cfi::strip, GeomDet::surface(), and Surface::toGlobal().

Referenced by calcGEMSpecificEta(), calcGEMSpecificPhi(), and getGlobalPoint().

138  {
139  LocalPoint lp;
140  GlobalPoint gp;
141 
142  if (!tp.getGEMData().isME0) { // use GEM geometry
143  const GEMDetId id(tp.detId<GEMDetId>());
144  const GEMEtaPartition * roll = _geogem->etaPartition(id);
145  assert(roll);
146  //const uint16_t pad = tp.getGEMData().pad;
147  // Use half-strip precision, - 0.5 at the end to get the center of the strip
148  const float pad = (0.5 * static_cast<float>(tp.getGEMData().pad_low + tp.getGEMData().pad_hi)) - 0.5;
149  lp = roll->centreOfPad(pad);
150  gp = roll->surface().toGlobal(lp);
151 
152  } else { // use ME0 geometry
153  const ME0DetId id(tp.detId<ME0DetId>());
154  const ME0EtaPartition * roll = _geome0->etaPartition(id);
155  assert(roll);
156  //const uint16_t pad = tp.getGEMData().pad;
157  // Use half-strip precision, - 0.5 at the end to get the center of the strip
158  const float pad = (0.5 * static_cast<float>(tp.getGEMData().pad_low + tp.getGEMData().pad_hi)) - 0.5;
159  //lp = roll->centreOfPad(pad); // does not work
160  const float strip = 2.0 * pad;
161  lp = roll->centreOfStrip(strip);
162  gp = roll->surface().toGlobal(lp);
163  }
164 
165  //roll.release();
166 
167  return gp;
168 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
const GEMData getGEMData() const
edm::ESHandle< GEMGeometry > _geogem
edm::ESHandle< ME0Geometry > _geome0
LocalPoint centreOfStrip(int strip) const
const ME0EtaPartition * etaPartition(ME0DetId id) const
Return a etaPartition given its id.
Definition: ME0Geometry.cc:64
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:99
LocalPoint centreOfPad(int pad) const
GlobalPoint GeometryTranslator::getGlobalPoint ( const TriggerPrimitive tp) const

Definition at line 96 of file GeometryTranslator.cc.

References calcDTSpecificPoint(), getCSCSpecificPoint(), getGEMSpecificPoint(), getRPCSpecificPoint(), L1TMuon::TriggerPrimitive::kCSC, L1TMuon::TriggerPrimitive::kDT, L1TMuon::TriggerPrimitive::kGEM, L1TMuon::TriggerPrimitive::kRPC, and L1TMuon::TriggerPrimitive::subsystem().

Referenced by PrimitiveConversion::convert_csc(), PrimitiveConversion::convert_gem(), and PrimitiveConversion::convert_rpc().

96  {
97  switch(tp.subsystem()) {
99  return calcDTSpecificPoint(tp);
100  break;
102  return getCSCSpecificPoint(tp);
103  break;
105  return getRPCSpecificPoint(tp);
106  break;
108  return getGEMSpecificPoint(tp);
109  break;
110  default:
111  GlobalPoint ret(GlobalPoint::Polar(std::nan("Invalid TP type!"), std::nan("Invalid TP type!"), std::nan("Invalid TP type!")));
112  return ret;
113  break;
114  }
115 }
const subsystem_type subsystem() const
GlobalPoint getRPCSpecificPoint(const TriggerPrimitive &) const
GlobalPoint getCSCSpecificPoint(const TriggerPrimitive &) const
GlobalPoint calcDTSpecificPoint(const TriggerPrimitive &) const
GlobalPoint getGEMSpecificPoint(const TriggerPrimitive &) const
const MagneticField& L1TMuon::GeometryTranslator::getMagneticField ( ) const
inline

Definition at line 58 of file GeometryTranslator.h.

58 { return *_magfield; }
edm::ESHandle< MagneticField > _magfield
const ME0Geometry& L1TMuon::GeometryTranslator::getME0Geometry ( ) const
inline

Definition at line 52 of file GeometryTranslator.h.

52 { return *_geome0; }
edm::ESHandle< ME0Geometry > _geome0
const RPCGeometry& L1TMuon::GeometryTranslator::getRPCGeometry ( ) const
inline

Definition at line 54 of file GeometryTranslator.h.

54 { return *_georpc; }
edm::ESHandle< RPCGeometry > _georpc
GlobalPoint GeometryTranslator::getRPCSpecificPoint ( const TriggerPrimitive tp) const
private

Definition at line 187 of file GeometryTranslator.cc.

References _georpc, RPCRoll::centreOfStrip(), L1TMuon::TriggerPrimitive::detId(), L1TMuon::TriggerPrimitive::getRPCData(), runTauDisplay::gp, triggerObjects_cff::id, RPCGeometry::roll(), digitizers_cfi::strip, L1TMuon::TriggerPrimitive::RPCData::strip_hi, L1TMuon::TriggerPrimitive::RPCData::strip_low, GeomDet::surface(), and Surface::toGlobal().

Referenced by calcRPCSpecificEta(), calcRPCSpecificPhi(), and getGlobalPoint().

187  {
188  const RPCDetId id(tp.detId<RPCDetId>());
189  const RPCRoll * roll = _georpc->roll(id);
190  assert(roll);
191  //const int strip = static_cast<int>(tp.getRPCData().strip);
192  // Use half-strip precision, - 0.5 at the end to get the center of the strip
193  const float strip = (0.5 * static_cast<float>(tp.getRPCData().strip_low + tp.getRPCData().strip_hi)) - 0.5;
194  const LocalPoint lp = roll->centreOfStrip(strip);
195  const GlobalPoint gp = roll->surface().toGlobal(lp);
196 
197  //roll.release();
198 
199  return gp;
200 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
LocalPoint centreOfStrip(int strip) const
Definition: RPCRoll.cc:52
edm::ESHandle< RPCGeometry > _georpc
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
const RPCData getRPCData() const
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:75
bool GeometryTranslator::isCSCCounterClockwise ( const std::unique_ptr< const CSCLayer > &  layer) const
private

Definition at line 359 of file GeometryTranslator.cc.

References funct::abs(), and M_PI.

Referenced by calcDTSpecificBend(), and getCSCSpecificPoint().

359  {
360  const int nStrips = layer->geometry()->numberOfStrips();
361  const double phi1 = layer->centerOfStrip(1).phi();
362  const double phiN = layer->centerOfStrip(nStrips).phi();
363  return ( (std::abs(phi1 - phiN) < M_PI && phi1 >= phiN) ||
364  (std::abs(phi1 - phiN) >= M_PI && phi1 < phiN) );
365 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI

Member Data Documentation

edm::ESHandle<CSCGeometry> L1TMuon::GeometryTranslator::_geocsc
private

Definition at line 66 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry(), and getCSCSpecificPoint().

edm::ESHandle<DTGeometry> L1TMuon::GeometryTranslator::_geodt
private

Definition at line 67 of file GeometryTranslator.h.

Referenced by calcDTSpecificPoint(), and checkAndUpdateGeometry().

edm::ESHandle<GEMGeometry> L1TMuon::GeometryTranslator::_geogem
private

Definition at line 64 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry(), and getGEMSpecificPoint().

unsigned long long L1TMuon::GeometryTranslator::_geom_cache_id
private

Definition at line 62 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry().

edm::ESHandle<ME0Geometry> L1TMuon::GeometryTranslator::_geome0
private

Definition at line 63 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry(), and getGEMSpecificPoint().

edm::ESHandle<RPCGeometry> L1TMuon::GeometryTranslator::_georpc
private

Definition at line 65 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry(), and getRPCSpecificPoint().

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

Definition at line 70 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry().

unsigned long long L1TMuon::GeometryTranslator::_magfield_cache_id
private

Definition at line 69 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry().