CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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, EBGlobalCoord
EtaPhiCoord
 
typedef std::pair< float, float > EtaPhiPoint
 
typedef std::pair
< EBLocalCoord, EBLocalCoord
XYCoord
 

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

Definition at line 23 of file MEEBGeom.h.

Definition at line 22 of file MEEBGeom.h.

Definition at line 24 of file MEEBGeom.h.

Definition at line 26 of file MEEBGeom.h.

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

Definition at line 25 of file MEEBGeom.h.

Definition at line 27 of file MEEBGeom.h.

Member Enumeration Documentation

Enumerator
iEcalBarrel 
iSuperModule 
iDCC 
iSide 
iLMRegion 
iLMModule 
iTriggerTower 
iCrystal 

Definition at line 20 of file MEEBGeom.h.

Constructor & Destructor Documentation

virtual MEEBGeom::~MEEBGeom ( )
inlinevirtual

Definition at line 71 of file MEEBGeom.h.

71 {}

Member Function Documentation

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

Definition at line 551 of file MEEBGeom.cc.

Referenced by ME::apdRefChannels().

552 {
553 
554  std::vector< int > vec;
555  switch( ilmmod )
556  {
557  case 1: vec.push_back(0); vec.push_back(24); break;
558  case 2: vec.push_back(0); vec.push_back(24); break;
559  case 3: vec.push_back(0); vec.push_back(24); break;
560  case 4: vec.push_back(0); vec.push_back(24); break;
561  case 5: vec.push_back(0); vec.push_back(24); break;
562  case 6: vec.push_back(0); vec.push_back(24); break;
563  case 7: vec.push_back(0); vec.push_back(24); break;
564  case 8: vec.push_back(0); vec.push_back(24); break;
565  case 9: vec.push_back(0); vec.push_back(24); break;
566  default:
567  abort();
568  }
569  return vec;
570 }
int MEEBGeom::apdRefTower ( int  ilmmod)
static

Definition at line 520 of file MEEBGeom.cc.

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

521 {
522  switch( ilmmod )
523  {
524  /* case 1: return 1;
525  case 2: return 5;
526  case 3: return 7;
527  case 4: return 21;
528  case 5: return 23;
529  case 6: return 37;
530  case 7: return 39;
531  case 8: return 53;
532  case 9: return 55;
533  */
534  case 1: return 2;
535  case 2: return 6;
536  case 3: return 8;
537  case 4: return 22;
538  case 5: return 24;
539  case 6: return 38;
540  case 7: return 40;
541  case 8: return 54;
542  case 9: return 56;
543  default:
544  abort();
545  }
546  return 0;
547 }
int MEEBGeom::barrel ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 15 of file MEEBGeom.cc.

16 {
17  int iz=1;
18  if( ieta<0 ) iz=-1;
19  ieta *= iz;
20  assert( ieta>0 && ieta<=85 );
21  if( iphi<0 ) iphi+=360;
22  assert( iphi>0 && iphi<=360 );
23  return iz;
24 }
int MEEBGeom::crystal ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 107 of file MEEBGeom.cc.

108 {
109  std::pair<EBLocalCoord,EBLocalCoord> ixy = localCoord( ieta, iphi );
110  return crystal_channel( ixy.first, ixy.second );
111 }
static XYCoord localCoord(int icr)
Definition: MEEBGeom.cc:153
static int crystal_channel(EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:332
int MEEBGeom::crystal_channel ( EBLocalCoord  ix,
EBLocalCoord  iy 
)
static

Definition at line 332 of file MEEBGeom.cc.

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

333 {
334  // "Test beam numbering"
335  int icr = 20*ix + 19-iy + 1; // :)
336 
337  return icr;
338 }
int MEEBGeom::dcc ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 48 of file MEEBGeom.cc.

References ecalpyutils::ism().

49 {
50  int ism = sm( ieta, iphi );
51  return dccFromSm( ism );
52 }
static int sm(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:27
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
static int dccFromSm(int ism)
Definition: MEEBGeom.cc:55
int MEEBGeom::dccFromSm ( int  ism)
static

Definition at line 55 of file MEEBGeom.cc.

References ecalpyutils::ism().

56 {
57  assert( ism>=1 && ism<=36 );
58  int iz=1;
59  if( ism>18 ) iz=-1;
60  if( iz==-1 ) ism-=18;
61  assert( ism>=1 && ism<=18 );
62  int idcc = 9+ism;
63  if( iz==+1 ) idcc+=18;
64  return idcc;
65 }
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
int MEEBGeom::electronic_channel ( EBLocalCoord  ix,
EBLocalCoord  iy 
)
static

Definition at line 341 of file MEEBGeom.cc.

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

342 {
343  int iX = ix/5;
344  int iY = iy/5;
345  int itt = tt_channel( iX, iY );
346  int type = tt_type( iX, iY );
347 
348  int iVFE = ix%5+1;
349  int islot = iy%5+1;
350  if( iVFE%2==1 ) islot = 6-islot;
351  int icr = 5*(iVFE-1)+(islot-1);
352  // rotate for type-1 towers
353  if( type==1 )
354  {
355  icr = 24-icr;
356  }
357  icr += 25*(itt-1);
358 
359  return icr;
360 }
type
Definition: HCALResponse.h:21
static int tt_type(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:244
static int tt_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:322
TGraph * MEEBGeom::getGraphBoundary ( int  type,
int  num,
bool  global = false 
)
static

Definition at line 363 of file MEEBGeom.cc.

References cuy::ii, ecalpyutils::ism(), n, pileupDistInMC::num, and create_public_lumi_plots::xy.

Referenced by MEGeom::drawGlobalBoundaries().

364 {
365  int ism_=0;
366  if( type==iSuperModule )
367  {
368  ism_ = num;
369  }
370  else if( type==iLMRegion )
371  {
372  ism_ = (num-1)/2+1;
373  if( ism_>18 )
374  ism_-=18;
375  else
376  ism_+=18;
377  }
378  else
379  abort();
380 
381  int ism=1;
382  if( global ) ism = ism_;
383 
384  // std::list< std::pair< float, float > > l;
385  // getBoundary( l, type, num, global, ism );
386  // int n = l.size();
387  // if( n==0 ) return 0;
388 
389  float ix[100];
390  float iy[100];
391  int ixmin = 0;
392  int ixmax = 84;
393  int iymin = 0;
394  int iymax = 19;
395 
396  int n(0);
397  if( type==iSuperModule )
398  {
399  n=5;
400  ix[0] = ixmin-0.5;
401  iy[0] = iymin-0.5;
402  ix[1] = ixmin-0.5;
403  iy[1] = iymax+0.5;
404  ix[2] = ixmax+0.5;
405  iy[2] = iymax+0.5;
406  ix[3] = ixmax+0.5;
407  iy[3] = iymin-0.5;
408  ix[4] = ix[0];
409  iy[4] = iy[0];
410  }
411  else if( type==iLMRegion )
412  {
413  int iside = num;
414  if( global )
415  {
416  iside = (num-1)%2;
417  }
418 
419  if( iside==1 )
420  {
421  n=5;
422  ix[0] = ixmin+5-0.5;
423  iy[0] = iymin+10-0.5;
424  ix[1] = ixmin+5-0.5;
425  iy[1] = iymax+0.5;
426  ix[2] = ixmax+0.5;
427  iy[2] = iymax+0.5;
428  ix[3] = ixmax+0.5;
429  iy[3] = iymin+10-0.5;
430  ix[4] = ix[0];
431  iy[4] = iy[0];
432  }
433  else
434  {
435  n=7;
436  ix[0] = ixmin-0.5;
437  iy[0] = iymin-0.5;
438  ix[1] = ixmin-0.5;
439  iy[1] = iymax+0.5;
440  ix[2] = ixmin+5-0.5;
441  iy[2] = iymax+0.5;
442  ix[3] = ixmin+5-0.5;
443  iy[3] = iymax-10+0.5;
444  ix[4] = ixmax+0.5;
445  iy[4] = iymax-10+0.5;
446  ix[5] = ixmax+0.5;
447  iy[5] = iymin-0.5;
448  ix[6] = ix[0];
449  iy[6] = iy[0];
450  }
451  }
452 
453  if( global )
454  {
455  for( int ii=0; ii<n; ii ++ )
456  {
457  std::pair<float,float> xy = globalCoord( ism, ix[ii], iy[ii] );
458  ix[ii] = xy.first;
459  iy[ii] = xy.second;
460  }
461  }
462 
463 // int ii=0;
464 // std::list< std::pair< float, float > >::const_iterator l_it;
465 // for( l_it=l.begin(); l_it!=l.end(); l_it++ )
466 // {
467 // // std::cout << "[" << l_it->first << "," << l_it->second << "]" << std::endl;
468 // ix[ii] = l_it->first;
469 // iy[ii] = l_it->second;
470 // ii++;
471 // }
472 
473 
474 // assert( ii==n );
475  return new TGraph( n, ix, iy );
476 }
type
Definition: HCALResponse.h:21
int ii
Definition: cuy.py:588
static EtaPhiCoord globalCoord(int ism, EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:162
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
std::pair< MEEBGeom::EBGlobalCoord, MEEBGeom::EBGlobalCoord > MEEBGeom::globalCoord ( int  ism,
MEEBGeom::EBLocalCoord  ix,
MEEBGeom::EBLocalCoord  iy 
)
static

Definition at line 162 of file MEEBGeom.cc.

Referenced by ME::regTree().

163 {
164  assert( ism>=1 && ism<=36 );
165  assert( ix>=0 && ix<85 );
166  assert( iy>=0 && iy<20 );
167  // int iz=-1;
168  int iz=1;
169  if( ism>18 )
170  {
171  iz=-1;
172  ism -= 18;
173  }
174  if( iz==-1 ) iy = 19-iy;
175  // if( iz==1 ) iy = 19-iy;
176 
177  int ieta = ix+1;
178  ieta *= iz;
179  // int iphi = -9 + iy + 20*(ism-1);
180  int iphi = 1 + iy + 20*(ism-1);
181 
182  return std::pair< EBGlobalCoord, EBGlobalCoord >(ieta,iphi);
183 }
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
std::pair< float, float > MEEBGeom::globalCoord ( int  ism,
float  x,
float  y 
)
static

Definition at line 186 of file MEEBGeom.cc.

References eta(), phi, and detailsBasic3DVector::y.

187 {
188  assert( ism>=1 && ism<=36 );
189  int iz=1;
190  if( ism>18 )
191  {
192  iz=-1;
193  ism -= 18;
194  }
195  if( iz==-1 ) y = 19-y;
196 
197  float eta = x+1;
198  eta *= iz;
199  // float phi = -9 + y + 20*(ism-1);
200  float phi = 1 + y + 20*(ism-1);
201 
202  return std::pair< float, float >(eta,phi);
203 }
T eta() const
Definition: DDAxes.h:10
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
Definition: DDAxes.h:10
std::pair< MEEBGeom::EBGlobalCoord, MEEBGeom::EBGlobalCoord > MEEBGeom::globalCoord ( int  ism,
int  icrystal 
)
static

Definition at line 206 of file MEEBGeom.cc.

207 {
208  assert( ism>=1 && ism<=36 );
209  assert( icr>=1 && icr<=1700 );
210 
211  int ix = (icr-1)/20;
212  int iy = 19 - (icr-1)%20;
213 
214  return globalCoord( ism, ix, iy );
215 }
static EtaPhiCoord globalCoord(int ism, EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:162
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
int MEEBGeom::hv_channel ( EBTTLocalCoord  iX,
EBTTLocalCoord  iY 
)
static

Definition at line 270 of file MEEBGeom.cc.

References cuy::ii.

271 {
272  static const int
273  idx_[] =
274  {
275  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
276  1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, // 3
277  1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, // 2
278  2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, // 1
279  2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34 // 0
280  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
281  };
282 
283  int iym, ixm, il, ic, ii;
284  iym=4;
285  ixm=17;
286  int iX_ = iX+1;
287  int iY_ = iY+1;
288  il=iym-iY_;
289  ic=iX_-1;
290  ii=il*ixm+ic;
291  if(ii < 0 || ii > (int)(sizeof(idx_)/sizeof(int))) { return -1; };
292  return idx_[ii];
293 }
int ii
Definition: cuy.py:588
int MEEBGeom::lm_channel ( EBTTLocalCoord  iX,
EBTTLocalCoord  iY 
)
static

Definition at line 218 of file MEEBGeom.cc.

References cuy::ii.

Referenced by ME::regTree().

219 {
220  static const int
221  idx_[] =
222  {
223  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
224  1, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, // 3
225  1, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, // 2
226  1, 3, 3, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 9, 9, 9, 9, // 1
227  1, 3, 3, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 9, 9, 9, 9 // 0
228  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
229  };
230 
231  int iym, ixm, il, ic, ii;
232  iym=4;
233  ixm=17;
234  int iX_ = iX+1;
235  int iY_ = iY+1;
236  il=iym-iY_;
237  ic=iX_-1;
238  ii=il*ixm+ic;
239  if(ii < 0 || ii > (int)(sizeof(idx_)/sizeof(int))) { return -1; };
240  return idx_[ii];
241 }
int ii
Definition: cuy.py:588
int MEEBGeom::lmmod ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 93 of file MEEBGeom.cc.

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

94 {
95  std::pair<EBLocalCoord,EBLocalCoord> ixy = localCoord( ieta, iphi );
96  return lm_channel( ixy.first/5, ixy.second/5 );
97 }
static XYCoord localCoord(int icr)
Definition: MEEBGeom.cc:153
static int lm_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:218
std::vector< int > MEEBGeom::lmmodFromLmr ( int  ilmr)
static

Definition at line 507 of file MEEBGeom.cc.

References ME::dccAndSide().

Referenced by ME::lmmodFromLmr().

508 {
509  std::pair< int, int > dccAndSide_ = ME::dccAndSide( ilmr );
510  int iside = dccAndSide_.second;
511  std::vector< int > vec;
512  for( int ilmmod=1; ilmmod<=9; ilmmod++ )
513  {
514  if( (ilmmod+iside)%2==1 ) vec.push_back(ilmmod);
515  }
516  return vec;
517 }
static std::pair< int, int > dccAndSide(int ilmr)
Definition: ME.cc:313
int MEEBGeom::lmr ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 121 of file MEEBGeom.cc.

References ecalpyutils::ism().

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

122 {
123  int idcc = dcc( ieta, iphi );
124  int ism = idcc-9;
125  int iside = side( ieta, iphi );
126  int ilmr = 1 + 2*(ism-1) + iside;
127  return ilmr;
128 }
static int side(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:114
static int dcc(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:48
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
std::pair< MEEBGeom::EBLocalCoord, MEEBGeom::EBLocalCoord > MEEBGeom::localCoord ( int  icr)
static

Definition at line 153 of file MEEBGeom.cc.

Referenced by EcalABAnalyzer::analyze(), EcalPerEvtLaserAnalyzer::analyze(), EcalTestPulseAnalyzer::analyze(), EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), MELaserPrim::fillHistograms(), MEChannel::oneLine(), and MEChannel::oneWord().

154 {
155  assert( icr>=1 && icr<=1700 );
156  int ix = (icr-1)/20;
157  int iy = 19 - (icr-1)%20;
158  return std::pair< EBLocalCoord, EBLocalCoord >(ix,iy);
159 }
std::pair< MEEBGeom::EBLocalCoord, MEEBGeom::EBLocalCoord > MEEBGeom::localCoord ( MEEBGeom::EBGlobalCoord  ieta,
MEEBGeom::EBGlobalCoord  iphi 
)
static

Definition at line 131 of file MEEBGeom.cc.

132 {
133  int iz=1;
134  if( ieta<0 ) iz=-1;
135  ieta *= iz;
136  assert( ieta>0 && ieta<=85 );
137 
138  // int iphi_ = iphi+10;
139  int iphi_ = iphi;
140  if( iphi_>360 ) iphi_-=360;
141  assert( iphi_>0 && iphi_<=360 );
142 
143  int ix = ieta-1;
144 
145  int iy = (iphi_-1)%20;
146  if( iz==-1 ) iy = 19-iy;
147  // if( iz==1 ) iy = 19-iy;
148 
149  return std::pair< EBLocalCoord, EBLocalCoord >(ix,iy);
150 }
int MEEBGeom::lv_channel ( EBTTLocalCoord  iX,
EBTTLocalCoord  iY 
)
static

Definition at line 296 of file MEEBGeom.cc.

References cuy::ii.

297 {
298  static const int
299  idx_[] =
300  {
301  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
302  1, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, // 3
303  1, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, // 2
304  1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15, 17, 17, // 1
305  1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15, 17, 17 // 0
306  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
307  };
308 
309  int iym, ixm, il, ic, ii;
310  iym=4;
311  ixm=17;
312  int iX_ = iX+1;
313  int iY_ = iY+1;
314  il=iym-iY_;
315  ic=iX_-1;
316  ii=il*ixm+ic;
317  if(ii < 0 || ii > (int)(sizeof(idx_)/sizeof(int))) { return -1; };
318  return idx_[ii];
319 }
int ii
Definition: cuy.py:588
std::pair< int, int > MEEBGeom::memFromLmr ( int  ilmr)
static

Definition at line 499 of file MEEBGeom.cc.

References ME::dccAndSide().

Referenced by ME::memFromLmr().

500 {
501  std::pair< int, int > dccAndSide_ = ME::dccAndSide( ilmr );
502  int idcc = dccAndSide_.first;
503  return std::pair<int,int>( idcc, idcc );
504 }
static std::pair< int, int > dccAndSide(int ilmr)
Definition: ME.cc:313
std::pair< int, int > MEEBGeom::pn ( int  ilmmod)
static

Definition at line 479 of file MEEBGeom.cc.

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

480 {
481  switch( ilmmod )
482  {
483  case 1: return std::pair<int,int>( 0, 5 );
484  case 2: return std::pair<int,int>( 1, 6 );
485  case 3: return std::pair<int,int>( 1, 6 );
486  case 4: return std::pair<int,int>( 2, 7 );
487  case 5: return std::pair<int,int>( 2, 7 );
488  case 6: return std::pair<int,int>( 3, 8 );
489  case 7: return std::pair<int,int>( 3, 8 );
490  case 8: return std::pair<int,int>( 4, 9 );
491  case 9: return std::pair<int,int>( 4, 9 );
492  default:
493  abort();
494  }
495  return std::pair<int,int>(-1,-1);
496 }
int MEEBGeom::side ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 114 of file MEEBGeom.cc.

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

115 {
116  int ilmmod = lmmod( ieta, iphi );
117  return (ilmmod%2==0)?1:0;
118 }
static int lmmod(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:93
int MEEBGeom::sm ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 27 of file MEEBGeom.cc.

References ecalpyutils::ism().

28 {
29  int iz=1;
30  if( ieta<0 ) iz=-1;
31  ieta *= iz;
32  assert( ieta>0 && ieta<=85 );
33 
34  // int iphi_ = iphi+10;
35  int iphi_ = iphi;
36  if( iphi_>360 ) 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 ) ism += 18;
43 
44  return ism;
45 }
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
int MEEBGeom::smFromDcc ( int  idcc)
static

Definition at line 68 of file MEEBGeom.cc.

References ecalpyutils::ism().

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

Definition at line 79 of file MEEBGeom.cc.

References ecalpyutils::ism(), and dbtoconf::out.

Referenced by MEGeom::getHist().

80 {
81  assert( ism>=1 && ism<=36 );
82  TString out = "EB+";
83  if( ism>18 )
84  {
85  out = "EB-";
86  ism -= 18;
87  }
88  out += ism;
89  return out;
90 }
tuple out
Definition: dbtoconf.py:99
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
int MEEBGeom::tt ( EBGlobalCoord  ieta,
EBGlobalCoord  iphi 
)
static

Definition at line 100 of file MEEBGeom.cc.

101 {
102  std::pair<EBLocalCoord,EBLocalCoord> ixy = localCoord( ieta, iphi );
103  return tt_channel( ixy.first/5, ixy.second/5 );
104 }
static XYCoord localCoord(int icr)
Definition: MEEBGeom.cc:153
static int tt_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:322
int MEEBGeom::tt_channel ( EBTTLocalCoord  iX,
EBTTLocalCoord  iY 
)
static

Definition at line 322 of file MEEBGeom.cc.

Referenced by ME::regTree().

323 {
324 
325  int itt = 4*iX+4-iY; // :)
326 
327  return itt;
328 
329 }
int MEEBGeom::tt_type ( EBTTLocalCoord  iX,
EBTTLocalCoord  iY 
)
static

Definition at line 244 of file MEEBGeom.cc.

References cuy::ii.

245 {
246  static const int
247  idx_[] =
248  {
249  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
250  1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, // 3
251  1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, // 2
252  1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, // 1
253  1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2 // 0
254  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
255  };
256 
257  int iym, ixm, il, ic, ii;
258  iym=4;
259  ixm=17;
260  int iX_ = iX+1;
261  int iY_ = iY+1;
262  il=iym-iY_;
263  ic=iX_-1;
264  ii=il*ixm+ic;
265  if(ii < 0 || ii > (int)(sizeof(idx_)/sizeof(int))) { return -1; };
266  return idx_[ii];
267 }
int ii
Definition: cuy.py:588