CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
OmtfAngleConverter Class Reference

#include <OmtfAngleConverter.h>

Inheritance diagram for OmtfAngleConverter:
AngleConverterBase

Public Member Functions

virtual int getGlobalEta (const DTChamberId dTChamberId, const L1MuDTChambThContainer *dtThDigis, int bxNum) const
 
virtual int getGlobalEta (unsigned int rawid, const CSCCorrelatedLCTDigi &aDigi) const
 Convert local eta coordinate to global digital microGMT scale. More...
 
virtual int getGlobalEtaRpc (unsigned int rawid, const unsigned int &aDigi) const
 Convert local eta coordinate to global digital microGMT scale. More...
 
 OmtfAngleConverter ()
 
 ~OmtfAngleConverter () override
 
- Public Member Functions inherited from AngleConverterBase
 AngleConverterBase ()
 
virtual void checkAndUpdateGeometry (const edm::EventSetup &, const ProcConfigurationBase *config, const MuonGeometryTokens &muonGeometryTokens)
 Update the Geometry with current Event Setup. More...
 
float cscChamberEtaSize (const CSCDetId &id) const
 
virtual void getGlobalEta (const L1MuDTChambThDigi &thetaDigi, std::vector< EtaValue > &etaSegments) const
 
virtual std::vector< EtaValuegetGlobalEta (const L1MuDTChambThContainer *dtThDigis, int bxFrom, int bxTo) const
 
virtual EtaValue getGlobalEta (const CSCDetId &detId, const CSCCorrelatedLCTDigi &aDigi) const
 Convert local eta coordinate to global digital microGMT scale. More...
 
virtual EtaValue getGlobalEta (unsigned int rawid, const unsigned int &aDigi) const
 
virtual EtaValue getGlobalEtaCsc (const CSCDetId &detId) const
 returns the eta position of the CSC chamber More...
 
virtual EtaValue getGlobalEtaDt (const DTChamberId &detId) const
 
virtual int getProcessorPhi (int phiZero, l1t::tftype part, int dtScNum, int dtPhi) const
 
virtual int getProcessorPhi (int phiZero, l1t::tftype part, const CSCDetId &csc, const CSCCorrelatedLCTDigi &digi) const
 
virtual int getProcessorPhi (unsigned int iProcessor, l1t::tftype part, const RPCDetId &rollId, const unsigned int &digi) const
 
virtual int getProcessorPhi (int phiZero, l1t::tftype part, const RPCDetId &rollId, const unsigned int &digi1, const unsigned int &digi2) const
 
virtual ~AngleConverterBase ()
 

Additional Inherited Members

- Protected Member Functions inherited from AngleConverterBase
virtual const int findBTIgroup (const L1MuDTChambPhDigi &aDigi, const L1MuDTChambThContainer *dtThDigis)
 Find BTI group. More...
 
virtual bool isCSCCounterClockwise (const CSCLayer *layer) const
 Check orientation of strips in given CSC chamber. More...
 
- Protected Attributes inherited from AngleConverterBase
edm::ESHandle< CSCGeometry_geocsc
 
edm::ESHandle< DTGeometry_geodt
 
unsigned long long _geom_cache_id = 0
 
edm::ESHandle< RPCGeometry_georpc
 
const ProcConfigurationBaseconfig = nullptr
 
edm::ESWatcher
< MuonGeometryRecord
muonGeometryRecordWatcher
 
unsigned int nPhiBins = 0
 Number of phi bins along 2Pi. More...
 

Detailed Description

Definition at line 13 of file OmtfAngleConverter.h.

Constructor & Destructor Documentation

OmtfAngleConverter::OmtfAngleConverter ( )
inline

Definition at line 15 of file OmtfAngleConverter.h.

OmtfAngleConverter::~OmtfAngleConverter ( )
override

Definition at line 143 of file OmtfAngleConverter.cc.

143 {}

Member Function Documentation

int OmtfAngleConverter::getGlobalEta ( const DTChamberId  dTChamberId,
const L1MuDTChambThContainer dtThDigis,
int  bxNum 
) const
virtual

Convert local eta coordinate to global digital microGMT scale. theta is returned only if in the dtThDigis is only one hit, otherwise eta = 95 or middle of the chamber

Definition at line 147 of file OmtfAngleConverter.cc.

References AngleConverterBase::_geodt, L1MuDTChambThContainer::chThetaSegm(), PV3DBase< T, PVType, FrameType >::eta(), mps_fire::i, L1MuDTChambThDigi::position(), DTChamberId::sector(), FWPFMaths::sgn(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by CscDigiToStubsConverterOmtf::addCSCstubs(), and DtDigiToStubsConverterOmtf::addDTphiDigi().

149  {
150  //const DTChamberId dTChamberId(aDigi.whNum(),aDigi.stNum(),aDigi.scNum()+1);
151  DTTrigGeom trig_geom(_geodt->chamber(dTChamberId), false);
152 
153  // super layer one is the theta superlayer in a DT chamber
154  // station 4 does not have a theta super layer
155  // the BTI index from the theta trigger is an OR of some BTI outputs
156  // so, we choose the BTI that's in the middle of the group
157  // as the BTI that we get theta from
158  // TODO:::::>>> need to make sure this ordering doesn't flip under wheel sign
159  const int NBTI_theta = ((dTChamberId.station() != 4) ? trig_geom.nCell(2) : trig_geom.nCell(3));
160 
161  const L1MuDTChambThDigi *theta_segm =
162  dtThDigis->chThetaSegm(dTChamberId.wheel(), dTChamberId.station(), dTChamberId.sector() - 1, bxNum);
163 
164  int bti_group = -1;
165  if (theta_segm) {
166  for (unsigned int i = 0; i < 7; ++i)
167  if (theta_segm->position(i) && bti_group < 0)
168  bti_group = i;
169  else if (theta_segm->position(i) && bti_group > -1)
170  bti_group = 511;
171  }
172 
173  int iEta = 0;
174  if (bti_group == 511)
175  iEta = 95;
176  else if (bti_group == -1 && dTChamberId.station() == 1)
177  iEta = 92;
178  else if (bti_group == -1 && dTChamberId.station() == 2)
179  iEta = 79;
180  else if (bti_group == -1 && dTChamberId.station() == 3)
181  iEta = 75;
182  else if (dTChamberId.station() != 4 && bti_group >= 0) {
183  unsigned bti_actual = bti_group * NBTI_theta / 7 + NBTI_theta / 14 + 1;
184  DTBtiId thetaBTI = DTBtiId(dTChamberId, 2, bti_actual);
185  GlobalPoint theta_gp = trig_geom.CMSPosition(thetaBTI);
186  iEta = etaVal2Code(fabs(theta_gp.eta()));
187  }
188  int signEta = sgn(dTChamberId.wheel());
189  iEta *= signEta;
190  return iEta;
191 }
edm::ESHandle< DTGeometry > _geodt
float sgn(float val)
Definition: FWPFMaths.cc:9
int position(const int i) const
L1MuDTChambThDigi const * chThetaSegm(int wheel, int stat, int sect, int bx) const
T eta() const
Definition: PV3DBase.h:73
int sector() const
Definition: DTChamberId.h:49
int station() const
Return the station number.
Definition: DTChamberId.h:42
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int OmtfAngleConverter::getGlobalEta ( unsigned int  rawid,
const CSCCorrelatedLCTDigi aDigi 
) const
virtual

Convert local eta coordinate to global digital microGMT scale.

Code taken from GeometryTranslator. Will be replaced by direct CSC phi local to global scale transformation as used in FPGA implementation

Definition at line 195 of file OmtfAngleConverter.cc.

References AngleConverterBase::_geocsc, CSCCorrelatedLCTDigi::getKeyWG(), CSCCorrelatedLCTDigi::getStrip(), gpuClustering::id, AngleConverterBase::isCSCCounterClockwise(), CSCConstants::KEY_ALCT_LAYER, phase1PixelTopology::layer, PV3DBase< T, PVType, FrameType >::mag(), hltrates_dqm_sourceclient-live_cfg::offset, PV3DBase< T, PVType, FrameType >::phi(), digitizers_cfi::strip, PV3DBase< T, PVType, FrameType >::theta(), and Geom::Phi< T1, Range >::value().

195  {
199 
200  // a lot of this is transcription and consolidation of the CSC
201  // global phi calculation code
202  // this works directly with the geometry
203  // rather than using the old phi luts
204  const CSCDetId id(rawid);
205  // we should change this to weak_ptrs at some point
206  // requires introducing std::shared_ptrs to geometry
207  auto chamb = _geocsc->chamber(id);
208  auto layer_geom = chamb->layer(CSCConstants::KEY_ALCT_LAYER)->geometry();
209  auto layer = chamb->layer(CSCConstants::KEY_ALCT_LAYER);
210 
211  const uint16_t halfstrip = aDigi.getStrip();
212  //const uint16_t pattern = aDigi.getPattern();
213  const uint16_t keyWG = aDigi.getKeyWG();
214  //const unsigned maxStrips = layer_geom->numberOfStrips();
215 
216  // so we can extend this later
217  // assume TMB2007 half-strips only as baseline
218  double offset = 0.0;
219  //K.B. CSCPatternLUT is removed since CMSSW_11_2_1, but it looks that this offset is effectively not needed here
220  //offset = CSCPatternLUT::get2007Position(pattern);
221 
222  const unsigned halfstrip_offs = unsigned(0.5 + halfstrip + offset);
223  const unsigned strip = halfstrip_offs / 2 + 1; // geom starts from 1
224 
225  // the rough location of the hit at the ALCT key layer
226  // we will refine this using the half strip information
227  const LocalPoint coarse_lp = layer_geom->stripWireGroupIntersection(strip, keyWG);
228  const GlobalPoint coarse_gp = layer->surface().toGlobal(coarse_lp);
229 
230  // the strip width/4.0 gives the offset of the half-strip
231  // center with respect to the strip center
232  const double hs_offset = layer_geom->stripPhiPitch() / 4.0;
233 
234  // determine handedness of the chamber
235  const bool ccw = isCSCCounterClockwise(layer);
236  // we need to subtract the offset of even half strips and add the odd ones
237  const double phi_offset = ((halfstrip_offs % 2 ? 1 : -1) * (ccw ? -hs_offset : hs_offset));
238 
239  // the global eta calculation uses the middle of the strip
240  // so no need to increment it
241  const GlobalPoint final_gp(
242  GlobalPoint::Polar(coarse_gp.theta(), (coarse_gp.phi().value() + phi_offset), coarse_gp.mag()));
243 
244  // LogTrace("l1tOmtfEventPrint")<<id<<" st: " << id.station()<< "ri: "<<id.ring()<<" eta: " << final_gp.eta()
245  // <<" etaCode_simple: " << etaVal2Code( final_gp.eta() )<< " KW: "<<keyWG <<" etaKeyWG2Code: "<<etaKeyWG2Code(id,keyWG)<< std::endl;
246  // int station = (id.endcap()==1) ? id.station() : -id.station();
247  // LogTrace("l1tOmtfEventPrint")<<"ETA_CSC: " << station <<" "<<id.ring()<<" "<< final_gp.eta()<<" "<<keyWG <<" "<< etaKeyWG2Code(id,keyWG) << std::endl;
248 
249  return etaKeyWG2Code(id, keyWG);
250 }
uint16_t *__restrict__ id
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T1 value() const
Explicit access to value in case implicit conversion not OK.
Definition: Phi.h:75
constexpr std::array< uint8_t, layerIndexSize > layer
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
T mag() const
Definition: PV3DBase.h:64
uint16_t getKeyWG() const
return the key wire group. counts from 0.
virtual bool isCSCCounterClockwise(const CSCLayer *layer) const
Check orientation of strips in given CSC chamber.
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
edm::ESHandle< CSCGeometry > _geocsc
int OmtfAngleConverter::getGlobalEtaRpc ( unsigned int  rawid,
const unsigned int &  aDigi 
) const
virtual

Convert local eta coordinate to global digital microGMT scale.

Definition at line 253 of file OmtfAngleConverter.cc.

References AngleConverterBase::_georpc, PV3DBase< T, PVType, FrameType >::eta(), runTauDisplay::gp, and gpuClustering::id.

Referenced by RpcDigiToStubsConverterOmtf::addRPCstub().

253  {
254  const RPCDetId id(rawid);
255  auto roll = _georpc->roll(id);
256  const LocalPoint lp = roll->centreOfStrip((int)strip);
257  const GlobalPoint gp = roll->toGlobal(lp);
258 
259  return etaVal2Code(gp.eta());
260 }
uint16_t *__restrict__ id
edm::ESHandle< RPCGeometry > _georpc
T eta() const
Definition: PV3DBase.h:73