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))
67 double scale = 1. / dtPhiBins / hsPhiPitch;
68 int scale_coeff = lround(
scale *
pow(2, 11));
72 ichamber = ichamber - 12;
76 int phiConverted = floor(dtPhi * scale_coeff /
pow(2, 11)) + offsetGlobal -
phiZero;
79 return config->foldPhi(phiConverted);
97 if (
csc.station() == 1 &&
csc.ring() == 1 && halfStrip > 128) {
104 int order = (
layer->centerOfStrip(2).phi() -
layer->centerOfStrip(1).phi() > 0) ? 1 : -1;
110 double phiHalfStrip0 =
layer->centerOfStrip(1).phi() -
order * stripPhiPitch / 4.;
112 int offsetLoc = lround((phiHalfStrip0) / hsPhiPitch -
phiZero);
113 offsetLoc =
config->foldPhi(offsetLoc);
115 if (
csc.station() == 1 &&
csc.ring() == 1 && halfStrip > 128) {
125 int fixOff = offsetLoc;
129 if (
config->getFixCscGeometryOffset()) {
130 if (
config->nProcessors() == 6)
131 fixOff = fixCscOffsetGeom(offsetLoc);
132 else if (
config->nProcessors() == 3) {
135 fixOff = fixCscOffsetGeom(offsetLoc - 900) + 900;
137 fixOff = fixCscOffsetGeom(offsetLoc);
174 double stripPhi1 = (
roll->toGlobal(
roll->centreOfStrip((
int)digi1))).phi();
175 double stripPhi2 = (
roll->toGlobal(
roll->centreOfStrip((
int)digi2))).phi();
178 if (std::signbit(stripPhi1) != std::signbit(stripPhi2) &&
std::abs(stripPhi1) >
M_PI / 2.) {
179 if (std::signbit(stripPhi1)) {
180 stripPhi1 += 2 *
M_PI;
182 stripPhi2 += 2 *
M_PI;
184 int halfStrip = lround(((stripPhi1 + stripPhi2) / 2.) / hsPhiPitch);
185 halfStrip =
config->foldPhi(halfStrip);
187 LogTrace(
"l1tOmtfEventPrint") << __FUNCTION__ <<
":" << 185 <<
" roll " << rollId.
rawId() <<
" " << rollId
188 <<
" cluster: firstStrip " << digi1 <<
" stripPhi1Global " << stripPhi1
189 <<
" stripPhi1LocalPhi " <<
roll->centreOfStrip((
int)digi1).x() <<
" y " 190 <<
roll->centreOfStrip((
int)digi1).y() <<
" lastStrip " << digi2 <<
" stripPhi2Global " 191 << stripPhi2 <<
" stripPhi2LocalPhi x " <<
roll->centreOfStrip((
int)digi2).x() <<
" y " 192 <<
roll->centreOfStrip((
int)digi2).y() <<
" halfStrip " << halfStrip << std::endl;
200 const unsigned int& digi)
const {
203 int processor = iProcessor + 1;
208 double phi15deg =
M_PI / 3. * (processor - 1) +
M_PI / 12.;
211 double stripPhi = (
roll->toGlobal(
roll->centreOfStrip((
int)digi))).phi();
218 phi15deg -= 2 *
M_PI;
223 stripPhi += 2 *
M_PI;
229 int halfStrip = lround((stripPhi - phi15deg) / hsPhiPitch);
243 config->etaToHwEta(chamberMiddleGP.
eta()),
244 config->etaToHwEta(
std::abs(chamberMiddleGP.
eta() - chambNeighMiddleGP.eta())) / 2,
266 const int NBTI_theta = trig_geom.
nCell(2);
267 for (
unsigned int btiGroup = 0; btiGroup < 7; ++btiGroup) {
269 unsigned btiActual = btiGroup * NBTI_theta / 7 + NBTI_theta / 14 + 1;
271 GlobalPoint theta_gp = trig_geom.CMSPosition(thetaBTI);
280 etaSegments.emplace_back(etaValue);
292 std::vector<EtaValue> etaSegments;
294 for (
auto& thetaDigi : (*(dtThDigis->
getContainer()))) {
295 if (thetaDigi.bxNum() >= bxFrom && thetaDigi.bxNum() <= bxTo) {
304 if (
detId.station() == 1) {
305 if (
detId.ring() == 1)
306 return (2.5 - 1.6) / 2.;
308 if (
detId.ring() == 2)
309 return (1.7 - 1.2) / 2.;
310 if (
detId.ring() == 3)
311 return (1.12 - 0.9) / 2.;
312 if (
detId.ring() == 4)
313 return (2.5 - 1.6) / 2.;
314 }
else if (
detId.station() == 2) {
315 if (
detId.ring() == 1)
316 return (2.5 - 1.6) / 2.;
317 if (
detId.ring() == 2)
318 return (1.6 - 1.0) / 2.;
319 }
else if (
detId.station() == 3) {
320 if (
detId.ring() == 1)
321 return (2.5 - 1.7) / 2.;
322 if (
detId.ring() == 2)
323 return (1.7 - 1.1) / 2.;
324 }
else if (
detId.station() == 4) {
325 if (
detId.ring() == 1)
326 return (2.45 - 1.8) / 2.;
327 if (
detId.ring() == 2)
328 return (1.8 - 1.2) / 2.;
347 const uint16_t keyWG = aDigi.
getKeyWG();
349 const LocalPoint lpWg = layer_geom->localCenterOfWireGroup(keyWG);
370 GlobalPoint chamberMiddleGP = chamb->toGlobal(chamberMiddleLP);
373 config->etaToHwEta(chamberMiddleGP.
eta()),
404 neighbRoll = (
id.roll() == 1 ? 3 : 1);
406 neighbRoll =
id.roll() + (
id.roll() == 1 ? +1 : -1);
416 const GlobalPoint gpNeigh = rollNeigh->toGlobal(lpNeigh);
429 const int nStrips =
layer->geometry()->numberOfStrips();
430 const double phi1 =
layer->centerOfStrip(1).phi();
431 const double phiN =
layer->centerOfStrip(
nStrips).phi();
444 for (
unsigned int i = 0;
i < 7; ++
i) {
445 if (theta_segm->
position(
i) && bti_group < 0)
450 else if (theta_segm->
position(
i) && bti_group > -1)
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
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 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
int nCell(int sl) const
Number of BTIs in a required superlayer (i.e. nCells in lay 1)