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 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< RPCGeometry_georpc
 
edm::ESHandle< MagneticField_magfield
 
unsigned long long _magfield_cache_id
 

Detailed Description

Definition at line 38 of file GeometryTranslator.h.

Constructor & Destructor Documentation

GeometryTranslator::GeometryTranslator ( )

Definition at line 24 of file GeometryTranslator.cc.

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

Definition at line 28 of file GeometryTranslator.cc.

28  {
29 }

Member Function Documentation

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

Definition at line 267 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalEta().

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

Definition at line 272 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalPhi().

272  {
273  return getCSCSpecificPoint(tp).phi();
274 }
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 331 of file GeometryTranslator.cc.

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

Referenced by calculateBendAngle().

331  {
332  int bend = tp.getDTData().bendingAngle;
333  double bendf = bend/512.0;
334  return bendf;
335 }
const DTData getDTData() const
double GeometryTranslator::calcDTSpecificEta ( const TriggerPrimitive tp) const
private

Definition at line 320 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalEta().

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

Definition at line 325 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalPhi().

325  {
326  return calcDTSpecificPoint(tp).phi();
327 }
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 282 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().

282  {
283  const DTChamberId baseid(tp.detId<DTChamberId>());
284  // do not use this pointer for anything other than creating a trig geom
285  std::unique_ptr<DTChamber> chamb(
286  const_cast<DTChamber*>(_geodt->chamber(baseid))
287  );
288  std::unique_ptr<DTTrigGeom> trig_geom( new DTTrigGeom(chamb.get(),false) );
289  chamb.release(); // release it here so no one gets funny ideas
290  // super layer one is the theta superlayer in a DT chamber
291  // station 4 does not have a theta super layer
292  // the BTI index from the theta trigger is an OR of some BTI outputs
293  // so, we choose the BTI that's in the middle of the group
294  // as the BTI that we get theta from
295  // TODO:::::>>> need to make sure this ordering doesn't flip under wheel sign
296  const int NBTI_theta = ( (baseid.station() != 4) ?
297  trig_geom->nCell(2) : trig_geom->nCell(3) );
298  const int bti_group = tp.getDTData().theta_bti_group;
299  const unsigned bti_actual = bti_group*NBTI_theta/7 + NBTI_theta/14 + 1;
300  DTBtiId thetaBTI;
301  if ( baseid.station() != 4 && bti_group != -1) {
302  thetaBTI = DTBtiId(baseid,2,bti_actual);
303  } else {
304  // since this is phi oriented it'll give us theta in the middle
305  // of the chamber
306  thetaBTI = DTBtiId(baseid,3,1);
307  }
308  const GlobalPoint theta_gp = trig_geom->CMSPosition(thetaBTI);
309 
310  // local phi in sector -> global phi
311  double phi = ((double)tp.getDTData().radialAngle)/4096.0;
312  phi += tp.getDTData().sector*M_PI/6.0; // add sector offset
313 
314  return GlobalPoint( GlobalPoint::Polar( theta_gp.theta(),
315  phi,
316  theta_gp.mag() ) );
317 }
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

Definition at line 161 of file GeometryTranslator.cc.

Referenced by calculateBendAngle().

161  {
162  return 0.0;
163 }
double GeometryTranslator::calcGEMSpecificEta ( const TriggerPrimitive tp) const
private

Definition at line 149 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalEta().

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

Definition at line 154 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalPhi().

154  {
155  return getGEMSpecificPoint(tp).phi();
156 }
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 194 of file GeometryTranslator.cc.

Referenced by calculateBendAngle().

194  {
195  return 0.0;
196 }
double GeometryTranslator::calcRPCSpecificEta ( const TriggerPrimitive tp) const
private

Definition at line 182 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalEta().

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

Definition at line 187 of file GeometryTranslator.cc.

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

Referenced by calculateGlobalPhi().

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

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

74  {
75  switch(tp.subsystem()) {
77  return calcDTSpecificBend(tp);
78  break;
80  return calcCSCSpecificBend(tp);
81  break;
83  return calcRPCSpecificBend(tp);
84  break;
86  return calcGEMSpecificBend(tp);
87  break;
88  default:
89  return std::nan("Invalid TP type!");
90  break;
91  }
92 }
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 32 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().

32  {
33  switch(tp.subsystem()) {
35  return calcDTSpecificEta(tp);
36  break;
38  return calcCSCSpecificEta(tp);
39  break;
41  return calcRPCSpecificEta(tp);
42  break;
44  return calcGEMSpecificEta(tp);
45  break;
46  default:
47  return std::nan("Invalid TP type!");
48  break;
49  }
50 }
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 53 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().

53  {
54  switch(tp.subsystem()) {
56  return calcDTSpecificPhi(tp);
57  break;
59  return calcCSCSpecificPhi(tp);
60  break;
62  return calcRPCSpecificPhi(tp);
63  break;
65  return calcGEMSpecificPhi(tp);
66  break;
67  default:
68  return std::nan("Invalid TP type!");
69  break;
70  }
71 }
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 116 of file GeometryTranslator.cc.

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

Referenced by TrackFinder::process().

116  {
118  unsigned long long geomid = geom.cacheIdentifier();
119  if( _geom_cache_id != geomid ) {
120  geom.get(_geogem);
121  geom.get(_georpc);
122  geom.get(_geocsc);
123  geom.get(_geodt);
124  _geom_cache_id = geomid;
125  }
126 
127  const IdealMagneticFieldRecord& magfield = es.get<IdealMagneticFieldRecord>();
128  unsigned long long magfieldid = magfield.cacheIdentifier();
129  if( _magfield_cache_id != magfieldid ) {
130  magfield.get(_magfield);
131  _magfield_cache_id = magfieldid;
132  }
133 }
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< MagneticField > _magfield
edm::ESHandle< CSCGeometry > _geocsc
void get(HolderT &iHolder) const
const T & get() const
Definition: EventSetup.h:58
unsigned long long _magfield_cache_id
const CSCGeometry& L1TMuon::GeometryTranslator::getCSCGeometry ( ) const
inline

Definition at line 53 of file GeometryTranslator.h.

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

Definition at line 204 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(), digi_MixPreMix_cfi::strip, L1TMuon::TriggerPrimitive::CSCData::strip, and PV3DBase< T, PVType, FrameType >::theta().

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

204  {
205  const CSCDetId id(tp.detId<CSCDetId>());
206  // we should change this to weak_ptrs at some point
207  // requires introducing std::shared_ptrs to geometry
208  std::unique_ptr<const CSCChamber> chamb(_geocsc->chamber(id));
209  std::unique_ptr<const CSCLayerGeometry> layer_geom(
210  chamb->layer(CSCConstants::KEY_ALCT_LAYER)->geometry()
211  );
212  std::unique_ptr<const CSCLayer> layer(
213  chamb->layer(CSCConstants::KEY_ALCT_LAYER)
214  );
215 
216  const uint16_t halfstrip = tp.getCSCData().strip;
217  const uint16_t pattern = tp.getCSCData().pattern;
218  const uint16_t keyWG = tp.getCSCData().keywire;
219  //const unsigned maxStrips = layer_geom->numberOfStrips();
220 
221  // so we can extend this later
222  // assume TMB2007 half-strips only as baseline
223  double offset = 0.0;
224  switch(1) {
225  case 1:
226  offset = CSCPatternLUT::get2007Position(pattern);
227  }
228  const unsigned halfstrip_offs = unsigned(0.5 + halfstrip + offset);
229  const unsigned strip = halfstrip_offs/2 + 1; // geom starts from 1
230 
231  // the rough location of the hit at the ALCT key layer
232  // we will refine this using the half strip information
233  const LocalPoint coarse_lp =
234  layer_geom->stripWireGroupIntersection(strip,keyWG);
235  const GlobalPoint coarse_gp = layer->surface().toGlobal(coarse_lp);
236 
237  // the strip width/4.0 gives the offset of the half-strip
238  // center with respect to the strip center
239  const double hs_offset = layer_geom->stripPhiPitch()/4.0;
240 
241  // determine handedness of the chamber
242  const bool ccw = isCSCCounterClockwise(layer);
243  // we need to subtract the offset of even half strips and add the odd ones
244  const double phi_offset = ( ( halfstrip_offs%2 ? 1 : -1)*
245  ( ccw ? -hs_offset : hs_offset ) );
246 
247  // the global eta calculation uses the middle of the strip
248  // so no need to increment it
249  const GlobalPoint final_gp( GlobalPoint::Polar( coarse_gp.theta(),
250  (coarse_gp.phi().value() +
251  phi_offset),
252  coarse_gp.mag() ) );
253 
254  // We need to add in some notion of the 'error' on trigger primitives
255  // like the width of the wire group by the width of the strip
256  // or something similar
257 
258  // release ownership of the pointers
259  chamb.release();
260  layer_geom.release();
261  layer.release();
262 
263  return final_gp;
264 }
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 54 of file GeometryTranslator.h.

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

Definition at line 51 of file GeometryTranslator.h.

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

Definition at line 136 of file GeometryTranslator.cc.

References _geogem, GEMEtaPartition::centreOfPad(), L1TMuon::TriggerPrimitive::detId(), GEMGeometry::etaPartition(), L1TMuon::TriggerPrimitive::getGEMData(), runTauDisplay::gp, triggerObjects_cff::id, L1TMuon::TriggerPrimitive::GEMData::pad, and GeomDet::toGlobal().

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

136  {
137  const GEMDetId id(tp.detId<GEMDetId>());
138  const GEMEtaPartition * roll = _geogem->etaPartition(id);
139  const uint16_t pad = tp.getGEMData().pad;
140  const LocalPoint lp = roll->centreOfPad(pad);
141  const GlobalPoint gp = roll->toGlobal(lp);
142 
143  //roll.release();
144 
145  return gp;
146 }
const GEMData getGEMData() const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
edm::ESHandle< GEMGeometry > _geogem
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 95 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().

95  {
96  switch(tp.subsystem()) {
98  return calcDTSpecificPoint(tp);
99  break;
101  return getCSCSpecificPoint(tp);
102  break;
104  return getRPCSpecificPoint(tp);
105  break;
107  return getGEMSpecificPoint(tp);
108  break;
109  default:
110  GlobalPoint ret(GlobalPoint::Polar(std::nan("Invalid TP type!"), std::nan("Invalid TP type!"), std::nan("Invalid TP type!")));
111  return ret;
112  break;
113  }
114 }
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 56 of file GeometryTranslator.h.

56 { return *_magfield; }
edm::ESHandle< MagneticField > _magfield
const RPCGeometry& L1TMuon::GeometryTranslator::getRPCGeometry ( ) const
inline

Definition at line 52 of file GeometryTranslator.h.

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

Definition at line 167 of file GeometryTranslator.cc.

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

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

167  {
168  const RPCDetId id(tp.detId<RPCDetId>());
169  const RPCRoll * roll = _georpc->roll(id);
170  //const int strip = static_cast<int>(tp.getRPCData().strip);
171  // Use half-strip precision, - 0.5 at the end to get the center of the strip
172  const float strip = (0.5 * static_cast<float>(tp.getRPCData().strip_low + tp.getRPCData().strip_hi)) - 0.5;
173  const LocalPoint lp = roll->centreOfStrip(strip);
174  const GlobalPoint gp = roll->toGlobal(lp);
175 
176  //roll.release();
177 
178  return gp;
179 }
LocalPoint centreOfStrip(int strip) const
Definition: RPCRoll.cc:52
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
edm::ESHandle< RPCGeometry > _georpc
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 338 of file GeometryTranslator.cc.

References funct::abs(), and M_PI.

Referenced by calcDTSpecificBend(), and getCSCSpecificPoint().

338  {
339  const int nStrips = layer->geometry()->numberOfStrips();
340  const double phi1 = layer->centerOfStrip(1).phi();
341  const double phiN = layer->centerOfStrip(nStrips).phi();
342  return ( (std::abs(phi1 - phiN) < M_PI && phi1 >= phiN) ||
343  (std::abs(phi1 - phiN) >= M_PI && phi1 < phiN) );
344 }
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 63 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry(), and getCSCSpecificPoint().

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

Definition at line 64 of file GeometryTranslator.h.

Referenced by calcDTSpecificPoint(), and checkAndUpdateGeometry().

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

Definition at line 61 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry(), and getGEMSpecificPoint().

unsigned long long L1TMuon::GeometryTranslator::_geom_cache_id
private

Definition at line 60 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry().

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

Definition at line 62 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry(), and getRPCSpecificPoint().

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

Definition at line 67 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry().

unsigned long long L1TMuon::GeometryTranslator::_magfield_cache_id
private

Definition at line 66 of file GeometryTranslator.h.

Referenced by checkAndUpdateGeometry().