Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
LArHVIdMapping.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 
10 
11 LArHVIdMapping::LArHVIdMapping(const CaloCell_ID* caloId, const LArHVLineID* hvId, const LArElectrodeID* elId) :
12  m_caloHelper(caloId), m_hvlineHelper(hvId), m_electrodeHelper(elId)
13 
14 {
18 }
19 
20 
21 //============================================================================
23 //============================================================================
24 {
25 
26 
27  std::map<HWIdentifier,HWIdentifier>::const_iterator elecIt = m_electrode_hvline_map.find(electrodeId);
28  if(elecIt != m_electrode_hvline_map.end()) {
29  HWIdentifier hvlineId = (elecIt)->second;
30  // commented out, until proper messaging will be added
31  /*
32  if (msgLvl(MSG::DEBUG)) {
33  const int dete = m_electrodeHelper->detector(electrodeId);
34  const int side = m_electrodeHelper->zside(electrodeId);
35  const int modu = m_electrodeHelper->module(electrodeId);
36  const int hvph = m_electrodeHelper->hv_phi(electrodeId);
37  const int hvet = m_electrodeHelper->hv_eta(electrodeId);
38  const int hvga = m_electrodeHelper->gap(electrodeId);
39  const int elec = m_electrodeHelper->electrode(electrodeId);
40  const int part = m_hvlineHelper->partition(hvlineId);
41  const int canl = m_hvlineHelper->can_line(hvlineId);
42  const int cann = m_hvlineHelper->can_node(hvlineId);
43  const int hvli = m_hvlineHelper->hv_line(hvlineId);
44  msg(MSG::DEBUG) << "[getLArHVLineID] input ElectrodeId=["
45  << dete << "." << side << "." << modu << "." << hvph
46  << "." << hvet << "." << hvga << "." << elec << "]"
47  << " corresponding hvlineID=["
48  << part << "." << canl << "." << cann << "." << hvli << "]... OK "
49  << endmsg;
50  }//end if debug
51  */
52  return hvlineId;
53  }
54  else {
55  // commented out, until the proper messaging will be added
56  /*
57  int dete = m_electrodeHelper->detector(electrodeId);
58  int side = m_electrodeHelper->zside(electrodeId);
59  int modu = m_electrodeHelper->module(electrodeId);
60  int hvph = m_electrodeHelper->hv_phi(electrodeId);
61  int hvet = m_electrodeHelper->hv_eta(electrodeId);
62  int hvga = m_electrodeHelper->gap(electrodeId);
63  int elec = m_electrodeHelper->electrode(electrodeId);
64 
65  int part = m_hvlineHelper->partition(invalidId);
66  int canl = m_hvlineHelper->can_line(invalidId);
67  int cann = m_hvlineHelper->can_node(invalidId);
68  int hvli = m_hvlineHelper->hv_line(invalidId);
69  ATH_MSG_WARNING( "[getLArHVLineID] NO MAP for ElectrodeId=["
70  << dete << "." << side << "." << modu << "." << hvph
71  << "." << hvet << "." << hvga << "." << elec << "] returning ["
72  << part << "." << canl << "." << cann << "." << hvli << "]... OK ");
73  */
74  HWIdentifier invalidId = m_hvlineHelper->HVLineId(0,0,0,0);
75  return (invalidId);
76 
77  //return m_hvmapHelper->getLArHVLineID( electrodeId ) ;
78  }
79  // if the map exists, use the mapping object
80 }
81 
82 
83 //========================================================================================
84 const std::vector<HWIdentifier>& LArHVIdMapping::getLArElectrodeIDvec(HWIdentifier &hvlineId) const
85 //========================================================================================
86 {// Start of getLArElectrodeIdvec()
87  //ATH_MSG_VERBOSE("Entering getLArElectrodeIDvec( hvlineId )" );
88  std::map<HWIdentifier,std::vector<HWIdentifier> >::const_iterator elecIt=m_hvline_electrode_map.find(hvlineId);
89  if( elecIt != m_hvline_electrode_map.end()){
90  return (elecIt)->second;
91  }
92  else{
93  // commented out, until proper messaging will be added
94  /*
95  int part = m_hvlineHelper->partition(hvlineId);
96  int canl = m_hvlineHelper->can_line(hvlineId);
97  int cann = m_hvlineHelper->can_node(hvlineId);
98  int hvli = m_hvlineHelper->hv_line(hvlineId);
99  msg(MSG::WARNING) << "LArHVCablingSvc: getLArElectrodeIDvec didnot find electrode to hvline ["
100  << part << "." << canl << "." << cann << "." << hvli << "]" << endmsg;
101  */
102  return(m_invalid);
103  }
104  //return m_hvmapHelper->getLArElectrodeIDvec( hvlineId );
105 }
106 
107 //=====================================================================
108 int LArHVIdMapping::getCellModule( const Identifier &offId ) const
109 //=====================================================================
110 // Returns the LArModule index as an integer
111 //
112 // Last Modified:
113 // 05-FEB-2007 AL fixed FCAL info --thanks to Zhaoyu Yang
114 // 02-FEB-2007 AL added Module info for FCAL
115 // 31-JAN-2007 AL reversed ModuleID returned for EMEC C-side
116 //
117 // =====================================================================
118 {// Start of getCellModule
119  //======================================
120  //ATH_MSG_VERBOSE("Entering getCellModule " );
121 
122  int bec =-99;
123  int sampling =-99;
124  int region =-99;
125  int phi =-99;
126  //int module =-99;
127  // Returned Value
128  // =====================================
129  int ModuleID =-99;
130 
131  // Identify the Helper to be used
132  // =====================================
133  if( m_caloHelper->is_em( offId ) ){
134  bec = m_emHelper->barrel_ec(offId);
135  sampling = m_emHelper->sampling(offId);
136  region = m_emHelper->region(offId);
137  phi = m_emHelper->phi(offId);
138  //ATH_MSG_DEBUG("[getCellModule] processing an EM cell.." );
139  }
140  else if( m_caloHelper->is_hec( offId ) ){
141  bec = m_hecHelper->pos_neg(offId)*10;
142  sampling = m_hecHelper->sampling(offId);
143  region = m_hecHelper->region(offId);
144  phi = m_hecHelper->phi(offId);
145  //ATH_MSG_DEBUG("[getCellModule] processing an HEC cell.." );
146  }
147  else if( m_caloHelper->is_fcal( offId )){
148  bec = m_fcalHelper->pos_neg(offId)*20;
149  sampling = m_fcalHelper->module(offId);
150  //module = m_fcalHelper->module(offId);
151  phi = m_fcalHelper->phi(offId);
152  //ATH_MSG_DEBUG("[getCellModule] processing an FCAL cell.." );
153  }
154 
155  // Now determine the Module ID
156  if( abs(bec) == 1 ){
157  // EM BARREL
158  // ===========================================================================
159  // x being the ATLAS x direction (pointing towards the center of the collider)
160  // we have :
161  // SIDE - C (z<0) SIDE - A (z>0)
162  // ------------- --------------
163  // C04 A04
164  // C03 C05 A05 A03
165  // C02 C06 A06 A02
166  // C01 C07 A07 A01
167  // C00----------C08-->X A08----------A00---> X
168  // C15 C09 A09 A15
169  // C14 C10 A10 A14
170  // C13 C11 A11 A13
171  // C12 A12
172  //============================================================================
173  if( bec == 1 ){
174  // A-WHEEL
175  // =======
176  if( sampling == 0 ){
177  // ------------------------------
178  // 32 Modules of two cells in phi
179  // ------------------------------
180  int phi_module=int(phi/2);
181  ModuleID = phi_module;
182  }
183  else if( sampling == 1 && region == 0 ){
184  // -----------------------------
185  // 16 Modules of 4 cells in phi
186  // -----------------------------
187  int phi_module = int((phi+2)/4);
188  if( phi_module == 16 ){
189  ModuleID = 0;
190  }
191  else{
192  ModuleID = phi_module;
193  }
194  }
195  else if( sampling == 2 || sampling == 3 || (sampling == 1 && region == 1 ) ){
196  // -----------------------------
197  // 16 Modules of 16 cells in phi
198  // -----------------------------
199  int phi_module = int((phi+8)/16);
200  if( phi_module == 16 ){
201  ModuleID=0;
202  }
203  else{
204  ModuleID=phi_module;
205  }
206  }
207  }
208 
209  else if( bec == -1 ){
210  // C-WHEEL
211  // =======
212  if( sampling == 0 ){
213  // ------------------------------
214  // 32 Modules of two cells in phi
215  // ------------------------------
216  int phi_module=int(phi/2);
217  if( phi_module <= 15 ){
218  phi_module = 15 - phi_module;
219  }
220  else{
221  phi_module = 47 - phi_module;
222  }
223  ModuleID = phi_module;
224  }
225  else if( sampling == 1 && region == 0 ){
226  // -----------------------------
227  // 16 Modules of 4 cells in phi
228  // -----------------------------
229  int phi_module = int((phi+2)/4);
230  if( phi_module <= 8){
231  phi_module = 8 - phi_module;
232  }
233  else{
234  phi_module = 24 - phi_module;
235  }
236  ModuleID = phi_module;
237  }
238  else if( sampling == 2 || sampling == 3 || (sampling == 1 && region == 1 ) ){
239  // -----------------------------
240  // 16 Modules of 16 cells in phi
241  // -----------------------------
242  int phi_module = int((phi+8)/16);
243  if( phi_module <= 8){
244  phi_module = 8 - phi_module;
245  }
246  else{
247  phi_module = 24 - phi_module;
248  }
249  ModuleID = phi_module;
250  }
251  }
252  }
253 
254  else if( abs(bec) == 2 || abs(bec) == 3){
255  // EMEC
256  // ----
257  //
258  // x being the ATLAS x direction (pointing towards the center of the collider)
259  // we have :
260  // SIDE - C SIDE - A
261  // -------- -----------
262  //
263  // ECC1 ECC2 ECA2 ECA1
264  //
265  // ECC0 ECC3 ECA3 ECA0
266  // -------------> X -----------> X
267  // ECC7 ECC4 ECA4 ECA7
268  //
269  // ECC6 ECC5 ECA5 ECA6
270  //
271  //
272  if( bec > 0 ){
273  // SIDE - A
274  if( sampling == 0 || sampling == 1 ||
275  (sampling == 2 && abs(bec) == 3 ) ){
276  // -------------------------------
277  // 8 Modules of 8 cells in phi
278  // -------------------------------
279  // Sampling 0, 1 (inner+outer) & 2 region 0 (inner)
280  //
281  int phi_local = int(phi/8);
282  ModuleID = phi_local;
283  }
284  else if( (sampling == 2 && abs(bec) == 2) || (sampling == 3 && abs(bec) == 2)){
285  // ----------------------------------------
286  // 8 Modules of 32 cells in phi
287  // ----------------------------------------
288  // Sampling 2 & 3 ( outer wheel) in [0,255]
289  //
290  int phi_local = int(phi/32);
291  ModuleID = phi_local;
292  }
293  }
294  else{
295  // SIDE-C
296  if( sampling == 0 || sampling == 1 ||
297  (sampling == 2 && abs(bec) == 3 ) ){
298  // ------------------------------
299  // 8 Modules of 8 cells in phi
300  // -------------------------------
301  // Sampling 0, 1 & 2( inner wheel) in [0,63]
302  //
303  int rev_phi=-99;
304  int phi_local = int(phi/8);
305  if( phi_local == 0 ){rev_phi = 3;}
306  if( phi_local == 1 ){rev_phi = 2;}
307  if( phi_local == 2 ){rev_phi = 1;}
308  if( phi_local == 3 ){rev_phi = 0;}
309  if( phi_local == 4 ){rev_phi = 7;}
310  if( phi_local == 5 ){rev_phi = 6;}
311  if( phi_local == 6 ){rev_phi = 5;}
312  if( phi_local == 7 ){rev_phi = 4;}
313  ModuleID = rev_phi;
314  }
315  else if( (sampling == 2 && abs(bec) == 2) || (sampling == 3 && abs(bec) == 2)){
316  // ----------------------------------------
317  // 8 Modules of 32 cells in phi
318  // ----------------------------------------
319  // Sampling 2 & 3 ( outer wheel) in [0,255]
320  //
321  int rev_phi=-99;
322  int phi_local = int(phi/32);
323  if( phi_local == 0 ){rev_phi = 3;}
324  if( phi_local == 1 ){rev_phi = 2;}
325  if( phi_local == 2 ){rev_phi = 1;}
326  if( phi_local == 3 ){rev_phi = 0;}
327  if( phi_local == 4 ){rev_phi = 7;}
328  if( phi_local == 5 ){rev_phi = 6;}
329  if( phi_local == 6 ){rev_phi = 5;}
330  if( phi_local == 7 ){rev_phi = 4;}
331  ModuleID = rev_phi;
332  }
333  }
334  }
335 
336 
337  else if( abs(bec) == 20 ){
338  // HEC Detector
339  // ============
340  if( bec > 0){
341  // WHEEL A
342  if( region == 0 ){
343  // OUTER WHEEL
344  // ----------------------------
345  // 32 Modules of 2 cells in phi
346  // ----------------------------
347  int phi_module=int(phi/2);
348  ModuleID = phi_module;
349  }
350  else if( region == 1){
351  // INNER WHEEL
352  // ----------------------------
353  // 32 Modules of 1 cells in phi
354  // ----------------------------
355  int phi_module=int(phi);
356  ModuleID = phi_module;
357  }
358  }
359  else if( bec < 0){
360  // WHEEL C
361  if( region == 0 ){
362  // OUTER WHEEL
363  // -----------
364  int phi_module=int(phi/2);
365  if( phi_module <= 15 ){
366  phi_module = 15 - phi_module;
367  }
368  else{
369  phi_module = 47 - phi_module;
370  }
371  ModuleID = phi_module;
372  }
373  else if( region == 1){
374  // INNER WHEEL
375  // -----------
376  int phi_module=int(phi);
377  if( phi_module <= 15 ){
378  phi_module = 15 - phi_module;
379  }
380  else{
381  phi_module = 47 - phi_module;
382  }
383  ModuleID = phi_module;
384  }
385  }
386  }
387  // ===========================================================================
388  // x being the ATLAS x direction (pointing towards the center of the collider)
389  // we have :
390  // SIDE - C (z<0) SIDE - A (z>0)
391  // ------------- --------------
392  // C04 A04
393  // C03 C05 A05 A03
394  // C02 C06 A06 A02
395  // C01 C07 A07 A01
396  // C00----------C08-->X A08----------A00---> X
397  // C15 C09 A09 A15
398  // C14 C10 A10 A14
399  // C13 C11 A11 A13
400  // C12 A12
401  //============================================================================
402 
403  else if( abs(bec) == 40 ){
404  // FCAL Detector
405  // ==============
406  // FCAL-Module 1 : EM
407  // FCAL-Module 2,3 : Hadronic
408  // -> 16 cells in phi per Module
409  // ==============================
410  if( sampling == 1){
411  ModuleID = int(phi);
412  }
413  else if( sampling == 2 ){
414  ModuleID = int(phi/2);
415  }
416  else if( sampling == 3){
417  ModuleID = int(phi/4);
418  }
419  }
420  else{
421  //msg(MSG::WARNING) << " -->> Invalid MODULE returned " << endmsg;
422  }
423  //ATH_MSG_DEBUG("Closing getCellModule " );
424  return ModuleID;
425 }
426 
427 
428 
429 //===================================================================
431 //===================================================================
432 // Returns the HV eta sector given an cell ID as an integert
433 //
434 // 05-FEB-2007 : AL added FCAL info from Zhaoyu
435 //
436 // 11-FEB-2005: modified getHVEtaSector to return an int.
437 // 25-NOV-2004: AL Added EMEC
438 // 09-DEC-2004: AL fixed EMBPS : change from 8 to 4 HV-sectors in Eta (08-DEC-2004)
439 // & fixed EMEC
440 // 15-DEC-2004: AL added HEC wheels
441 //===================================================================
442 {// Start of getHVEtaSector()
443  //ATH_MSG_VERBOSE("Entering getCellEtaSector ...." );
444 
445  std::string l_version = m_emHelper->dictionaryVersion();
446 
447  // Returned Value
448  int l_bec =-99;
449  int sampling=-99;
450  int region =-99;
451  int ieta =-99;
452  // Identify the Helper to be used
453  // =====================================
454  if( m_caloHelper->is_em( offId ) ){
455  l_bec = m_emHelper->barrel_ec(offId);
456  sampling = m_emHelper->sampling(offId);
457  region = m_emHelper->region(offId);
458  ieta = m_emHelper->eta(offId);
459  }
460  else if( m_caloHelper->is_hec( offId ) ){
461  l_bec = m_hecHelper->pos_neg(offId)*10;
462  sampling = m_hecHelper->sampling(offId);
463  region = m_hecHelper->region(offId);
464  ieta = m_hecHelper->eta(offId);
465  }
466  else if( m_caloHelper->is_fcal( offId ) ){
467  l_bec = m_fcalHelper->pos_neg(offId)*20;
468  sampling = m_fcalHelper->module(offId);
469  }
470 
471  // Output argument
472  // =====================================
473  int hvEta=-99;
474 
475  // Construct heEta
476  // =====================================
477  if( abs(l_bec) == 1 ){
478  // BARREL
479  if( sampling == 1 )
480  {// FRONT sampling
481  if( region == 0 ){
482  if( ieta >= 0 && ieta < 64 ){
483  hvEta=1;
484  }
485  else if( ieta >=64 && ieta < 128 ){
486  hvEta=2;
487  }
488  else if( ieta >=128 && ieta < 192 ){
489  hvEta=3;
490  }
491  else if( ieta >=192 && ieta < 256 ){
492  hvEta=4;
493  }
494  else if( ieta >=256 && ieta < 320 ){
495  hvEta=5;
496  }
497  else if( ieta >=320 && ieta < 384 ){
498  hvEta=6;
499  }
500  else if( ieta >=384 && ieta < 448 ){
501  hvEta=7;
502  }
503  }
504  else if( region == 1){
505  hvEta=7;
506  }
507  else {
508  //msg(MSG::WARNING) << "==> Invalid HV Eta-Sector for sampling=" << sampling << " Region=" << region << " I(eta)="<< ieta << endmsg;
509  }
510  }
511  else if( sampling == 2 ){
512  // MIDDLE Sampling in Barrel
513  // ----------------------
514  //
515  if( region == 0 ){
516  if( ieta >= 0 && ieta < 8 ){
517  hvEta=1;
518  }
519  else if( ieta >=8 && ieta < 16 ){
520  hvEta=2;
521  }
522  else if( ieta >=16 && ieta < 24 ){
523  hvEta=3;
524  }
525  else if( ieta >=24 && ieta < 32 ){
526  hvEta=4;
527  }
528  else if( ieta >=32 && ieta < 40 ){
529  hvEta=5;
530  }
531  else if( ieta >=40 && ieta < 48 ){
532  hvEta=6;
533  }
534  else if( ieta >=48 && ieta < 57 ){
535  hvEta=7;
536  }
537  }
538  else if( region == 1)
539  {
540  hvEta=7; // to be checked with Francesco
541 
542  }
543  else{
544  //msg(MSG::WARNING) << "==> Invalid HV Eta-Sector for sampling=" << sampling << " Region=" << region << " I(eta)="<< ieta << endmsg;
545  }
546  }
547  else if( sampling == 3 ){
548  // BACK Sampling in Barrel
549  // -----------------------
550  //
551  if( region == 0 ){
552  if( ieta >= 0 && ieta < 4 ){
553  hvEta=1;
554  }
555  else if( ieta >=4 && ieta < 8 ){
556  hvEta=2;
557  }
558  else if( ieta >=8 && ieta < 12 ){
559  hvEta=3;
560  }
561  else if( ieta >=12 && ieta < 16 ){
562  hvEta=4;
563  }
564  else if( ieta >=16 && ieta < 20 ){
565  hvEta=5;
566  }
567  else if( ieta >=20 && ieta < 24 ){
568  hvEta=6;
569  }
570  else if( ieta >=24 && ieta < 28 ){
571  hvEta=7;
572  }
573  }
574  else if( region == 1){
575  //msg(MSG::WARNING) << "==> Invalid HV Eta-Sector for sampling=" << sampling << " Region=" << region << " I(eta)="<< ieta << endmsg;
576  }
577  else{
578  //msg(MSG::WARNING) << "==> Invalid HV Eta-Sector for sampling=" << sampling << " Region=" << region << " I(eta)="<< ieta << endmsg;
579  }
580  }
581 
582  else if( sampling == 0 ){
583  // PreSampler Sampling in Barrel
584  // -----------------------------
585  if( region == 0 ){
586  // OKed by JY Hostachy
587  if( ieta <= 60 ){
588  if( ieta >= 0 && ieta < 15 ){
589  hvEta=1;
590  }
591  else if( ieta >=15 && ieta <30 ){
592  hvEta=2;
593  }
594  else if( ieta >=30 && ieta < 45 ){
595  hvEta=3;
596  }
597  else if( ieta >=45 && ieta < 61 ){
598  hvEta=4;
599  }
600  }
601  else{
602  //msg(MSG::WARNING) << "Not in EMBPS..i(eta)=" << ieta << endmsg;
603  }
604  }
605  }
606  else {
607  //msg(MSG::WARNING) << "Not in Barrel ..." << endmsg;
608  }
609  }
610  else if( abs(l_bec) == 2 || abs(l_bec) == 3){
611  // ENDCAP EMEC
612  // -----------
613  //
614  if( sampling == 3 ){
615  // Sampling 3 OUTER Wheel
616  // -----------------------
617  // Validated on NOV-25-2004 with Djama (CPPM)
618  //
619  if( ieta >= 0 && ieta <= 1){
620  hvEta=1;
621  }
622  else if(ieta >=2 && ieta <= 5){
623  hvEta=2;
624  }
625  else if(ieta >=6 && ieta <= 9){
626  hvEta=3;
627  }
628  else if(ieta >=10 && ieta <= 11){
629  hvEta=4;
630  }
631  else if(ieta >=12 && ieta <= 15){
632  hvEta=5;
633  }
634  else if(ieta >=16 && ieta <= 19){
635  hvEta=6;
636  }
637  }
638  else if( sampling == 2 && abs(l_bec) == 2 ){
639  // Sampling 2 OUTER Wheel
640  // ----------------------
641  //
642  // Validated on NOV-25-2004 with Djama (CPPM)
643  //
644  if(region == 0){
645  hvEta =0;
646  }
647  else if( region == 1 ){
648  // region 1 Sampling 2
649  if( ieta >=0 && ieta <= 2){
650  hvEta=0;
651  }
652  else if( ieta >=3 && ieta <= 6){
653  hvEta=1;
654  }
655  else if( ieta >=7 && ieta <= 15){
656  hvEta=2;
657  }
658  else if( ieta >=16 && ieta <= 23){
659  hvEta=3;
660  }
661  else if( ieta >=24 && ieta <= 27){
662  hvEta=4;
663  }
664  else if( ieta >=28 && ieta <= 35){
665  hvEta=5;
666  }
667  else if( ieta >=36 && ieta <= 42){
668  hvEta=6;
669  }
670  }
671  }
672 
673  else if( sampling == 2 && abs(l_bec) == 3 ){
674  // Sampling 2 INNER Wheel
675  // -----------------------
676  //
677  // Validated on NOV-25-2004 with Djama (CPPM)
678  //
679  if( ieta >=0 && ieta <= 2){
680  hvEta=7;
681  }
682  else if( ieta >=3 && ieta <= 6){
683  hvEta=8;
684  }
685  }
686 
687  else if( sampling == 1 && abs(l_bec) == 3 ){
688  // Sampling 1 INNER Wheel
689  // -----------------------
690  //
691  // Validated on NOV-25-2004 with Djama (CPPM)
692  //
693  if( ieta >=0 && ieta <= 2){
694  hvEta=7;
695  }
696  else if( ieta >=3 && ieta <= 6){
697  hvEta=8;
698  }
699  }
700 
701  else if( sampling == 1 && abs(l_bec) == 2 ){
702  // Sampling 1 OUTER Wheel
703  // -----------------------
704  //
705  if( region == 0 || region == 1)
706  {// 1.375 < eta < 1.5
707  hvEta=0;
708  }
709  else if( region == 2 ){
710  if( ieta >= 0 && ieta <= 31)
711  {
712  // 1.5 < eta < 1.6
713  hvEta = 1;
714  }
715  else if( ieta <= 95) {
716  // 1.6 < eta < 1.8
717  hvEta = 2;
718  }
719  }
720  else if(region == 3){
721  // 1.8 < eta < 2.0
722  hvEta = 3;
723  }
724  else if(region == 4){
725  // 2.0 < eta < 2.4
726  if( ieta >=0 && ieta <= 15 ){
727  // 2.0 < eta < 2.1
728  hvEta = 4;
729  }
730  else if( ieta >= 16 && ieta <= 47 ){
731  // 2.1 < eta < 2.3
732  hvEta = 5;
733  }
734  else if( ieta >= 48 && ieta <= 63 ){
735  // 2.3 < eta < 2.4
736  hvEta = 6;
737  }
738  }
739  else if( region == 5 ){
740  // 2.4 < eta < 2.5
741  hvEta = 6;
742  }
743  }
744  }
745 
746 
747  else if( abs(l_bec)== 20 ){
748  // HEC Wheels
749  //-----------
750  if( sampling == 0 ){
751  hvEta = 1;
752  }
753  else if( sampling == 1){
754  hvEta = 2;
755  }
756  else if( sampling == 2){
757  hvEta = 3;
758  }
759  else if( sampling == 3){
760  hvEta = 4;
761  }
762  }
763  // ============================
764  // FCAL eta bins
765  // eta = [0,62] in Module 1
766  // eta = [0,31] in Module 2
767  // eta = [0,15] in Module 3
768  // ============================
769  else if( abs(l_bec)== 40 ){
770  // FCAL Wheels
771  //-----------
772  if( sampling == 1 ){
773  hvEta = 1;
774  }
775  else if( sampling == 2 ){
776  hvEta = 2;
777  }
778  else if( sampling == 3 ){
779  hvEta = 3;
780  }
781  else{
782  //msg(MSG::WARNING)
783  // << "[getCellEtaSector] invalid FCAL input cell.." << endmsg;
784  }
785  }
786  else{
787  //msg(MSG::WARNING) << "[getCellModule] Detector unknown ! " << endmsg;
788  }
789  // Output
790  //ATH_MSG_DEBUG("Closing getCellEtaSector ...." );
791  return hvEta;
792 }
793 
794 
795 
796 
797 //=====================================================================
799 //=====================================================================
800 // Returns the phi-sector used number for a given cell
801 //
802 // 23-JAN-2007 AL change of convention for EMB :
803 // now returns hv_phi = 0 for FT=-1 (prev. 1)
804 // hv_phi = 1 for FT= 0 (prev. 0)
805 //
806 // 09-FEB-2005 AL fixed for H8 (module A00 rotated)
807 // 09-DEC-2004 AL created from getLArFeefdthrough(int,int,int,int)
808 // - Added H8-EMBPS returning FT=0
809 // - Corrected for reversed order for C-Wheel
810 // 16-DEC-2004 AL added HEC and H6-HEC (which returns 0)
811 // 14-JAN-2005 AL added H6-EMEC
812 // - Added H6-EMEC returning FT=0
813 //=====================================================================
814 {// Start of getCellPhiSector()
815  //ATH_MSG_VERBOSE("Entering getCellPhiSector ...." );
816  //
817  // Get relevant offline fields
818  //
819  int bec =99;
820  int sampling=-99;
821  int region =-99;
822  int phi =-99;
823 
824  if( m_caloHelper->is_em( offId ) ){
825  bec = m_emHelper->barrel_ec(offId);
826  sampling = m_emHelper->sampling(offId);
827  region = m_emHelper->region(offId);
828  phi = m_emHelper->phi(offId);
829  }
830  else if( m_caloHelper->is_hec( offId ) ){
831  bec = m_hecHelper->pos_neg(offId)*10;
832  }
833  else if( m_caloHelper->is_fcal( offId ) ){
834  bec = m_fcalHelper->pos_neg(offId)*20; // ie: +/-40
835  }
836  // Output Argument
837  int hvPhi=-2;
838  //
839  //*** Note*** :
840  //
841  // For EMB, Feedthrough (FT) takes value -1 and 0
842  // Instead, we encode these values as:
843  // FT = -1 --> hvPhiSector = 1
844  // FT = 0 --> hvPhiSector = 0
845  //
846  if( abs(bec) == 1){
847  // EMBARREL
848  //----------
849  if( bec == 1){
850  // WHEEL-A
851  //--------
852  if( sampling == 0 ){
853  // ------------------------------
854  // EMBPS : phiSector not relevant
855  // ------------------------------
856  hvPhi = 0;
857  }
858  if( sampling == 1 && region == 0 ){
859  // ---------------------------------
860  // EM1 Region 0: phi-cells in [0,63]
861  // ---------------------------------
862  //
863  int phi_local = int(phi);
864  for(int ift=0; ift<= 15; ift++){
865  if( phi_local == ift*4 || phi_local == 1+ift*4 ){
866  hvPhi = 0;
867  }
868  if( phi_local == 2+ift*4 || phi_local == 3+ift*4 ){
869  hvPhi = 1;
870  }
871  }
872  }
873  else if( sampling == 2 || sampling == 3 || (sampling == 1 && region == 1 ) ){
874  // ----------------------------------------------
875  // FRONT Region 1 + MIDDLE + BACK Phi in [0,255]
876  // ----------------------------------------------
877  int phi_local = int(phi);
878  for( int ift=0; ift<= 15; ift++){
879  for( int i=0; i<=7; i++){
880  if( phi_local == i+ift*16 ){
881  hvPhi = 0;
882  }
883  }
884  for( int i=8; i<=15; i++){
885  if( phi_local == i+ift*16 ){
886  hvPhi = 1;
887  }
888  }
889  }
890  }
891  }
892 
893  else if( bec == -1){
894  // WHEEL-C
895  //--------
896  if( sampling == 0 ){
897  // ------------------------------
898  // EMBPS : phiSector not relevant
899  // ------------------------------
900  hvPhi = 0;
901  }
902  if( sampling == 1 && region == 0 ){
903  // ---------------------------------------
904  // FRONT (Region 0): phi-cells in [0,63]
905  // ---------------------------------------
906  int phi_local = int(phi);
907  for(int ift=0; ift<= 15; ift++){
908  if( phi_local == ift*4 || phi_local == 1+ift*4 ){
909  hvPhi = 1;
910  }
911  if( phi_local == 2+ift*4 || phi_local == 3+ift*4 ){
912  hvPhi = 0;
913  }
914  }
915  }
916  else if( sampling == 2 || sampling == 3 || (sampling == 1 && region == 1 ) ){
917  // FRONT Region 1 + MIDDLE + BACK Phi in [0,255]
918  int phi_local = int(phi);
919  for( int ift=0; ift<= 15; ift++){
920  for( int i=0; i<=7; i++){
921  if( phi_local == i+ift*16 ){
922  hvPhi = 1;
923  }
924  }
925  for( int i=8; i<=15; i++){
926  if( phi_local == i+ift*16 ){
927  hvPhi = 0;
928  }
929  }
930  }
931  }
932  }
933  }
934 
935  else if( abs(bec) == 2 || abs(bec) == 3 ){
936  // EMEC
937  if( bec > 0 ){
938  // WHEEL-A
939  if( sampling == 1 && abs(bec) == 2 ){
940  // ====================================
941  // Sampling 1 OUTER Wheel
942  // =====================================
943  // 64 cells per SIDE
944  // 8 Modules per side
945  // --> 8 cells / module
946  // 4 FT per module [1,4]
947  // --> 2 cells / FT
948  // =====================================
949  int imod=int(phi/8);
950  int phi_local = phi - imod*8;
951  if( phi_local == 0 || phi_local == 1){
952  hvPhi = 1;
953  }
954  else if( phi_local == 2 || phi_local == 3){
955  hvPhi = 2;
956  }
957  else if( phi_local == 4 || phi_local == 5){
958  hvPhi = 3;
959  }
960  else if( phi_local == 6 || phi_local == 7){
961  hvPhi = 4;
962  }
963  }
964  if( sampling == 1 && abs(bec) == 3 ){
965  // Sampling 1 INNER Wheel (FT in [1,8])
966  // ------------------------------------
967  //
968  int imod=int(phi/8);
969  int phi_local = phi-imod*8;
970  hvPhi = phi_local+1;
971  }
972  else if( sampling == 2 && abs(bec) == 3 ){
973  //
974  // Sampling 2 Inner Wheel (FT in [1,8])
975  // ------------------------------------
976  //
977  int imod=int(phi/8);
978  int phi_local = phi - imod*8;
979  hvPhi = phi_local+1;
980  }
981  else if( sampling == 2 && abs(bec) == 2 ){
982  //
983  // Sampling 2 Outer Wheel (FT in [1,4])
984  // ------------------------------------
985  //
986  int imod = (phi/32);
987  int phi_local= phi-imod*32;
988  if( phi_local >= 0 && phi_local <= 7 ){
989  hvPhi = 1;
990  }
991  else if( phi_local >= 8 && phi_local <= 15 ){
992  hvPhi = 2;
993  }
994  else if( phi_local >= 16 && phi_local <= 23 ){
995  hvPhi = 3;
996  }
997  else if( phi_local >= 24 && phi_local <= 31 ){
998  hvPhi = 4;
999  }
1000  }
1001  else if( sampling == 3 ){
1002  //
1003  // Sampling 3 Outer Wheel (FT in [1,4])
1004  // ------------------------------------
1005  //
1006  int imod = (phi/32);
1007  int phi_local= phi-imod*32;
1008  if( phi_local >= 0 && phi_local <= 7 ){
1009  hvPhi = 1;
1010  }
1011  else if( phi_local >= 8 && phi_local <= 15 ){
1012  hvPhi = 2;
1013  }
1014  else if( phi_local >= 16 && phi_local <= 23 ){
1015  hvPhi = 3;
1016  }
1017  else if( phi_local >= 24 && phi_local <= 31 ){
1018  hvPhi = 4;
1019  }
1020  }
1021  }
1022  else if( bec < 0 ){
1023  // WHEEL-C
1024  if( sampling == 1 && abs(bec) == 2 ){
1025  // Sampling 1 OUTER Wheel (FT in [1,4])
1026  // ------------------------------------
1027  int imod=int(phi/8);
1028  int phi_local = phi-imod*8;
1029  if( phi_local == 0 || phi_local == 1){
1030  hvPhi = 4;
1031  }
1032  else if( phi_local == 2 || phi_local == 3){
1033  hvPhi = 3;
1034  }
1035  else if( phi_local == 4 || phi_local == 5){
1036  hvPhi = 2;
1037  }
1038  else if( phi_local == 6 || phi_local == 7){
1039  hvPhi = 1;
1040  }
1041  }
1042  if( sampling == 1 && abs(bec) == 3 ){
1043  // Sampling 1 INNER Wheel (FT in [1,8])
1044  // ------------------------------------
1045  //
1046  int imod=int(phi/8);
1047  int phi_local = phi - imod*8;
1048  hvPhi = 8-(phi_local);
1049  }
1050  else if( sampling == 2 && abs(bec) == 3 ){
1051  // Sampling 2 Inner Wheel (FT in [1,8])
1052  // ------------------------------------
1053  int imod=int(phi/8);
1054  int phi_local = phi-imod*8;
1055  hvPhi = 8-(phi_local);
1056  }
1057  else if( sampling == 2 && abs(bec) == 2 ){
1058  // Sampling 2 Outer Wheel (FT in [1,4])
1059  // ------------------------------------
1060  int imod = (phi/32);
1061  int phi_local= phi-imod*32;
1062  if( phi_local >= 0 && phi_local <= 7 ){
1063  hvPhi = 4;
1064  }
1065  else if( phi_local >= 8 && phi_local <= 15 ){
1066  hvPhi = 3;
1067  }
1068  else if( phi_local >= 16 && phi_local <= 23 ){
1069  hvPhi = 2;
1070  }
1071  else if( phi_local >= 24 && phi_local <= 31 ){
1072  hvPhi = 1;
1073  }
1074  }
1075  else if( sampling == 3 ){
1076  // Sampling 3 Outer Wheel (FT in [1,4])
1077  // ------------------------------------
1078  int imod = (phi/32);
1079  int phi_local= phi-imod*32;
1080  if( phi_local >= 0 && phi_local <= 7 ){
1081  hvPhi = 4;
1082  }
1083  else if( phi_local >= 8 && phi_local <= 15 ){
1084  hvPhi = 3;
1085  }
1086  else if( phi_local >= 16 && phi_local <= 23 ){
1087  hvPhi = 2;
1088  }
1089  else if( phi_local >= 24 && phi_local <= 31 ){
1090  hvPhi = 1;
1091  }
1092  }
1093  }
1094  }
1095 
1096  else if( abs(bec)==20){
1097  // HEC detector
1098  //------------
1099  // Note: not used because we use the 32 modules instead
1100  hvPhi = 0;
1101  }
1102  else if( abs(bec)==40){
1103  // FCAL detector
1104  //------------
1105  // Note: not used
1106  hvPhi = 0;
1107  }
1108  std::cout<<"Closing getCellPhiSector ...." << hvPhi <<std::endl;
1109  return hvPhi;
1110 }
1111 
1112 
1113 //============================================================================
1114 std::pair<int,int> LArHVIdMapping::getCellElectrodeMinMax( const Identifier &offId ) const
1115 //============================================================================
1116 // Returns a pair <1st_electrode,last_electrode> of a given calo cell
1117 //
1118 // 12-FEB-2007 : AL fixed a bug in HEC
1119 // 02-FEB-2007 : AL added FCAL info *null* (see Zhaoyu)
1120 // 01-FEB-2007 : AL modified HEC info according to TDR 96-41
1121 // *te be checked by an expert*
1122 // 26-JAN-2007 : AL fixed electrode Min,Max for EMBARREL and EMEC
1123 //
1124 // 09-FEB-2005 : AL fixed the H8 inversion problem (rotation of Module 00)
1125 // 07-DEC-2004 : AL fixed A-Wheel (phi_local vs phi_atlas)
1126 // fixed for Reversed order for Barrel C-Wheel
1127 // 15-DEC-2004 : AL added HEC detector
1128 //
1129 //============================================================================
1130 {// get getCell1stElectrode start
1131  //ATH_MSG_VERBOSE("[getCellElectrodeMinMax] Entering..." );
1132 
1133  int l_bec=99;
1134  int l_sampling=-99;
1135  int l_region=-99;
1136  //int l_eta=-99;
1137  int l_phi=-99;
1138 
1139  if( m_caloHelper->is_em( offId ) ){
1140  l_bec = m_emHelper->barrel_ec(offId);
1141  l_sampling = m_emHelper->sampling(offId);
1142  l_region = m_emHelper->region(offId);
1143  //l_eta = m_emHelper->eta(offId);
1144  l_phi = m_emHelper->phi(offId);
1145  }
1146  else if( m_caloHelper->is_hec( offId ) ){
1147  l_bec = m_hecHelper->pos_neg(offId)*10; // +-20
1148  l_sampling = m_hecHelper->sampling(offId);
1149  l_region = m_hecHelper->region(offId);
1150  //l_eta = m_hecHelper->eta(offId);
1151  l_phi = m_hecHelper->phi(offId);
1152  }
1153  else if( m_caloHelper->is_fcal( offId ) ){
1154  l_bec = m_fcalHelper->pos_neg(offId)*20; // +-40
1155  }
1156  // Output argument
1157  // ===============
1158  int ElecMin=-99;
1159  int ElecMax=-99;
1160  if( abs(l_bec) == 1 )
1161  {// if in BARREL
1162  if( l_bec == 1 ) {
1163  // EMBARREL SIDE A
1164  if( l_sampling == 0 || ( l_sampling == 1 && l_region == 0) ){
1165  // ========================================
1166  // - 64 cells-in-phi per SIDE
1167  // - 4 cells-in-phi per MODULE
1168  // - 64 electrodes-in-phi per MODULE
1169  // --> 4 cells of 16 electrodes per CELL
1170  // Examples in *ATLAS* (not H8)
1171  // --> Cell #0 ==> MOD A01 FT=-1 ELEC 0-15
1172  // --> Cell #1 ==> MOD A01 FT=-1 ELEC 16-31
1173  // --> Cell #2 ==> MOD A01 FT=0 ELEC 32-47
1174  // --> Cell #3 ==> MOD A01 FT=0 ELEC 48-64
1175  // ========================================
1176  int phi_module = int((l_phi+2)/4);
1177  int phi_local = l_phi+2 - 4*phi_module;
1178  ElecMin = phi_local*16;
1179  ElecMax = ElecMin + 16-1;
1180  /*
1181  ATH_MSG_DEBUG("[getCellElectrodeMinMax] EMB"
1182  << " Side A " << l_bec
1183  << " Sampling= " << l_sampling
1184  << " Region= " << l_region
1185  << " Module= A" << phi_module
1186  << " Phi/Module= " << phi_local
1187  << " Electrode=[" << ElecMin << "." << ElecMax << "]"
1188  );
1189  */
1190  if( l_sampling == 0 ){
1191  ElecMin = 0;
1192  ElecMax = 0;
1193  }
1194 
1195  }
1196  else if( (l_sampling == 1 && l_region == 1) || l_sampling == 2 || l_sampling == 3 ){
1197  // ==========================================
1198  // - 256 cells-in-phi per SIDE
1199  // - 16 cells-in-phi per MODULE
1200  // - 64 electrode's planes per MODULE
1201  // --> 16 cells of 4 electrodes per CELL
1202  // ==========================================
1203  // --> Cell #0 ==> MOD A01 FT=-1 ELEC 00-03
1204  // --> Cell #1 ==> MOD A01 FT=-1 ELEC 04-07
1205  // --> Cell #2 ==> MOD A01 FT=-1 ELEC 08-11
1206  // --> Cell #3 ==> MOD A01 FT=-1 ELEC 12-15
1207  // --> Cell #4 ==> MOD A01 FT=-1 ELEC 16-19
1208  // --> Cell #5 ==> MOD A01 FT=-1 ELEC 20-23
1209  // --> Cell #6 ==> MOD A01 FT=-1 ELEC 24-27
1210  // --> Cell #7 ==> MOD A01 FT=-1 ELEC 28-31
1211  // --> Cell #8 ==> MOD A01 FT=0 ELEC 32-35
1212  // --> Cell #9 ==> MOD A01 FT=0 ELEC 36-39
1213  // --> Cell#10 ==> MOD A01 FT=0 ELEC 40-43
1214  // --> Cell#11 ==> MOD A01 FT=0 ELEC 44-47
1215  // --> Cell#12 ==> MOD A01 FT=0 ELEC 48-51
1216  // --> Cell#13 ==> MOD A01 FT=0 ELEC 52-55
1217  // --> Cell#14 ==> MOD A01 FT=0 ELEC 56-59
1218  // --> Cell#15 ==> MOD A01 FT=0 ELEC 60-63
1219  // ==========================================
1220  int phi_module = int((l_phi+8)/16);
1221  // shift of 8 cells because Module #0 is rotated by half-module
1222  int phi_local = l_phi+8 - 16*phi_module;
1223  ElecMin = phi_local * 4;
1224  ElecMax = ElecMin + 4 - 1;
1225  /*
1226  ATH_MSG_DEBUG("[getCellElectrodeMinMax] EMB"
1227  << " Side A " << l_bec
1228  << " Sampling= " << l_sampling
1229  << " Region= " << l_region
1230  << " Phi/Module= " << phi_local
1231  << " Module= A" << phi_module
1232  << " Electrode=[" << ElecMin << "." << ElecMax << "]"
1233  );
1234  */
1235  }
1236  }
1237 
1238  else if( l_bec == -1){
1239  //=====================
1240  //=====================
1241  // EMBARREL SIDE C
1242  //=====================
1243  //=====================
1244  // Phi in module is reversed going from left to right
1245  // in the MODULE frame
1246  if( l_sampling == 0 || ( l_sampling == 1 && l_region == 0) ){
1247  // ========================================
1248  // SAMPLING 0
1249  // - 64 cells-in-phi per DETECTOR
1250  // - 4 cells-in-phi per MODULE
1251  // - 64 electrodes-in-phi per MODULE
1252  // --> 4 cells of 16 electrodes per CELL
1253  // ========================================
1254  // --> Cell #0 ==> MOD C01 FT=-1 ELEC 0-15
1255  // --> Cell #1 ==> MOD C01 FT=-1 ELEC 16-31
1256  // --> Cell #2 ==> MOD C01 FT=0 ELEC 32-47
1257  // --> Cell #3 ==> MOD C01 FT=0 ELEC 48-64
1258  // ========================================
1259  int phi_module = int((l_phi+2)/4);
1260  int phi_local = (l_phi+2 - 4*phi_module) ;
1261  ElecMin = 48-phi_local*16;
1262  ElecMax = ElecMin + 16 - 1;
1263  /*
1264  ATH_MSG_DEBUG("[getCellElectrodeMinMax] EMB"
1265  << " Side C " << l_bec
1266  << " Sampling= " << l_sampling
1267  << " Region= " << l_region
1268  << " Module= C" << phi_module
1269  << " Phi/Module= " << phi_local
1270  << " Electrode=[" << ElecMin << "." << ElecMax << "]"
1271  );
1272  */
1273  if( l_sampling == 0 ){
1274  ElecMin = 0;
1275  ElecMax = 0;
1276  }
1277  }
1278  else if( (l_sampling == 1 && l_region == 1) || l_sampling == 2 || l_sampling == 3 ){
1279  //===========================================
1280  // - 256 cells-in-phi per SIDE
1281  // - 16 cells-in-phi per MODULE
1282  // - 64 electrodes-in-phi per MODULE
1283  // --> 16 cells of 4 electrodes per CELL
1284  // Cell[electrodes]: 0[0,3],1[4,7],2[8,11],3[12,15]..etc...
1285  //===========================================
1286  // --> Cell #0 ==> MOD C01 FT=-1 ELEC 00-03
1287  // --> Cell #1 ==> MOD C01 FT=-1 ELEC 04-07
1288  // --> Cell #2 ==> MOD C01 FT=-1 ELEC 08-11
1289  // --> Cell #3 ==> MOD C01 FT=-1 ELEC 12-15
1290  // --> Cell #4 ==> MOD C01 FT=-1 ELEC 16-19
1291  // --> Cell #5 ==> MOD C01 FT=-1 ELEC 20-23
1292  // --> Cell #6 ==> MOD C01 FT=-1 ELEC 24-27
1293  // --> Cell #7 ==> MOD C01 FT=-1 ELEC 28-31
1294  // --> Cell #8 ==> MOD C01 FT=0 ELEC 32-35
1295  // --> Cell #9 ==> MOD C01 FT=0 ELEC 36-39
1296  // --> Cell#10 ==> MOD C01 FT=0 ELEC 40-43
1297  // --> Cell#11 ==> MOD C01 FT=0 ELEC 44-47
1298  // --> Cell#12 ==> MOD C01 FT=0 ELEC 48-51
1299  // --> Cell#13 ==> MOD C01 FT=0 ELEC 52-55
1300  // --> Cell#14 ==> MOD C01 FT=0 ELEC 56-59
1301  // --> Cell#15 ==> MOD C01 FT=0 ELEC 60-63
1302  //===========================================
1303  int phi_module = int((l_phi+8)/16);
1304  int phi_local = (l_phi+8 - 16*phi_module);
1305  // Just to get the right MOD id (electrode plane is idem to A-side)
1306  // Do not use to compute local Phi
1307  if( phi_module <= 8){
1308  phi_module = 8 - phi_module;
1309  }
1310  else{
1311  phi_module = 24 - phi_module;
1312  }
1313  ElecMin = 60-phi_local * 4;
1314  ElecMax = ElecMin + 4 - 1;
1315  /*
1316  ATH_MSG_DEBUG("[getCellElectrodeMinMax] EMB"
1317  << " Side C " << l_bec
1318  << " Sampling= " << l_sampling
1319  << " Region= " << l_region
1320  << " Module= C" << phi_module
1321  << " Phi/Module= " << phi_local
1322  << " Electrode=[" << ElecMin << "." << ElecMax << "]"
1323  );
1324  */
1325  }
1326  }
1327  }
1328  // ======================================
1329  // ======================================
1330  // EM ENDCAP (A+C SIDES)
1331  // ======================================
1332  // ======================================
1333  else if(abs(l_bec) == 2 || abs(l_bec) == 3){
1334  // EMEC
1335  if( l_bec == 2 ){// bec==2
1336  //======================
1337  // A-SIDE / OUTER WHEEL
1338  //======================
1339  if( l_sampling == 0 ||
1340  (l_sampling == 1 && l_region >= 0 && l_region <= 5) ){
1341  //=============================
1342  // 64 cells per SIDE
1343  // 8 Modules per SIDE
1344  // -> 8 cells / module
1345  // 768 electrodes for 64 cells
1346  // -> 96 electrodes per module
1347  // -> 12 electrodes per cell
1348  //=============================
1349  // --> Cell #0 ==> ELEC 00-11
1350  // --> Cell #1 ==> ELEC 12-23
1351  // --> Cell #2 ==> ELEC 24-35
1352  // --> Cell #3 ==> ELEC 36-47
1353  // --> Cell #4 ==> ELEC 48-59
1354  // --> Cell #5 ==> ELEC 60-71
1355  // --> Cell #6 ==> ELEC 72-83
1356  // --> Cell #7 ==> ELEC 84-95
1357  //=============================
1358  int phi_module = int(l_phi/8);
1359  int phi_local = l_phi - 8*phi_module;
1360  ElecMin = phi_local * 12;
1361  ElecMax = ElecMin + 12 - 1;
1362  /*
1363  ATH_MSG_DEBUG("[getCellElectrodeMinMax] EMEC"
1364  << " Side A " << l_bec
1365  << " Sampling= " << l_sampling
1366  << " Region= " << l_region
1367  << " Module= A" << phi_module
1368  << " FT= " << phi_local
1369  << " Electrode=[" << ElecMin << "." << ElecMax << "]"
1370  );
1371  */
1372 
1373  }
1374  else if( l_sampling == 2 || l_sampling == 3){
1375  //=============================
1376  // 256 cells per SIDE
1377  // 8 Modules per SIDE
1378  // --> 32 cells per module
1379  // 768 electrodes for 256 cells
1380  // --> 96 electrodes per module
1381  // --> 3 electrodes per cell
1382  //=============================
1383  // --> Cell #0 ==> ELEC 00-02
1384  // --> Cell #1 ==> ELEC 03-05
1385  // --> Cell #2 ==> ELEC 06-08
1386  // ...
1387  // --> Cell #31 => ELEC 92-95
1388  //=============================
1389  int phi_module = int(l_phi/32);
1390  int phi_local = l_phi - 32*phi_module;
1391  ElecMin = phi_local*3;
1392  ElecMax = ElecMin+3-1;
1393  /*
1394  ATH_MSG_DEBUG("[getCellElectrodeMinMax] EMEC"
1395  << " Side A " << l_bec
1396  << " Sampling= " << l_sampling
1397  << " Region= " << l_region
1398  << " Module= A" << phi_module
1399  << " Phi/Module= " << phi_local
1400  << " Electrode=[" << ElecMin << "." << ElecMax << "]"
1401  );
1402 
1403  */
1404  }
1405  }
1406  else if( l_bec == 3 ){
1407  // =================
1408  // INNER WHEEL
1409  // =================
1410  if( l_sampling == 1 || l_sampling == 2 || l_sampling == 0 ){
1411  //====================================
1412  // 64 cells per SIDE
1413  // 8 module per SIDE
1414  // -> 8 cells per Module
1415  // 256 electrodes for 8 modules
1416  // --> 32 electrodes per module
1417  // --> 4 electrodes per cell
1418  //====================================
1419  // --> Cell #0 ==> ELEC 00-03
1420  // --> Cell #1 ==> ELEC 04-07
1421  // --> Cell #2 ==> ELEC 08-11
1422  // ...
1423  // --> Cell #7 ==> ELEC 28-31
1424  //====================================
1425  int phi_module = int(l_phi/8);
1426  int phi_local = l_phi - 8*phi_module;
1427  ElecMin = phi_local *4;
1428  ElecMax = ElecMin + 4 - 1;
1429  /*
1430  ATH_MSG_DEBUG("[getCellElectrodeMinMax] EMEC"
1431  << " Side A " << l_bec
1432  << " Sampling= " << l_sampling
1433  << " Region= " << l_region
1434  << " Module= A" << phi_module
1435  << " Phi/Module= " << phi_local
1436  << " Electrode=[" << ElecMin << "." << ElecMax << "]"
1437  );
1438  */
1439  }
1440  }
1441  else if( l_bec == -2 ){
1442  //========================
1443  // C-SIDE OUTER WHEEL
1444  //========================
1445  if( l_sampling == 0 || (l_sampling == 1 && l_region >= 0 && l_region <= 5) ){
1446  //=============================
1447  // 64 cells per SIDE
1448  // 8 Modules per SIDE
1449  // -> 8 cells / module
1450  // 768 electrodes for 64 cells
1451  // -> 96 electrodes per module
1452  // -> 12 electrodes per cell
1453  //=============================
1454  // --> Cell #0 ==> ELEC 00-11
1455  // --> Cell #1 ==> ELEC 12-23
1456  // --> Cell #2 ==> ELEC 24-35
1457  // --> Cell #3 ==> ELEC 36-47
1458  // --> Cell #4 ==> ELEC 48-59
1459  // --> Cell #5 ==> ELEC 60-71
1460  // --> Cell #6 ==> ELEC 72-83
1461  // --> Cell #7 ==> ELEC 84-95
1462  //=============================
1463  int phi_module = int(l_phi/8);
1464  int phi_local = 7 - (l_phi - 8*phi_module);
1465  ElecMin = phi_local * 12;
1466  ElecMax = ElecMin + 12 - 1;
1467  /*
1468  ATH_MSG_DEBUG("[getCellElectrodeMinMax] EMEC"
1469  << " Side C " << l_bec
1470  << " Sampling= " << l_sampling
1471  << " Region= " << l_region
1472  << " Module= C" << phi_module
1473  << " Phi/Module= " << phi_local
1474  << " Electrode=[" << ElecMin << "." << ElecMax << "]"
1475  );
1476 
1477  */
1478  }
1479  else if( l_sampling == 2 || l_sampling == 3){
1480  //=============================
1481  // 256 cells per SIDE
1482  // 8 Modules per SIDE
1483  // --> 32 cells per module
1484  // 768 electrodes for 256 cells
1485  // --> 96 electrodes per module
1486  // --> 3 electrodes per cell
1487  //=============================
1488  // --> Cell #0 ==> ELEC 00-02
1489  // --> Cell #1 ==> ELEC 03-05
1490  // --> Cell #2 ==> ELEC 06-08
1491  // ...
1492  // --> Cell #31 => ELEC 92-95
1493  //=============================
1494  int phi_module = int(l_phi/32);
1495  int phi_local = 31 - (l_phi - 32*phi_module);
1496  ElecMin = phi_local*3;
1497  ElecMax = ElecMin + 3 - 1;
1498  /*
1499  ATH_MSG_DEBUG("[getCellElectrodeMinMax] EMEC"
1500  << " Side C " << l_bec
1501  << " Sampling= " << l_sampling
1502  << " Region= " << l_region
1503  << " Module= C" << phi_module
1504  << " Phi/Module= " << phi_local
1505  << " Electrode=[" << ElecMin << "." << ElecMax << "]"
1506  );
1507  */
1508  }
1509  }
1510  else if( l_bec == -3 ){
1511  // INNER WHEEL C
1512  if( l_sampling == 1 || l_sampling == 2 || l_sampling == 0 ){
1513  // 256 electrodes for 64 cells
1514  // --> 8 cells per module
1515  // --> 32 electrodes per module
1516  // --> 4 electrodes per cell
1517  int phi_module = int(l_phi/8);
1518  int phi_local = l_phi - 8*phi_module;
1519  ElecMin = 28 - phi_local *4;
1520  ElecMax = ElecMin + 4 -1;
1521  /*
1522  ATH_MSG_DEBUG("[getCellElectrodeMinMax] EMEC"
1523  << " Side C " << l_bec
1524  << " Sampling= " << l_sampling
1525  << " Region= " << l_region
1526  << " Module= C" << phi_module
1527  << " Phi/Module= " << phi_local
1528  << " Electrode=[" << ElecMin << "." << ElecMax << "]"
1529  );
1530  */
1531  }
1532  }
1533  }
1534  else if( abs(l_bec)==20 ){// HEC
1535  //==========================
1536  // HEC wheels
1537  //==========================
1538  // Sampling 0 & 1 : 1st wheel
1539  // Sampling 2 & 3 : 2nd wheel
1540  // l_region 0 : Outer
1541  // region 1 : Inner
1542  //==========================
1543  if( l_sampling == 0){
1544  // ======================
1545  // Sampling 0 , region 0
1546  // * 1st wheel *
1547  // 64 cells per SIDE
1548  // 32 module per SIDE
1549  // -> 2 cells in phi per Module
1550  // 8 electrode's planes
1551  // -> 8 electrode's planes per cell !
1552  // ================================
1553  // Made using Fig. 8-1 in TDR 96-41
1554  // ================================
1555  //ElecMin = l_eta+1;
1556  //ElecMax = ElecMin + 4;
1557  ElecMin = 1;
1558  ElecMax = 8;
1559  // Note : idem for region 0 and region 1
1560  }
1561  else if( l_sampling == 1){
1562  // ====================
1563  // sampling 1 l_region 0
1564  // * 1st wheel *
1565  // 64 cells in phi per SIDE
1566  // 10 cells in eta per SIDE
1567  // 32 modules per SIDE
1568  // -> 2x10 cells per module
1569  // 16 electrode's planes per module
1570  // ================================
1571  // Made using Fig. 8-1 in TDR 96-41
1572  // ================================
1573  ElecMin = 9;
1574  ElecMax =24;
1575  // Note : idem for region 0 and region 1
1576  }
1577  else if( l_sampling == 2){
1578  // ====================
1579  // sampling 2 region 0
1580  // * 2nd wheel *
1581  // 64 cells in phi per SIDE
1582  // 10 cells in eta per SIDE
1583  // 32 modules in phi per SIDE
1584  // 16 electrode's plane
1585  // ================================
1586  // Made using Fig. 8-1 in TDR 96-41
1587  // ================================
1588  // Note : idem for region 0 and region 1
1589  ElecMin = 25;
1590  ElecMax = 32;
1591  }
1592  else if( l_sampling == 3){
1593  // ==============================
1594  // index starting at 2 thus the 32-2=20
1595  // 2 cells in phi per module
1596  // 8 electrode per module
1597  // ie: 4 electrodes per cell
1598  // ==============================
1599  // Note : idem for region 0 and region 1
1600  ElecMin = 33;
1601  ElecMax = 40;
1602  }
1603  } // HEC
1604  else if( abs(l_bec)==40 ){// FCAL
1605  ElecMin = 0;
1606  ElecMax = 0;
1607  }
1608  else{
1609  //msg(MSG::WARNING)
1610  // << "[getCellElectrodeMinMax] Detector unknown .."
1611  // << endmsg;
1612  }
1613  //ATH_MSG_DEBUG("[getCellElectrodeMinMax] Exiting..." );
1614  std::pair<int, int> electrodeMinMax( ElecMin, ElecMax);
1615  return electrodeMinMax;
1616 }
1617 
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
LArHVIdMapping::getCellEtaSector
int getCellEtaSector(const Identifier &offId) const
Definition: LArHVIdMapping.cxx:430
CaloCell_ID::em_idHelper
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition: CaloCell_ID.h:63
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
LArHVIdMapping::m_hecHelper
const LArHEC_ID * m_hecHelper
Definition: LArHVIdMapping.h:51
LArElectrodeID
Helper for the Liquid Argon Calorimeter cell at the electrode level.
Definition: LArElectrodeID.h:101
LArHVIdMapping::m_fcalHelper
const LArFCAL_ID * m_fcalHelper
Definition: LArHVIdMapping.h:52
LArHVIdMapping::getCellModule
int getCellModule(const Identifier &offId) const
returns the Module of a given offId
Definition: LArHVIdMapping.cxx:108
LArHVIdMapping::getLArHVLineID
const HWIdentifier getLArHVLineID(HWIdentifier &electrodeId) const
Return the LArHVLineID corresponding to a given LArElectrodeId.
Definition: LArHVIdMapping.cxx:22
LArHVLineID.h
HWIdentifier
Definition: HWIdentifier.h:13
CaloCell_ID.h
CaloCell_ID::hec_idHelper
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Definition: CaloCell_ID.h:69
LArHVIdMapping::m_caloHelper
const CaloCell_ID * m_caloHelper
Definition: LArHVIdMapping.h:49
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArHVIdMapping.h
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
LArHVIdMapping::m_emHelper
const LArEM_ID * m_emHelper
Definition: LArHVIdMapping.h:50
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
LArHVIdMapping::getCellElectrodeMinMax
std::pair< int, int > getCellElectrodeMinMax(const Identifier &offId) const
Definition: LArHVIdMapping.cxx:1114
LArHVIdMapping::getCellPhiSector
int getCellPhiSector(const Identifier &offId) const
Definition: LArHVIdMapping.cxx:798
LArElectrodeID.h
LArHVIdMapping::LArHVIdMapping
LArHVIdMapping()=delete
LArHVIdMapping::getLArElectrodeIDvec
const std::vector< HWIdentifier > & getLArElectrodeIDvec(HWIdentifier &hvlineId) const
Return a vector of LArElectrodeID corresponding to a given LArHVLineID.
Definition: LArHVIdMapping.cxx:84
CaloCell_ID::fcal_idHelper
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Definition: CaloCell_ID.h:75
Identifier
Definition: IdentifierFieldParser.cxx:14
LArHVLineID
Helper for the Liquid Argon Calorimeter High-Voltage identifiers.
Definition: LArHVLineID.h:48