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;
76 int phiConverted = floor(dtPhi * scale_coeff /
pow(2, 11)) + offsetGlobal - phiZero;
79 return config->foldPhi(phiConverted);
99 if (
csc.station() == 1 &&
csc.ring() == 1 && halfStrip > 128) {
106 int order = (
layer->centerOfStrip(2).phi() -
layer->centerOfStrip(1).phi() > 0) ? 1 : -1;
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);
115 offsetLoc =
config->foldPhi(offsetLoc);
117 if (
csc.station() == 1 &&
csc.ring() == 1 && halfStrip > 128) {
127 int fixOff = offsetLoc;
131 if (
config->getFixCscGeometryOffset())
132 fixOff = fixCscOffsetGeom(offsetLoc);
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);
179 halfStrip =
config->foldPhi(halfStrip);
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;
188 return config->foldPhi(halfStrip - phiZero);
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);
237 config->etaToHwEta(chamberMiddleGP.
eta()),
238 config->etaToHwEta(fabs(chamberMiddleGP.
eta() - chambNeighMiddleGP.eta())) / 2,
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.;
341 const uint16_t keyWG = aDigi.
getKeyWG();
343 const LocalPoint lpWg = layer_geom->localCenterOfWireGroup(keyWG);
364 GlobalPoint chamberMiddleGP = chamb->toGlobal(chamberMiddleLP);
367 config->etaToHwEta(chamberMiddleGP.
eta()),
398 neighbRoll = (
id.roll() == 1 ? 3 : 1);
400 neighbRoll =
id.roll() + (
id.roll() == 1 ? +1 : -1);
410 const GlobalPoint gpNeigh = rollNeigh->toGlobal(lpNeigh);
423 const int nStrips =
layer->geometry()->numberOfStrips();
424 const double phi1 =
layer->centerOfStrip(1).phi();
425 const double phiN =
layer->centerOfStrip(
nStrips).phi();
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)
int station() const
Return the station number.
edm::ESHandle< DTGeometry > _geodt
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
L1MuDTChambThDigi const * chThetaSegm(int wheel, int stat, int sect, int bx) const
const ProcConfigurationBase * config
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeometryEsToken
virtual ~AngleConverterBase()
edm::ESHandle< RPCGeometry > _georpc
int position(const int i) const
virtual EtaValue getGlobalEtaDt(const DTChamberId &detId) const
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
const CSCLayerGeometry * geometry() const
constexpr std::array< uint8_t, layerIndexSize > layer
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeometryEsToken
The_Container const * getContainer() const
Abs< T >::type abs(const T &t)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
unsigned int nPhiBins
Number of phi bins along 2Pi.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
virtual const int findBTIgroup(const L1MuDTChambPhDigi &aDigi, const L1MuDTChambThContainer *dtThDigis)
Find BTI group.
float cscChamberEtaSize(const CSCDetId &id) const
virtual int getProcessorPhi(int phiZero, l1t::tftype part, int dtScNum, int dtPhi) const
float stripPhiPitch() const
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeometryEsToken
virtual void getGlobalEta(const L1MuDTChambThDigi &thetaDigi, std::vector< EtaValue > &etaSegments) const
virtual void checkAndUpdateGeometry(const edm::EventSetup &, const ProcConfigurationBase *config, const MuonGeometryTokens &muonGeometryTokens)
Update the Geometry with current Event Setup.
constexpr uint32_t rawId() const
get the raw id
edm::ESHandle< CSCGeometry > _geocsc
bool check(const edm::EventSetup &iSetup)
edm::ESWatcher< MuonGeometryRecord > muonGeometryRecordWatcher
int wheel() const
Return the wheel number.
int quality(const int i) const
virtual bool isCSCCounterClockwise(const CSCLayer *layer) const
Check orientation of strips in given CSC chamber.
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Power< A, B >::type pow(const A &a, const B &b)
virtual EtaValue getGlobalEtaCsc(const CSCDetId &detId) const
returns the eta position of the CSC chamber
LocalPoint centreOfStrip(int strip) const
int nCell(int sl) const
Number of BTIs in a required superlayer (i.e. nCells in lay 1)