CMS 3D CMS Logo

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

#include <MEEBGeom.h>

Public Types

typedef int EBGlobalCoord
 
typedef int EBLocalCoord
 
typedef int EBTTLocalCoord
 
enum  EBUnit {
  iEcalBarrel, iSuperModule, iDCC, iSide,
  iLMRegion, iLMModule, iTriggerTower, iCrystal
}
 
typedef std::pair< EBGlobalCoord, EBGlobalCoordEtaPhiCoord
 
typedef std::pair< float, float > EtaPhiPoint
 
typedef std::pair< EBLocalCoord, EBLocalCoordXYCoord
 

Public Member Functions

virtual ~MEEBGeom ()
 

Static Public Member Functions

static std::vector< int > apdRefChannels (int ilmmod)
 
static int apdRefTower (int ilmmod)
 
static int barrel (EBGlobalCoord ieta, EBGlobalCoord iphi)
 
static int crystal (EBGlobalCoord ieta, EBGlobalCoord iphi)
 
static int crystal_channel (EBLocalCoord ix, EBLocalCoord iy)
 
static int dcc (EBGlobalCoord ieta, EBGlobalCoord iphi)
 
static int dccFromSm (int ism)
 
static int electronic_channel (EBLocalCoord ix, EBLocalCoord iy)
 
static TGraph * getGraphBoundary (int type, int num, bool global=false)
 
static EtaPhiCoord globalCoord (int ism, EBLocalCoord ix, EBLocalCoord iy)
 
static EtaPhiPoint globalCoord (int ism, float x, float y)
 
static EtaPhiCoord globalCoord (int ism, int icrystal)
 
static int hv_channel (EBTTLocalCoord iX, EBTTLocalCoord iY)
 
static int lm_channel (EBTTLocalCoord iX, EBTTLocalCoord iY)
 
static int lmmod (EBGlobalCoord ieta, EBGlobalCoord iphi)
 
static std::vector< int > lmmodFromLmr (int ilmr)
 
static int lmr (EBGlobalCoord ieta, EBGlobalCoord iphi)
 
static XYCoord localCoord (int icr)
 
static XYCoord localCoord (EBGlobalCoord ieta, EBGlobalCoord iphi)
 
static int lv_channel (EBTTLocalCoord iX, EBTTLocalCoord iY)
 
static std::pair< int, int > memFromLmr (int ilmr)
 
static std::pair< int, int > pn (int ilmmod)
 
static int side (EBGlobalCoord ieta, EBGlobalCoord iphi)
 
static int sm (EBGlobalCoord ieta, EBGlobalCoord iphi)
 
static int smFromDcc (int idcc)
 
static TString smName (int ism)
 
static int tt (EBGlobalCoord ieta, EBGlobalCoord iphi)
 
static int tt_channel (EBTTLocalCoord iX, EBTTLocalCoord iY)
 
static int tt_type (EBTTLocalCoord iX, EBTTLocalCoord iY)
 

Detailed Description

Definition at line 15 of file MEEBGeom.h.

Member Typedef Documentation

◆ EBGlobalCoord

Definition at line 21 of file MEEBGeom.h.

◆ EBLocalCoord

Definition at line 20 of file MEEBGeom.h.

◆ EBTTLocalCoord

Definition at line 22 of file MEEBGeom.h.

◆ EtaPhiCoord

Definition at line 24 of file MEEBGeom.h.

◆ EtaPhiPoint

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

Definition at line 23 of file MEEBGeom.h.

◆ XYCoord

Definition at line 25 of file MEEBGeom.h.

Member Enumeration Documentation

◆ EBUnit

Enumerator
iEcalBarrel 
iSuperModule 
iDCC 
iSide 
iLMRegion 
iLMModule 
iTriggerTower 
iCrystal 

Definition at line 18 of file MEEBGeom.h.

Constructor & Destructor Documentation

◆ ~MEEBGeom()

virtual MEEBGeom::~MEEBGeom ( )
inlinevirtual

Definition at line 68 of file MEEBGeom.h.

68 {}

Member Function Documentation

◆ apdRefChannels()

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

Definition at line 526 of file MEEBGeom.cc.

Referenced by ME::apdRefChannels().

526  {
527  std::vector<int> vec;
528  switch (ilmmod) {
529  case 1:
530  vec.push_back(0);
531  vec.push_back(24);
532  break;
533  case 2:
534  vec.push_back(0);
535  vec.push_back(24);
536  break;
537  case 3:
538  vec.push_back(0);
539  vec.push_back(24);
540  break;
541  case 4:
542  vec.push_back(0);
543  vec.push_back(24);
544  break;
545  case 5:
546  vec.push_back(0);
547  vec.push_back(24);
548  break;
549  case 6:
550  vec.push_back(0);
551  vec.push_back(24);
552  break;
553  case 7:
554  vec.push_back(0);
555  vec.push_back(24);
556  break;
557  case 8:
558  vec.push_back(0);
559  vec.push_back(24);
560  break;
561  case 9:
562  vec.push_back(0);
563  vec.push_back(24);
564  break;
565  default:
566  abort();
567  }
568  return vec;
569 }

◆ apdRefTower()

int MEEBGeom::apdRefTower ( int  ilmmod)
static

Definition at line 490 of file MEEBGeom.cc.

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

490  {
491  switch (ilmmod) {
492  /* case 1: return 1;
493  case 2: return 5;
494  case 3: return 7;
495  case 4: return 21;
496  case 5: return 23;
497  case 6: return 37;
498  case 7: return 39;
499  case 8: return 53;
500  case 9: return 55;
501  */
502  case 1:
503  return 2;
504  case 2:
505  return 6;
506  case 3:
507  return 8;
508  case 4:
509  return 22;
510  case 5:
511  return 24;
512  case 6:
513  return 38;
514  case 7:
515  return 40;
516  case 8:
517  return 54;
518  case 9:
519  return 56;
520  default:
521  abort();
522  }
523  return 0;
524 }

◆ barrel()

int MEEBGeom::barrel ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 14 of file MEEBGeom.cc.

References cms::cuda::assert(), hcalRecHitTable_cff::ieta, and hcalRecHitTable_cff::iphi.

14  {
15  int iz = 1;
16  if (ieta < 0)
17  iz = -1;
18  ieta *= iz;
19  assert(ieta > 0 && ieta <= 85);
20  if (iphi < 0)
21  iphi += 360;
22  assert(iphi > 0 && iphi <= 360);
23  return iz;
24 }
assert(be >=bs)

◆ crystal()

int MEEBGeom::crystal ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 100 of file MEEBGeom.cc.

References hcalRecHitTable_cff::ieta, and hcalRecHitTable_cff::iphi.

100  {
101  std::pair<EBLocalCoord, EBLocalCoord> ixy = localCoord(ieta, iphi);
102  return crystal_channel(ixy.first, ixy.second);
103 }
static XYCoord localCoord(int icr)
Definition: MEEBGeom.cc:142
static int crystal_channel(EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:319

◆ crystal_channel()

int MEEBGeom::crystal_channel ( EBLocalCoord  ix,
EBLocalCoord  iy 
)
static

Definition at line 319 of file MEEBGeom.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), and ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy().

Referenced by MELaserPrim::fillHistograms(), and ME::regTree().

319  {
320  // "Test beam numbering"
321  int icr = 20 * ix + 19 - iy + 1; // :)
322 
323  return icr;
324 }
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)

◆ dcc()

int MEEBGeom::dcc ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

◆ dccFromSm()

int MEEBGeom::dccFromSm ( int  ism)
static

Definition at line 53 of file MEEBGeom.cc.

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

53  {
54  assert(ism >= 1 && ism <= 36);
55  int iz = 1;
56  if (ism > 18)
57  iz = -1;
58  if (iz == -1)
59  ism -= 18;
60  assert(ism >= 1 && ism <= 18);
61  int idcc = 9 + ism;
62  if (iz == +1)
63  idcc += 18;
64  return idcc;
65 }
assert(be >=bs)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49

◆ electronic_channel()

int MEEBGeom::electronic_channel ( EBLocalCoord  ix,
EBLocalCoord  iy 
)
static

Definition at line 326 of file MEEBGeom.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), and ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy().

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

326  {
327  int iX = ix / 5;
328  int iY = iy / 5;
329  int itt = tt_channel(iX, iY);
330  int type = tt_type(iX, iY);
331 
332  int iVFE = ix % 5 + 1;
333  int islot = iy % 5 + 1;
334  if (iVFE % 2 == 1)
335  islot = 6 - islot;
336  int icr = 5 * (iVFE - 1) + (islot - 1);
337  // rotate for type-1 towers
338  if (type == 1) {
339  icr = 24 - icr;
340  }
341  icr += 25 * (itt - 1);
342 
343  return icr;
344 }
static int tt_type(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:229
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
static int tt_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:313
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)

◆ getGraphBoundary()

TGraph * MEEBGeom::getGraphBoundary ( int  type,
int  num,
bool  global = false 
)
static

Definition at line 346 of file MEEBGeom.cc.

References cuy::ii, ecalpyutils::ism(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), dqmiodumpmetadata::n, EgammaValidation_cff::num, and geometryCSVtoXML::xy.

Referenced by MEGeom::drawGlobalBoundaries().

346  {
347  int ism_ = 0;
348  if (type == iSuperModule) {
349  ism_ = num;
350  } else if (type == iLMRegion) {
351  ism_ = (num - 1) / 2 + 1;
352  if (ism_ > 18)
353  ism_ -= 18;
354  else
355  ism_ += 18;
356  } else
357  abort();
358 
359  int ism = 1;
360  if (global)
361  ism = ism_;
362 
363  // std::list< std::pair< float, float > > l;
364  // getBoundary( l, type, num, global, ism );
365  // int n = l.size();
366  // if( n==0 ) return 0;
367 
368  float ix[100];
369  float iy[100];
370  int ixmin = 0;
371  int ixmax = 84;
372  int iymin = 0;
373  int iymax = 19;
374 
375  int n(0);
376  if (type == iSuperModule) {
377  n = 5;
378  ix[0] = ixmin - 0.5;
379  iy[0] = iymin - 0.5;
380  ix[1] = ixmin - 0.5;
381  iy[1] = iymax + 0.5;
382  ix[2] = ixmax + 0.5;
383  iy[2] = iymax + 0.5;
384  ix[3] = ixmax + 0.5;
385  iy[3] = iymin - 0.5;
386  ix[4] = ix[0];
387  iy[4] = iy[0];
388  } else if (type == iLMRegion) {
389  int iside = num;
390  if (global) {
391  iside = (num - 1) % 2;
392  }
393 
394  if (iside == 1) {
395  n = 5;
396  ix[0] = ixmin + 5 - 0.5;
397  iy[0] = iymin + 10 - 0.5;
398  ix[1] = ixmin + 5 - 0.5;
399  iy[1] = iymax + 0.5;
400  ix[2] = ixmax + 0.5;
401  iy[2] = iymax + 0.5;
402  ix[3] = ixmax + 0.5;
403  iy[3] = iymin + 10 - 0.5;
404  ix[4] = ix[0];
405  iy[4] = iy[0];
406  } else {
407  n = 7;
408  ix[0] = ixmin - 0.5;
409  iy[0] = iymin - 0.5;
410  ix[1] = ixmin - 0.5;
411  iy[1] = iymax + 0.5;
412  ix[2] = ixmin + 5 - 0.5;
413  iy[2] = iymax + 0.5;
414  ix[3] = ixmin + 5 - 0.5;
415  iy[3] = iymax - 10 + 0.5;
416  ix[4] = ixmax + 0.5;
417  iy[4] = iymax - 10 + 0.5;
418  ix[5] = ixmax + 0.5;
419  iy[5] = iymin - 0.5;
420  ix[6] = ix[0];
421  iy[6] = iy[0];
422  }
423  }
424 
425  if (global) {
426  for (int ii = 0; ii < n; ii++) {
427  std::pair<float, float> xy = globalCoord(ism, ix[ii], iy[ii]);
428  ix[ii] = xy.first;
429  iy[ii] = xy.second;
430  }
431  }
432 
433  // int ii=0;
434  // std::list< std::pair< float, float > >::const_iterator l_it;
435  // for( l_it=l.begin(); l_it!=l.end(); l_it++ )
436  // {
437  // // std::cout << "[" << l_it->first << "," << l_it->second << "]" << std::endl;
438  // ix[ii] = l_it->first;
439  // iy[ii] = l_it->second;
440  // ii++;
441  // }
442 
443  // assert( ii==n );
444  return new TGraph(n, ix, iy);
445 }
static EtaPhiCoord globalCoord(int ism, EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:149
ii
Definition: cuy.py:589
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49

◆ globalCoord() [1/3]

std::pair< MEEBGeom::EBGlobalCoord, MEEBGeom::EBGlobalCoord > MEEBGeom::globalCoord ( int  ism,
MEEBGeom::EBLocalCoord  ix,
MEEBGeom::EBLocalCoord  iy 
)
static

Definition at line 149 of file MEEBGeom.cc.

References cms::cuda::assert(), hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, ecalpyutils::ism(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), and ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy().

Referenced by ME::regTree().

151  {
152  assert(ism >= 1 && ism <= 36);
153  assert(ix >= 0 && ix < 85);
154  assert(iy >= 0 && iy < 20);
155  // int iz=-1;
156  int iz = 1;
157  if (ism > 18) {
158  iz = -1;
159  ism -= 18;
160  }
161  if (iz == -1)
162  iy = 19 - iy;
163  // if( iz==1 ) iy = 19-iy;
164 
165  int ieta = ix + 1;
166  ieta *= iz;
167  // int iphi = -9 + iy + 20*(ism-1);
168  int iphi = 1 + iy + 20 * (ism - 1);
169 
170  return std::pair<EBGlobalCoord, EBGlobalCoord>(ieta, iphi);
171 }
assert(be >=bs)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49

◆ globalCoord() [2/3]

std::pair< float, float > MEEBGeom::globalCoord ( int  ism,
float  x,
float  y 
)
static

Definition at line 173 of file MEEBGeom.cc.

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

173  {
174  assert(ism >= 1 && ism <= 36);
175  int iz = 1;
176  if (ism > 18) {
177  iz = -1;
178  ism -= 18;
179  }
180  if (iz == -1)
181  y = 19 - y;
182 
183  float eta = x + 1;
184  eta *= iz;
185  // float phi = -9 + y + 20*(ism-1);
186  float phi = 1 + y + 20 * (ism - 1);
187 
188  return std::pair<float, float>(eta, phi);
189 }
assert(be >=bs)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49

◆ globalCoord() [3/3]

std::pair< MEEBGeom::EBGlobalCoord, MEEBGeom::EBGlobalCoord > MEEBGeom::globalCoord ( int  ism,
int  icrystal 
)
static

Definition at line 191 of file MEEBGeom.cc.

References cms::cuda::assert(), ecalpyutils::ism(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), and ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy().

191  {
192  assert(ism >= 1 && ism <= 36);
193  assert(icr >= 1 && icr <= 1700);
194 
195  int ix = (icr - 1) / 20;
196  int iy = 19 - (icr - 1) % 20;
197 
198  return globalCoord(ism, ix, iy);
199 }
assert(be >=bs)
static EtaPhiCoord globalCoord(int ism, EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:149
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49

◆ hv_channel()

int MEEBGeom::hv_channel ( EBTTLocalCoord  iX,
EBTTLocalCoord  iY 
)
static

Definition at line 257 of file MEEBGeom.cc.

References cuy::ii.

257  {
258  static const int idx_[] = {
259  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
260  1, 3, 5, 7, 9, 11, 13, 15, 17,
261  19, 21, 23, 25, 27, 29, 31, 33, // 3
262  1, 3, 5, 7, 9, 11, 13, 15, 17,
263  19, 21, 23, 25, 27, 29, 31, 33, // 2
264  2, 4, 6, 8, 10, 12, 14, 16, 18,
265  20, 22, 24, 26, 28, 30, 32, 34, // 1
266  2, 4, 6, 8, 10, 12, 14, 16, 18,
267  20, 22, 24, 26, 28, 30, 32, 34 // 0
268  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
269  };
270 
271  int iym, ixm, il, ic, ii;
272  iym = 4;
273  ixm = 17;
274  int iX_ = iX + 1;
275  int iY_ = iY + 1;
276  il = iym - iY_;
277  ic = iX_ - 1;
278  ii = il * ixm + ic;
279  if (ii < 0 || ii > (int)(sizeof(idx_) / sizeof(int))) {
280  return -1;
281  };
282  return idx_[ii];
283 }
ii
Definition: cuy.py:589

◆ lm_channel()

int MEEBGeom::lm_channel ( EBTTLocalCoord  iX,
EBTTLocalCoord  iY 
)
static

Definition at line 201 of file MEEBGeom.cc.

References cuy::ii.

Referenced by ME::regTree().

201  {
202  static const int idx_[] = {
203  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
204  1, 2, 2, 2, 2, 4, 4, 4, 4,
205  6, 6, 6, 6, 8, 8, 8, 8, // 3
206  1, 2, 2, 2, 2, 4, 4, 4, 4,
207  6, 6, 6, 6, 8, 8, 8, 8, // 2
208  1, 3, 3, 3, 3, 5, 5, 5, 5,
209  7, 7, 7, 7, 9, 9, 9, 9, // 1
210  1, 3, 3, 3, 3, 5, 5, 5, 5,
211  7, 7, 7, 7, 9, 9, 9, 9 // 0
212  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
213  };
214 
215  int iym, ixm, il, ic, ii;
216  iym = 4;
217  ixm = 17;
218  int iX_ = iX + 1;
219  int iY_ = iY + 1;
220  il = iym - iY_;
221  ic = iX_ - 1;
222  ii = il * ixm + ic;
223  if (ii < 0 || ii > (int)(sizeof(idx_) / sizeof(int))) {
224  return -1;
225  };
226  return idx_[ii];
227 }
ii
Definition: cuy.py:589

◆ lmmod()

int MEEBGeom::lmmod ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 90 of file MEEBGeom.cc.

References hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, and ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::lm_channel().

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

90  {
91  std::pair<EBLocalCoord, EBLocalCoord> ixy = localCoord(ieta, iphi);
92  return lm_channel(ixy.first / 5, ixy.second / 5);
93 }
static XYCoord localCoord(int icr)
Definition: MEEBGeom.cc:142
static int lm_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:201

◆ lmmodFromLmr()

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

Definition at line 479 of file MEEBGeom.cc.

References ME::dccAndSide().

Referenced by ME::lmmodFromLmr().

479  {
480  std::pair<int, int> dccAndSide_ = ME::dccAndSide(ilmr);
481  int iside = dccAndSide_.second;
482  std::vector<int> vec;
483  for (int ilmmod = 1; ilmmod <= 9; ilmmod++) {
484  if ((ilmmod + iside) % 2 == 1)
485  vec.push_back(ilmmod);
486  }
487  return vec;
488 }
static std::pair< int, int > dccAndSide(int ilmr)
Definition: ME.cc:295

◆ lmr()

int MEEBGeom::lmr ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 110 of file MEEBGeom.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::dcc(), hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, ecalpyutils::ism(), and ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::side().

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

110  {
111  int idcc = dcc(ieta, iphi);
112  int ism = idcc - 9;
113  int iside = side(ieta, iphi);
114  int ilmr = 1 + 2 * (ism - 1) + iside;
115  return ilmr;
116 }
static int side(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:105
static int dcc(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:48
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49

◆ localCoord() [1/2]

std::pair< MEEBGeom::EBLocalCoord, MEEBGeom::EBLocalCoord > MEEBGeom::localCoord ( int  icr)
static

◆ localCoord() [2/2]

std::pair< MEEBGeom::EBLocalCoord, MEEBGeom::EBLocalCoord > MEEBGeom::localCoord ( MEEBGeom::EBGlobalCoord  ieta,
MEEBGeom::EBGlobalCoord  iphi 
)
static

Definition at line 118 of file MEEBGeom.cc.

References cms::cuda::assert(), hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), and ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy().

119  {
120  int iz = 1;
121  if (ieta < 0)
122  iz = -1;
123  ieta *= iz;
124  assert(ieta > 0 && ieta <= 85);
125 
126  // int iphi_ = iphi+10;
127  int iphi_ = iphi;
128  if (iphi_ > 360)
129  iphi_ -= 360;
130  assert(iphi_ > 0 && iphi_ <= 360);
131 
132  int ix = ieta - 1;
133 
134  int iy = (iphi_ - 1) % 20;
135  if (iz == -1)
136  iy = 19 - iy;
137  // if( iz==1 ) iy = 19-iy;
138 
139  return std::pair<EBLocalCoord, EBLocalCoord>(ix, iy);
140 }
assert(be >=bs)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)

◆ lv_channel()

int MEEBGeom::lv_channel ( EBTTLocalCoord  iX,
EBTTLocalCoord  iY 
)
static

Definition at line 285 of file MEEBGeom.cc.

References cuy::ii.

285  {
286  static const int idx_[] = {
287  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
288  1, 2, 2, 4, 4, 6, 6, 8, 8,
289  10, 10, 12, 12, 14, 14, 16, 16, // 3
290  1, 2, 2, 4, 4, 6, 6, 8, 8,
291  10, 10, 12, 12, 14, 14, 16, 16, // 2
292  1, 3, 3, 5, 5, 7, 7, 9, 9,
293  11, 11, 13, 13, 15, 15, 17, 17, // 1
294  1, 3, 3, 5, 5, 7, 7, 9, 9,
295  11, 11, 13, 13, 15, 15, 17, 17 // 0
296  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
297  };
298 
299  int iym, ixm, il, ic, ii;
300  iym = 4;
301  ixm = 17;
302  int iX_ = iX + 1;
303  int iY_ = iY + 1;
304  il = iym - iY_;
305  ic = iX_ - 1;
306  ii = il * ixm + ic;
307  if (ii < 0 || ii > (int)(sizeof(idx_) / sizeof(int))) {
308  return -1;
309  };
310  return idx_[ii];
311 }
ii
Definition: cuy.py:589

◆ memFromLmr()

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

Definition at line 473 of file MEEBGeom.cc.

References ME::dccAndSide().

Referenced by ME::memFromLmr().

473  {
474  std::pair<int, int> dccAndSide_ = ME::dccAndSide(ilmr);
475  int idcc = dccAndSide_.first;
476  return std::pair<int, int>(idcc, idcc);
477 }
static std::pair< int, int > dccAndSide(int ilmr)
Definition: ME.cc:295

◆ pn()

std::pair< int, int > MEEBGeom::pn ( int  ilmmod)
static

Definition at line 447 of file MEEBGeom.cc.

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

447  {
448  switch (ilmmod) {
449  case 1:
450  return std::pair<int, int>(0, 5);
451  case 2:
452  return std::pair<int, int>(1, 6);
453  case 3:
454  return std::pair<int, int>(1, 6);
455  case 4:
456  return std::pair<int, int>(2, 7);
457  case 5:
458  return std::pair<int, int>(2, 7);
459  case 6:
460  return std::pair<int, int>(3, 8);
461  case 7:
462  return std::pair<int, int>(3, 8);
463  case 8:
464  return std::pair<int, int>(4, 9);
465  case 9:
466  return std::pair<int, int>(4, 9);
467  default:
468  abort();
469  }
470  return std::pair<int, int>(-1, -1);
471 }

◆ side()

int MEEBGeom::side ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

◆ sm()

int MEEBGeom::sm ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 26 of file MEEBGeom.cc.

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

26  {
27  int iz = 1;
28  if (ieta < 0)
29  iz = -1;
30  ieta *= iz;
31  assert(ieta > 0 && ieta <= 85);
32 
33  // int iphi_ = iphi+10;
34  int iphi_ = iphi;
35  if (iphi_ > 360)
36  iphi_ -= 360;
37  assert(iphi_ > 0 && iphi_ <= 360);
38 
39  int ism = (iphi_ - 1) / 20 + 1;
40  assert(ism >= 1 && ism <= 18);
41  // if( iz==1 ) ism += 18;
42  if (iz == -1)
43  ism += 18;
44 
45  return ism;
46 }
assert(be >=bs)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49

◆ smFromDcc()

int MEEBGeom::smFromDcc ( int  idcc)
static

Definition at line 67 of file MEEBGeom.cc.

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

67  {
68  if (idcc > 600)
69  idcc -= 600; // also works with FEDids
70  assert(idcc >= 10 && idcc <= 45);
71  int ism = idcc - 9;
72  if (ism > 18)
73  ism -= 18;
74  else
75  ism += 18;
76  return ism;
77 }
assert(be >=bs)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49

◆ smName()

TString MEEBGeom::smName ( int  ism)
static

Definition at line 79 of file MEEBGeom.cc.

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

Referenced by MEGeom::getHist().

79  {
80  assert(ism >= 1 && ism <= 36);
81  TString out = "EB+";
82  if (ism > 18) {
83  out = "EB-";
84  ism -= 18;
85  }
86  out += ism;
87  return out;
88 }
assert(be >=bs)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49

◆ tt()

int MEEBGeom::tt ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 95 of file MEEBGeom.cc.

References hcalRecHitTable_cff::ieta, and hcalRecHitTable_cff::iphi.

95  {
96  std::pair<EBLocalCoord, EBLocalCoord> ixy = localCoord(ieta, iphi);
97  return tt_channel(ixy.first / 5, ixy.second / 5);
98 }
static XYCoord localCoord(int icr)
Definition: MEEBGeom.cc:142
static int tt_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:313

◆ tt_channel()

int MEEBGeom::tt_channel ( EBTTLocalCoord  iX,
EBTTLocalCoord  iY 
)
static

Definition at line 313 of file MEEBGeom.cc.

Referenced by ME::regTree().

313  {
314  int itt = 4 * iX + 4 - iY; // :)
315 
316  return itt;
317 }

◆ tt_type()

int MEEBGeom::tt_type ( EBTTLocalCoord  iX,
EBTTLocalCoord  iY 
)
static

Definition at line 229 of file MEEBGeom.cc.

References cuy::ii.

229  {
230  static const int idx_[] = {
231  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
232  1, 1, 1, 2, 2, 1, 1, 2, 2,
233  1, 1, 2, 2, 1, 1, 2, 2, // 3
234  1, 1, 1, 2, 2, 1, 1, 2, 2,
235  1, 1, 2, 2, 1, 1, 2, 2, // 2
236  1, 1, 1, 2, 2, 1, 1, 2, 2,
237  1, 1, 2, 2, 1, 1, 2, 2, // 1
238  1, 1, 1, 2, 2, 1, 1, 2, 2,
239  1, 1, 2, 2, 1, 1, 2, 2 // 0
240  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
241  };
242 
243  int iym, ixm, il, ic, ii;
244  iym = 4;
245  ixm = 17;
246  int iX_ = iX + 1;
247  int iY_ = iY + 1;
248  il = iym - iY_;
249  ic = iX_ - 1;
250  ii = il * ixm + ic;
251  if (ii < 0 || ii > (int)(sizeof(idx_) / sizeof(int))) {
252  return -1;
253  };
254  return idx_[ii];
255 }
ii
Definition: cuy.py:589