23 return (
T(0) < val) - (val <
T(0));
26 int fixCscOffsetGeom(
int offsetLoc) {
30 const std::vector<int> offCSC = {-154, -133, -17, -4, 4, 17, 133, 146, 154, 167, 283, 296, 304, 317,
31 433, 446, 454, 467, 583, 596, 604, 617, 733, 746, 754, 767, 883, 904};
33 int fixOff = (gep != offCSC.end()) ? *gep : *(gep - 1);
34 if (gep != offCSC.begin() &&
std::abs(*(gep - 1) - offsetLoc) <
std::abs(fixOff - offsetLoc))
65 int sector = dtScNum + 1;
67 double scale = 1. / dtPhiBins / hsPhiPitch;
68 int scale_coeff = lround(scale *
pow(2, 11));
70 int ichamber = sector - 1;
72 ichamber = ichamber - 12;
74 int offsetGlobal = (int)
nPhiBins * ichamber / 12;
76 int phiConverted = floor(dtPhi * scale_coeff /
pow(2, 11)) + offsetGlobal - phiZero;
99 if (csc.
station() == 1 && csc.
ring() == 1 && halfStrip > 128) {
101 chamber =
_geocsc->chamber(cscME11);
108 double scale = fabs(stripPhiPitch / hsPhiPitch / 2.);
109 if (fabs(scale - 1.) < 0.0002)
112 double phiHalfStrip0 = layer->
centerOfStrip(1).
phi() - order * stripPhiPitch / 4.;
114 int offsetLoc = lround((phiHalfStrip0) / hsPhiPitch - phiZero);
117 if (csc.
station() == 1 && csc.
ring() == 1 && halfStrip > 128) {
127 int fixOff = offsetLoc;
132 fixOff = fixCscOffsetGeom(offsetLoc);
134 int phi = fixOff + order * scale * halfStrip;
161 int phiZero,
l1t::tftype part,
const RPCDetId& rollId,
const unsigned int& digi1,
const unsigned int& digi2)
const {
172 if (std::signbit(stripPhi1) != std::signbit(stripPhi2) &&
abs(stripPhi1) >
M_PI / 2.) {
173 if (std::signbit(stripPhi1)) {
174 stripPhi1 += 2 *
M_PI;
176 stripPhi2 += 2 *
M_PI;
178 int halfStrip = lround(((stripPhi1 + stripPhi2) / 2.) / hsPhiPitch);
181 LogTrace(
"l1tOmtfEventPrint") << __FUNCTION__ <<
":" << 185 <<
" roll " << rollId.
rawId() <<
" " << rollId
182 <<
" cluster: firstStrip " << digi1 <<
" stripPhi1Global " << stripPhi1
183 <<
" stripPhi1LocalPhi " << roll->
centreOfStrip((
int)digi1).
x() <<
" y "
184 << roll->
centreOfStrip((
int)digi1).
y() <<
" lastStrip " << digi2 <<
" stripPhi2Global "
185 << stripPhi2 <<
" stripPhi2LocalPhi x " << roll->
centreOfStrip((
int)digi2).
x() <<
" y "
186 << roll->
centreOfStrip((
int)digi2).
y() <<
" halfStrip " << halfStrip << std::endl;
194 const unsigned int& digi)
const {
197 int processor = iProcessor + 1;
202 double phi15deg =
M_PI / 3. * (processor - 1) +
M_PI / 12.;
212 phi15deg -= 2 *
M_PI;
217 stripPhi += 2 *
M_PI;
223 int halfStrip = lround((stripPhi - phi15deg) / hsPhiPitch);
234 GlobalPoint chambNeighMiddleGP =
_geodt->chamber(baseidNeigh)->toGlobal(chamberMiddleLP);
260 const int NBTI_theta = trig_geom.
nCell(2);
261 for (
unsigned int btiGroup = 0; btiGroup < 7; ++btiGroup) {
263 unsigned btiActual = btiGroup * NBTI_theta / 7 + NBTI_theta / 14 + 1;
265 GlobalPoint theta_gp = trig_geom.CMSPosition(thetaBTI);
274 etaSegments.emplace_back(etaValue);
286 std::vector<EtaValue> etaSegments;
288 for (
auto& thetaDigi : (*(dtThDigis->
getContainer()))) {
289 if (thetaDigi.bxNum() >= bxFrom && thetaDigi.bxNum() <= bxTo) {
299 if (detId.
ring() == 1)
300 return (2.5 - 1.6) / 2.;
302 if (detId.
ring() == 2)
303 return (1.7 - 1.2) / 2.;
304 if (detId.
ring() == 3)
305 return (1.12 - 0.9) / 2.;
306 if (detId.
ring() == 4)
307 return (2.5 - 1.6) / 2.;
308 }
else if (detId.
station() == 2) {
309 if (detId.
ring() == 1)
310 return (2.5 - 1.6) / 2.;
311 if (detId.
ring() == 2)
312 return (1.6 - 1.0) / 2.;
313 }
else if (detId.
station() == 3) {
314 if (detId.
ring() == 1)
315 return (2.5 - 1.7) / 2.;
316 if (detId.
ring() == 2)
317 return (1.7 - 1.1) / 2.;
318 }
else if (detId.
station() == 4) {
319 if (detId.
ring() == 1)
320 return (2.45 - 1.8) / 2.;
321 if (detId.
ring() == 2)
322 return (1.8 - 1.2) / 2.;
337 auto chamb =
_geocsc->chamber(detId);
341 const uint16_t keyWG = aDigi.
getKeyWG();
343 const LocalPoint lpWg = layer_geom->localCenterOfWireGroup(keyWG);
361 auto chamb =
_geocsc->chamber(detId);
364 GlobalPoint chamberMiddleGP = chamb->toGlobal(chamberMiddleLP);
384 const LocalPoint lp = roll->centreOfStrip((
int)strip);
398 neighbRoll = (
id.roll() == 1 ? 3 : 1);
400 neighbRoll =
id.roll() + (
id.roll() == 1 ? +1 : -1);
408 auto rollNeigh =
_georpc->roll(idNeigh);
409 const LocalPoint lpNeigh = rollNeigh->centreOfStrip((
int)strip);
410 const GlobalPoint gpNeigh = rollNeigh->toGlobal(lpNeigh);
438 for (
unsigned int i = 0;
i < 7; ++
i) {
439 if (theta_segm->
position(
i) && bti_group < 0)
444 else if (theta_segm->
position(
i) && bti_group > -1)
The_Container const * getContainer() const
edm::ESHandle< DTGeometry > _geodt
LocalPoint centreOfStrip(int strip) const
const ProcConfigurationBase * config
uint16_t *__restrict__ id
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeometryEsToken
virtual ~AngleConverterBase()
virtual int etaToHwEta(double eta) const =0
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
edm::ESHandle< RPCGeometry > _georpc
muonGeometryTokens({esConsumes< RPCGeometry, MuonGeometryRecord, edm::Transition::BeginRun >(), esConsumes< CSCGeometry, MuonGeometryRecord, edm::Transition::BeginRun >(), esConsumes< DTGeometry, MuonGeometryRecord, edm::Transition::BeginRun >()})
Geom::Phi< T > phi() const
constexpr uint32_t rawId() const
get the raw id
float cscChamberEtaSize(const CSCDetId &id) const
virtual unsigned int nPhiBins() const =0
int numberOfStrips() const
int quality(const int i) const
tuple nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
virtual void getGlobalEta(const L1MuDTChambThDigi &thetaDigi, std::vector< EtaValue > &etaSegments) const
constexpr std::array< uint8_t, layerIndexSize > layer
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeometryEsToken
int position(const int i) const
float stripPhiPitch() const
virtual bool getFixCscGeometryOffset() const
const CSCChamberSpecs * specs() const
virtual bool isCSCCounterClockwise(const CSCLayer *layer) const
Check orientation of strips in given CSC chamber.
Abs< T >::type abs(const T &t)
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
unsigned int nPhiBins
Number of phi bins along 2Pi.
virtual const int findBTIgroup(const L1MuDTChambPhDigi &aDigi, const L1MuDTChambThContainer *dtThDigis)
Find BTI group.
GlobalPoint centerOfStrip(int strip) const
virtual int getProcessorPhi(int phiZero, l1t::tftype part, int dtScNum, int dtPhi) const
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeometryEsToken
virtual EtaValue getGlobalEtaCsc(const CSCDetId &detId) const
returns the eta position of the CSC chamber
virtual void checkAndUpdateGeometry(const edm::EventSetup &, const ProcConfigurationBase *config, const MuonGeometryTokens &muonGeometryTokens)
Update the Geometry with current Event Setup.
L1MuDTChambThDigi const * chThetaSegm(int wheel, int stat, int sect, int bx) const
edm::ESHandle< CSCGeometry > _geocsc
bool check(const edm::EventSetup &iSetup)
virtual int foldPhi(int phi) const
tuple config
parse the configuration file
edm::ESWatcher< MuonGeometryRecord > muonGeometryRecordWatcher
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
virtual EtaValue getGlobalEtaDt(const DTChamberId &detId) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
int station() const
Return the station number.
int wheel() const
Return the wheel number.
int nCell(int sl) const
Number of BTIs in a required superlayer (i.e. nCells in lay 1)
const CSCLayerGeometry * geometry() const
Power< A, B >::type pow(const A &a, const B &b)