CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
MEEEGeom Class Reference

#include <MEEEGeom.h>

Public Types

typedef int CrysCoord
 
enum  EEUnit {
  iEcalEndCap = 0, iDee, iQuadrant, iSector,
  iDCC, iLMRegion, iLMModule, iSuperCrystal,
  iCrystal
}
 
typedef std::pair< float, float > EtaPhiPoint
 
typedef int SuperCrysCoord
 

Public Member Functions

virtual ~MEEEGeom ()
 

Static Public Member Functions

static std::vector< int > apdRefChannels (int ilmmod)
 
static int apdRefTower (int ilmr, int ilmmod)
 
static int crystal (CrysCoord ix, CrysCoord iy)
 
static int crystal_in_sc (CrysCoord ix, CrysCoord iy)
 
static int dcc (SuperCrysCoord iX, SuperCrysCoord iY, int iz)
 
static int dccFromSm (int ism)
 
static int dee (int ilmr)
 
static int dee (SuperCrysCoord iX, SuperCrysCoord iY, int iz)
 
static int deeFromMem (int imem)
 
static void getBoundary (std::list< std::pair< float, float > > &l, int type, int num, int iz=-1, int xside=0)
 
static TGraph * getGraphBoundary (int type, int num, int iz=-1, int xside=0)
 
static int lmmod (SuperCrysCoord iX, SuperCrysCoord iY)
 
static std::vector< int > lmmodFromLmr (int ilmr)
 
static int lmr (SuperCrysCoord iX, SuperCrysCoord iY, int iz)
 
static std::pair< int, int > memFromLmr (int ilmr)
 
static bool near (int ilmr)
 
static std::pair< int, int > pn (int dee, int ilmod)
 
static int quadrant (SuperCrysCoord iX, SuperCrysCoord iY)
 
static int sc (SuperCrysCoord iX, SuperCrysCoord iY)
 
static int sc_in_quad (SuperCrysCoord iX, SuperCrysCoord iY)
 
static int sc_type (SuperCrysCoord iX, SuperCrysCoord iY)
 
static int sector (SuperCrysCoord iX, SuperCrysCoord iY)
 
static int side (SuperCrysCoord iX, SuperCrysCoord iY, int iz)
 
static int sm (SuperCrysCoord iX, SuperCrysCoord iY, int iz)
 
static int smFromDcc (int idcc)
 
static TString smName (int ism)
 

Static Public Attributes

static bool pnTheory = true
 

Detailed Description

Definition at line 15 of file MEEEGeom.h.

Member Typedef Documentation

◆ CrysCoord

typedef int MEEEGeom::CrysCoord

Definition at line 21 of file MEEEGeom.h.

◆ EtaPhiPoint

typedef std::pair<float, float> MEEEGeom::EtaPhiPoint

Definition at line 23 of file MEEEGeom.h.

◆ SuperCrysCoord

Definition at line 20 of file MEEEGeom.h.

Member Enumeration Documentation

◆ EEUnit

Enumerator
iEcalEndCap 
iDee 
iQuadrant 
iSector 
iDCC 
iLMRegion 
iLMModule 
iSuperCrystal 
iCrystal 

Definition at line 18 of file MEEEGeom.h.

Constructor & Destructor Documentation

◆ ~MEEEGeom()

virtual MEEEGeom::~MEEEGeom ( )
inlinevirtual

Definition at line 59 of file MEEEGeom.h.

59 {}

Member Function Documentation

◆ apdRefChannels()

std::vector< int > MEEEGeom::apdRefChannels ( int  ilmmod)
static

Definition at line 1364 of file MEEEGeom.cc.

1364  {
1365  std::vector<int> vec;
1366  switch (ilmmod) {
1367  case 1:
1368  vec.push_back(0);
1369  vec.push_back(1);
1370  break;
1371  case 2:
1372  vec.push_back(0);
1373  vec.push_back(1);
1374  break;
1375  case 3:
1376  vec.push_back(0);
1377  vec.push_back(1);
1378  break;
1379  case 4:
1380  vec.push_back(0);
1381  vec.push_back(1);
1382  break;
1383  case 5:
1384  vec.push_back(0);
1385  vec.push_back(1);
1386  break;
1387  case 6:
1388  vec.push_back(0);
1389  vec.push_back(1);
1390  break;
1391  case 7:
1392  vec.push_back(0);
1393  vec.push_back(1);
1394  break;
1395  case 8:
1396  vec.push_back(0);
1397  vec.push_back(1);
1398  break;
1399  case 9:
1400  vec.push_back(0);
1401  vec.push_back(1);
1402  break;
1403  case 10:
1404  vec.push_back(0);
1405  vec.push_back(1);
1406  break;
1407  case 11:
1408  vec.push_back(0);
1409  vec.push_back(1);
1410  break;
1411  case 12:
1412  vec.push_back(0);
1413  vec.push_back(1);
1414  break;
1415  case 13:
1416  vec.push_back(0);
1417  vec.push_back(1);
1418  break;
1419  case 14:
1420  vec.push_back(0);
1421  vec.push_back(1);
1422  break;
1423  case 15:
1424  vec.push_back(0);
1425  vec.push_back(1);
1426  break;
1427  case 16:
1428  vec.push_back(0);
1429  vec.push_back(1);
1430  break;
1431  case 17:
1432  vec.push_back(0);
1433  vec.push_back(1);
1434  break;
1435  case 18:
1436  vec.push_back(0);
1437  vec.push_back(1);
1438  break;
1439  case 19:
1440  vec.push_back(0);
1441  vec.push_back(1);
1442  break;
1443  case 20:
1444  vec.push_back(0);
1445  vec.push_back(1);
1446  break;
1447  case 21:
1448  vec.push_back(0);
1449  vec.push_back(1);
1450  break;
1451 
1452  default:
1453  abort();
1454  }
1455  return vec;
1456 }

Referenced by ME::apdRefChannels().

◆ apdRefTower()

int MEEEGeom::apdRefTower ( int  ilmr,
int  ilmmod 
)
static

Definition at line 1208 of file MEEEGeom.cc.

1208  {
1209  int ilmr10 = ilmr % 10;
1210  int tower = 0;
1211 
1212  if (ilmr10 == 3) {
1213  switch (ilmmod) {
1214  case 9:
1215  tower = 77;
1216  break;
1217  case 10:
1218  tower = 55;
1219  break;
1220  case 11:
1221  tower = 37;
1222  break;
1223  case 12:
1224  tower = 310;
1225  break;
1226  case 13:
1227  tower = 294;
1228  break;
1229  default:
1230  abort();
1231  }
1232  } else if (ilmr10 == 4) {
1233  switch (ilmmod) {
1234  case 5:
1235  tower = 52;
1236  break;
1237  case 6:
1238  tower = 41;
1239  break;
1240  case 7:
1241  tower = 18;
1242  break;
1243  case 8:
1244  tower = 65;
1245  break;
1246  default:
1247  abort();
1248  }
1249  } else if (ilmr10 == 5) {
1250  switch (ilmmod) {
1251  case 1:
1252  tower = 45;
1253  break;
1254  case 2:
1255  tower = 53;
1256  break;
1257  case 3:
1258  tower = 42;
1259  break;
1260  case 4:
1261  tower = 32;
1262  break;
1263  default:
1264  abort();
1265  }
1266  } else if (ilmr10 == 6) {
1267  switch (ilmmod) {
1268  case 1:
1269  tower = 124;
1270  break;
1271  case 2:
1272  tower = 132;
1273  break;
1274  case 3:
1275  tower = 121;
1276  break;
1277  case 4:
1278  tower = 111;
1279  break;
1280  default:
1281  abort();
1282  }
1283  } else if (ilmr10 == 7) {
1284  switch (ilmmod) {
1285  case 5:
1286  tower = 147;
1287  break;
1288  case 6:
1289  tower = 135;
1290  break;
1291  case 7:
1292  tower = 117;
1293  break;
1294  case 8:
1295  tower = 158;
1296  break;
1297  default:
1298  abort();
1299  }
1300 
1301  } else if (ilmr10 == 8) {
1302  switch (ilmmod) {
1303  case 9:
1304  tower = 156;
1305  break;
1306  case 10:
1307  tower = 214;
1308  break;
1309  case 11:
1310  tower = 197;
1311  break;
1312  case 12:
1313  tower = 237;
1314  break;
1315  case 13:
1316  tower = 224;
1317  break;
1318  default:
1319  abort();
1320  }
1321  } else if (ilmr10 == 9) {
1322  switch (ilmmod) {
1323  case 14:
1324  tower = 234;
1325  break;
1326  case 15:
1327  tower = 220;
1328  break;
1329  case 16:
1330  tower = 212;
1331  break;
1332  case 17:
1333  tower = 189;
1334  break;
1335  default:
1336  abort();
1337  }
1338  } else if (ilmr10 == 0) {
1339  switch (ilmmod) {
1340  case 18:
1341  tower = 185;
1342  break;
1343  case 19:
1344  tower = 172;
1345  break;
1346  default:
1347  abort();
1348  }
1349  } else if (ilmr10 == 1) {
1350  switch (ilmmod) {
1351  case 18:
1352  tower = 264;
1353  break;
1354  case 19:
1355  tower = 251;
1356  break;
1357  default:
1358  abort();
1359  }
1360  }
1361  return tower;
1362 }

References hgcalTowerProducer_cfi::tower.

Referenced by EcalLaserAnalyzer2::analyze(), and EcalLaserAnalyzer::analyze().

◆ crystal()

int MEEEGeom::crystal ( CrysCoord  ix,
CrysCoord  iy 
)
static

Definition at line 372 of file MEEEGeom.cc.

372  {
373  int iX = (ix - 1) / 5 + 1;
374  int iY = (iy - 1) / 5 + 1;
375  int isc = sc(iX, iY);
376  assert(isc != 0);
377  if (isc < 0)
378  return -2;
379 
380  int icr_in_sc = crystal_in_sc(ix, iy);
381  assert(icr_in_sc != 0);
382  if (icr_in_sc < 0)
383  return -1;
384 
385  return 25 * (isc - 1) + icr_in_sc;
386 }

References cms::cuda::assert().

Referenced by EcalPerEvtLaserAnalyzer::analyze(), and ME::regTree().

◆ crystal_in_sc()

int MEEEGeom::crystal_in_sc ( CrysCoord  ix,
CrysCoord  iy 
)
static

Definition at line 311 of file MEEEGeom.cc.

311  {
312  // the seven types of super-crystals
313  static const int idx_[7][25] = {
314  {21, 16, 11, 6, 1, 22, 17, 12, 7, 2, 23, 18, 13, 8, 3, 24, 19, 14, 9, 4, 25, 20, 15, 10, 5},
315  {
316  -1, -1, -1, -1, -1, 22, 17, 12, 7, 2, 23, 18, 13, 8, 3, 24, 19, 14, 9, 4, 25, 20, 15, 10, 5,
317  },
318  {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, 24, 19, -1, -1, -1, 25, 20, 15, -1, -1},
319  {21, 16, 11, 6, -1, 22, 17, 12, 7, -1, 23, 18, 13, 8, -1, 24, 19, 14, 9, -1, 25, 20, 15, 10, -1},
320  {
321  21, 16, 11, 6, 1, 22, 17, 12, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
322  },
323  {
324  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
325  },
326  {-1, -1, -1, 6, 1, -1, -1, -1, 7, 2, -1, -1, -1, 8, 3, -1, -1, -1, 9, 4, -1, -1, -1, 10, 5}};
327 
328  int iX, iY, jx, jy;
329  int iX_ = (ix - 1) / 5 + 1;
330  int iY_ = (iy - 1) / 5 + 1;
331  int jx_ = ix - 5 * (iX_ - 1);
332  int jy_ = iy - 5 * (iY_ - 1);
333 
334  int iquad = quadrant(iX_, iY_);
335  if (iX_ >= 11) {
336  iX_ = 20 - iX_ + 1;
337  jx_ = 5 - jx_ + 1;
338  }
339  if (iY_ >= 11) {
340  iY_ = 20 - iY_ + 1;
341  jy_ = 5 - jy_ + 1;
342  }
343 
344  // FIXME : this is stupid !!!
345  if (iquad == 1 || iquad == 3) {
346  iX = iX_;
347  iY = iY_;
348  jx = jx_;
349  jy = jy_;
350  } else {
351  iX = iY_;
352  iY = iX_;
353  jx = jy_;
354  jy = jx_;
355  }
356 
357  int isc_type = sc_type(iX, iY);
358  assert(isc_type >= 0 && isc_type < 7);
359 
360  int iym, ixm, il, ic, ii;
361  iym = 5;
362  ixm = 5;
363  il = iym - jy;
364  ic = jx - 1;
365  ii = il * ixm + ic;
366  if (ii < 0 || ii > (int)(sizeof(idx_) / sizeof(int)) || idx_[isc_type][ii] == -1) {
367  return -1;
368  };
369  return idx_[isc_type][ii];
370 }

References cms::cuda::assert(), cuy::ii, and SiPixelPI::quadrant().

◆ dcc()

int MEEEGeom::dcc ( SuperCrysCoord  iX,
SuperCrysCoord  iY,
int  iz 
)
static

Definition at line 225 of file MEEEGeom.cc.

225  {
226  // end-cap minus:
227  // S7 --> DCC-1 (N)
228  // S8 --> DCC-2 (N)
229  // S9 --> DCC-3 (N)
230  // S1 --> DCC-4 (F)
231  // S2 --> DCC-5 (F)
232  // S3 --> DCC-6 (F)
233  // S4 --> DCC-7 (F)
234  // S5 --> DCC-8 (F and N)
235  // S6 --> DCC-9 (N)
236  // for the end-cap plus, add 45 to the DCC number
237  int isect = sector(iX, iY);
238  assert(isect != 0);
239  assert(abs(iz) == 1);
240  if (isect < 0)
241  return -1;
242 
243  int idcc = 0;
244 
245  idcc = isect - 6;
246  if (idcc <= 0)
247  idcc += 9;
248  if (iz == +1)
249  idcc += 45;
250 
251  return idcc;
252 }

References funct::abs(), and cms::cuda::assert().

◆ dccFromSm()

int MEEEGeom::dccFromSm ( int  ism)
static

Definition at line 399 of file MEEEGeom.cc.

399  {
400  assert(ism >= 1 && ism <= 18);
401  int dcc_[18] = {49, 50, 51, 52, 53, 54, 46, 47, 48, 4, 5, 6, 7, 8, 9, 1, 2, 3};
402  return dcc_[ism - 1];
403 }

References cms::cuda::assert(), and ecalpyutils::ism().

◆ dee() [1/2]

int MEEEGeom::dee ( int  ilmr)
static

Definition at line 1111 of file MEEEGeom.cc.

1111  {
1112  int dee_(0);
1113  int i_[7] = {73, 76, 81, 83, 86, 91, 93};
1114  int d_[6] = {2, 1, 2, 3, 4, 3};
1115  for (int ii = 0; ii < 6; ii++) {
1116  if (ilmr >= i_[ii] && ilmr < i_[ii + 1]) {
1117  dee_ = d_[ii];
1118  break;
1119  }
1120  }
1121  if (dee_ == 0) {
1122  std::cout << "ilmr=" << ilmr << std::endl;
1123  }
1124  assert(dee_ != 0);
1125  return dee_;
1126 }

References cms::cuda::assert(), gather_cfg::cout, and cuy::ii.

◆ dee() [2/2]

int MEEEGeom::dee ( SuperCrysCoord  iX,
SuperCrysCoord  iY,
int  iz 
)
static

Definition at line 292 of file MEEEGeom.cc.

292  {
293  int iquad = quadrant(iX, iY);
294  int idee = 0;
295  bool far = (iquad == 2 || iquad == 3);
296  bool near = !far;
297  bool plus = (iz > 0);
298  bool minus = !plus;
299  if (far && plus)
300  idee = 1;
301  if (near && plus)
302  idee = 2;
303  if (near && minus)
304  idee = 3;
305  if (far && minus)
306  idee = 4;
307 
308  return idee;
309 }

References reco::HaloData::minus, reco::HaloData::plus, and SiPixelPI::quadrant().

Referenced by EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), MELaserPrim::fillHistograms(), ME::pn(), and ecaldqm::pnForCrystal().

◆ deeFromMem()

int MEEEGeom::deeFromMem ( int  imem)
static

Definition at line 558 of file MEEEGeom.cc.

558  {
559  int imem_ = imem % 600;
560  int dee_(0);
561  if (imem_ == 50 || imem_ == 51)
562  dee_ = 1;
563  else if (imem_ == 47 || imem_ == 46)
564  dee_ = 2;
565  else if (imem_ == 1 || imem_ == 2)
566  dee_ = 3;
567  else if (imem_ == 5 || imem_ == 6)
568  dee_ = 4;
569  else
570  abort();
571  return dee_;
572 }

◆ getBoundary()

void MEEEGeom::getBoundary ( std::list< std::pair< float, float > > &  l,
int  type,
int  num,
int  iz = -1,
int  xside = 0 
)
static

Definition at line 447 of file MEEEGeom.cc.

447  {
448  // for each iy, get first and last ix for <whatever>
449  std::multimap<int, std::pair<int, int> > map_;
450 
451  int iymin = 1;
452  int iymax = 100;
453  int ixmin = 1;
454  int ixmax = 100;
455  if (xside == 1) {
456  ixmin = 1;
457  ixmax = 50;
458  }
459  if (xside == 2) {
460  ixmin = 51;
461  ixmax = 100;
462  }
463 
464  for (int iy = iymin; iy <= iymax; iy++) {
465  bool in = false;
466  int firstix(0);
467  int lastix(0);
468  for (int ix = ixmin; ix <= ixmax; ix++) {
469  int icr = crystal(ix, iy);
470  bool ok = icr > 0;
471 
472  int iX = (ix - 1) / 5 + 1;
473  int iY = (iy - 1) / 5 + 1;
474 
475  int num_(0);
476  switch (type) {
477  case iDee:
478  num_ = dee(iX, iY, iz);
479  break;
480  case iQuadrant:
481  num_ = quadrant(iX, iY);
482  break;
483  case iSector:
484  num_ = sector(iX, iY);
485  break;
486  case iLMRegion:
487  num_ = lmr(iX, iY, iz);
488  break;
489  case iLMModule:
490  num_ = lmmod(iX, iY);
491  break;
492  case iDCC:
493  num_ = dcc(iX, iY, iz);
494  break;
495  case iSuperCrystal:
496  num_ = sc(iX, iY);
497  break;
498  case iCrystal:
499  num_ = crystal(ix, iy);
500  break;
501  default:
502  abort();
503  };
504  ok &= num_ == num;
505 
506  if (!in && !ok)
507  continue;
508  if (in && ok) {
509  lastix = ix;
510  continue;
511  }
512  if (!in && ok) {
513  in = true;
514  firstix = ix;
515  } else if (in && !ok) {
516  in = false;
517  map_.insert(std::pair<int, std::pair<int, int> >(iy, std::pair<int, int>(firstix, lastix)));
518  }
519  }
520  if (in)
521  map_.insert(std::pair<int, std::pair<int, int> >(iy, std::pair<int, int>(firstix, lastix)));
522  }
523 
524  // clean the list
525  l.clear();
526 
527  std::multimap<int, std::pair<int, int> >::const_iterator it;
528  std::multimap<int, std::pair<int, int> >::const_iterator lastelement;
529  std::list<std::pair<float, float> > rightl;
530  for (int iy = 1; iy <= 100; iy++) {
531  it = map_.find(iy);
532  if (it == map_.end())
533  continue;
534  int n_ = map_.count(iy);
535  // std::cout << "n[" << iy << "]=" << n_ << std::endl;
536  assert(n_ == 1); // fixme !
537 
538  lastelement = map_.upper_bound(iy);
539  for (; it != lastelement; ++it) {
540  std::pair<float, float> p_ = it->second;
541  l.push_back(std::pair<float, float>(p_.first - 0.5, iy - 0.5));
542  l.push_back(std::pair<float, float>(p_.first - 0.5, iy + 0.5));
543  rightl.push_back(std::pair<float, float>(p_.second + 0.5, iy - 0.5));
544  rightl.push_back(std::pair<float, float>(p_.second + 0.5, iy + 0.5));
545  }
546  }
547  l.unique();
548  rightl.unique();
549  rightl.reverse();
550 
551  std::list<std::pair<float, float> >::const_iterator rightl_it;
552  for (rightl_it = rightl.begin(); rightl_it != rightl.end(); ++rightl_it) {
553  l.push_back(std::pair<float, float>(rightl_it->first, rightl_it->second));
554  }
555  l.push_back(*l.begin());
556 }

References cms::cuda::assert(), recoMuon::in, cmsLHEtoEOSManager::l, EgammaValidation_cff::num, convertSQLiteXML::ok, and SiPixelPI::quadrant().

◆ getGraphBoundary()

TGraph * MEEEGeom::getGraphBoundary ( int  type,
int  num,
int  iz = -1,
int  xside = 0 
)
static

Definition at line 423 of file MEEEGeom.cc.

423  {
424  std::list<std::pair<float, float> > l;
425  getBoundary(l, type, num, iz, xside);
426  int n = l.size();
427  if (n == 0)
428  return nullptr;
429 
430  // GHM : changed to comply to CMSSW compilator options
431  float ix[1000];
432  float iy[1000];
433  assert(n < 1000);
434 
435  int ii = 0;
436  std::list<std::pair<float, float> >::const_iterator l_it;
437  for (l_it = l.begin(); l_it != l.end(); ++l_it) {
438  // std::cout << "[" << l_it->first << "," << l_it->second << "]" << std::endl;
439  ix[ii] = l_it->first;
440  iy[ii] = l_it->second;
441  ii++;
442  }
443  assert(ii == n);
444  return new TGraph(n, ix, iy);
445 }

References cms::cuda::assert(), cuy::ii, cmsLHEtoEOSManager::l, dqmiodumpmetadata::n, and EgammaValidation_cff::num.

Referenced by MEGeom::drawGlobalBoundaries().

◆ lmmod()

int MEEEGeom::lmmod ( SuperCrysCoord  iX,
SuperCrysCoord  iY 
)
static

Definition at line 112 of file MEEEGeom.cc.

112  {
113  //
114  // laser monitoring modules for EE-F and EE+F
115  // for EE-N and EE+N : iX ---> 20-iX+1
116  //
117 
118  static const int idx_[] = {// 1 2 3 4 5 6 7 8 9 A
119  //------------------------------
120  0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 2, 1, 1, 1, 1, 1, 0, 0, 0,
121  5, 2, 2, 2, 2, 2, 1, 0, 0, 5, 5, 5, 3, 3, 2, 2, 2, 0, 8, 5, 5, 5, 3,
122  3, 3, 3, 3, 0, 8, 8, 5, 6, 6, 4, 4, 4, 3, 0, 8, 8, 5, 6, 6, 7, 4, 4,
123  4, 8, 8, 8, 6, 6, 7, 7, 7, 4, 4, 9, 9, 8, 6, 6, 7, 7, 7, 7, 0, 9, 9,
124  9, 10, 10, 11, 11, 7, 0, 0, 12, 9, 9, 10, 10, 11, 11, 11, 0, 0, 12, 12, 13, 10, 10,
125  11, 11, 17, 17, 0, 12, 12, 13, 13, 13, 11, 17, 17, 17, 19, 0, 12, 13, 13, 14, 15, 17, 17,
126  17, 19, 0, 12, 14, 14, 14, 15, 16, 17, 19, 19, 0, 14, 14, 14, 14, 15, 16, 16, 19, 19, 0,
127  0, 14, 15, 15, 15, 16, 16, 19, 19, 0, 0, 0, 15, 15, 15, 16, 18, 18, 18, 0, 0, 0, 0,
128  16, 16, 16, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 18, 18, 18};
129 
130  int iym, ixm, il, ic, ii;
131  iym = 20;
132  ixm = 10;
133  int iX_ = iX;
134  if (iX >= 11)
135  iX_ = 20 - iX + 1;
136  int iY_ = iY;
137  il = iym - iY_;
138  ic = iX_ - 1;
139  ii = il * ixm + ic;
140  if (ii < 0 || ii > (int)(sizeof(idx_) / sizeof(int)) || idx_[ii] == 0) {
141  return -1;
142  };
143  return idx_[ii];
144 }

References cuy::ii.

Referenced by EcalPerEvtLaserAnalyzer::analyze(), EcalTestPulseAnalyzer::analyze(), EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), ecaldqm::pnForCrystal(), and ME::regTree().

◆ lmmodFromLmr()

std::vector< int > MEEEGeom::lmmodFromLmr ( int  ilmr)
static

Definition at line 1163 of file MEEEGeom.cc.

1163  {
1164  std::vector<int> vec;
1165 
1166  std::pair<int, int> dccAndSide_ = ME::dccAndSide(ilmr);
1167  int idcc = dccAndSide_.first;
1168  int iside = dccAndSide_.second;
1169  bool near_ = near(ilmr);
1170  int ism = smFromDcc(idcc);
1171  if (ism > 9)
1172  ism -= 9;
1173  assert(iside == 0 || ism == 5);
1174  if (ism == 5 || (ism < 5 && !near_) || (ism > 5 && near_)) {
1175  } else {
1176  std::cout << "ism/near " << ism << "/" << near_ << std::endl;
1177  }
1178 
1179  if (ism == 1 || ism == 9) {
1180  vec.push_back(1);
1181  vec.push_back(2);
1182  vec.push_back(3);
1183  vec.push_back(4);
1184  } else if (ism == 2 || ism == 8) {
1185  vec.push_back(5);
1186  vec.push_back(6);
1187  vec.push_back(7);
1188  vec.push_back(8);
1189  } else if (ism == 3 || ism == 7) {
1190  vec.push_back(9);
1191  vec.push_back(10);
1192  vec.push_back(11);
1193  vec.push_back(12);
1194  vec.push_back(13);
1195  } else if (ism == 4 || ism == 6) {
1196  vec.push_back(14);
1197  vec.push_back(15);
1198  vec.push_back(16);
1199  vec.push_back(17);
1200  } else {
1201  assert(ism == 5);
1202  vec.push_back(18);
1203  vec.push_back(19);
1204  }
1205  return vec;
1206 }

References cms::cuda::assert(), gather_cfg::cout, ME::dccAndSide(), and ecalpyutils::ism().

Referenced by ME::lmmodFromLmr().

◆ lmr()

int MEEEGeom::lmr ( SuperCrysCoord  iX,
SuperCrysCoord  iY,
int  iz 
)
static

Definition at line 254 of file MEEEGeom.cc.

254  {
255  // laser monitoring regions
256  // end-cap minus:
257  // S7 --> LM-1
258  // S8 --> LM-2
259  // S9 --> LM-3
260  // S1 --> LM-4
261  // S2 --> LM-5
262  // S3 --> LM-6
263  // S4 --> LM-7
264  // S5 --> LM-8 (F) and LM-9 (N)
265  // S6 --> LM-10
266  // for the end-cap plus, add 72 to the LM number
267  // for the end-cap minus, add 82 to the LM number
268 
269  int iquad = quadrant(iX, iY);
270  int isect = sector(iX, iY);
271  assert(isect != 0);
272  assert(abs(iz) == 1);
273  if (isect < 0)
274  return -1;
275 
276  int ilmr = 0;
277  ilmr = isect - 6;
278  if (ilmr <= 0)
279  ilmr += 9;
280  if (ilmr == 9)
281  ilmr++;
282  if (ilmr == 8 && iquad == 4)
283  ilmr++;
284  if (iz == +1)
285  ilmr += 72;
286  else
287  ilmr += 82;
288 
289  return ilmr;
290 }

References funct::abs(), cms::cuda::assert(), and SiPixelPI::quadrant().

Referenced by EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), EcalLaserDbService::getLaserCorrection(), and ME::regTree().

◆ memFromLmr()

std::pair< int, int > MEEEGeom::memFromLmr ( int  ilmr)
static

Definition at line 1128 of file MEEEGeom.cc.

1128  {
1129  std::pair<int, int> out_;
1130  int dee_ = dee(ilmr);
1131  if (dee_ == 1) // EE+F
1132  {
1133  out_.first = 50;
1134  out_.second = 51;
1135  } else if (dee_ == 2) // EE+N
1136  {
1137  out_.first = 47; // JM: warning -- inverted !!
1138  out_.second = 46;
1139  } else if (dee_ == 3) // EE-N
1140  {
1141  out_.first = 1;
1142  out_.second = 2;
1143  } else if (dee_ == 4) {
1144  out_.first = 5;
1145  out_.second = 6;
1146  }
1147  return out_;
1148 }

Referenced by ME::memFromLmr().

◆ near()

bool MEEEGeom::near ( int  ilmr)
static

Definition at line 1150 of file MEEEGeom.cc.

1150  {
1151  int idee = dee(ilmr);
1152  return (idee == 2 || idee == 3);
1153 }

◆ pn()

std::pair< int, int > MEEEGeom::pn ( int  dee,
int  ilmod 
)
static

Definition at line 574 of file MEEEGeom.cc.

574  {
575  // table below
576  // convention to be consistent with Marc's numbering
577  // PNA = 100 + pn + 1
578  // PNB = 200 + pn + 1
579 
580  // LMR=73 EE+7(646/0)
581  // -- module 9 PNA=(647)106 PNB=(646)201
582  // -- module 10 PNA=(647)103 PNB=(646)208
583  // -- module 11 PNA=(647)103 PNB=(646)203
584  // -- module 12 PNA=(647)101 PNB=(646)206
585  // -- module 13 PNA=(647)104 PNB=(646)209
586  // LMR=74 EE+8(647/0)
587  // -- module 5 PNA=(647)105 PNB=(646)210
588  // -- module 6 PNA=(647)110 PNB=(646)205
589  // -- module 7 PNA=(647)107 PNB=(646)202
590  // -- module 8 PNA=(647)105 PNB=(646)210
591  // LMR=75 EE+9(648/0)
592  // -- module 1 PNA=(647)110 PNB=(646)205
593  // -- module 2 PNA=(647)107 PNB=(646)202
594  // -- module 3 PNA=(647)105 PNB=(646)210
595  // -- module 4 PNA=(647)105 PNB=(646)210
596  // LMR=76 EE+1(649/0)
597  // -- module 1 PNA=(650)102 PNB=(651)206
598  // -- module 2 PNA=(650)102 PNB=(651)207
599  // -- module 3 PNA=(650)103 PNB=(651)208
600  // -- module 4 PNA=(650)104 PNB=(651)209
601  // LMR=77 EE+2(650/0)
602  // -- module 5 PNA=(650)103 PNB=(651)208
603  // -- module 6 PNA=(650)102 PNB=(651)206
604  // -- module 7 PNA=(650)102 PNB=(651)207
605  // -- module 8 PNA=(650)104 PNB=(651)209
606  // LMR=78 EE+3(651/0)
607  // -- module 9 PNA=(650)106 PNB=(651)201
608  // -- module 10 PNA=(650)107 PNB=(651)202
609  // -- module 11 PNA=(650)108 PNB=(651)203
610  // -- module 12 PNA=(650)109 PNB=(651)204
611  // -- module 13 PNA=(650)110 PNB=(651)205
612  // LMR=79 EE+4(652/0)
613  // -- module 14 PNA=(650)108 PNB=(651)203
614  // -- module 15 PNA=(650)106 PNB=(651)201
615  // -- module 16 PNA=(650)107 PNB=(651)202
616  // -- module 17 PNA=(650)110 PNB=(651)205
617  // LMR=80 EE+5(653/0)
618  // -- module 18 PNA=(650)105 PNB=(651)210
619  // -- module 19 PNA=(650)109 PNB=(651)204
620  // LMR=81 EE+5(653/1)
621  // -- module 18 PNA=(647)101 PNB=(646)206
622  // -- module 19 PNA=(647)101 PNB=(646)206
623  // LMR=82 EE+6(654/0)
624  // -- module 14 PNA=(647)108 PNB=(646)203
625  // -- module 15 PNA=(647)106 PNB=(646)201
626  // -- module 16 PNA=(647)103 PNB=(646)208
627  // -- module 17 PNA=(647)104 PNB=(646)209
628  // LMR=83 EE-7(601/0)
629  // -- module 9 PNA=(601)108 PNB=(602)203
630  // -- module 10 PNA=(601)105 PNB=(602)210
631  // -- module 11 PNA=(601)106 PNB=(602)201
632  // -- module 12 PNA=(601)110 PNB=(602)205
633  // -- module 13 PNA=(601)110 PNB=(602)205
634  // LMR=84 EE-8(602/0)
635  // -- module 5 PNA=(601)103 PNB=(602)208
636  // -- module 6 PNA=(601)101 PNB=(602)206
637  // -- module 7 PNA=(601)101 PNB=(602)206
638  // -- module 8 PNA=(601)103 PNB=(602)209
639  // LMR=85 EE-9(603/0)
640  // -- module 1 PNA=(601)101 PNB=(602)206
641  // -- module 2 PNA=(601)101 PNB=(602)206
642  // -- module 3 PNA=(601)103 PNB=(602)208
643  // -- module 4 PNA=(601)103 PNB=(602)209
644  // LMR=86 EE-1(604/0)
645  // -- module 1 PNA=(605)105 PNB=(606)210
646  // -- module 2 PNA=(605)102 PNB=(606)207
647  // -- module 3 PNA=(605)102 PNB=(606)207
648  // -- module 4 PNA=(605)110 PNB=(606)205
649  // LMR=87 EE-2(605/0)
650  // -- module 5 PNA=(605)105 PNB=(606)210
651  // -- module 6 PNA=(605)105 PNB=(606)210
652  // -- module 7 PNA=(605)102 PNB=(606)207
653  // -- module 8 PNA=(605)110 PNB=(606)205
654  // LMR=88 EE-3(606/0)
655  // -- module 9 PNA=(605)101 PNB=(606)206
656  // -- module 10 PNA=(605)108 PNB=(606)203
657  // -- module 11 PNA=(605)103 PNB=(606)208
658  // -- module 12 PNA=(605)106 PNB=(606)201
659  // -- module 13 PNA=(605)109 PNB=(606)204
660  // LMR=89 EE-4(607/0)
661  // -- module 14 PNA=(605)103 PNB=(606)208
662  // -- module 15 PNA=(605)101 PNB=(606)206
663  // -- module 16 PNA=(605)108 PNB=(606)203
664  // -- module 17 PNA=(605)109 PNB=(606)204
665  // LMR=90 EE-5(608/0)
666  // -- module 18 PNA=(605)106 PNB=(606)201
667  // -- module 19 PNA=(605)106 PNB=(606)201
668  // LMR=91 EE-5(608/1)
669  // -- module 18 PNA=(601)107 PNB=(602)202
670  // -- module 19 PNA=(601)110 PNB=(602)205
671  // LMR=92 EE-6(609/0)
672  // -- module 14 PNA=(601)106 PNB=(602)201
673  // -- module 15 PNA=(601)108 PNB=(602)203
674  // -- module 16 PNA=(601)105 PNB=(602)210
675  // -- module 17 PNA=(601)105 PNB=(602)210
676 
677  if (ilmmod == 20)
678  ilmmod = 18;
679  if (ilmmod == 21)
680  ilmmod = 19;
681 
682  std::pair<int, int> pns(0, 0);
683 
684  if (pnTheory) {
685  switch (ilmmod) {
686  case 1:
687  pns.first = 0;
688  pns.second = 5;
689  break;
690  case 2:
691  pns.first = 1;
692  pns.second = 6;
693  break;
694  case 3:
695  pns.first = 2;
696  pns.second = 7;
697  break;
698  case 4:
699  pns.first = 3;
700  pns.second = 8;
701  break;
702  case 5:
703  pns.first = 2;
704  pns.second = 7;
705  break;
706  case 6:
707  pns.first = 0;
708  pns.second = 5;
709  break;
710  case 7:
711  pns.first = 1;
712  pns.second = 6;
713  break;
714  case 8:
715  pns.first = 3;
716  pns.second = 8;
717  break;
718  case 9:
719  pns.first = 5;
720  pns.second = 0;
721  break;
722  case 10:
723  pns.first = 6;
724  pns.second = 1;
725  break;
726  case 11:
727  pns.first = 7;
728  pns.second = 2;
729  break;
730  case 12:
731  pns.first = 8;
732  pns.second = 3;
733  break;
734  case 13:
735  pns.first = 9;
736  pns.second = 4;
737  break;
738  case 14:
739  pns.first = 7;
740  pns.second = 2;
741  break;
742  case 15:
743  pns.first = 5;
744  pns.second = 0;
745  break;
746  case 16:
747  pns.first = 6;
748  pns.second = 1;
749  break;
750  case 17:
751  pns.first = 9;
752  pns.second = 4;
753  break;
754  case 18:
755  pns.first = 4;
756  pns.second = 9;
757  break;
758  case 19:
759  pns.first = 8;
760  pns.second = 3;
761  break;
762  default:
763  abort();
764  };
765  } else {
766  // theoretical ~ dee 1
767  if (dee == 1) {
768  switch (ilmmod) {
769  // case 1: pns.first=0; pns.second=5; break;
770  case 1:
771  pns.first = 1;
772  pns.second = 5;
773  break; // missing PNA
774  case 2:
775  pns.first = 1;
776  pns.second = 6;
777  break;
778  case 3:
779  pns.first = 2;
780  pns.second = 7;
781  break;
782  case 4:
783  pns.first = 3;
784  pns.second = 8;
785  break;
786  case 5:
787  pns.first = 2;
788  pns.second = 7;
789  break;
790  // case 6: pns.first=0; pns.second=5; break;
791  case 6:
792  pns.first = 1;
793  pns.second = 5;
794  break; // missing PNA
795  case 7:
796  pns.first = 1;
797  pns.second = 6;
798  break;
799  case 8:
800  pns.first = 3;
801  pns.second = 8;
802  break;
803  case 9:
804  pns.first = 5;
805  pns.second = 0;
806  break;
807  case 10:
808  pns.first = 6;
809  pns.second = 1;
810  break;
811  case 11:
812  pns.first = 7;
813  pns.second = 2;
814  break;
815  case 12:
816  pns.first = 8;
817  pns.second = 3;
818  break;
819  case 13:
820  pns.first = 9;
821  pns.second = 4;
822  break;
823  case 14:
824  pns.first = 7;
825  pns.second = 2;
826  break;
827  case 15:
828  pns.first = 5;
829  pns.second = 0;
830  break;
831  case 16:
832  pns.first = 6;
833  pns.second = 1;
834  break;
835  case 17:
836  pns.first = 9;
837  pns.second = 4;
838  break;
839  case 18:
840  pns.first = 4;
841  pns.second = 9;
842  break;
843  case 19:
844  pns.first = 8;
845  pns.second = 3;
846  break;
847  default:
848  abort();
849  };
850  } else if (dee == 2) {
851  switch (ilmmod) {
852  case 1:
853  pns.first = 9;
854  pns.second = 4;
855  break;
856  case 2:
857  pns.first = 6;
858  pns.second = 1;
859  break;
860  // case 3: pns.first=2; pns.second=7; break;
861  case 3:
862  pns.first = 4;
863  pns.second = 9;
864  break; // missing PNA & PNB
865  case 4:
866  pns.first = 4;
867  pns.second = 9;
868  break;
869  // case 5: pns.first=2; pns.second=7; break;
870  case 5:
871  pns.first = 4;
872  pns.second = 9;
873  break; // missing PNA & PNB
874  case 6:
875  pns.first = 9;
876  pns.second = 4;
877  break;
878  case 7:
879  pns.first = 6;
880  pns.second = 1;
881  break;
882  case 8:
883  pns.first = 4;
884  pns.second = 9;
885  break;
886  case 9:
887  pns.first = 5;
888  pns.second = 0;
889  break;
890  case 10:
891  pns.first = 2;
892  pns.second = 7;
893  break;
894  // case 11: pns.first=7; pns2second=2; break;
895  case 11:
896  pns.first = 2;
897  pns.second = 2;
898  break; // PNA - fibre cassee
899  case 12:
900  pns.first = 0;
901  pns.second = 5;
902  break;
903  case 13:
904  pns.first = 3;
905  pns.second = 8;
906  break;
907  case 14:
908  pns.first = 7;
909  pns.second = 2;
910  break;
911  case 15:
912  pns.first = 5;
913  pns.second = 0;
914  break;
915  case 16:
916  pns.first = 2;
917  pns.second = 7;
918  break;
919  case 17:
920  pns.first = 3;
921  pns.second = 8;
922  break;
923  // case 18: pns.first=4; pns.second=9; break;
924  case 18:
925  pns.first = 0;
926  pns.second = 5;
927  break; // missing PNA & PNB
928  case 19:
929  pns.first = 0;
930  pns.second = 5;
931  break;
932  default:
933  abort();
934  };
935  } else if (dee == 3) {
936  switch (ilmmod) {
937  case 1:
938  pns.first = 0;
939  pns.second = 5;
940  break;
941  // case 2: pns.first=0; pns.second=1; break;
942  case 2:
943  pns.first = 0;
944  pns.second = 5;
945  break; // missing PNA & PNB
946  case 3:
947  pns.first = 2;
948  pns.second = 7;
949  break;
950  // case 4: pns.first=4; pns.second=9; break;
951  case 4:
952  pns.first = 2;
953  pns.second = 8;
954  break; // missing PNA
955  case 5:
956  pns.first = 2;
957  pns.second = 7;
958  break;
959  case 6:
960  pns.first = 0;
961  pns.second = 5;
962  break;
963  // case 7: pns.first=6; pns.second=1; break;
964  case 7:
965  pns.first = 0;
966  pns.second = 5;
967  break; // missing PNA & PNB
968  // case 8: pns.first=4; pns.second=9; break;
969  case 8:
970  pns.first = 2;
971  pns.second = 8;
972  break; // missing PNA
973  case 9:
974  pns.first = 7;
975  pns.second = 2;
976  break;
977  case 10:
978  pns.first = 4;
979  pns.second = 9;
980  break;
981  case 11:
982  pns.first = 5;
983  pns.second = 0;
984  break;
985  case 12:
986  pns.first = 9;
987  pns.second = 4;
988  break;
989  // case 13: pns.first=3; pns.second=8; break;
990  case 13:
991  pns.first = 9;
992  pns.second = 4;
993  break; // missing PNA & PNB
994  case 14:
995  pns.first = 5;
996  pns.second = 0;
997  break;
998  case 15:
999  pns.first = 7;
1000  pns.second = 2;
1001  break;
1002  case 16:
1003  pns.first = 4;
1004  pns.second = 9;
1005  break;
1006  // case 17: pns.first=3; pns.second=8; break;
1007  case 17:
1008  pns.first = 4;
1009  pns.second = 9;
1010  break; // missing PNA & PNB
1011  case 18:
1012  pns.first = 6;
1013  pns.second = 1;
1014  break;
1015  case 19:
1016  pns.first = 9;
1017  pns.second = 4;
1018  break;
1019  default:
1020  abort();
1021  };
1022  } else if (dee == 4) {
1023  switch (ilmmod) {
1024  case 1:
1025  pns.first = 4;
1026  pns.second = 9;
1027  break;
1028  case 2:
1029  pns.first = 1;
1030  pns.second = 6;
1031  break;
1032  // case 3: pns.first=6; pns.second=1; break;
1033  case 3:
1034  pns.first = 1;
1035  pns.second = 6;
1036  break; // missing PNA & PNB
1037  case 4:
1038  pns.first = 9;
1039  pns.second = 4;
1040  break;
1041  // case 5: pns.first=4; pns.second=9; break;
1042  case 5:
1043  pns.first = 4;
1044  pns.second = 9;
1045  break; // missing PNA & PNB
1046  case 6:
1047  pns.first = 4;
1048  pns.second = 9;
1049  break;
1050  case 7:
1051  pns.first = 1;
1052  pns.second = 6;
1053  break;
1054  case 8:
1055  pns.first = 9;
1056  pns.second = 4;
1057  break;
1058  case 9:
1059  pns.first = 0;
1060  pns.second = 5;
1061  break;
1062  case 10:
1063  pns.first = 7;
1064  pns.second = 2;
1065  break;
1066  case 11:
1067  pns.first = 2;
1068  pns.second = 7;
1069  break;
1070  case 12:
1071  pns.first = 5;
1072  pns.second = 0;
1073  break;
1074  case 13:
1075  pns.first = 8;
1076  pns.second = 3;
1077  break;
1078  case 14:
1079  pns.first = 2;
1080  pns.second = 7;
1081  break;
1082  case 15:
1083  pns.first = 0;
1084  pns.second = 5;
1085  break;
1086  case 16:
1087  pns.first = 7;
1088  pns.second = 2;
1089  break;
1090  case 17:
1091  pns.first = 8;
1092  pns.second = 3;
1093  break;
1094  // case 18: pns.first=9; pns.second=4; break;
1095  case 18:
1096  pns.first = 5;
1097  pns.second = 0;
1098  break; // missing PNA & PNB
1099  case 19:
1100  pns.first = 5;
1101  pns.second = 0;
1102  break;
1103  default:
1104  abort();
1105  };
1106  }
1107  }
1108  return pns;
1109 }

Referenced by EcalPerEvtLaserAnalyzer::analyze(), EcalTestPulseAnalyzer::analyze(), EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), and ME::pn().

◆ quadrant()

int MEEEGeom::quadrant ( SuperCrysCoord  iX,
SuperCrysCoord  iY 
)
static

Definition at line 14 of file MEEEGeom.cc.

14  {
15  bool near = iX >= 11;
16  bool far = !near;
17  bool top = iY >= 11;
18  bool bot = !top;
19 
20  int iquad = 0;
21  if (near && top)
22  iquad = 1;
23  if (far && top)
24  iquad = 2;
25  if (far && bot)
26  iquad = 3;
27  if (near && bot)
28  iquad = 4;
29 
30  return iquad;
31 }

◆ sc()

int MEEEGeom::sc ( SuperCrysCoord  iX,
SuperCrysCoord  iY 
)
static

Definition at line 215 of file MEEEGeom.cc.

215  {
216  int isc_in_quad = sc_in_quad(iX, iY);
217  assert(isc_in_quad != 0);
218  if (isc_in_quad < 0)
219  return -1;
220 
221  int iquad = quadrant(iX, iY);
222  return 79 * (iquad - 1) + isc_in_quad;
223 }

References cms::cuda::assert(), and SiPixelPI::quadrant().

Referenced by ME::regTree().

◆ sc_in_quad()

int MEEEGeom::sc_in_quad ( SuperCrysCoord  iX,
SuperCrysCoord  iY 
)
static

Definition at line 146 of file MEEEGeom.cc.

146  {
147  static const int idx_[] = {
148  // 1 2 3 4 5 6 7 8 9 A
149  //-----------------------------------
150  77, 71, 63, 55, 46, 37, 28, 18, 0, 0, // A
151  78, 72, 64, 56, 47, 38, 29, 19, 9, 0, // 9
152  79, 73, 65, 57, 48, 39, 30, 20, 10, 1, // 8
153  0, 74, 66, 58, 49, 40, 31, 21, 11, 2, // 7
154  0, 75, 67, 59, 50, 41, 32, 22, 12, 3, // 6
155  0, 76, 68, 60, 51, 42, 33, 23, 13, 4, // 5
156  0, 0, 69, 61, 52, 43, 34, 24, 14, 5, // 4
157  0, 0, 70, 62, 53, 44, 35, 25, 15, 6, // 3
158  0, 0, 0, 0, 54, 45, 36, 26, 16, 7, // 2
159  0, 0, 0, 0, 0, 0, 0, 27, 17, 8, // 1
160  //-----------------------------------
161  };
162  int iym, ixm, il, ic, ii;
163  iym = 10;
164  ixm = 10;
165  int iX_ = iX;
166  if (iX >= 11)
167  iX_ = 20 - iX + 1;
168  int iY_ = iY;
169  if (iY >= 11)
170  iY_ = 20 - iY + 1;
171  il = iym - iY_;
172  ic = iX_ - 1;
173  ii = il * ixm + ic;
174  if (ii < 0 || ii > (int)(sizeof(idx_) / sizeof(int)) || idx_[ii] == 0) {
175  return -1;
176  };
177  return idx_[ii];
178 }

References cuy::ii.

◆ sc_type()

int MEEEGeom::sc_type ( SuperCrysCoord  iX,
SuperCrysCoord  iY 
)
static

Definition at line 180 of file MEEEGeom.cc.

180  {
181  static const int idx_[] = {
182  // there are seven types of super-crystals
183  // 1 2 3 4 5 6 7 8 9 10
184  //-----------------------------------
185  0, 0, 0, 0, 0, 0, 0, 3, -1, -1, // 10
186  0, 0, 0, 0, 0, 0, 0, 0, 2, -1, // 9
187  6, 0, 0, 0, 0, 0, 0, 0, 0, 1, // 8
188  -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 7
189  -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6
190  -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, // 5
191  -1, -1, 6, 0, 0, 0, 0, 0, 0, 0, // 4
192  -1, -1, 5, 4, 0, 0, 0, 0, 0, 0, // 3
193  -1, -1, -1, -1, 4, 0, 0, 0, 0, 0, // 2
194  -1, -1, -1, -1, -1, -1, -1, 4, 0, 0, // 1
195  //-----------------------------------
196  };
197  int iym, ixm, il, ic, ii;
198  iym = 10;
199  ixm = 10;
200  int iX_ = iX;
201  if (iX >= 11)
202  iX_ = 20 - iX + 1;
203  int iY_ = iY;
204  if (iY >= 11)
205  iY_ = 20 - iY + 1;
206  il = iym - iY_;
207  ic = iX_ - 1;
208  ii = il * ixm + ic;
209  if (ii < 0 || ii > (int)(sizeof(idx_) / sizeof(int)) || idx_[ii] == -1) {
210  return -1;
211  };
212  return idx_[ii];
213 }

References cuy::ii.

◆ sector()

int MEEEGeom::sector ( SuperCrysCoord  iX,
SuperCrysCoord  iY 
)
static

Definition at line 33 of file MEEEGeom.cc.

33  {
34  // Y (towards the surface)
35  // T
36  // |
37  // |
38  // |
39  // o---------| X (towards center of LHC)
40  //
41  static const int idx_[] = {
42  // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
43  0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 9,
44  9, 9, 0, 0, 0, 0, 0, 0, 0, // 20
45  0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 9,
46  9, 9, 9, 9, 9, 0, 0, 0, 0, // 19
47  0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 9,
48  9, 9, 9, 9, 9, 8, 0, 0, 0, // 18
49  0, 0, 2, 2, 2, 1, 1, 1, 1, 1, 9,
50  9, 9, 9, 9, 8, 8, 8, 0, 0, // 17
51  0, 2, 2, 2, 2, 1, 1, 1, 1, 1, 9,
52  9, 9, 9, 9, 8, 8, 8, 8, 0, // 16
53  0, 2, 2, 2, 2, 2, 1, 1, 1, 1, 9,
54  9, 9, 9, 8, 8, 8, 8, 8, 0, // 15
55  0, 2, 2, 2, 2, 2, 2, 1, 1, 1, 9,
56  9, 9, 8, 8, 8, 8, 8, 8, 0, // 14
57  2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 9,
58  9, 8, 8, 8, 8, 8, 8, 8, 8, // 13
59  3, 3, 2, 2, 2, 2, 2, 2, 2, 0, 0,
60  8, 8, 8, 8, 8, 8, 8, 7, 7, // 12
61  3, 3, 3, 3, 3, 3, 3, 2, 0, 0, 0,
62  0, 8, 7, 7, 7, 7, 7, 7, 7, // 11
63  3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0,
64  0, 7, 7, 7, 7, 7, 7, 7, 7, // 10
65  3, 3, 3, 3, 3, 3, 3, 4, 4, 0, 0,
66  6, 6, 7, 7, 7, 7, 7, 7, 7, // 9
67  3, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5,
68  6, 6, 6, 7, 7, 7, 7, 7, 7, // 8
69  0, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5,
70  6, 6, 6, 6, 6, 7, 7, 7, 0, // 7
71  0, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5,
72  5, 6, 6, 6, 6, 6, 6, 7, 0, // 6
73  0, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5,
74  5, 6, 6, 6, 6, 6, 6, 6, 0, // 5
75  0, 0, 4, 4, 4, 4, 4, 4, 5, 5, 5,
76  5, 6, 6, 6, 6, 6, 6, 0, 0, // 4
77  0, 0, 0, 4, 4, 4, 4, 5, 5, 5, 5,
78  5, 5, 6, 6, 6, 6, 0, 0, 0, // 3
79  0, 0, 0, 0, 4, 4, 4, 5, 5, 5, 5,
80  5, 5, 6, 6, 6, 0, 0, 0, 0, // 2
81  0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5,
82  5, 5, 0, 0, 0, 0, 0, 0, 0 // 1
83  // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
84  };
85 
86  int iym, ixm, il, ic, ii;
87  iym = 20;
88  ixm = 20;
89  int iX_ = iX;
90  int iY_ = iY;
91  il = iym - iY_;
92  ic = iX_ - 1;
93  ii = il * ixm + ic;
94 
95  if (ii < 0 || ii > (int)(sizeof(idx_) / sizeof(int)) || idx_[ii] == 0) {
96  return -1;
97  };
98  return idx_[ii];
99 }

References cuy::ii.

Referenced by geometryXMLparser.DTAlignable::index().

◆ side()

int MEEEGeom::side ( SuperCrysCoord  iX,
SuperCrysCoord  iY,
int  iz 
)
static

Definition at line 1155 of file MEEEGeom.cc.

1155  {
1156  int side = 0;
1157  int ilmr = lmr(iX, iY, iz);
1158  if (ilmr == 81 || ilmr == 91)
1159  side = 1;
1160 
1161  return side;
1162 }

Referenced by EcalABAnalyzer::analyze(), EcalTestPulseAnalyzer::analyze(), EcalLaserAnalyzer2::setGeomEE(), and EcalLaserAnalyzer::setGeomEE().

◆ sm()

int MEEEGeom::sm ( SuperCrysCoord  iX,
SuperCrysCoord  iY,
int  iz 
)
static

Definition at line 101 of file MEEEGeom.cc.

101  {
102  // this is *my* convention. To be consistent with the barrel
103  // sm goes from 1 to 9 for iz+ and from 10 to 18 for iz-
104  int ism_ = sector(iX, iY);
105  if (ism_ < 0)
106  return ism_;
107  if (iz < 0)
108  ism_ += 9;
109  return ism_;
110 }

Referenced by ME::regTree().

◆ smFromDcc()

int MEEEGeom::smFromDcc ( int  idcc)
static

Definition at line 405 of file MEEEGeom.cc.

405  {
406  if (idcc > 600)
407  idcc -= 600; // also works with FEDids
408  int ism(0);
409  if (idcc >= 1 && idcc <= 9) {
410  ism = 6 + idcc;
411  if (ism > 9)
412  ism -= 9;
413  ism += 9;
414  } else if (idcc >= 46 && idcc <= 54) {
415  ism = idcc - 46 + 7;
416  if (ism > 9)
417  ism -= 9;
418  } else
419  abort();
420  return ism;
421 }

References ecalpyutils::ism().

◆ smName()

TString MEEEGeom::smName ( int  ism)
static

Definition at line 388 of file MEEEGeom.cc.

388  {
389  assert(ism >= 1 && ism <= 18);
390  TString out = "EE+";
391  if (ism > 9) {
392  out = "EE-";
393  ism -= 9;
394  }
395  out += ism;
396  return out;
397 }

References cms::cuda::assert(), ecalpyutils::ism(), and MillePedeFileConverter_cfg::out.

Referenced by MEGeom::getHist().

Member Data Documentation

◆ pnTheory

bool MEEEGeom::pnTheory = true
static

Definition at line 46 of file MEEEGeom.h.

dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
MEEEGeom::pnTheory
static bool pnTheory
Definition: MEEEGeom.h:46
MEEEGeom::sc
static int sc(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:215
MEEEGeom::near
static bool near(int ilmr)
Definition: MEEEGeom.cc:1150
MEEEGeom::crystal
static int crystal(CrysCoord ix, CrysCoord iy)
Definition: MEEEGeom.cc:372
MEEEGeom::iDee
Definition: MEEEGeom.h:18
gather_cfg.cout
cout
Definition: gather_cfg.py:144
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
cms::cuda::assert
assert(be >=bs)
MEEEGeom::iCrystal
Definition: MEEEGeom.h:18
reco::HaloData::minus
Definition: HaloData.h:14
MEEEGeom::iSuperCrystal
Definition: MEEEGeom.h:18
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
MEEEGeom::iLMModule
Definition: MEEEGeom.h:18
reco::HaloData::plus
Definition: HaloData.h:14
MEEEGeom::dcc
static int dcc(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:225
ME::dccAndSide
static std::pair< int, int > dccAndSide(int ilmr)
Definition: ME.cc:295
MEEEGeom::smFromDcc
static int smFromDcc(int idcc)
Definition: MEEEGeom.cc:405
MEEEGeom::sc_type
static int sc_type(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:180
MEEEGeom::dee
static int dee(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:292
MEEEGeom::iEcalEndCap
Definition: MEEEGeom.h:18
MEEEGeom::quadrant
static int quadrant(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:14
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
MEEEGeom::iDCC
Definition: MEEEGeom.h:18
recoMuon::in
Definition: RecoMuonEnumerators.h:6
MEEEGeom::iLMRegion
Definition: MEEEGeom.h:18
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
MEEEGeom::iSector
Definition: MEEEGeom.h:18
MEEEGeom::sc_in_quad
static int sc_in_quad(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:146
MEEEGeom::lmmod
static int lmmod(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:112
MEEEGeom::lmr
static int lmr(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:254
ecalpyutils::ism
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:51
MEEEGeom::iQuadrant
Definition: MEEEGeom.h:18
MEEEGeom::sector
static int sector(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:33
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
MEEEGeom::side
static int side(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:1155
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MEEEGeom::crystal_in_sc
static int crystal_in_sc(CrysCoord ix, CrysCoord iy)
Definition: MEEEGeom.cc:311
MEEEGeom::getBoundary
static void getBoundary(std::list< std::pair< float, float > > &l, int type, int num, int iz=-1, int xside=0)
Definition: MEEEGeom.cc:447
cuy.ii
ii
Definition: cuy.py:590