CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
TEcnaNumbering Class Reference

#include <TEcnaNumbering.h>

Inheritance diagram for TEcnaNumbering:

Public Member Functions

void BuildBarrelCrysTable ()
 
void BuildEndcapCrysTable ()
 
void BuildEndcapSCTable ()
 
Int_t Get0SMEchaFrom1SMTowAnd0TowEcha (const Int_t &, const Int_t &)
 
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha (const Int_t &, const Int_t &)
 
Int_t Get0TowEchaFrom0SMEcha (const Int_t &)
 
Int_t Get0TowEchaFrom1SMCrys (const Int_t &)
 
Int_t Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha (const Int_t &, const Int_t &, const TString &)
 
Int_t Get1DeeSCEcnaFrom0DeeEcha (const Int_t &)
 
Int_t Get1DeeSCEcnaFrom1DeeCrys (const Int_t &, const TString &)
 
Int_t Get1DeeSCEcnaFromDeeSCCons (const Int_t &, const Int_t &)
 
Int_t Get1SCEchaFrom0DeeEcha (const Int_t &)
 
Int_t Get1SCEchaFrom1DeeCrys (const Int_t &, const TString &)
 
Int_t Get1SMCrysFrom1SMTowAnd0TowEcha (const Int_t &, const Int_t &)
 
Int_t Get1SMTowFrom0SMEcha (const Int_t &)
 
Int_t Get1SMTowFrom1SMCrys (const Int_t &)
 
Int_t Get1StexCrysFrom1StexStinAnd0StinEcha (const Int_t &, const Int_t &, const Int_t &)
 
Int_t Get1StexStinFrom0StexEcha (const Int_t &)
 
Int_t GetDeeDirIndex (const TString &)
 
TString GetDeeDirViewedFromIP (const Int_t &)
 
TString GetDeeHalfEndcap (const Int_t &)
 
Int_t GetDeeSCConsFrom1DeeSCEcna (const Int_t &, const Int_t &)
 
Int_t GetDeeSCConsFrom1DeeSCEcna (const Int_t &, const Int_t &, const Int_t &)
 
Int_t GetDSFrom1DeeSCEcna (const Int_t &, const Int_t &)
 
Int_t GetDSFromFED (const Int_t &)
 
Int_t GetDSSCFrom1DeeSCEcna (const Int_t &, const Int_t &, const Int_t &)
 
Int_t GetDSSCFrom1DeeSCEcna (const Int_t &, const Int_t &)
 
TString GetEEDeeEndcap (const Int_t &)
 
TString GetEEDeeType (const Int_t &)
 
Double_t GetEta (const Int_t &, const Int_t &, const Int_t &)
 
Double_t GetEtaMax (const Int_t &, const Int_t &)
 
Double_t GetEtaMin (const Int_t &, const Int_t &)
 
Int_t GetHashedNumberFromIEtaAndIPhi (const Int_t &, const Int_t &)
 
Int_t GetIEtaFromHashed (const Int_t &, const Int_t &)
 
Double_t GetIEtaMax (const Int_t &, const Int_t &)
 
Double_t GetIEtaMax (const Int_t &)
 
Double_t GetIEtaMin (const Int_t &, const Int_t &)
 
Double_t GetIEtaMin (const Int_t &)
 
Double_t GetIHocoMax (const Int_t &, const Int_t &)
 
Double_t GetIHocoMin (const Int_t &, const Int_t &)
 
Double_t GetIIXMax (const Int_t &)
 
Double_t GetIIXMax ()
 
Double_t GetIIXMin (const Int_t &)
 
Double_t GetIIXMin ()
 
Int_t GetIPhiFromHashed (const Int_t &)
 
Int_t GetIXCrysInDee (const Int_t &, const Int_t &, const Int_t &)
 
Int_t GetIXCrysInSC (const Int_t &, const Int_t &, const Int_t &)
 
Int_t GetIXSCInDee (const Int_t &)
 
Double_t GetJIYMax (const Int_t &, const Int_t &)
 
Double_t GetJIYMax (const Int_t &)
 
Double_t GetJIYMin (const Int_t &, const Int_t &)
 
Double_t GetJIYMin (const Int_t &)
 
Double_t GetJPhiMax (const Int_t &, const Int_t &)
 
Double_t GetJPhiMax (const Int_t &)
 
Double_t GetJPhiMin (const Int_t &, const Int_t &)
 
Double_t GetJPhiMin (const Int_t &)
 
Double_t GetJVecoMax (const Int_t &, const Int_t &)
 
Double_t GetJVecoMin (const Int_t &, const Int_t &)
 
Int_t GetJYCrysInDee (const Int_t &, const Int_t &, const Int_t &)
 
Int_t GetJYCrysInSC (const Int_t &, const Int_t &, const Int_t &)
 
TString GetJYDirectionEB (const Int_t &)
 
TString GetJYDirectionEE (const Int_t &)
 
Int_t GetJYSCInDee (const Int_t &)
 
Int_t GetMaxSCInDS (const Int_t &)
 
Double_t GetPhi (const Int_t &, const Int_t &, const Int_t &)
 
Double_t GetPhiInSM (const Int_t &, const Int_t &, const Int_t &)
 
Double_t GetPhiMax (const Int_t &, const Int_t &)
 
Double_t GetPhiMax (const Int_t &)
 
Double_t GetPhiMin (const Int_t &, const Int_t &)
 
Double_t GetPhiMin (const Int_t &)
 
TString GetSCQuadFrom1DeeSCEcna (const Int_t &)
 
Int_t GetSCQuadTypeIndex (const TString &, const TString &)
 
TString GetSCType (const Int_t &)
 
Double_t GetSMCentralPhi (const Int_t &)
 
Int_t GetSMFromFED (const Int_t &)
 
TString GetSMHalfBarrel (const Int_t &)
 
TString GetStexHalfStas (const Int_t &)
 
TString GetStinLvrbType (const Int_t &)
 
TString GetTowerLvrbType (const Int_t &)
 
Double_t GetVecoMax (const Int_t &, const Int_t &)
 
Double_t GetVecoMin (const Int_t &, const Int_t &)
 
TString GetXDirectionEB (const Int_t &)
 
TString GetXDirectionEE (const Int_t &)
 
TString GetYDirectionEB (const Int_t &)
 
TString GetYDirectionEE (const Int_t &)
 
Int_t MaxCrysInStinEcna (const Int_t &, const Int_t &, const TString &)
 
Int_t PlusMinusSMNumber (const Int_t &)
 
void SetEcalSubDetector (const TString &)
 
void SetEcalSubDetector (const TString &, TEcnaParEcal *)
 
Int_t StexEchaForCons (const Int_t &, const Int_t &)
 
 TEcnaNumbering ()
 
 TEcnaNumbering (TEcnaObject *, const TString &)
 
 TEcnaNumbering (const TString &, TEcnaParEcal *)
 
 ~TEcnaNumbering () override
 

Protected Member Functions

void Init ()
 

Private Attributes

Int_t fCdelete
 
Int_t fCnew
 
TString fCodeChNumberingITP1Bot
 
TString fCodeChNumberingITP2Top
 
TString fCodeChNumberingLvrbBot
 
TString fCodeChNumberingLvrbTop
 
TEcnaParEcalfEcal
 
Int_t fFlagPrint
 
TString fFlagSubDet
 
Int_t fgMaxCar
 
Int_t * fT1d_DeeSCCons
 
Int_t * fT1d_DS
 
Int_t * fT1d_DSSC
 
Int_t * fT1d_ich_IX
 
Int_t * fT1d_jch_JY
 
Int_t * fT1d_RecovDeeSC
 
Int_t * fT1dDeeCrys
 
Int_t * fT1dDeeSC
 
Int_t * fT1dSCEcha
 
Int_t * fT1dSMCrys
 
Int_t * fT1dSMTow
 
Int_t * fT1dTowEcha
 
Int_t ** fT2d_DeeSCCons
 
Int_t ** fT2d_DS
 
Int_t ** fT2d_DSSC
 
Int_t ** fT2d_ich_IX
 
Int_t ** fT2d_jch_JY
 
Int_t ** fT2d_RecovDeeSC
 
Int_t ** fT2dDeeCrys
 
Int_t ** fT2dDeeSC
 
Int_t ** fT2dSCEcha
 
Int_t ** fT2dSMCrys
 
Int_t *** fT3dDeeCrys
 
TString fTTBELL
 

Detailed Description


TEcnaNumbering.h Update: 05/10/2012 Author: B.Fabbro (berna.nosp@m.rd.f.nosp@m.abbro.nosp@m.@cea.nosp@m..fr) DSM/IRFU/SPP CEA-Saclay Copyright: Those valid for CEA sofware

ECNA web page: http://cms-fabbro.web.cern.ch/cms-fabbro/

cna_new/Correlated_Noise_Analysis/ECNA_main_page.htm

Definition at line 23 of file TEcnaNumbering.h.

Constructor & Destructor Documentation

◆ TEcnaNumbering() [1/3]

TEcnaNumbering::TEcnaNumbering ( )

Definition at line 34 of file TEcnaNumbering.cc.

References Init().

34  {
35  // Constructor without argument: call to method Init()
36 
37  // std::cout << "[Info Management] CLASS: TEcnaNumbering. CREATE OBJECT: this = " << this << std::endl;
38 
39  Init();
40 }

◆ TEcnaNumbering() [2/3]

TEcnaNumbering::TEcnaNumbering ( TEcnaObject pObjectManager,
const TString &  SubDet 
)

Definition at line 42 of file TEcnaNumbering.cc.

References fEcal, TEcnaObject::GetPointerValue(), Init(), TEcnaObject::RegisterPointer(), SetEcalSubDetector(), and ntupleEnum::SubDet.

42  {
43  // Constructor with argument: call to methods Init() and SetEcalSubDetector(const TString&)
44 
45  // std::cout << "[Info Management] CLASS: TEcnaNumbering. CREATE OBJECT: this = " << this << std::endl;
46 
47  Init();
48  Long_t i_this = (Long_t)this;
49  pObjectManager->RegisterPointer("TEcnaNumbering", i_this);
50 
51  //............................ fEcal => to be changed in fParEcal
52  fEcal = nullptr;
53  Long_t iParEcal = pObjectManager->GetPointerValue("TEcnaParEcal");
54  if (iParEcal == 0) {
55  fEcal = new TEcnaParEcal(pObjectManager, SubDet.Data()); /*fCnew++*/
56  } else {
57  fEcal = (TEcnaParEcal*)iParEcal;
58  }
59 
60  SetEcalSubDetector(SubDet.Data());
61 }
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:100
TEcnaParEcal * fEcal
void SetEcalSubDetector(const TString &)
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:209

◆ TEcnaNumbering() [3/3]

TEcnaNumbering::TEcnaNumbering ( const TString &  SubDet,
TEcnaParEcal pEcal 
)

Definition at line 63 of file TEcnaNumbering.cc.

References Init(), SetEcalSubDetector(), and ntupleEnum::SubDet.

63  {
64  // Constructor with argument: call to methods Init() and SetEcalSubDetector(const TString&)
65 
66  // std::cout << "[Info Management] CLASS: TEcnaNumbering. CREATE OBJECT: this = " << this << std::endl;
67 
68  Init();
69  SetEcalSubDetector(SubDet.Data(), pEcal);
70 }
void SetEcalSubDetector(const TString &)

◆ ~TEcnaNumbering()

TEcnaNumbering::~TEcnaNumbering ( )
override

Definition at line 73 of file TEcnaNumbering.cc.

References fCdelete, fT1d_DeeSCCons, fT1d_DS, fT1d_DSSC, fT1d_ich_IX, fT1d_jch_JY, fT1d_RecovDeeSC, fT1dDeeCrys, fT1dDeeSC, fT1dSCEcha, fT1dSMCrys, fT1dSMTow, fT1dTowEcha, fT2d_DeeSCCons, fT2d_DS, fT2d_DSSC, fT2d_ich_IX, fT2d_jch_JY, fT2d_RecovDeeSC, fT2dDeeCrys, fT2dDeeSC, fT2dSCEcha, fT2dSMCrys, and fT3dDeeCrys.

73  {
74  //destructor
75 
76  //if (fEcal != 0){delete fEcal; fCdelete++;}
77 
78  //....................... Barrel
79  if (fT2dSMCrys != nullptr) {
80  delete[] fT2dSMCrys;
81  fCdelete++;
82  }
83  if (fT1dSMCrys != nullptr) {
84  delete[] fT1dSMCrys;
85  fCdelete++;
86  }
87  if (fT1dSMTow != nullptr) {
88  delete[] fT1dSMTow;
89  fCdelete++;
90  }
91  if (fT1dTowEcha != nullptr) {
92  delete[] fT1dTowEcha;
93  fCdelete++;
94  }
95 
96  //....................... Endcap
97  if (fT3dDeeCrys != nullptr) {
98  delete[] fT3dDeeCrys;
99  fCdelete++;
100  }
101  if (fT2dDeeCrys != nullptr) {
102  delete[] fT2dDeeCrys;
103  fCdelete++;
104  }
105  if (fT1dDeeCrys != nullptr) {
106  delete[] fT1dDeeCrys;
107  fCdelete++;
108  }
109  if (fT2dDeeSC != nullptr) {
110  delete[] fT2dDeeSC;
111  fCdelete++;
112  }
113  if (fT1dDeeSC != nullptr) {
114  delete[] fT1dDeeSC;
115  fCdelete++;
116  }
117  if (fT2dSCEcha != nullptr) {
118  delete[] fT2dSCEcha;
119  fCdelete++;
120  }
121  if (fT1dSCEcha != nullptr) {
122  delete[] fT1dSCEcha;
123  fCdelete++;
124  }
125  if (fT2d_jch_JY != nullptr) {
126  delete[] fT2d_jch_JY;
127  fCdelete++;
128  }
129  if (fT1d_jch_JY != nullptr) {
130  delete[] fT1d_jch_JY;
131  fCdelete++;
132  }
133  if (fT2d_ich_IX != nullptr) {
134  delete[] fT2d_ich_IX;
135  fCdelete++;
136  }
137  if (fT1d_ich_IX != nullptr) {
138  delete[] fT1d_ich_IX;
139  fCdelete++;
140  }
141  if (fT2d_DS != nullptr) {
142  delete[] fT2d_DS;
143  fCdelete++;
144  }
145  if (fT1d_DS != nullptr) {
146  delete[] fT1d_DS;
147  fCdelete++;
148  }
149  if (fT2d_DSSC != nullptr) {
150  delete[] fT2d_DSSC;
151  fCdelete++;
152  }
153  if (fT1d_DSSC != nullptr) {
154  delete[] fT1d_DSSC;
155  fCdelete++;
156  }
157  if (fT2d_DeeSCCons != nullptr) {
158  delete[] fT2d_DeeSCCons;
159  fCdelete++;
160  }
161  if (fT1d_DeeSCCons != nullptr) {
162  delete[] fT1d_DeeSCCons;
163  fCdelete++;
164  }
165  if (fT2d_RecovDeeSC != nullptr) {
166  delete[] fT2d_RecovDeeSC;
167  fCdelete++;
168  }
169  if (fT1d_RecovDeeSC != nullptr) {
170  delete[] fT1d_RecovDeeSC;
171  fCdelete++;
172  }
173 
174  // std::cout << "[Info Management] CLASS: TEcnaNumbering. DESTROY OBJECT: this = " << this << std::endl;
175 }
Int_t * fT1dSCEcha
Int_t ** fT2d_DS
Int_t * fT1dDeeCrys
Int_t * fT1d_ich_IX
Int_t ** fT2d_ich_IX
Int_t ** fT2d_RecovDeeSC
Int_t * fT1d_DeeSCCons
Int_t ** fT2dDeeSC
Int_t ** fT2d_DSSC
Int_t * fT1dSMCrys
Int_t ** fT2d_jch_JY
Int_t * fT1d_RecovDeeSC
Int_t * fT1d_jch_JY
Int_t * fT1dTowEcha
Int_t ** fT2d_DeeSCCons
Int_t ** fT2dDeeCrys
Int_t ** fT2dSMCrys
Int_t *** fT3dDeeCrys
Int_t ** fT2dSCEcha

Member Function Documentation

◆ BuildBarrelCrysTable()

void TEcnaNumbering::BuildBarrelCrysTable ( )

Definition at line 272 of file TEcnaNumbering.cc.

References fCdelete, fCnew, fEcal, fT1dSMCrys, fT1dSMTow, fT1dTowEcha, fT2dSMCrys, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, callgraph::m2, TEcnaParEcal::MaxCrysInSM(), TEcnaParEcal::MaxCrysInTow(), and TEcnaParEcal::MaxTowInSM().

Referenced by Get1SMCrysFrom1SMTowAnd0TowEcha(), and SetEcalSubDetector().

272  {
273  // Build the correspondance table: SMCrys <-> (SMTow, TowEcha) for the ECAL BARREL
274  //
275  // From CMS Internal Note "CMS ECAL Barrel channel numbering"
276  //
277  // Name Number Reference set Range Comment
278  //
279  // SMTow : Tower number in SuperModule [1,68] (phi,eta) progression
280  // SMCrys : Crystal number in SuperModule [1,1700] (phi,eta) progression
281  // SMEcha : Electronic channel number in SuperModule [0,1699] S shape data reading order
282  //
283  // TowEcha: Electronic channel number in Tower [0,24] S shape data reading order
284  //
285  //
286  // fill the 2D array: fT2dSMCrys[n_SMTow][n_TowEcha]
287  //
288  // and the 1d arrays: fT1dSMTow[i_SMCrys] and fT1dTowEcha[i_SMCrys]
289  //
290  //-----------------------------------------------------------------------------------------------------
291 
292  if (fT2dSMCrys == nullptr) {
293  Int_t MaxSMTow = fEcal->MaxTowInSM();
294  Int_t MaxTowEcha = fEcal->MaxCrysInTow();
295  Int_t MaxSMCrys = fEcal->MaxCrysInSM();
296 
297  //................... Allocation and Init CrysNumbersTable
298 
299  fT2dSMCrys = new Int_t*[MaxSMTow];
300  fCnew++;
301  fT1dSMCrys = new Int_t[MaxSMTow * MaxTowEcha];
302  fCnew++;
303  for (Int_t i_SMTow = 0; i_SMTow < MaxSMTow; i_SMTow++) {
304  fT2dSMCrys[i_SMTow] = &fT1dSMCrys[0] + i_SMTow * MaxTowEcha;
305  }
306  for (Int_t i = 0; i < MaxSMTow; i++) {
307  for (Int_t j = 0; j < MaxTowEcha; j++) {
308  fT2dSMCrys[i][j] = 0;
309  }
310  }
311 
312  fT1dSMTow = new Int_t[MaxSMCrys];
313  fCnew++;
314  for (Int_t i = 0; i < MaxSMCrys; i++) {
315  fT1dSMTow[i] = 0;
316  }
317 
318  fT1dTowEcha = new Int_t[MaxSMCrys];
319  fCnew++;
320  for (Int_t i = 0; i < MaxSMCrys; i++) {
321  fT1dTowEcha[i] = 0;
322  }
323 
324  //........................ Build table
325  Int_t m2 = (Int_t)2;
326  Int_t m26 = (Int_t)26;
327 
328  // Int_t jch_type[2][26];
329  Int_t** jch_type = new Int_t*[m2];
330  fCnew++;
331  Int_t* jch_type_d1 = new Int_t[m2 * m26];
332  fCnew++;
333  for (Int_t i_m2 = 0; i_m2 < m2; i_m2++) {
334  jch_type[i_m2] = &jch_type_d1[0] + i_m2 * m26;
335  }
336 
337  for (Int_t k = 25; k >= 21; k--) {
338  jch_type[0][k] = 25 - k;
339  } // k = 25,24,23,22,21 -> jch_type[0][k] = 0,1,2,3,4
340  for (Int_t k = 16; k <= 20; k++) {
341  jch_type[0][k] = k - 16;
342  } // k = 16,17,18,19,20 -> jch_type[0][k] = 0,1,2,3,4
343  for (Int_t k = 15; k >= 11; k--) {
344  jch_type[0][k] = 15 - k;
345  } // k = 15,14,12,13,11 -> jch_type[0][k] = 0,1,2,3,4
346  for (Int_t k = 6; k <= 10; k++) {
347  jch_type[0][k] = k - 6;
348  } // k = 6, 7, 8, 9,10 -> jch_type[0][k] = 0,1,2,3,4
349  for (Int_t k = 5; k >= 1; k--) {
350  jch_type[0][k] = 5 - k;
351  } // k = 5, 4, 3, 2, 1 -> jch_type[0][k] = 0,1,2,3,4
352 
353  for (Int_t k = 1; k <= 5; k++) {
354  jch_type[1][k] = k - 1;
355  } // k = 1, 2, 3, 4, 5 -> jch_type[1][k] = 0,1,2,3,4
356  for (Int_t k = 10; k >= 6; k--) {
357  jch_type[1][k] = 10 - k;
358  } // k = 10, 9, 8, 7, 6 -> jch_type[1][k] = 0,1,2,3,4
359  for (Int_t k = 11; k <= 15; k++) {
360  jch_type[1][k] = k - 11;
361  } // k = 11,12,13,14,15 -> jch_type[1][k] = 0,1,2,3,4
362  for (Int_t k = 20; k >= 16; k--) {
363  jch_type[1][k] = 20 - k;
364  } // k = 20,19,18,17,16 -> jch_type[1][k] = 0,1,2,3,4
365  for (Int_t k = 21; k <= 25; k++) {
366  jch_type[1][k] = k - 21;
367  } // k = 21,22,23,24,25 -> jch_type[1][k] = 0,1,2,3,4
368 
369  // Int_t ich_type[2][26];
370  Int_t** ich_type = new Int_t*[m2];
371  fCnew++;
372  Int_t* ich_type_d1 = new Int_t[m2 * m26];
373  fCnew++;
374  for (Int_t i_m2 = 0; i_m2 < m2; i_m2++) {
375  ich_type[i_m2] = &ich_type_d1[0] + i_m2 * m26;
376  }
377 
378  for (Int_t k = 25; k >= 21; k--) {
379  ich_type[0][k] = 0;
380  } // k = 25,24,23,22,21 -> ich_type[0][k] = 0
381  for (Int_t k = 16; k <= 20; k++) {
382  ich_type[0][k] = 1;
383  } // k = 16,17,18,19,20 -> ich_type[0][k] = 1
384  for (Int_t k = 15; k >= 11; k--) {
385  ich_type[0][k] = 2;
386  } // k = 15,14,12,13,11 -> ich_type[0][k] = 2
387  for (Int_t k = 6; k <= 10; k++) {
388  ich_type[0][k] = 3;
389  } // k = 6, 7, 8, 9,10 -> ich_type[0][k] = 3
390  for (Int_t k = 5; k >= 1; k--) {
391  ich_type[0][k] = 4;
392  } // k = 5, 4, 3, 2, 1 -> ich_type[0][k] = 4
393 
394  for (Int_t k = 1; k <= 5; k++) {
395  ich_type[1][k] = 0;
396  } // k = 1, 2, 3, 4, 5 -> ich_type[1][k] = 0
397  for (Int_t k = 10; k >= 6; k--) {
398  ich_type[1][k] = 1;
399  } // k = 10, 9, 8, 7, 6 -> ich_type[1][k] = 1
400  for (Int_t k = 11; k <= 15; k++) {
401  ich_type[1][k] = 2;
402  } // k = 11,12,13,14,15 -> ich_type[1][k] = 2
403  for (Int_t k = 20; k >= 16; k--) {
404  ich_type[1][k] = 3;
405  } // k = 20,19,18,17,16 -> ich_type[1][k] = 3
406  for (Int_t k = 21; k <= 25; k++) {
407  ich_type[1][k] = 4;
408  } // k = 21,22,23,24,25 -> ich_type[1][k] = 4
409 
410  // Int_t type[17]={0,0,0,1,1, 0,0,1,1, 0,0,1,1, 0,0,1,1};
411  Int_t m17 = 17;
412  Int_t* type = new Int_t[m17];
413  fCnew++;
414 
415  // 0 -> LVRB at the bottom, 1 -> LVRB at the top
416  type[0] = 0; // M1
417  type[1] = 0;
418  type[2] = 0;
419  type[3] = 1;
420  type[4] = 1;
421 
422  type[5] = 0; // M2
423  type[6] = 0;
424  type[7] = 1;
425  type[8] = 1;
426 
427  type[9] = 0; // M3
428  type[10] = 0;
429  type[11] = 1;
430  type[12] = 1;
431 
432  type[13] = 0; // M4
433  type[14] = 0;
434  type[15] = 1;
435  type[16] = 1;
436 
437  for (Int_t tow = 0; tow < MaxSMTow; tow++) // tow = 0 to 67 (MaxSMTow = 68)
438  {
439  for (Int_t ic = 1; ic <= MaxTowEcha; ic++) // ic = 1 to 25 (MaxTowEcha = 25)
440  {
441  Int_t jtow = tow % 4; // jtow = 0,1,2,3
442  Int_t itow = tow / 4; // itow = 0 to 16
443 
444  Int_t icrys = itow * 5 + ich_type[type[itow]][ic]; // type[0->16] = 0,1 ,
445  // ich_type[0->1][1->25] = 0,1,2,3,4
446  // icrys = 0 to 84 (=> eta)
447 
448  Int_t jcrys = jtow * 5 + jch_type[type[itow]][ic]; // type[0->16] = 0,1 ,
449  // jch_type[0->1][1->25] = 0,1,2,3,4
450  // jcrys = 0 to 19 (=> phi)
451 
452  Int_t n1SMCrys = icrys * 20 + jcrys + 1; // n1SMCrys = 1 to 1700
453 
454  fT2dSMCrys[tow][ic - 1] = n1SMCrys; // fT2dSMCrys[] : range = [1,1700]
455  fT1dSMTow[n1SMCrys - 1] = tow + 1; // fT1dSMTow[] : range = [1,68]
456  fT1dTowEcha[n1SMCrys - 1] = ic - 1; // fT1dTowEcha[] : range = [0,24]
457  }
458  }
459  // std::cout << "#TEcnaNumbering::TBuildBarrelCrysTable()> Crys Table Building done" << std::endl;
460 
461  delete[] jch_type;
462  fCdelete++;
463  delete[] jch_type_d1;
464  fCdelete++;
465  delete[] ich_type;
466  fCdelete++;
467  delete[] ich_type_d1;
468  fCdelete++;
469  delete[] type;
470  fCdelete++;
471  } else {
472  // std::cout << "#TEcnaNumbering::TBuildBarrelCrysTable()> No Building of Crys Table since it is already done." << std::endl;
473  }
474 }
Int_t MaxCrysInSM()
TEcnaParEcal * fEcal
Int_t * fT1dSMCrys
Int_t MaxCrysInTow()
Int_t * fT1dTowEcha
Int_t ** fT2dSMCrys
Int_t MaxTowInSM()

◆ BuildEndcapCrysTable()

void TEcnaNumbering::BuildEndcapCrysTable ( )

Definition at line 1155 of file TEcnaNumbering.cc.

References fCdelete, fCnew, fEcal, fT1d_ich_IX, fT1d_jch_JY, fT1dDeeCrys, fT1dDeeSC, fT1dSCEcha, fT2d_ich_IX, fT2d_jch_JY, fT2dDeeCrys, fT2dDeeSC, fT2dSCEcha, fT3dDeeCrys, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, TEcnaParEcal::MaxCrysEcnaInDee(), TEcnaParEcal::MaxCrysInSC(), TEcnaParEcal::MaxCrysIXInSC(), TEcnaParEcal::MaxCrysIYInSC(), TEcnaParEcal::MaxSCEcnaInDee(), and TEcnaParEcal::MaxSCIYInDee().

Referenced by Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(), and SetEcalSubDetector().

1155  {
1156  // Build the correspondance table: DeeCrys <-> (DeeSC, SCEcha) for the ECAL ENDCAP
1157  //
1158  // From CMS Internal Note "CMS ECAL Endcap channel numbering"
1159  //
1160  // Name Number Reference set Range Comment
1161  //
1162  // DeeSC : Super-Crystal (SC) number in Dee [1,200] (IY,IX) progression
1163  // DeeCrys : Crystal number in Dee [1,5000] (IY,IX) progression
1164  // DeeEcha : Electronic channel number in Dee [0,4999] Crystal numbering for construction
1165  //
1166  // SCEcha : Electronic channel number in SC [1,25] Crystal numbering for construction
1167  //
1168  //
1169  // fill the 3D array: fT3dDeeCrys[n_DeeSC][n_SCEcha][2]
1170  //
1171  // and the 2d arrays: fT2dDeeSC[n_DeeCrys][2] and fT2dSCEcha[n_DeeCrys][2]
1172  //
1173  //------------------------------------------------------------------------------------------------------
1174 
1175  if (fT3dDeeCrys == nullptr) {
1176  Int_t MaxDeeSC = fEcal->MaxSCEcnaInDee(); // fEcal->MaxSCEcnaInDee() = 200
1177  Int_t MaxSCEcha = fEcal->MaxCrysInSC();
1178  Int_t MaxDeeCrys = fEcal->MaxCrysEcnaInDee();
1179 
1180  Int_t MaxDirections = 2; // (2 directions: left and right)
1181 
1182  //................... Allocation and Init CrysNumbersTable
1183  fT3dDeeCrys = new Int_t**[MaxDeeSC];
1184  fCnew++;
1185  fT2dDeeCrys = new Int_t*[MaxDeeSC * MaxSCEcha];
1186  fCnew++;
1187  fT1dDeeCrys = new Int_t[MaxDeeSC * MaxSCEcha * MaxDirections];
1188  fCnew++;
1189 
1190  for (Int_t i_DeeSC = 0; i_DeeSC < MaxDeeSC; i_DeeSC++) {
1191  fT3dDeeCrys[i_DeeSC] = &fT2dDeeCrys[0] + i_DeeSC * MaxSCEcha;
1192  for (Int_t i_SCEcha = 0; i_SCEcha < MaxSCEcha; i_SCEcha++) {
1193  fT2dDeeCrys[i_DeeSC * MaxSCEcha + i_SCEcha] =
1194  &fT1dDeeCrys[0] + (i_DeeSC * MaxSCEcha + i_SCEcha) * MaxDirections;
1195  }
1196  }
1197  for (Int_t i = 0; i < MaxDeeSC; i++) {
1198  for (Int_t j = 0; j < MaxSCEcha; j++) {
1199  for (Int_t k = 0; k < MaxDirections; k++) {
1200  fT3dDeeCrys[i][j][k] = 0;
1201  }
1202  }
1203  }
1204 
1205  fT2dDeeSC = new Int_t*[MaxDeeCrys];
1206  fCnew++;
1207  fT1dDeeSC = new Int_t[MaxDeeCrys * MaxDirections];
1208  fCnew++;
1209  for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxDeeCrys; i_DeeCrys++) {
1210  fT2dDeeSC[i_DeeCrys] = &fT1dDeeSC[0] + i_DeeCrys * MaxDirections;
1211  }
1212  for (Int_t i = 0; i < MaxDeeCrys; i++) {
1213  for (Int_t j = 0; j < MaxDirections; j++) {
1214  fT2dDeeSC[i][j] = 0;
1215  }
1216  }
1217 
1218  fT2dSCEcha = new Int_t*[MaxDeeCrys];
1219  fCnew++;
1220  fT1dSCEcha = new Int_t[MaxDeeCrys * MaxDirections];
1221  fCnew++;
1222  for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxDeeCrys; i_DeeCrys++) {
1223  fT2dSCEcha[i_DeeCrys] = &fT1dSCEcha[0] + i_DeeCrys * MaxDirections;
1224  }
1225  for (Int_t i = 0; i < MaxDeeCrys; i++) {
1226  for (Int_t j = 0; j < MaxDirections; j++) {
1227  fT2dSCEcha[i][j] = 0;
1228  }
1229  }
1230 
1231  //................................ Build table
1232  Int_t MaxTyp = (Int_t)4;
1233  Int_t MaxCrysP1 = (Int_t)(fEcal->MaxCrysInSC() + 1);
1234 
1235  // Int_t fT2d_jch_JY[type][Echa+1]: JY in the SC as a function of type and Echa+1
1236  fT2d_jch_JY = new Int_t*[MaxTyp];
1237  fCnew++;
1238  fT1d_jch_JY = new Int_t[MaxTyp * MaxCrysP1];
1239  fCnew++;
1240  for (Int_t i_MaxTyp = 0; i_MaxTyp < MaxTyp; i_MaxTyp++) {
1241  fT2d_jch_JY[i_MaxTyp] = &fT1d_jch_JY[0] + i_MaxTyp * MaxCrysP1;
1242  }
1243 
1244  // type: 0=(top/right), 1=(top/left), 2=(bottom/left), 3=(bottom/right),
1245 
1246  //................. top/right
1247  for (Int_t k = 5; k >= 1; k--) {
1248  fT2d_jch_JY[0][k] = 4;
1249  } // k = 5, 4, 3, 2, 1 -> fT2d_jch_JY[0][k] = 4
1250  for (Int_t k = 10; k >= 6; k--) {
1251  fT2d_jch_JY[0][k] = 3;
1252  } // k = 10, 9, 8, 7, 6 -> fT2d_jch_JY[0][k] = 3
1253  for (Int_t k = 15; k >= 11; k--) {
1254  fT2d_jch_JY[0][k] = 2;
1255  } // k = 15,14,13,12,11 -> fT2d_jch_JY[0][k] = 2
1256  for (Int_t k = 20; k >= 16; k--) {
1257  fT2d_jch_JY[0][k] = 1;
1258  } // k = 20,19,18,17,16 -> fT2d_jch_JY[0][k] = 1
1259  for (Int_t k = 25; k >= 21; k--) {
1260  fT2d_jch_JY[0][k] = 0;
1261  } // k = 25,24,23,22,21 -> fT2d_jch_JY[0][k] = 0
1262  //................. top/left
1263  for (Int_t k = 5; k >= 1; k--) {
1264  fT2d_jch_JY[1][k] = 5 - k;
1265  } // k = 5, 4, 3, 2, 1 -> fT2d_jch_JY[1][k] = 0,1,2,3,4
1266  for (Int_t k = 10; k >= 6; k--) {
1267  fT2d_jch_JY[1][k] = 10 - k;
1268  } // k = 10, 9, 8, 7, 6 -> fT2d_jch_JY[1][k] = 0,1,2,3,4
1269  for (Int_t k = 15; k >= 11; k--) {
1270  fT2d_jch_JY[1][k] = 15 - k;
1271  } // k = 15,14,13,12,11 -> fT2d_jch_JY[1][k] = 0,1,2,3,4
1272  for (Int_t k = 20; k >= 16; k--) {
1273  fT2d_jch_JY[1][k] = 20 - k;
1274  } // k = 20,19,18,17,16 -> fT2d_jch_JY[1][k] = 0,1,2,3,4
1275  for (Int_t k = 25; k >= 21; k--) {
1276  fT2d_jch_JY[1][k] = 25 - k;
1277  } // k = 25,24,23,22,21 -> fT2d_jch_JY[1][k] = 0,1,2,3,4
1278  //................. bottom/left
1279  for (Int_t k = 1; k <= 5; k++) {
1280  fT2d_jch_JY[2][k] = 0;
1281  } // k = 1, 2, 3, 4, 5 -> fT2d_jch_JY[2][k] = 0
1282  for (Int_t k = 6; k <= 10; k++) {
1283  fT2d_jch_JY[2][k] = 1;
1284  } // k = 6, 7, 8, 9,10 -> fT2d_jch_JY[2][k] = 1
1285  for (Int_t k = 11; k <= 15; k++) {
1286  fT2d_jch_JY[2][k] = 2;
1287  } // k = 11,12,13,14,15 -> fT2d_jch_JY[2][k] = 2
1288  for (Int_t k = 16; k <= 20; k++) {
1289  fT2d_jch_JY[2][k] = 3;
1290  } // k = 16,17,18,19,20 -> fT2d_jch_JY[2][k] = 3
1291  for (Int_t k = 21; k <= 25; k++) {
1292  fT2d_jch_JY[2][k] = 4;
1293  } // k = 21,22,23,24,25 -> fT2d_jch_JY[2][k] = 4
1294  //................. bottom/right
1295  for (Int_t k = 1; k <= 5; k++) {
1296  fT2d_jch_JY[3][k] = k - 1;
1297  } // k = 1, 2, 3, 4, 5 -> fT2d_jch_JY[3][k] = 0,1,2,3,4
1298  for (Int_t k = 6; k <= 10; k++) {
1299  fT2d_jch_JY[3][k] = k - 6;
1300  } // k = 6, 7, 8, 9,10 -> fT2d_jch_JY[3][k] = 0,1,2,3,4
1301  for (Int_t k = 11; k <= 15; k++) {
1302  fT2d_jch_JY[3][k] = k - 11;
1303  } // k = 11,12,13,14,15 -> fT2d_jch_JY[3][k] = 0,1,2,3,4
1304  for (Int_t k = 16; k <= 20; k++) {
1305  fT2d_jch_JY[3][k] = k - 16;
1306  } // k = 16,17,18,19,20 -> fT2d_jch_JY[3][k] = 0,1,2,3,4
1307  for (Int_t k = 21; k <= 25; k++) {
1308  fT2d_jch_JY[3][k] = k - 21;
1309  } // k = 21,22,23,24,25 -> fT2d_jch_JY[3][k] = 0,1,2,3,4
1310 
1311  // Int_t fT2d_ich_IX[type][Echa+1]: IX in the SC as a function of type and Echa+1
1312  fT2d_ich_IX = new Int_t*[MaxTyp];
1313  fCnew++;
1314  fT1d_ich_IX = new Int_t[MaxTyp * MaxCrysP1];
1315  fCnew++;
1316  for (Int_t i_MaxTyp = 0; i_MaxTyp < MaxTyp; i_MaxTyp++) {
1317  fT2d_ich_IX[i_MaxTyp] = &fT1d_ich_IX[0] + i_MaxTyp * MaxCrysP1;
1318  }
1319 
1320  //................. top/right
1321  for (Int_t k = 5; k >= 1; k--) {
1322  fT2d_ich_IX[0][k] = 5 - k;
1323  } // k = 5, 4, 3, 2, 1 -> fT2d_ich_IX[0][k] = 0,1,2,3,4
1324  for (Int_t k = 10; k >= 6; k--) {
1325  fT2d_ich_IX[0][k] = 10 - k;
1326  } // k = 10, 9, 8, 7, 6 -> fT2d_ich_IX[0][k] = 0,1,2,3,4
1327  for (Int_t k = 15; k >= 11; k--) {
1328  fT2d_ich_IX[0][k] = 15 - k;
1329  } // k = 15,14,13,12,11 -> fT2d_ich_IX[0][k] = 0,1,2,3,4
1330  for (Int_t k = 20; k >= 16; k--) {
1331  fT2d_ich_IX[0][k] = 20 - k;
1332  } // k = 20,19,18,17,16 -> fT2d_ich_IX[0][k] = 0,1,2,3,4
1333  for (Int_t k = 25; k >= 21; k--) {
1334  fT2d_ich_IX[0][k] = 25 - k;
1335  } // k = 25,24,23,22,21 -> fT2d_ich_IX[0][k] = 0,1,2,3,4
1336  //................. top/left
1337  for (Int_t k = 5; k >= 1; k--) {
1338  fT2d_ich_IX[1][k] = 4;
1339  } // k = 5, 4, 3, 2, 1 -> fT2d_ich_IX[1][k] = 4
1340  for (Int_t k = 10; k >= 6; k--) {
1341  fT2d_ich_IX[1][k] = 3;
1342  } // k = 10, 9, 8, 7, 6 -> fT2d_ich_IX[1][k] = 3
1343  for (Int_t k = 15; k >= 11; k--) {
1344  fT2d_ich_IX[1][k] = 2;
1345  } // k = 15,14,13,12,11 -> fT2d_ich_IX[1][k] = 2
1346  for (Int_t k = 20; k >= 16; k--) {
1347  fT2d_ich_IX[1][k] = 1;
1348  } // k = 20,19,18,17,16 -> fT2d_ich_IX[1][k] = 1
1349  for (Int_t k = 25; k >= 21; k--) {
1350  fT2d_ich_IX[1][k] = 0;
1351  } // k = 25,24,23,22,21 -> fT2d_ich_IX[1][k] = 0
1352  //................. bottom/left
1353  for (Int_t k = 1; k <= 5; k++) {
1354  fT2d_ich_IX[2][k] = 5 - k;
1355  } // k = 1, 2, 3, 4, 5 -> fT2d_ich_IX[2][k] = 0,1,2,3,4
1356  for (Int_t k = 6; k <= 10; k++) {
1357  fT2d_ich_IX[2][k] = 10 - k;
1358  } // k = 6, 7, 8, 9,10 -> fT2d_ich_IX[2][k] = 0,1,2,3,4
1359  for (Int_t k = 11; k <= 15; k++) {
1360  fT2d_ich_IX[2][k] = 15 - k;
1361  } // k = 11,12,13,14,15 -> fT2d_ich_IX[2][k] = 0,1,2,3,4
1362  for (Int_t k = 16; k <= 20; k++) {
1363  fT2d_ich_IX[2][k] = 20 - k;
1364  } // k = 16,17,18,19,20 -> fT2d_ich_IX[2][k] = 0,1,2,3,4
1365  for (Int_t k = 21; k <= 25; k++) {
1366  fT2d_ich_IX[2][k] = 25 - k;
1367  } // k = 21,22,23,24,25 -> fT2d_ich_IX[2][k] = 0,1,2,3,4
1368  //................. bottom/right
1369  for (Int_t k = 1; k <= 5; k++) {
1370  fT2d_ich_IX[3][k] = 4;
1371  } // k = 1, 2, 3, 4, 5 -> fT2d_ich_IX[3][k] = 4
1372  for (Int_t k = 6; k <= 10; k++) {
1373  fT2d_ich_IX[3][k] = 3;
1374  } // k = 6, 7, 8, 9,10 -> fT2d_ich_IX[3][k] = 3
1375  for (Int_t k = 11; k <= 15; k++) {
1376  fT2d_ich_IX[3][k] = 2;
1377  } // k = 11,12,13,14,15 -> fT2d_ich_IX[3][k] = 2
1378  for (Int_t k = 16; k <= 20; k++) {
1379  fT2d_ich_IX[3][k] = 1;
1380  } // k = 16,17,18,19,20 -> fT2d_ich_IX[3][k] = 1
1381  for (Int_t k = 21; k <= 25; k++) {
1382  fT2d_ich_IX[3][k] = 0;
1383  } // k = 21,22,23,24,25 -> fT2d_ich_IX[3][k] = 0
1384 
1385  //............................................ type
1386  Int_t Nb_DeeSC_JY = fEcal->MaxSCIYInDee();
1387  Int_t** type = new Int_t*[Nb_DeeSC_JY];
1388  fCnew++;
1389  Int_t* type_d1 = new Int_t[Nb_DeeSC_JY * MaxDirections];
1390  fCnew++;
1391  for (Int_t i_DeeSC_JY = 0; i_DeeSC_JY < Nb_DeeSC_JY; i_DeeSC_JY++) {
1392  type[i_DeeSC_JY] = &type_d1[0] + i_DeeSC_JY * MaxDirections;
1393  }
1394 
1395  // bottom = (0,9), top = (10,19)
1396  // right = 0 , left = 1
1397  // type = Quadrant number - 1
1398 
1399  type[10][0] = 0; // Q1 top right
1400  type[11][0] = 0;
1401  type[12][0] = 0;
1402  type[13][0] = 0;
1403  type[14][0] = 0;
1404  type[15][0] = 0;
1405  type[16][0] = 0;
1406  type[17][0] = 0;
1407  type[18][0] = 0;
1408  type[19][0] = 0;
1409 
1410  type[10][1] = 1; // Q2 top left
1411  type[11][1] = 1;
1412  type[12][1] = 1;
1413  type[13][1] = 1;
1414  type[14][1] = 1;
1415  type[15][1] = 1;
1416  type[16][1] = 1;
1417  type[17][1] = 1;
1418  type[18][1] = 1;
1419  type[19][1] = 1;
1420 
1421  type[0][1] = 2; // Q3 : bottom left
1422  type[1][1] = 2;
1423  type[2][1] = 2;
1424  type[3][1] = 2;
1425  type[4][1] = 2;
1426  type[5][1] = 2;
1427  type[6][1] = 2;
1428  type[7][1] = 2;
1429  type[8][1] = 2;
1430  type[9][1] = 2;
1431 
1432  type[0][0] = 3; // Q4 : bottom right
1433  type[1][0] = 3;
1434  type[2][0] = 3;
1435  type[3][0] = 3;
1436  type[4][0] = 3;
1437  type[5][0] = 3;
1438  type[6][0] = 3;
1439  type[7][0] = 3;
1440  type[8][0] = 3;
1441  type[9][0] = 3;
1442 
1443  Int_t Nb_SCCrys_IX = fEcal->MaxCrysIXInSC();
1444  Int_t Nb_SCCrys_JY = fEcal->MaxCrysIYInSC();
1445 
1446  for (Int_t kSC = 0; kSC < MaxDeeSC; kSC++) // kSC = 0 to 199 (MaxDeeSC = 200)
1447  {
1448  for (Int_t n_Echa = 1; n_Echa <= MaxSCEcha; n_Echa++) // n_Echa = 1 to 25 (MaxSCEcha = 25)
1449  {
1450  for (Int_t idir = 0; idir < 2; idir++) {
1451  Int_t ikSC = kSC / Nb_DeeSC_JY; // ikSC = 0 to 9
1452  Int_t jkSC = kSC % Nb_DeeSC_JY; // jkSC = 0,1,2,..,19
1453 
1454  Int_t icrys = ikSC * Nb_SCCrys_IX + fT2d_ich_IX[type[jkSC][idir]][n_Echa];
1455  // type[0->9][1->2] = 0,1,2,3
1456  // fT2d_ich_IX[0->3][1->25] = 0,1,2,3,4
1457  // icrys = 0 to 49 (=> IX)
1458 
1459  Int_t jcrys = jkSC * Nb_SCCrys_JY + fT2d_jch_JY[type[jkSC][idir]][n_Echa];
1460  // type[0->9][1->2] = 0,1,2,3
1461  // fT2d_jch_JY[0->3][1->25] = 0,1,2,3,4
1462  // jcrys = 0 to 99 (=> IY)
1463 
1464  Int_t n_DeeCrys = icrys * Nb_DeeSC_JY * Nb_SCCrys_JY + jcrys + 1; // n_DeeCrys = 1 to 5000
1465 
1466  fT3dDeeCrys[kSC][n_Echa - 1][idir] = n_DeeCrys; // fT3dDeeCrys[][][] : range = [1,5000]
1467  fT2dDeeSC[n_DeeCrys - 1][idir] = kSC + 1; // fT2dDeeSC[][] : range = [1,200]
1468  fT2dSCEcha[n_DeeCrys - 1][idir] = n_Echa; // fT2dSCEcha[][] : range = [1,25]
1469  }
1470  }
1471  }
1472  // std::cout << "#TEcnaNumbering::TBuildEndcapCrysTable()> Crys Table Building done" << std::endl;
1473 
1474  delete[] type;
1475  fCdelete++;
1476  delete[] type_d1;
1477  fCdelete++;
1478  } else {
1479  // std::cout << "#TEcnaNumbering::TBuildEndcapCrysTable()> No Building of Crys Table since it is already done " << std::endl;
1480  }
1481 }
Int_t * fT1dSCEcha
Int_t MaxSCIYInDee()
Int_t MaxCrysEcnaInDee()
Int_t * fT1dDeeCrys
Int_t * fT1d_ich_IX
Int_t ** fT2d_ich_IX
Int_t ** fT2dDeeSC
TEcnaParEcal * fEcal
Int_t MaxCrysIXInSC()
Int_t ** fT2d_jch_JY
Int_t MaxSCEcnaInDee()
Int_t MaxCrysIYInSC()
Int_t * fT1d_jch_JY
Int_t MaxCrysInSC()
Int_t ** fT2dDeeCrys
Int_t *** fT3dDeeCrys
Int_t ** fT2dSCEcha

◆ BuildEndcapSCTable()

void TEcnaNumbering::BuildEndcapSCTable ( )

Definition at line 1483 of file TEcnaNumbering.cc.

References fCnew, fEcal, fT1d_DeeSCCons, fT1d_DS, fT1d_DSSC, fT1d_RecovDeeSC, fT2d_DeeSCCons, fT2d_DS, fT2d_DSSC, fT2d_RecovDeeSC, mps_fire::i, dqmiolumiharvest::j, TEcnaParEcal::MaxDeeInEE(), TEcnaParEcal::MaxSCEcnaInDee(), and TEcnaParEcal::MaxSCForConsInDee().

Referenced by SetEcalSubDetector().

1483  {
1484  // Build the correspondance table: (Dee, DeeSC) <-> (DS , DSSC) for the ECAL ENDCAP
1485  //
1486  // From CMS Internal Note "CMS ECAL Endcap channel numbering"
1487  //
1488  // Name Number Reference set Range Comment
1489  //
1490  // Dee : Dee number [1,4]
1491  // DeeSC : Super-Crystal (SC) number in Dee [1,200] (IY,IX) progression
1492  // DS : Data Sector number in EE + or - [1,9] (IY,IX) progression
1493  // DSSC : Super-Crystal (SC) number in Data Sector [1,32] Crystal numbering in data sector
1494  // DeeSCCons: Super-Crystal (SC) number for construction [1,297]
1495  //
1496  // fill the 2d arrays: fT2d_DS[4][200], fT2d_DSSC[4][200] and fT2d_DeeSCCons[4][200]
1497  //
1498  //------------------------------------------------------------------------------------------------------
1499 
1500  //.................. Allocations and Init
1501  Int_t MaxEEDee = fEcal->MaxDeeInEE();
1502  Int_t MaxDeeSC = fEcal->MaxSCEcnaInDee();
1503  Int_t MaxEESCForCons = 2 * fEcal->MaxSCForConsInDee();
1504 
1505  fT2d_DS = new Int_t*[MaxEEDee];
1506  fCnew++; // = DS[Dee - 1, CNA_SCInDee - 1]
1507  fT1d_DS = new Int_t[MaxEEDee * MaxDeeSC];
1508  fCnew++;
1509  for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxEEDee; i_DeeCrys++) {
1510  fT2d_DS[i_DeeCrys] = &fT1d_DS[0] + i_DeeCrys * MaxDeeSC;
1511  }
1512  for (Int_t i = 0; i < MaxEEDee; i++) {
1513  for (Int_t j = 0; j < MaxDeeSC; j++) {
1514  fT2d_DS[i][j] = 0;
1515  }
1516  }
1517 
1518  fT2d_DSSC = new Int_t*[MaxEEDee];
1519  fCnew++; // = SCInDS[Dee - 1, CNA_SCInDee - 1]
1520  fT1d_DSSC = new Int_t[MaxEEDee * MaxDeeSC];
1521  fCnew++;
1522  for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxEEDee; i_DeeCrys++) {
1523  fT2d_DSSC[i_DeeCrys] = &fT1d_DSSC[0] + i_DeeCrys * MaxDeeSC;
1524  }
1525  for (Int_t i = 0; i < MaxEEDee; i++) {
1526  for (Int_t j = 0; j < MaxDeeSC; j++) {
1527  fT2d_DSSC[i][j] = 0;
1528  }
1529  }
1530 
1531  fT2d_DeeSCCons = new Int_t*[MaxEEDee];
1532  fCnew++; // = SCConsInDee[Dee - 1, CNA_SCInDee - 1]
1533  fT1d_DeeSCCons = new Int_t[MaxEEDee * MaxDeeSC];
1534  fCnew++;
1535  for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxEEDee; i_DeeCrys++) {
1536  fT2d_DeeSCCons[i_DeeCrys] = &fT1d_DeeSCCons[0] + i_DeeCrys * MaxDeeSC;
1537  }
1538  for (Int_t i = 0; i < MaxEEDee; i++) {
1539  for (Int_t j = 0; j < MaxDeeSC; j++) {
1540  fT2d_DeeSCCons[i][j] = 0;
1541  }
1542  }
1543 
1544  fT2d_RecovDeeSC = new Int_t*[MaxEEDee];
1545  fCnew++; // = CNA_SCInDee[Dee - 1, SCConsInDee - 1]
1546  fT1d_RecovDeeSC = new Int_t[MaxEEDee * MaxEESCForCons];
1547  fCnew++;
1548  for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxEEDee; i_DeeCrys++) {
1549  fT2d_RecovDeeSC[i_DeeCrys] = &fT1d_RecovDeeSC[0] + i_DeeCrys * MaxEESCForCons;
1550  }
1551  for (Int_t i = 0; i < MaxEEDee; i++) {
1552  for (Int_t j = 0; j < MaxEESCForCons; j++) {
1553  fT2d_RecovDeeSC[i][j] = 0;
1554  }
1555  }
1556 
1557  //.............................. Data sector (DS) numbers: fT2d_DS[][]
1558  // isc = ECNA numbers
1559 
1560  Int_t ids = 0;
1561 
1562  //........... (D1,S1)=(D2,S9)=(D3,S9)=(D4,S1)
1563  for (Int_t dee = 1; dee <= 4; dee++) {
1564  if (dee == 1 || dee == 4) {
1565  ids = 1;
1566  }
1567  if (dee == 2 || dee == 3) {
1568  ids = 9;
1569  }
1570  for (Int_t isc = 13; isc <= 20; isc++)
1571  fT2d_DS[dee - 1][isc - 1] = ids;
1572  for (Int_t isc = 33; isc <= 40; isc++)
1573  fT2d_DS[dee - 1][isc - 1] = ids;
1574  for (Int_t isc = 54; isc <= 60; isc++)
1575  fT2d_DS[dee - 1][isc - 1] = ids;
1576  for (Int_t isc = 75; isc <= 79; isc++)
1577  fT2d_DS[dee - 1][isc - 1] = ids;
1578  for (Int_t isc = 96; isc <= 99; isc++)
1579  fT2d_DS[dee - 1][isc - 1] = ids;
1580  for (Int_t isc = 118; isc <= 119; isc++)
1581  fT2d_DS[dee - 1][isc - 1] = ids;
1582  }
1583  //........... (D1,S2)=(D2,S8)=(D3,S8)=(D4,S2)
1584  for (Int_t dee = 1; dee <= 4; dee++) {
1585  if (dee == 1 || dee == 4) {
1586  ids = 2;
1587  }
1588  if (dee == 2 || dee == 3) {
1589  ids = 8;
1590  }
1591  for (Int_t isc = 32; isc <= 32; isc++)
1592  fT2d_DS[dee - 1][isc - 1] = ids;
1593  for (Int_t isc = 51; isc <= 53; isc++)
1594  fT2d_DS[dee - 1][isc - 1] = ids;
1595  for (Int_t isc = 72; isc <= 74; isc++)
1596  fT2d_DS[dee - 1][isc - 1] = ids;
1597  for (Int_t isc = 92; isc <= 95; isc++)
1598  fT2d_DS[dee - 1][isc - 1] = ids;
1599  for (Int_t isc = 112; isc <= 117; isc++)
1600  fT2d_DS[dee - 1][isc - 1] = ids;
1601  for (Int_t isc = 132; isc <= 138; isc++)
1602  fT2d_DS[dee - 1][isc - 1] = ids;
1603  for (Int_t isc = 152; isc <= 157; isc++)
1604  fT2d_DS[dee - 1][isc - 1] = ids;
1605  for (Int_t isc = 173; isc <= 176; isc++)
1606  fT2d_DS[dee - 1][isc - 1] = ids;
1607  for (Int_t isc = 193; isc <= 193; isc++)
1608  fT2d_DS[dee - 1][isc - 1] = ids;
1609  }
1610  //........... (D1,S3)=(D2,S7)=(D3,S7)=(D4,S3)
1611  for (Int_t dee = 1; dee <= 4; dee++) {
1612  if (dee == 1 || dee == 4) {
1613  ids = 3;
1614  }
1615  if (dee == 2 || dee == 3) {
1616  ids = 7;
1617  }
1618  for (Int_t isc = 50; isc <= 50; isc++)
1619  fT2d_DS[dee - 1][isc - 1] = ids;
1620  for (Int_t isc = 69; isc <= 71; isc++)
1621  fT2d_DS[dee - 1][isc - 1] = ids;
1622  for (Int_t isc = 88; isc <= 91; isc++)
1623  fT2d_DS[dee - 1][isc - 1] = ids;
1624  for (Int_t isc = 108; isc <= 111; isc++)
1625  fT2d_DS[dee - 1][isc - 1] = ids;
1626  for (Int_t isc = 127; isc <= 131; isc++)
1627  fT2d_DS[dee - 1][isc - 1] = ids;
1628  for (Int_t isc = 147; isc <= 151; isc++)
1629  fT2d_DS[dee - 1][isc - 1] = ids;
1630  for (Int_t isc = 166; isc <= 172; isc++)
1631  fT2d_DS[dee - 1][isc - 1] = ids;
1632  for (Int_t isc = 188; isc <= 192; isc++)
1633  fT2d_DS[dee - 1][isc - 1] = ids;
1634  }
1635  //........... (D1,S4)=(D2,S6)=(D3,S6)=(D4,S4)
1636  for (Int_t dee = 1; dee <= 4; dee++) {
1637  if (dee == 1 || dee == 4) {
1638  ids = 4;
1639  }
1640  if (dee == 2 || dee == 3) {
1641  ids = 6;
1642  }
1643  for (Int_t isc = 27; isc <= 29; isc++)
1644  fT2d_DS[dee - 1][isc - 1] = ids;
1645  for (Int_t isc = 44; isc <= 49; isc++)
1646  fT2d_DS[dee - 1][isc - 1] = ids;
1647  for (Int_t isc = 62; isc <= 68; isc++)
1648  fT2d_DS[dee - 1][isc - 1] = ids;
1649  for (Int_t isc = 82; isc <= 87; isc++)
1650  fT2d_DS[dee - 1][isc - 1] = ids;
1651  for (Int_t isc = 102; isc <= 107; isc++)
1652  fT2d_DS[dee - 1][isc - 1] = ids;
1653  for (Int_t isc = 123; isc <= 126; isc++)
1654  fT2d_DS[dee - 1][isc - 1] = ids;
1655  for (Int_t isc = 144; isc <= 146; isc++)
1656  fT2d_DS[dee - 1][isc - 1] = ids;
1657  for (Int_t isc = 165; isc <= 165; isc++)
1658  fT2d_DS[dee - 1][isc - 1] = ids;
1659  }
1660  //........... (D1,S5)=(D2,S5)=(D3,S5)=(D4,S5)
1661  for (Int_t dee = 1; dee <= 4; dee++) {
1662  for (Int_t isc = 1; isc <= 8; isc++)
1663  fT2d_DS[dee - 1][isc - 1] = 5;
1664  for (Int_t isc = 21; isc <= 26; isc++)
1665  fT2d_DS[dee - 1][isc - 1] = 5;
1666  for (Int_t isc = 41; isc <= 43; isc++)
1667  fT2d_DS[dee - 1][isc - 1] = 5;
1668  }
1669 
1670  //............................................ SC numbers in Data Sectors: fT2d_DSSC[][]
1671  // fT2d_DSSC[dee-1][SC ECNA number - 1] = SC number in DS;
1672  for (Int_t dee = 1; dee <= 4; dee++) {
1673  for (Int_t isc = 1; isc <= MaxDeeSC; isc++) {
1674  fT2d_DSSC[dee - 1][isc - 1] = -1;
1675  }
1676  //.......................................... S1 (D1,D4), S9 (D2,D3) ; 33 SC's
1677  fT2d_DSSC[dee - 1][13 - 1] = 12;
1678  fT2d_DSSC[dee - 1][14 - 1] = 11;
1679  fT2d_DSSC[dee - 1][15 - 1] = 10;
1680  fT2d_DSSC[dee - 1][16 - 1] = 9;
1681  fT2d_DSSC[dee - 1][17 - 1] = 4;
1682  fT2d_DSSC[dee - 1][18 - 1] = 3;
1683  fT2d_DSSC[dee - 1][19 - 1] = 2;
1684  fT2d_DSSC[dee - 1][20 - 1] = 1;
1685 
1686  fT2d_DSSC[dee - 1][33 - 1] = 16;
1687  fT2d_DSSC[dee - 1][34 - 1] = 15;
1688  fT2d_DSSC[dee - 1][35 - 1] = 14;
1689  fT2d_DSSC[dee - 1][36 - 1] = 13;
1690  fT2d_DSSC[dee - 1][37 - 1] = 8;
1691  fT2d_DSSC[dee - 1][38 - 1] = 7;
1692  fT2d_DSSC[dee - 1][39 - 1] = 6;
1693  fT2d_DSSC[dee - 1][40 - 1] = 5;
1694 
1695  fT2d_DSSC[dee - 1][54 - 1] = 33;
1696  fT2d_DSSC[dee - 1][55 - 1] = 31;
1697  fT2d_DSSC[dee - 1][56 - 1] = 27;
1698  fT2d_DSSC[dee - 1][57 - 1] = 24;
1699  fT2d_DSSC[dee - 1][58 - 1] = 20;
1700  fT2d_DSSC[dee - 1][59 - 1] = 17;
1701  fT2d_DSSC[dee - 1][60 - 1] = 30; // (182a, 33a for construction)
1702 
1703  fT2d_DSSC[dee - 1][75 - 1] = 32;
1704  fT2d_DSSC[dee - 1][76 - 1] = 28;
1705  fT2d_DSSC[dee - 1][77 - 1] = 25;
1706  fT2d_DSSC[dee - 1][78 - 1] = 21;
1707  fT2d_DSSC[dee - 1][79 - 1] = 18;
1708 
1709  fT2d_DSSC[dee - 1][96 - 1] = 29;
1710  fT2d_DSSC[dee - 1][97 - 1] = 26;
1711  fT2d_DSSC[dee - 1][98 - 1] = 22;
1712  fT2d_DSSC[dee - 1][99 - 1] = 19;
1713 
1714  fT2d_DSSC[dee - 1][118 - 1] = 23;
1715  fT2d_DSSC[dee - 1][119 - 1] = 30; // (182b, 33b for construction)
1716 
1717  //.......................................... S2 (D1,D4), S8(D2,D3) ; 32 SC's
1718  fT2d_DSSC[dee - 1][32 - 1] = 25; // also 3; // ( (207c, 58c) also (178c, 29c) for construction)
1719 
1720  fT2d_DSSC[dee - 1][51 - 1] = 32;
1721  fT2d_DSSC[dee - 1][52 - 1] = 26;
1722  fT2d_DSSC[dee - 1][53 - 1] = 18;
1723 
1724  fT2d_DSSC[dee - 1][72 - 1] = 27;
1725  fT2d_DSSC[dee - 1][73 - 1] = 19;
1726  fT2d_DSSC[dee - 1][74 - 1] = 12;
1727 
1728  fT2d_DSSC[dee - 1][92 - 1] = 28;
1729  fT2d_DSSC[dee - 1][93 - 1] = 20;
1730  fT2d_DSSC[dee - 1][94 - 1] = 13;
1731  fT2d_DSSC[dee - 1][95 - 1] = 7;
1732 
1733  fT2d_DSSC[dee - 1][112 - 1] = 29;
1734  fT2d_DSSC[dee - 1][113 - 1] = 21;
1735  fT2d_DSSC[dee - 1][114 - 1] = 14;
1736  fT2d_DSSC[dee - 1][115 - 1] = 8;
1737  fT2d_DSSC[dee - 1][116 - 1] = 4;
1738  fT2d_DSSC[dee - 1][117 - 1] = 1;
1739 
1740  fT2d_DSSC[dee - 1][132 - 1] = 30;
1741  fT2d_DSSC[dee - 1][133 - 1] = 22;
1742  fT2d_DSSC[dee - 1][134 - 1] = 15;
1743  fT2d_DSSC[dee - 1][135 - 1] = 9;
1744  fT2d_DSSC[dee - 1][136 - 1] = 5;
1745  fT2d_DSSC[dee - 1][137 - 1] = 2;
1746  fT2d_DSSC[dee - 1][138 - 1] = 3; // (178a, 29a for construction)
1747 
1748  fT2d_DSSC[dee - 1][152 - 1] = 31;
1749  fT2d_DSSC[dee - 1][153 - 1] = 23;
1750  fT2d_DSSC[dee - 1][154 - 1] = 16;
1751  fT2d_DSSC[dee - 1][155 - 1] = 10;
1752  fT2d_DSSC[dee - 1][156 - 1] = 6;
1753  fT2d_DSSC[dee - 1][157 - 1] = 3; // (178b, 29b for construction)
1754 
1755  fT2d_DSSC[dee - 1][173 - 1] = 24;
1756  fT2d_DSSC[dee - 1][174 - 1] = 17;
1757  fT2d_DSSC[dee - 1][175 - 1] = 11;
1758  fT2d_DSSC[dee - 1][176 - 1] = 25; // (207a, 58a for construction)
1759 
1760  fT2d_DSSC[dee - 1][193 - 1] = 25; // (207b, 58b for construction)
1761 
1762  //.......................................... S3 (D1,D4), S7 (D2,D3) ; 34 SC's
1763  fT2d_DSSC[dee - 1][50 - 1] = 10;
1764 
1765  fT2d_DSSC[dee - 1][69 - 1] = 18;
1766  fT2d_DSSC[dee - 1][70 - 1] = 11;
1767  fT2d_DSSC[dee - 1][71 - 1] = 3;
1768 
1769  fT2d_DSSC[dee - 1][88 - 1] = 25;
1770  fT2d_DSSC[dee - 1][89 - 1] = 19;
1771  fT2d_DSSC[dee - 1][90 - 1] = 12;
1772  fT2d_DSSC[dee - 1][91 - 1] = 4;
1773 
1774  fT2d_DSSC[dee - 1][108 - 1] = 26;
1775  fT2d_DSSC[dee - 1][109 - 1] = 20;
1776  fT2d_DSSC[dee - 1][110 - 1] = 13;
1777  fT2d_DSSC[dee - 1][111 - 1] = 5;
1778 
1779  fT2d_DSSC[dee - 1][127 - 1] = 31;
1780  fT2d_DSSC[dee - 1][128 - 1] = 27;
1781  fT2d_DSSC[dee - 1][129 - 1] = 21;
1782  fT2d_DSSC[dee - 1][130 - 1] = 14;
1783  fT2d_DSSC[dee - 1][131 - 1] = 6;
1784 
1785  fT2d_DSSC[dee - 1][147 - 1] = 32;
1786  fT2d_DSSC[dee - 1][148 - 1] = 28;
1787  fT2d_DSSC[dee - 1][149 - 1] = 22;
1788  fT2d_DSSC[dee - 1][150 - 1] = 15;
1789  fT2d_DSSC[dee - 1][151 - 1] = 7;
1790 
1791  fT2d_DSSC[dee - 1][166 - 1] = 33;
1792  fT2d_DSSC[dee - 1][167 - 1] = 30;
1793  fT2d_DSSC[dee - 1][168 - 1] = 29;
1794  fT2d_DSSC[dee - 1][169 - 1] = 23;
1795  fT2d_DSSC[dee - 1][170 - 1] = 16;
1796  fT2d_DSSC[dee - 1][171 - 1] = 8;
1797  fT2d_DSSC[dee - 1][172 - 1] = 1;
1798 
1799  fT2d_DSSC[dee - 1][188 - 1] = 34; // (298a, 149a for construction)
1800  fT2d_DSSC[dee - 1][189 - 1] = 24;
1801  fT2d_DSSC[dee - 1][190 - 1] = 17;
1802  fT2d_DSSC[dee - 1][191 - 1] = 9;
1803  fT2d_DSSC[dee - 1][192 - 1] = 2;
1804 
1805  //.......................................... S4 (D1,D4), S6 (D2,D3) ; 33 SC's
1806  fT2d_DSSC[dee - 1][27 - 1] = 33;
1807  fT2d_DSSC[dee - 1][28 - 1] = 32;
1808  fT2d_DSSC[dee - 1][29 - 1] = 14; // also 21; // ( (261a, 112a) also (268a, 119a) for construction)
1809 
1810  fT2d_DSSC[dee - 1][44 - 1] = 22;
1811  fT2d_DSSC[dee - 1][45 - 1] = 15;
1812  fT2d_DSSC[dee - 1][46 - 1] = 8;
1813  fT2d_DSSC[dee - 1][47 - 1] = 4;
1814  fT2d_DSSC[dee - 1][48 - 1] = 2;
1815  fT2d_DSSC[dee - 1][49 - 1] = 1;
1816 
1817  fT2d_DSSC[dee - 1][62 - 1] = 29;
1818  fT2d_DSSC[dee - 1][63 - 1] = 28;
1819  fT2d_DSSC[dee - 1][64 - 1] = 23;
1820  fT2d_DSSC[dee - 1][65 - 1] = 16;
1821  fT2d_DSSC[dee - 1][66 - 1] = 9;
1822  fT2d_DSSC[dee - 1][67 - 1] = 5;
1823  fT2d_DSSC[dee - 1][68 - 1] = 3;
1824 
1825  fT2d_DSSC[dee - 1][82 - 1] = 31;
1826  fT2d_DSSC[dee - 1][83 - 1] = 30;
1827  fT2d_DSSC[dee - 1][84 - 1] = 24;
1828  fT2d_DSSC[dee - 1][85 - 1] = 17;
1829  fT2d_DSSC[dee - 1][86 - 1] = 10;
1830  fT2d_DSSC[dee - 1][87 - 1] = 6;
1831 
1832  fT2d_DSSC[dee - 1][102 - 1] = 21; // (268c, 119c for construction)
1833  fT2d_DSSC[dee - 1][103 - 1] = 27;
1834  fT2d_DSSC[dee - 1][104 - 1] = 25;
1835  fT2d_DSSC[dee - 1][105 - 1] = 18;
1836  fT2d_DSSC[dee - 1][106 - 1] = 11;
1837  fT2d_DSSC[dee - 1][107 - 1] = 7;
1838 
1839  fT2d_DSSC[dee - 1][123 - 1] = 21; // (268b, 119b for construction)
1840  fT2d_DSSC[dee - 1][124 - 1] = 26;
1841  fT2d_DSSC[dee - 1][125 - 1] = 19;
1842  fT2d_DSSC[dee - 1][126 - 1] = 12;
1843 
1844  fT2d_DSSC[dee - 1][144 - 1] = 14; // (261c, 112c for construction)
1845  fT2d_DSSC[dee - 1][145 - 1] = 20;
1846  fT2d_DSSC[dee - 1][146 - 1] = 13;
1847 
1848  fT2d_DSSC[dee - 1][165 - 1] = 14; // (261b, 112b for construction)
1849 
1850  //.......................................... S5 (2*17 = 34 SC's)
1851  if (dee == 1 || dee == 3) {
1852  fT2d_DSSC[dee - 1][1 - 1] = 34;
1853  fT2d_DSSC[dee - 1][2 - 1] = 33;
1854  fT2d_DSSC[dee - 1][3 - 1] = 32;
1855  fT2d_DSSC[dee - 1][4 - 1] = 31;
1856  fT2d_DSSC[dee - 1][5 - 1] = 26;
1857  fT2d_DSSC[dee - 1][6 - 1] = 25;
1858  fT2d_DSSC[dee - 1][7 - 1] = 24;
1859  fT2d_DSSC[dee - 1][8 - 1] = 23;
1860 
1861  fT2d_DSSC[dee - 1][21 - 1] = 30;
1862  fT2d_DSSC[dee - 1][22 - 1] = 29;
1863  fT2d_DSSC[dee - 1][23 - 1] = 28;
1864  fT2d_DSSC[dee - 1][24 - 1] = 27;
1865  fT2d_DSSC[dee - 1][25 - 1] = 22;
1866  fT2d_DSSC[dee - 1][26 - 1] = 21;
1867 
1868  fT2d_DSSC[dee - 1][41 - 1] = 20; // (281a for construction)
1869  fT2d_DSSC[dee - 1][42 - 1] = 19;
1870  fT2d_DSSC[dee - 1][43 - 1] = 18;
1871  }
1872 
1873  if (dee == 2 || dee == 4) {
1874  fT2d_DSSC[dee - 1][1 - 1] = 17;
1875  fT2d_DSSC[dee - 1][2 - 1] = 16;
1876  fT2d_DSSC[dee - 1][3 - 1] = 15;
1877  fT2d_DSSC[dee - 1][4 - 1] = 14;
1878  fT2d_DSSC[dee - 1][5 - 1] = 9;
1879  fT2d_DSSC[dee - 1][6 - 1] = 8;
1880  fT2d_DSSC[dee - 1][7 - 1] = 7;
1881  fT2d_DSSC[dee - 1][8 - 1] = 6;
1882 
1883  fT2d_DSSC[dee - 1][21 - 1] = 13;
1884  fT2d_DSSC[dee - 1][22 - 1] = 12;
1885  fT2d_DSSC[dee - 1][23 - 1] = 11;
1886  fT2d_DSSC[dee - 1][24 - 1] = 10;
1887  fT2d_DSSC[dee - 1][25 - 1] = 5;
1888  fT2d_DSSC[dee - 1][26 - 1] = 4;
1889 
1890  fT2d_DSSC[dee - 1][41 - 1] = 3; // (132a for construction)
1891  fT2d_DSSC[dee - 1][42 - 1] = 2;
1892  fT2d_DSSC[dee - 1][43 - 1] = 1;
1893  }
1894  }
1895  //............................... Numbers for construction: fT2d_DeeSCCons[][]
1896  // fT2d_DeeSCCons[dee-1][SC ECNA number - 1] = SC number for construction;
1897 
1898  //............................... init to -1
1899  for (Int_t dee = 1; dee <= 4; dee++) {
1900  for (Int_t isc = 1; isc <= MaxDeeSC; isc++) {
1901  fT2d_DeeSCCons[dee - 1][isc - 1] = -1;
1902  }
1903  }
1904 
1905  for (Int_t i_dee_type = 1; i_dee_type <= 2; i_dee_type++) {
1906  Int_t dee = -1;
1907  if (i_dee_type == 1) {
1908  dee = 1;
1909  }
1910  if (i_dee_type == 2) {
1911  dee = 3;
1912  }
1913 
1914  //.......................................... (D1,S1 or D3,S9) AND (D2,S9 or D4,S1)
1915  // number in comment = fT2d_DSSC[dee-1][SC ECNA nb - 1] (= SC number in DS)
1916  fT2d_DeeSCCons[dee - 1][13 - 1] = 161;
1917  fT2d_DeeSCCons[dee][13 - 1] = 12; // 12;
1918  fT2d_DeeSCCons[dee - 1][14 - 1] = 160;
1919  fT2d_DeeSCCons[dee][14 - 1] = 11; // 11;
1920  fT2d_DeeSCCons[dee - 1][15 - 1] = 159;
1921  fT2d_DeeSCCons[dee][15 - 1] = 10; // 10;
1922  fT2d_DeeSCCons[dee - 1][16 - 1] = 158;
1923  fT2d_DeeSCCons[dee][16 - 1] = 9; // 9;
1924  fT2d_DeeSCCons[dee - 1][17 - 1] = 153;
1925  fT2d_DeeSCCons[dee][17 - 1] = 4; // 4;
1926  fT2d_DeeSCCons[dee - 1][18 - 1] = 152;
1927  fT2d_DeeSCCons[dee][18 - 1] = 3; // 3;
1928  fT2d_DeeSCCons[dee - 1][19 - 1] = 151;
1929  fT2d_DeeSCCons[dee][19 - 1] = 2; // 2;
1930  fT2d_DeeSCCons[dee - 1][20 - 1] = 150;
1931  fT2d_DeeSCCons[dee][20 - 1] = 1; // 1;
1932 
1933  fT2d_DeeSCCons[dee - 1][33 - 1] = 165;
1934  fT2d_DeeSCCons[dee][33 - 1] = 16; // 16;
1935  fT2d_DeeSCCons[dee - 1][34 - 1] = 164;
1936  fT2d_DeeSCCons[dee][34 - 1] = 15; // 15;
1937  fT2d_DeeSCCons[dee - 1][35 - 1] = 163;
1938  fT2d_DeeSCCons[dee][35 - 1] = 14; // 14;
1939  fT2d_DeeSCCons[dee - 1][36 - 1] = 162;
1940  fT2d_DeeSCCons[dee][36 - 1] = 13; // 13;
1941  fT2d_DeeSCCons[dee - 1][37 - 1] = 157;
1942  fT2d_DeeSCCons[dee][37 - 1] = 8; // 8;
1943  fT2d_DeeSCCons[dee - 1][38 - 1] = 156;
1944  fT2d_DeeSCCons[dee][38 - 1] = 7; // 7;
1945  fT2d_DeeSCCons[dee - 1][39 - 1] = 155;
1946  fT2d_DeeSCCons[dee][39 - 1] = 6; // 6;
1947  fT2d_DeeSCCons[dee - 1][40 - 1] = 154;
1948  fT2d_DeeSCCons[dee][40 - 1] = 5; // 5;
1949 
1950  fT2d_DeeSCCons[dee - 1][54 - 1] = 193;
1951  fT2d_DeeSCCons[dee][54 - 1] = 44; // 33;
1952  fT2d_DeeSCCons[dee - 1][55 - 1] = 186;
1953  fT2d_DeeSCCons[dee][55 - 1] = 37; // 31;
1954  fT2d_DeeSCCons[dee - 1][56 - 1] = 179;
1955  fT2d_DeeSCCons[dee][56 - 1] = 30; // 27;
1956  fT2d_DeeSCCons[dee - 1][57 - 1] = 173;
1957  fT2d_DeeSCCons[dee][57 - 1] = 24; // 24;
1958  fT2d_DeeSCCons[dee - 1][58 - 1] = 169;
1959  fT2d_DeeSCCons[dee][58 - 1] = 20; // 20;
1960  fT2d_DeeSCCons[dee - 1][59 - 1] = 166;
1961  fT2d_DeeSCCons[dee][59 - 1] = 17; // 17;
1962  fT2d_DeeSCCons[dee - 1][60 - 1] = 182;
1963  fT2d_DeeSCCons[dee][60 - 1] = 33; // 30; // 182a ; 33a;
1964 
1965  fT2d_DeeSCCons[dee - 1][75 - 1] = 187;
1966  fT2d_DeeSCCons[dee][75 - 1] = 38; // 32;
1967  fT2d_DeeSCCons[dee - 1][76 - 1] = 180;
1968  fT2d_DeeSCCons[dee][76 - 1] = 31; // 28;
1969  fT2d_DeeSCCons[dee - 1][77 - 1] = 174;
1970  fT2d_DeeSCCons[dee][77 - 1] = 25; // 25;
1971  fT2d_DeeSCCons[dee - 1][78 - 1] = 170;
1972  fT2d_DeeSCCons[dee][78 - 1] = 21; // 21;
1973  fT2d_DeeSCCons[dee - 1][79 - 1] = 167;
1974  fT2d_DeeSCCons[dee][79 - 1] = 18; // 18;
1975 
1976  fT2d_DeeSCCons[dee - 1][96 - 1] = 181;
1977  fT2d_DeeSCCons[dee][96 - 1] = 32; // 29;
1978  fT2d_DeeSCCons[dee - 1][97 - 1] = 175;
1979  fT2d_DeeSCCons[dee][97 - 1] = 26; // 26;
1980  fT2d_DeeSCCons[dee - 1][98 - 1] = 171;
1981  fT2d_DeeSCCons[dee][98 - 1] = 22; // 22;
1982  fT2d_DeeSCCons[dee - 1][99 - 1] = 168;
1983  fT2d_DeeSCCons[dee][99 - 1] = 19; // 19;
1984 
1985  fT2d_DeeSCCons[dee - 1][118 - 1] = 172;
1986  fT2d_DeeSCCons[dee][118 - 1] = 23; // 23;
1987  fT2d_DeeSCCons[dee - 1][119 - 1] = 182;
1988  fT2d_DeeSCCons[dee][119 - 1] = 33; // 30; // 182b ; 33b;
1989 
1990  //.......................................... (D1,S2 or D3,S8) AND (D2,S8 or D4,S2)
1991  fT2d_DeeSCCons[dee - 1][32 - 1] = 178;
1992  fT2d_DeeSCCons[dee][32 - 1] = 29; // 25-3; // 178c-207c ; 29c-58c;
1993 
1994  fT2d_DeeSCCons[dee - 1][51 - 1] = 216;
1995  fT2d_DeeSCCons[dee][51 - 1] = 67; // 32;
1996  fT2d_DeeSCCons[dee - 1][52 - 1] = 208;
1997  fT2d_DeeSCCons[dee][52 - 1] = 59; // 26;
1998  fT2d_DeeSCCons[dee - 1][53 - 1] = 200;
1999  fT2d_DeeSCCons[dee][53 - 1] = 51; // 18;
2000 
2001  fT2d_DeeSCCons[dee - 1][72 - 1] = 209;
2002  fT2d_DeeSCCons[dee][72 - 1] = 60; // 27;
2003  fT2d_DeeSCCons[dee - 1][73 - 1] = 201;
2004  fT2d_DeeSCCons[dee][73 - 1] = 52; // 19;
2005  fT2d_DeeSCCons[dee - 1][74 - 1] = 194;
2006  fT2d_DeeSCCons[dee][74 - 1] = 45; // 12;
2007 
2008  fT2d_DeeSCCons[dee - 1][92 - 1] = 210;
2009  fT2d_DeeSCCons[dee][92 - 1] = 61; // 28;
2010  fT2d_DeeSCCons[dee - 1][93 - 1] = 202;
2011  fT2d_DeeSCCons[dee][93 - 1] = 53; // 20;
2012  fT2d_DeeSCCons[dee - 1][94 - 1] = 195;
2013  fT2d_DeeSCCons[dee][94 - 1] = 46; // 13;
2014  fT2d_DeeSCCons[dee - 1][95 - 1] = 188;
2015  fT2d_DeeSCCons[dee][95 - 1] = 39; // 7;
2016 
2017  fT2d_DeeSCCons[dee - 1][112 - 1] = 211;
2018  fT2d_DeeSCCons[dee][112 - 1] = 62; // 29;
2019  fT2d_DeeSCCons[dee - 1][113 - 1] = 203;
2020  fT2d_DeeSCCons[dee][113 - 1] = 54; // 21;
2021  fT2d_DeeSCCons[dee - 1][114 - 1] = 196;
2022  fT2d_DeeSCCons[dee][114 - 1] = 47; // 14;
2023  fT2d_DeeSCCons[dee - 1][115 - 1] = 189;
2024  fT2d_DeeSCCons[dee][115 - 1] = 40; // 8;
2025  fT2d_DeeSCCons[dee - 1][116 - 1] = 183;
2026  fT2d_DeeSCCons[dee][116 - 1] = 34; // 4;
2027  fT2d_DeeSCCons[dee - 1][117 - 1] = 176;
2028  fT2d_DeeSCCons[dee][117 - 1] = 27; // 1;
2029 
2030  fT2d_DeeSCCons[dee - 1][132 - 1] = 212;
2031  fT2d_DeeSCCons[dee][132 - 1] = 63; // 30;
2032  fT2d_DeeSCCons[dee - 1][133 - 1] = 204;
2033  fT2d_DeeSCCons[dee][133 - 1] = 55; // 22;
2034  fT2d_DeeSCCons[dee - 1][134 - 1] = 197;
2035  fT2d_DeeSCCons[dee][134 - 1] = 48; // 15;
2036  fT2d_DeeSCCons[dee - 1][135 - 1] = 190;
2037  fT2d_DeeSCCons[dee][135 - 1] = 41; // 9;
2038  fT2d_DeeSCCons[dee - 1][136 - 1] = 184;
2039  fT2d_DeeSCCons[dee][136 - 1] = 35; // 5;
2040  fT2d_DeeSCCons[dee - 1][137 - 1] = 177;
2041  fT2d_DeeSCCons[dee][137 - 1] = 28; // 2;
2042  fT2d_DeeSCCons[dee - 1][138 - 1] = 178;
2043  fT2d_DeeSCCons[dee][138 - 1] = 29; // 3; // 178a ; 29a;
2044 
2045  fT2d_DeeSCCons[dee - 1][152 - 1] = 213;
2046  fT2d_DeeSCCons[dee][152 - 1] = 64; // 31;
2047  fT2d_DeeSCCons[dee - 1][153 - 1] = 205;
2048  fT2d_DeeSCCons[dee][153 - 1] = 56; // 23;
2049  fT2d_DeeSCCons[dee - 1][154 - 1] = 198;
2050  fT2d_DeeSCCons[dee][154 - 1] = 49; // 16;
2051  fT2d_DeeSCCons[dee - 1][155 - 1] = 191;
2052  fT2d_DeeSCCons[dee][155 - 1] = 42; // 10;
2053  fT2d_DeeSCCons[dee - 1][156 - 1] = 185;
2054  fT2d_DeeSCCons[dee][156 - 1] = 36; // 6;
2055  fT2d_DeeSCCons[dee - 1][157 - 1] = 178;
2056  fT2d_DeeSCCons[dee][157 - 1] = 29; // 3; // 178b ; 29b;
2057 
2058  fT2d_DeeSCCons[dee - 1][173 - 1] = 206;
2059  fT2d_DeeSCCons[dee][173 - 1] = 57; // 24;
2060  fT2d_DeeSCCons[dee - 1][174 - 1] = 199;
2061  fT2d_DeeSCCons[dee][174 - 1] = 50; // 17;
2062  fT2d_DeeSCCons[dee - 1][175 - 1] = 192;
2063  fT2d_DeeSCCons[dee][175 - 1] = 43; // 11;
2064  fT2d_DeeSCCons[dee - 1][176 - 1] = 207;
2065  fT2d_DeeSCCons[dee][176 - 1] = 58; // 25; // 58a ; 207a;
2066 
2067  fT2d_DeeSCCons[dee - 1][193 - 1] = 207;
2068  fT2d_DeeSCCons[dee][193 - 1] = 58; // 25; // 58b ; 207b;
2069 
2070  //.......................................... (D1,S3 or D3,S7) AND (D2,S7 or D4,S3)
2071  fT2d_DeeSCCons[dee - 1][50 - 1] = 224;
2072  fT2d_DeeSCCons[dee][50 - 1] = 75; // 10;
2073 
2074  fT2d_DeeSCCons[dee - 1][69 - 1] = 233;
2075  fT2d_DeeSCCons[dee][69 - 1] = 84; // 18;
2076  fT2d_DeeSCCons[dee - 1][70 - 1] = 225;
2077  fT2d_DeeSCCons[dee][70 - 1] = 76; // 11;
2078  fT2d_DeeSCCons[dee - 1][71 - 1] = 217;
2079  fT2d_DeeSCCons[dee][71 - 1] = 68; // 3;
2080 
2081  fT2d_DeeSCCons[dee - 1][88 - 1] = 242;
2082  fT2d_DeeSCCons[dee][88 - 1] = 93; // 25;
2083  fT2d_DeeSCCons[dee - 1][89 - 1] = 234;
2084  fT2d_DeeSCCons[dee][89 - 1] = 85; // 19;
2085  fT2d_DeeSCCons[dee - 1][90 - 1] = 226;
2086  fT2d_DeeSCCons[dee][90 - 1] = 77; // 12;
2087  fT2d_DeeSCCons[dee - 1][91 - 1] = 218;
2088  fT2d_DeeSCCons[dee][91 - 1] = 69; // 4;
2089 
2090  fT2d_DeeSCCons[dee - 1][108 - 1] = 243;
2091  fT2d_DeeSCCons[dee][108 - 1] = 94; // 26;
2092  fT2d_DeeSCCons[dee - 1][109 - 1] = 235;
2093  fT2d_DeeSCCons[dee][109 - 1] = 86; // 20;
2094  fT2d_DeeSCCons[dee - 1][110 - 1] = 227;
2095  fT2d_DeeSCCons[dee][110 - 1] = 78; // 13;
2096  fT2d_DeeSCCons[dee - 1][111 - 1] = 219;
2097  fT2d_DeeSCCons[dee][111 - 1] = 70; // 5;
2098 
2099  fT2d_DeeSCCons[dee - 1][127 - 1] = 252;
2100  fT2d_DeeSCCons[dee][127 - 1] = 103; // 31;
2101  fT2d_DeeSCCons[dee - 1][128 - 1] = 244;
2102  fT2d_DeeSCCons[dee][128 - 1] = 95; // 27;
2103  fT2d_DeeSCCons[dee - 1][129 - 1] = 236;
2104  fT2d_DeeSCCons[dee][129 - 1] = 87; // 21;
2105  fT2d_DeeSCCons[dee - 1][130 - 1] = 228;
2106  fT2d_DeeSCCons[dee][130 - 1] = 79; // 14;
2107  fT2d_DeeSCCons[dee - 1][131 - 1] = 220;
2108  fT2d_DeeSCCons[dee][131 - 1] = 71; // 6;
2109 
2110  fT2d_DeeSCCons[dee - 1][147 - 1] = 253;
2111  fT2d_DeeSCCons[dee][147 - 1] = 104; // 32;
2112  fT2d_DeeSCCons[dee - 1][148 - 1] = 245;
2113  fT2d_DeeSCCons[dee][148 - 1] = 96; // 28;
2114  fT2d_DeeSCCons[dee - 1][149 - 1] = 237;
2115  fT2d_DeeSCCons[dee][149 - 1] = 88; // 22;
2116  fT2d_DeeSCCons[dee - 1][150 - 1] = 229;
2117  fT2d_DeeSCCons[dee][150 - 1] = 80; // 15;
2118  fT2d_DeeSCCons[dee - 1][151 - 1] = 221;
2119  fT2d_DeeSCCons[dee][151 - 1] = 72; // 7;
2120 
2121  fT2d_DeeSCCons[dee - 1][166 - 1] = 254;
2122  fT2d_DeeSCCons[dee][166 - 1] = 105; // 33;
2123  fT2d_DeeSCCons[dee - 1][167 - 1] = 247;
2124  fT2d_DeeSCCons[dee][167 - 1] = 98; // 30;
2125  fT2d_DeeSCCons[dee - 1][168 - 1] = 246;
2126  fT2d_DeeSCCons[dee][168 - 1] = 97; // 29;
2127  fT2d_DeeSCCons[dee - 1][169 - 1] = 238;
2128  fT2d_DeeSCCons[dee][169 - 1] = 89; // 23;
2129  fT2d_DeeSCCons[dee - 1][170 - 1] = 230;
2130  fT2d_DeeSCCons[dee][170 - 1] = 81; // 16;
2131  fT2d_DeeSCCons[dee - 1][171 - 1] = 222;
2132  fT2d_DeeSCCons[dee][171 - 1] = 73; // 8;
2133  fT2d_DeeSCCons[dee - 1][172 - 1] = 214;
2134  fT2d_DeeSCCons[dee][172 - 1] = 65; // 1;
2135 
2136  fT2d_DeeSCCons[dee - 1][188 - 1] = 298;
2137  fT2d_DeeSCCons[dee][188 - 1] = 149; // 24; // 298a ; 149a;
2138  fT2d_DeeSCCons[dee - 1][189 - 1] = 239;
2139  fT2d_DeeSCCons[dee][189 - 1] = 90; // 24;
2140  fT2d_DeeSCCons[dee - 1][190 - 1] = 231;
2141  fT2d_DeeSCCons[dee][190 - 1] = 82; // 17;
2142  fT2d_DeeSCCons[dee - 1][191 - 1] = 223;
2143  fT2d_DeeSCCons[dee][191 - 1] = 74; // 9;
2144  fT2d_DeeSCCons[dee - 1][192 - 1] = 215;
2145  fT2d_DeeSCCons[dee][192 - 1] = 66; // 2;
2146 
2147  //.......................................... (D1,S4 or D3,S6) AND (D2,S6 or D4,S4)
2148  fT2d_DeeSCCons[dee - 1][29 - 1] = 261;
2149  fT2d_DeeSCCons[dee][29 - 1] = 112; // 14-21; // 261a-268a ; 112a-119a;
2150  fT2d_DeeSCCons[dee - 1][27 - 1] = 283;
2151  fT2d_DeeSCCons[dee][27 - 1] = 134; // 33;
2152  fT2d_DeeSCCons[dee - 1][28 - 1] = 282;
2153  fT2d_DeeSCCons[dee][28 - 1] = 133; // 32;
2154 
2155  fT2d_DeeSCCons[dee - 1][44 - 1] = 269;
2156  fT2d_DeeSCCons[dee][44 - 1] = 120; // 22;
2157  fT2d_DeeSCCons[dee - 1][45 - 1] = 262;
2158  fT2d_DeeSCCons[dee][45 - 1] = 113; // 15;
2159  fT2d_DeeSCCons[dee - 1][46 - 1] = 255;
2160  fT2d_DeeSCCons[dee][46 - 1] = 106; // 8;
2161  fT2d_DeeSCCons[dee - 1][47 - 1] = 248;
2162  fT2d_DeeSCCons[dee][47 - 1] = 99; // 4;
2163  fT2d_DeeSCCons[dee - 1][48 - 1] = 240;
2164  fT2d_DeeSCCons[dee][48 - 1] = 91; // 2;
2165  fT2d_DeeSCCons[dee - 1][49 - 1] = 232;
2166  fT2d_DeeSCCons[dee][49 - 1] = 83; // 1;
2167 
2168  fT2d_DeeSCCons[dee - 1][62 - 1] = 276;
2169  fT2d_DeeSCCons[dee][62 - 1] = 127; // 29;
2170  fT2d_DeeSCCons[dee - 1][63 - 1] = 275;
2171  fT2d_DeeSCCons[dee][63 - 1] = 126; // 28;
2172  fT2d_DeeSCCons[dee - 1][64 - 1] = 270;
2173  fT2d_DeeSCCons[dee][64 - 1] = 121; // 23;
2174  fT2d_DeeSCCons[dee - 1][65 - 1] = 263;
2175  fT2d_DeeSCCons[dee][65 - 1] = 114; // 16;
2176  fT2d_DeeSCCons[dee - 1][66 - 1] = 256;
2177  fT2d_DeeSCCons[dee][66 - 1] = 107; // 9;
2178  fT2d_DeeSCCons[dee - 1][67 - 1] = 249;
2179  fT2d_DeeSCCons[dee][67 - 1] = 100; // 5;
2180  fT2d_DeeSCCons[dee - 1][68 - 1] = 241;
2181  fT2d_DeeSCCons[dee][68 - 1] = 92; // 3;
2182 
2183  fT2d_DeeSCCons[dee - 1][82 - 1] = 278;
2184  fT2d_DeeSCCons[dee][82 - 1] = 129; // 31;
2185  fT2d_DeeSCCons[dee - 1][83 - 1] = 277;
2186  fT2d_DeeSCCons[dee][83 - 1] = 128; // 30;
2187  fT2d_DeeSCCons[dee - 1][84 - 1] = 271;
2188  fT2d_DeeSCCons[dee][84 - 1] = 122; // 24;
2189  fT2d_DeeSCCons[dee - 1][85 - 1] = 264;
2190  fT2d_DeeSCCons[dee][85 - 1] = 115; // 17;
2191  fT2d_DeeSCCons[dee - 1][86 - 1] = 257;
2192  fT2d_DeeSCCons[dee][86 - 1] = 108; // 10;
2193  fT2d_DeeSCCons[dee - 1][87 - 1] = 250;
2194  fT2d_DeeSCCons[dee][87 - 1] = 101; // 6;
2195 
2196  fT2d_DeeSCCons[dee - 1][102 - 1] = 268;
2197  fT2d_DeeSCCons[dee][102 - 1] = 119; // 21; // 268c ; 119c;
2198  fT2d_DeeSCCons[dee - 1][103 - 1] = 274;
2199  fT2d_DeeSCCons[dee][103 - 1] = 125; // 27;
2200  fT2d_DeeSCCons[dee - 1][104 - 1] = 272;
2201  fT2d_DeeSCCons[dee][104 - 1] = 123; // 25;
2202  fT2d_DeeSCCons[dee - 1][105 - 1] = 265;
2203  fT2d_DeeSCCons[dee][105 - 1] = 116; // 18;
2204  fT2d_DeeSCCons[dee - 1][106 - 1] = 258;
2205  fT2d_DeeSCCons[dee][106 - 1] = 109; // 11;
2206  fT2d_DeeSCCons[dee - 1][107 - 1] = 251;
2207  fT2d_DeeSCCons[dee][107 - 1] = 102; // 7;
2208 
2209  fT2d_DeeSCCons[dee - 1][123 - 1] = 268;
2210  fT2d_DeeSCCons[dee][123 - 1] = 119; // 27; // 268b ; 119b;
2211  fT2d_DeeSCCons[dee - 1][124 - 1] = 273;
2212  fT2d_DeeSCCons[dee][124 - 1] = 124; // 26;
2213  fT2d_DeeSCCons[dee - 1][125 - 1] = 266;
2214  fT2d_DeeSCCons[dee][125 - 1] = 117; // 19;
2215  fT2d_DeeSCCons[dee - 1][126 - 1] = 259;
2216  fT2d_DeeSCCons[dee][126 - 1] = 110; // 12;
2217 
2218  fT2d_DeeSCCons[dee - 1][144 - 1] = 261;
2219  fT2d_DeeSCCons[dee][144 - 1] = 112; // 27; // 261c ; 112c;
2220  fT2d_DeeSCCons[dee - 1][145 - 1] = 267;
2221  fT2d_DeeSCCons[dee][145 - 1] = 118; // 20;
2222  fT2d_DeeSCCons[dee - 1][146 - 1] = 260;
2223  fT2d_DeeSCCons[dee][146 - 1] = 111; // 13;
2224 
2225  fT2d_DeeSCCons[dee - 1][165 - 1] = 261;
2226  fT2d_DeeSCCons[dee][165 - 1] = 112; // 27; // 261b ; 112b;
2227 
2228  //.......................................... D1 or D3, right half of S5
2229  fT2d_DeeSCCons[dee - 1][1 - 1] = 297; // 34;
2230  fT2d_DeeSCCons[dee - 1][2 - 1] = 296; // 33;
2231  fT2d_DeeSCCons[dee - 1][3 - 1] = 295; // 32;
2232  fT2d_DeeSCCons[dee - 1][4 - 1] = 294; // 31;
2233  fT2d_DeeSCCons[dee - 1][5 - 1] = 289; // 26;
2234  fT2d_DeeSCCons[dee - 1][6 - 1] = 288; // 25;
2235  fT2d_DeeSCCons[dee - 1][7 - 1] = 287; // 24;
2236  fT2d_DeeSCCons[dee - 1][8 - 1] = 286; // 23;
2237 
2238  fT2d_DeeSCCons[dee - 1][21 - 1] = 293; // 30;
2239  fT2d_DeeSCCons[dee - 1][22 - 1] = 292; // 29;
2240  fT2d_DeeSCCons[dee - 1][23 - 1] = 291; // 28;
2241  fT2d_DeeSCCons[dee - 1][24 - 1] = 290; // 27;
2242  fT2d_DeeSCCons[dee - 1][25 - 1] = 285; // 22;
2243  fT2d_DeeSCCons[dee - 1][26 - 1] = 284; // 21;
2244 
2245  fT2d_DeeSCCons[dee - 1][41 - 1] = 281; // 20; // 281a
2246  fT2d_DeeSCCons[dee - 1][42 - 1] = 280; // 19;
2247  fT2d_DeeSCCons[dee - 1][43 - 1] = 279; // 18;
2248 
2249  //.......................................... D2 or D4, left half of S5
2250  fT2d_DeeSCCons[dee][1 - 1] = 148; // 17;
2251  fT2d_DeeSCCons[dee][2 - 1] = 147; // 16;
2252  fT2d_DeeSCCons[dee][3 - 1] = 146; // 15;
2253  fT2d_DeeSCCons[dee][4 - 1] = 145; // 14;
2254  fT2d_DeeSCCons[dee][5 - 1] = 140; // 9;
2255  fT2d_DeeSCCons[dee][6 - 1] = 139; // 8;
2256  fT2d_DeeSCCons[dee][7 - 1] = 138; // 7;
2257  fT2d_DeeSCCons[dee][8 - 1] = 137; // 6;
2258 
2259  fT2d_DeeSCCons[dee][21 - 1] = 144; // 13;
2260  fT2d_DeeSCCons[dee][22 - 1] = 143; // 12;
2261  fT2d_DeeSCCons[dee][23 - 1] = 142; // 11;
2262  fT2d_DeeSCCons[dee][24 - 1] = 141; // 10;
2263  fT2d_DeeSCCons[dee][25 - 1] = 136; // 5;
2264  fT2d_DeeSCCons[dee][26 - 1] = 135; // 4;
2265 
2266  fT2d_DeeSCCons[dee][41 - 1] = 132; // 3; // 132a
2267  fT2d_DeeSCCons[dee][42 - 1] = 131; // 2;
2268  fT2d_DeeSCCons[dee][43 - 1] = 130; // 1;
2269  }
2270 
2271  //........................ ECNA numbers from numbers for constructions: fT2d_RecovDeeSC[][]
2272 
2273  for (Int_t i0EEDee = 0; i0EEDee < MaxEEDee; i0EEDee++) {
2274  for (Int_t i_ecna = 0; i_ecna < MaxDeeSC; i_ecna++) {
2275  //....... test to avoid the -1 init value in 2nd index of array fT2d_RecovDeeSC[][]
2276  // (part of the matrix without real SC counterpart)
2277  if (fT2d_DeeSCCons[i0EEDee][i_ecna] >= 0 && fT2d_DeeSCCons[i0EEDee][i_ecna] <= MaxEESCForCons) {
2278  fT2d_RecovDeeSC[i0EEDee][fT2d_DeeSCCons[i0EEDee][i_ecna] - 1] = i_ecna + 1;
2279  }
2280  }
2281  }
2282 }
Int_t ** fT2d_DS
Int_t ** fT2d_RecovDeeSC
Int_t * fT1d_DeeSCCons
TEcnaParEcal * fEcal
Int_t ** fT2d_DSSC
Int_t MaxSCEcnaInDee()
Int_t * fT1d_RecovDeeSC
Int_t MaxSCForConsInDee()
Int_t ** fT2d_DeeSCCons
Int_t MaxDeeInEE()

◆ Get0SMEchaFrom1SMTowAnd0TowEcha()

Int_t TEcnaNumbering::Get0SMEchaFrom1SMTowAnd0TowEcha ( const Int_t &  n1SMTow,
const Int_t &  i0TowEcha 
)

Definition at line 569 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxCrysInTow().

Referenced by TEcnaHistos::TowerCrystalNumbering().

569  {
570  //get tower number from electronic channel number in SM
571 
572  Int_t i0SMEcha = (n1SMTow - 1) * fEcal->MaxCrysInTow() + i0TowEcha;
573 
574  return i0SMEcha;
575 }
TEcnaParEcal * fEcal
Int_t MaxCrysInTow()

◆ Get0StexEchaFrom1StexStinAnd0StinEcha()

Int_t TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha ( const Int_t &  n1StexStin,
const Int_t &  i0StinEcha 
)

Definition at line 2969 of file TEcnaNumbering.cc.

References gather_cfg::cout, fEcal, fTTBELL, and TEcnaParEcal::MaxCrysInStin().

Referenced by TEcnaRun::AverageHighFrequencyNoise(), TEcnaRun::AverageLowFrequencyNoise(), TEcnaRun::AverageMeanCorrelationsBetweenSamples(), TEcnaRun::AveragePedestals(), TEcnaRun::AverageSigmaOfCorrelationsBetweenSamples(), TEcnaRun::AverageTotalNoise(), TEcnaRead::ReadAverageNumberOfEvents(), TEcnaRead::ReadCorrelationsBetweenSamples(), TEcnaRead::ReadCovariancesBetweenSamples(), TEcnaRead::ReadNumberOfEvents(), TEcnaRead::ReadRelevantCorrelationsBetweenSamples(), TEcnaRead::ReadSampleAdcValues(), TEcnaRead::ReadSampleMeans(), TEcnaRead::ReadSampleSigmas(), and TEcnaHistos::ViewHistime().

2969  {
2970  // Electronic Channel number in Stex from Stin number in Stex
2971  // and from Electronic Channel number in Stin
2972 
2973  Int_t StexEcha = (Int_t)(-1.);
2974 
2975  if (n1StexStin > 0 && n1StexStin <= fEcal->MaxStinEcnaInStex() && i0StinEcha >= 0 &&
2976  i0StinEcha < fEcal->MaxCrysInStin()) {
2977  StexEcha = (n1StexStin - 1) * fEcal->MaxCrysInStin() + i0StinEcha;
2978  } else {
2979  std::cout << "!TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha *** ERROR ***> VALUE"
2980  << " OUT OF RANGE. Forced to -1. Argument values: n1StexStin = " << n1StexStin
2981  << ", channel = " << i0StinEcha << fTTBELL << std::endl;
2982  }
2983  return StexEcha;
2984 }
TEcnaParEcal * fEcal
Int_t MaxCrysInStin()

◆ Get0TowEchaFrom0SMEcha()

Int_t TEcnaNumbering::Get0TowEchaFrom0SMEcha ( const Int_t &  i0SMEcha)

Definition at line 552 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxCrysInTow().

Referenced by TEcnaWrite::fT2dWriteAscii(), and TEcnaWrite::WriteAsciiHisto().

552  {
553  //get electronic channel number in tower from electronic channel number in SM
554 
555  Int_t n1SMTow = i0SMEcha / fEcal->MaxCrysInTow() + 1;
556  Int_t i0TowEcha = i0SMEcha - fEcal->MaxCrysInTow() * (n1SMTow - 1);
557 
558  return i0TowEcha; // range = [0,24]
559 }
TEcnaParEcal * fEcal
Int_t MaxCrysInTow()

◆ Get0TowEchaFrom1SMCrys()

Int_t TEcnaNumbering::Get0TowEchaFrom1SMCrys ( const Int_t &  n1SMCrys)

Definition at line 515 of file TEcnaNumbering.cc.

References gather_cfg::cout, fT1dTowEcha, and fTTBELL.

Referenced by EcnaAnalyzer::analyze().

515  {
516  // get Electronic Channel number in Tower from Crystal number in SuperModule
517 
518  Int_t i0TowEcha = -1;
519 
520  if (n1SMCrys >= 1 && n1SMCrys <= fEcal->MaxCrysInSM()) {
521  i0TowEcha = fT1dTowEcha[n1SMCrys - 1];
522  } else {
523  i0TowEcha = -2;
524  std::cout << "!TEcnaNumbering::Get0TowEchaFrom1SMCrys(...)> Crystal number in SM out of range."
525  << " n1SMCrys = " << n1SMCrys << fTTBELL << std::endl;
526  }
527  return i0TowEcha; // range = [0,24]
528 }
Int_t * fT1dTowEcha

◆ Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha()

Int_t TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha ( const Int_t &  n1DeeSCEcna,
const Int_t &  i0SCEcha,
const TString &  sDeeDir 
)

Definition at line 2291 of file TEcnaNumbering.cc.

References BuildEndcapCrysTable(), gather_cfg::cout, fEcal, fT3dDeeCrys, fTTBELL, GetDeeDirIndex(), and TEcnaParEcal::MaxCrysInSC().

Referenced by Get1StexCrysFrom1StexStinAnd0StinEcha().

2293  {
2294  //get crystal number in Dee from SC number in Dee
2295  // and from Electronic Channel number in super-crystal
2296 
2297  Int_t n1DeeCrys = 0;
2298  Int_t i0DeeDir = GetDeeDirIndex(sDeeDir);
2299 
2300  if (fT3dDeeCrys == nullptr) {
2302  }
2303 
2304  if ((n1DeeSCEcna >= 1) && (n1DeeSCEcna <= fEcal->MaxSCEcnaInDee())) {
2305  if (i0SCEcha >= 0 && i0SCEcha < fEcal->MaxCrysInSC()) {
2306  n1DeeCrys = fT3dDeeCrys[n1DeeSCEcna - 1][i0SCEcha][i0DeeDir];
2307  } else {
2308  n1DeeCrys = -2; // Electronic Cnannel in Super-Crystal out of range
2309  std::cout << "!TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(...)> Electronic Channel in SuperCrystal = "
2310  << i0SCEcha + 1 << ". Out of range (range = [1," << fEcal->MaxCrysInSC() << "])" << fTTBELL
2311  << std::endl;
2312  }
2313  } else {
2314  n1DeeCrys = -3; // Super-Crystal number in Dee out of range
2315  std::cout << "!TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(...)> Super-Crystal number in Dee out of range."
2316  << " n1DeeSCEcna = " << n1DeeSCEcna << fTTBELL << std::endl;
2317  }
2318 
2319  return n1DeeCrys; // Range = [1,5000]
2320 }
void BuildEndcapCrysTable()
TEcnaParEcal * fEcal
Int_t MaxCrysInSC()
Int_t GetDeeDirIndex(const TString &)
Int_t *** fT3dDeeCrys

◆ Get1DeeSCEcnaFrom0DeeEcha()

Int_t TEcnaNumbering::Get1DeeSCEcnaFrom0DeeEcha ( const Int_t &  i0DeeEcha)

Definition at line 2376 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxCrysInSC().

Referenced by Get1StexStinFrom0StexEcha(), and TEcnaWrite::WriteAsciiHisto().

2376  {
2377  //get super-crystal number from electronic channel number in Dee
2378 
2379  Int_t n1DeeSC = i0DeeEcha / fEcal->MaxCrysInSC() + 1;
2380 
2381  return n1DeeSC; // range = [1,200]
2382 }
TEcnaParEcal * fEcal
Int_t MaxCrysInSC()

◆ Get1DeeSCEcnaFrom1DeeCrys()

Int_t TEcnaNumbering::Get1DeeSCEcnaFrom1DeeCrys ( const Int_t &  n1DeeCrys,
const TString &  sDeeDir 
)

Definition at line 2344 of file TEcnaNumbering.cc.

References gather_cfg::cout, fEcal, fT2dDeeSC, fTTBELL, GetDeeDirIndex(), and TEcnaParEcal::MaxCrysEcnaInDee().

Referenced by EcnaAnalyzer::analyze().

2344  {
2345  // get Super-Crystal number in Dee from Crystal number in Dee
2346 
2347  Int_t n1DeeSCEcna = 0;
2348  Int_t iDeeDir = GetDeeDirIndex(sDeeDir);
2349 
2350  if (n1DeeCrys >= 1 && n1DeeCrys <= fEcal->MaxCrysEcnaInDee()) {
2351  n1DeeSCEcna = fT2dDeeSC[n1DeeCrys - 1][iDeeDir];
2352  } else {
2353  n1DeeSCEcna = -1;
2354  std::cout << "!TEcnaNumbering::Get1DeeSCEcnaFrom1DeeCrys(...)> Crystal number in Dee out of range."
2355  << " n1DeeCrys = " << n1DeeCrys << "(max = " << fEcal->MaxCrysEcnaInDee() << ")" << fTTBELL << std::endl;
2356  }
2357  return n1DeeSCEcna; // range = [1,200]
2358 }
Int_t MaxCrysEcnaInDee()
Int_t ** fT2dDeeSC
TEcnaParEcal * fEcal
Int_t GetDeeDirIndex(const TString &)

◆ Get1DeeSCEcnaFromDeeSCCons()

Int_t TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons ( const Int_t &  n1DeeNumber,
const Int_t &  DeeSCCons 
)

Definition at line 2516 of file TEcnaNumbering.cc.

References gather_cfg::cout, fEcal, fT2d_RecovDeeSC, fTTBELL, TEcnaParEcal::MaxDeeInEE(), and TEcnaParEcal::MaxSCForConsInDee().

Referenced by TEcnaGui::DoButtonStinA(), TEcnaGui::DoButtonStinB(), TEcnaHistos::EvSamplesXtals(), TEcnaGui::InitKeys(), TEcnaHistos::PlotMatrix(), TEcnaHistos::SCCrystalNumbering(), TEcnaHistos::SigmaSamplesXtals(), TEcnaHistos::ViewStin(), TEcnaHistos::XtalSamplesEv(), and TEcnaHistos::XtalSamplesSigma().

2516  {
2517  // Get SC Ecna number in Dee from SC number for Construction in Dee
2518 
2519  Int_t dee_sc_ecna = -1;
2520 
2521  if (n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE()) {
2522  Int_t off_set_cons = 0;
2523  if (n1DeeNumber == 1 || n1DeeNumber == 3) {
2524  off_set_cons = fEcal->MaxSCForConsInDee();
2525  }
2526 
2527  if (DeeSCCons > off_set_cons && DeeSCCons <= fEcal->MaxSCForConsInDee() + off_set_cons) {
2528  dee_sc_ecna = fT2d_RecovDeeSC[n1DeeNumber - 1][DeeSCCons - 1];
2529  } else {
2530  std::cout << "!TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> DeeSCCons = " << DeeSCCons
2531  << ". Out of range ( range = [ " << off_set_cons + 1 << "," << fEcal->MaxSCForConsInDee() + off_set_cons
2532  << "] )" << fTTBELL << std::endl;
2533  }
2534  } else {
2535  if (n1DeeNumber != 0) {
2536  std::cout << "!TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> n1DeeNumber = " << n1DeeNumber
2537  << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )" << fTTBELL << std::endl;
2538  } else {
2539  std::cout << "TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> Dee = " << n1DeeNumber
2540  << ". Out of range (range = [1," << fEcal->MaxDeeInEE() << "])" << fTTBELL << std::endl;
2541  }
2542  }
2543  return dee_sc_ecna;
2544 }
Int_t ** fT2d_RecovDeeSC
TEcnaParEcal * fEcal
Int_t MaxSCForConsInDee()
Int_t MaxDeeInEE()

◆ Get1SCEchaFrom0DeeEcha()

Int_t TEcnaNumbering::Get1SCEchaFrom0DeeEcha ( const Int_t &  i0DeeEcha)

Definition at line 2367 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxCrysInSC().

Referenced by TEcnaWrite::fT2dWriteAscii(), TEcnaHistos::ViewHisto(), and TEcnaWrite::WriteAsciiHisto().

2367  {
2368  //get electronic channel number in super-crystal from electronic channel number in Dee
2369 
2370  Int_t i0DeeSC = i0DeeEcha / fEcal->MaxCrysInSC();
2371  Int_t n1SCEcha = i0DeeEcha - fEcal->MaxCrysInSC() * i0DeeSC + 1;
2372 
2373  return n1SCEcha; // range = [1,25]
2374 }
TEcnaParEcal * fEcal
Int_t MaxCrysInSC()

◆ Get1SCEchaFrom1DeeCrys()

Int_t TEcnaNumbering::Get1SCEchaFrom1DeeCrys ( const Int_t &  n1DeeCrys,
const TString &  sDeeDir 
)

Definition at line 2328 of file TEcnaNumbering.cc.

References gather_cfg::cout, fEcal, fT2dSCEcha, fTTBELL, GetDeeDirIndex(), and TEcnaParEcal::MaxCrysEcnaInDee().

Referenced by EcnaAnalyzer::analyze().

2328  {
2329  // get Electronic Channel number in Super-Crystal from Crystal ECNA number in Dee
2330 
2331  Int_t n1SCEcha = -1;
2332  Int_t iDeeDir = GetDeeDirIndex(sDeeDir);
2333 
2334  if (n1DeeCrys >= 1 && n1DeeCrys <= fEcal->MaxCrysEcnaInDee()) {
2335  n1SCEcha = fT2dSCEcha[n1DeeCrys - 1][iDeeDir];
2336  } else {
2337  n1SCEcha = -2;
2338  std::cout << "!TEcnaNumbering::Get1SCEchaFrom1DeeCrys(...)> Crystal number in Dee out of range."
2339  << " n1DeeCrys = " << n1DeeCrys << "(max = " << fEcal->MaxCrysEcnaInDee() << ")" << fTTBELL << std::endl;
2340  }
2341  return n1SCEcha; // range = [1,25]
2342 }
Int_t MaxCrysEcnaInDee()
TEcnaParEcal * fEcal
Int_t GetDeeDirIndex(const TString &)
Int_t ** fT2dSCEcha

◆ Get1SMCrysFrom1SMTowAnd0TowEcha()

Int_t TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha ( const Int_t &  n1SMTow,
const Int_t &  i0TowEcha 
)

Definition at line 482 of file TEcnaNumbering.cc.

References BuildBarrelCrysTable(), gather_cfg::cout, fT2dSMCrys, and fTTBELL.

Referenced by Get1StexCrysFrom1StexStinAnd0StinEcha(), TEcnaHistos::TowerCrystalNumbering(), and TEcnaWrite::WriteAsciiHisto().

482  {
483  //get crystal number in SM from tower number in SM
484  // and from Electronic Channel number in tower
485 
486  Int_t n1SMCrys = 0;
487 
488  if (fT2dSMCrys == nullptr) {
490  }
491 
492  if (n1SMTow >= 1 && n1SMTow <= fEcal->MaxTowInSM()) {
493  if (i0TowEcha >= 0 && i0TowEcha < fEcal->MaxCrysInTow()) {
494  n1SMCrys = fT2dSMCrys[n1SMTow - 1][i0TowEcha];
495  } else {
496  n1SMCrys = -2; // Electronic Cnannel in Tower out of range
497  std::cout << "!TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(...)> Electronic Channel in Tower out of range."
498  << " i0TowEcha = " << i0TowEcha << "(n1SMTow = " << n1SMTow << ")" << fTTBELL << std::endl;
499  }
500  } else {
501  n1SMCrys = -3; // Tower number in SM out of range
502  std::cout << "!TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(...)> Tower number in SM out of range."
503  << " n1SMTow = " << n1SMTow << "(i0TowEcha = " << i0TowEcha << ")" << fTTBELL << std::endl;
504  }
505 
506  return n1SMCrys; // Range = [1,1700]
507 }
void BuildBarrelCrysTable()
Int_t ** fT2dSMCrys

◆ Get1SMTowFrom0SMEcha()

Int_t TEcnaNumbering::Get1SMTowFrom0SMEcha ( const Int_t &  i0SMEcha)

Definition at line 561 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxCrysInTow().

Referenced by Get1StexStinFrom0StexEcha(), and TEcnaWrite::WriteAsciiHisto().

561  {
562  //get tower number from electronic channel number in SM
563 
564  Int_t n1SMTow = i0SMEcha / fEcal->MaxCrysInTow() + 1;
565 
566  return n1SMTow; // range = [1,68]
567 }
TEcnaParEcal * fEcal
Int_t MaxCrysInTow()

◆ Get1SMTowFrom1SMCrys()

Int_t TEcnaNumbering::Get1SMTowFrom1SMCrys ( const Int_t &  n1SMCrys)

Definition at line 530 of file TEcnaNumbering.cc.

References gather_cfg::cout, fT1dSMTow, and fTTBELL.

Referenced by EcnaAnalyzer::analyze().

530  {
531  // get Tower number in SM (range [1,68]) from Crystal number in SuperModule (range [1,1700])
532 
533  Int_t n1SMtox = 0;
534 
535  if (n1SMCrys >= 1 && n1SMCrys <= fEcal->MaxCrysInSM()) {
536  n1SMtox = fT1dSMTow[n1SMCrys - 1];
537  } else {
538  n1SMtox = -1;
539  std::cout << "!TEcnaNumbering::Get1SMTowFrom1SMCrys(...)> Crystal number in SM out of range."
540  << " n1SMCrys = " << n1SMCrys << fTTBELL << std::endl;
541  }
542  return n1SMtox; // range = [1,68]
543 }

◆ Get1StexCrysFrom1StexStinAnd0StinEcha()

Int_t TEcnaNumbering::Get1StexCrysFrom1StexStinAnd0StinEcha ( const Int_t &  n1StexStin,
const Int_t &  i0StinEcha,
const Int_t &  StexNumber 
)

Definition at line 2985 of file TEcnaNumbering.cc.

References fFlagSubDet, Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(), Get1SMCrysFrom1SMTowAnd0TowEcha(), and GetDeeDirViewedFromIP().

Referenced by TEcnaHistos::GetXCrysInStex(), TEcnaHistos::GetYCrysInStex(), TEcnaHistos::HistimePlot(), TEcnaHistos::HistoPlot(), TEcnaHistos::SetAllPavesViewHisto(), and TEcnaHistos::SetAllPavesViewMatrix().

2987  {
2988  // Crystal number in Stex from Stin number in Stex
2989  // and from Electronic Channel number in Stin (for the StexNumber_th Stex)
2990  // argument StexNumber used only in "EE" case
2991 
2992  Int_t n1StexCrys = (Int_t)0;
2993  if (fFlagSubDet == "EB") {
2994  n1StexCrys = Get1SMCrysFrom1SMTowAnd0TowEcha(n1StexStin, i0StinEcha);
2995  }
2996  if (fFlagSubDet == "EE") {
2997  TString sDeeDir = GetDeeDirViewedFromIP(StexNumber);
2998  n1StexCrys = Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(n1StexStin, i0StinEcha, sDeeDir);
2999  }
3000 
3001  return n1StexCrys;
3002 }
TString GetDeeDirViewedFromIP(const Int_t &)
Int_t Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(const Int_t &, const Int_t &, const TString &)
Int_t Get1SMCrysFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
TString fFlagSubDet

◆ Get1StexStinFrom0StexEcha()

Int_t TEcnaNumbering::Get1StexStinFrom0StexEcha ( const Int_t &  i0StexEcha)

Definition at line 2956 of file TEcnaNumbering.cc.

References fFlagSubDet, Get1DeeSCEcnaFrom0DeeEcha(), and Get1SMTowFrom0SMEcha().

Referenced by StexEchaForCons().

2956  {
2957  Int_t n1StexStin = 0;
2958 
2959  if (fFlagSubDet == "EB") {
2960  n1StexStin = Get1SMTowFrom0SMEcha(i0StexEcha);
2961  }
2962  if (fFlagSubDet == "EE") {
2963  n1StexStin = Get1DeeSCEcnaFrom0DeeEcha(i0StexEcha);
2964  }
2965 
2966  return n1StexStin;
2967 }
Int_t Get1DeeSCEcnaFrom0DeeEcha(const Int_t &)
Int_t Get1SMTowFrom0SMEcha(const Int_t &)
TString fFlagSubDet

◆ GetDeeDirIndex()

Int_t TEcnaNumbering::GetDeeDirIndex ( const TString &  sDeeDir)

Definition at line 2711 of file TEcnaNumbering.cc.

Referenced by Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(), Get1DeeSCEcnaFrom1DeeCrys(), and Get1SCEchaFrom1DeeCrys().

2711  {
2712  //gives the index of the direction (left,right) of the IX axis of the Dee
2713  // looking from the interaction point (right = 0, left = 1)
2714 
2715  Int_t iDeeDir = 0; // => default
2716  if (sDeeDir == "right") {
2717  iDeeDir = 0;
2718  }
2719  if (sDeeDir == "left") {
2720  iDeeDir = 1;
2721  }
2722  return iDeeDir;
2723 }

◆ GetDeeDirViewedFromIP()

TString TEcnaNumbering::GetDeeDirViewedFromIP ( const Int_t &  n1DeeNumber)

Definition at line 2698 of file TEcnaNumbering.cc.

Referenced by EcnaAnalyzer::analyze(), TEcnaWrite::fT2dWriteAscii(), Get1StexCrysFrom1StexStinAnd0StinEcha(), GetIXCrysInSC(), GetJYCrysInSC(), TEcnaHistos::GetXCrysInStex(), TEcnaHistos::GetXSampInStin(), TEcnaHistos::GetXStinInStas(), TEcnaHistos::ModifiedSCEchaForNotConnectedSCs(), TEcnaHistos::SCCrystalNumbering(), TEcnaHistos::SetAllPavesViewMatrix(), TEcnaHistos::ViewDeeSCNumberingPad(), and TEcnaHistos::ViewHisto().

2698  {
2699  //gives the direction (left/right) of the IX axis of the Dee
2700  // looking from the interaction point
2701 
2702  TString sDeeDir = "right"; // => default
2703  if ((n1DeeNumber == 1) || (n1DeeNumber == 3)) {
2704  sDeeDir = "right";
2705  }
2706  if ((n1DeeNumber == 2) || (n1DeeNumber == 4)) {
2707  sDeeDir = "left";
2708  }
2709  return sDeeDir;
2710 }

◆ GetDeeHalfEndcap()

TString TEcnaNumbering::GetDeeHalfEndcap ( const Int_t &  n1DeeNumber)

Definition at line 2883 of file TEcnaNumbering.cc.

Referenced by GetStexHalfStas().

2883  {
2884  //gives the half-endcap of the Dee ("EE+" or "EE-")
2885 
2886  TString type = "EE-"; // => default value
2887 
2888  if (n1DeeNumber == 1 || n1DeeNumber == 2) {
2889  type = "EE+";
2890  }
2891  if (n1DeeNumber == 3 || n1DeeNumber == 4) {
2892  type = "EE-";
2893  }
2894 
2895  return type;
2896 }

◆ GetDeeSCConsFrom1DeeSCEcna() [1/2]

Int_t TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna ( const Int_t &  n1DeeNumber,
const Int_t &  n1DeeSCEcna 
)

Definition at line 2463 of file TEcnaNumbering.cc.

References gather_cfg::cout, fEcal, fT2d_DeeSCCons, fTTBELL, TEcnaParEcal::MaxDeeInEE(), and TEcnaParEcal::MaxSCEcnaInDee().

Referenced by TEcnaGui::DialogBox(), TEcnaGui::DoButtonStex(), GetDeeSCConsFrom1DeeSCEcna(), TEcnaHistos::GetOkViewHisto(), TEcnaRun::GetSampleAdcValues(), TEcnaGui::HandleMenu(), TEcnaHistos::HistimePlot(), TEcnaHistos::HistoPlot(), MaxCrysInStinEcna(), TEcnaParHistos::SetPaveSC(), TEcnaHistos::ViewDeeSCNumberingPad(), TEcnaHistos::ViewHisto(), TEcnaHistos::ViewMatrix(), TEcnaHistos::ViewStin(), TEcnaGui::ViewStinCrystalNumbering(), TEcnaWrite::WriteAsciiCorrelationsBetweenSamples(), TEcnaWrite::WriteAsciiCovariancesBetweenSamples(), and TEcnaWrite::WriteAsciiHisto().

2463  {
2464  // Get SC number for Construction in Dee from SC ECNA number in Dee
2465 
2466  Int_t dee_sc_cons = -1;
2467 
2468  if (n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE()) {
2469  if (n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee()) {
2470  dee_sc_cons = fT2d_DeeSCCons[n1DeeNumber - 1][n1DeeSCEcna - 1];
2471  } else {
2472  std::cout << "!TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> *** WARNING *** n1DeeSCEcna = " << n1DeeSCEcna
2473  << ". Out of range ( range = [1," << fEcal->MaxSCEcnaInDee() << "] ). Nb for const. forced to "
2474  << fT2d_DeeSCCons[n1DeeNumber - 1][19] << "." << std::endl;
2475  dee_sc_cons = fT2d_DeeSCCons[n1DeeNumber - 1][19];
2476  }
2477  } else {
2478  if (n1DeeNumber != 0) {
2479  std::cout << "!TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
2480  << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )" << fTTBELL << std::endl;
2481  } else {
2482  std::cout << "TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
2483  << ". Out of range (range = [1," << fEcal->MaxDeeInEE() << "])" << fTTBELL << std::endl;
2484  }
2485  }
2486  return dee_sc_cons;
2487 }
TEcnaParEcal * fEcal
Int_t MaxSCEcnaInDee()
Int_t ** fT2d_DeeSCCons
Int_t MaxDeeInEE()

◆ GetDeeSCConsFrom1DeeSCEcna() [2/2]

Int_t TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna ( const Int_t &  n1DeeNumber,
const Int_t &  n1DeeSCEcna,
const Int_t &  n1SCEcha 
)

Definition at line 2489 of file TEcnaNumbering.cc.

References GetDeeSCConsFrom1DeeSCEcna().

2491  {
2492  //.......... Get the correct SC number (for cons) for the unconnected SC's (inner border)
2493  Int_t dee_sc_cons = GetDeeSCConsFrom1DeeSCEcna(n1DeeNumber, n1DeeSCEcna);
2494 
2495  if (n1DeeSCEcna == 29 || n1DeeSCEcna == 32) {
2496  if (n1SCEcha == 11) {
2497  if (dee_sc_cons == 261) {
2498  dee_sc_cons = 268;
2499  } // 261<=>14/BR
2500  if (dee_sc_cons == 112) {
2501  dee_sc_cons = 119;
2502  } // 112<=>14/BL
2503  }
2504  if (n1SCEcha == 1 || n1SCEcha == 2 || n1SCEcha == 3 || n1SCEcha == 6 || n1SCEcha == 7) {
2505  if (dee_sc_cons == 178) {
2506  dee_sc_cons = 207;
2507  } // 178<=>3/TR
2508  if (dee_sc_cons == 29) {
2509  dee_sc_cons = 58;
2510  } // 29<=>3/TL
2511  }
2512  }
2513  return dee_sc_cons;
2514 }
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)

◆ GetDSFrom1DeeSCEcna()

Int_t TEcnaNumbering::GetDSFrom1DeeSCEcna ( const Int_t &  n1DeeNumber,
const Int_t &  n1DeeSCEcna 
)

Definition at line 2395 of file TEcnaNumbering.cc.

References gather_cfg::cout, fEcal, fT2d_DS, fTTBELL, TEcnaParEcal::MaxDeeInEE(), and TEcnaParEcal::MaxSCEcnaInDee().

Referenced by TEcnaParHistos::SetPaveSC(), TEcnaHistos::ViewHisto(), and TEcnaWrite::WriteAsciiHisto().

2395  {
2396  // Get Data Sector number from SC ECNA number in Dee
2397 
2398  Int_t data_sector = -1;
2399 
2400  if (n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE()) {
2401  if (n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee()) {
2402  data_sector = fT2d_DS[n1DeeNumber - 1][n1DeeSCEcna - 1];
2403  } else {
2404  std::cout << "!TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> n1DeeSCEcna = " << n1DeeSCEcna
2405  << ". Out of range ( range = [1," << fEcal->MaxSCEcnaInDee() << "] )" << fTTBELL << std::endl;
2406  }
2407  } else {
2408  if (n1DeeNumber != 0) {
2409  std::cout << "!TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
2410  << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )" << fTTBELL << std::endl;
2411  } else {
2412  std::cout << "TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber << ". Out of range (range = [1,"
2413  << fEcal->MaxDeeInEE() << "])" << fTTBELL << std::endl;
2414  }
2415  }
2416  return data_sector;
2417 }
Int_t ** fT2d_DS
TEcnaParEcal * fEcal
Int_t MaxSCEcnaInDee()
Int_t MaxDeeInEE()

◆ GetDSFromFED()

Int_t TEcnaNumbering::GetDSFromFED ( const Int_t &  FEDNumber)

Definition at line 3103 of file TEcnaNumbering.cc.

3103  {
3104  Int_t EEDSNumber = 0; // DS = Data Sector
3105 
3106  if (FEDNumber >= 600 && FEDNumber <= 609) {
3107  EEDSNumber = FEDNumber - 599;
3108  }
3109  if (FEDNumber >= 646 && FEDNumber <= 655) {
3110  EEDSNumber = FEDNumber - 645;
3111  }
3112 
3113  return EEDSNumber;
3114 }

◆ GetDSSCFrom1DeeSCEcna() [1/2]

Int_t TEcnaNumbering::GetDSSCFrom1DeeSCEcna ( const Int_t &  n1DeeNumber,
const Int_t &  n1DeeSCEcna,
const Int_t &  n1SCEcha 
)

Definition at line 2419 of file TEcnaNumbering.cc.

Referenced by TEcnaParHistos::SetPaveSC(), TEcnaHistos::ViewDeeSCNumberingPad(), TEcnaHistos::ViewHisto(), and TEcnaWrite::WriteAsciiHisto().

2419  {
2420  //.......... Get the correct SC number for the unconnected SC's (inner border)
2421  Int_t ds_sc = GetDSSCFrom1DeeSCEcna(n1DeeNumber, n1DeeSCEcna);
2422 
2423  if (n1DeeSCEcna == 29 || n1DeeSCEcna == 32) {
2424  if (n1SCEcha == 11) {
2425  if (ds_sc == 14) {
2426  ds_sc = 21;
2427  } // 14 <=> 261/BR OR 112/BL
2428  }
2429  if (n1SCEcha == 1 || n1SCEcha == 2 || n1SCEcha == 3 || n1SCEcha == 6 || n1SCEcha == 7) {
2430  if (ds_sc == 3) {
2431  ds_sc = 25;
2432  } // 3 <=> 178/TR OR 29/TL
2433  }
2434  }
2435  return ds_sc;
2436 }
Int_t GetDSSCFrom1DeeSCEcna(const Int_t &, const Int_t &, const Int_t &)

◆ GetDSSCFrom1DeeSCEcna() [2/2]

Int_t TEcnaNumbering::GetDSSCFrom1DeeSCEcna ( const Int_t &  n1DeeNumber,
const Int_t &  n1DeeSCEcna 
)

Definition at line 2438 of file TEcnaNumbering.cc.

References gather_cfg::cout, fEcal, fT2d_DSSC, fTTBELL, TEcnaParEcal::MaxDeeInEE(), and TEcnaParEcal::MaxSCEcnaInDee().

2438  {
2439  // Get SC number in Data Sector from SC Ecna number in Dee
2440 
2441  Int_t ds_sc = -1;
2442 
2443  if (n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE()) {
2444  if (n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee()) {
2445  ds_sc = fT2d_DSSC[n1DeeNumber - 1][n1DeeSCEcna - 1]; // 25 (not 3) or 14 (not 21) if n1DeeSCEcna = 32 or 29
2446  // 25 and 14 => 5 Xtals, 3 and 21 => 1 Xtal
2447  } else {
2448  std::cout << "!TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> n1DeeSCEcna = " << n1DeeSCEcna
2449  << ". Out of range ( range = [1," << fEcal->MaxSCEcnaInDee() << "] )" << fTTBELL << std::endl;
2450  }
2451  } else {
2452  if (n1DeeNumber != 0) {
2453  std::cout << "!TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
2454  << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )" << fTTBELL << std::endl;
2455  } else {
2456  std::cout << "TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber << ". Out of range (range = [1,"
2457  << fEcal->MaxDeeInEE() << "])" << fTTBELL << std::endl;
2458  }
2459  }
2460  return ds_sc;
2461 }
TEcnaParEcal * fEcal
Int_t ** fT2d_DSSC
Int_t MaxSCEcnaInDee()
Int_t MaxDeeInEE()

◆ GetEEDeeEndcap()

TString TEcnaNumbering::GetEEDeeEndcap ( const Int_t &  n1DeeNumber)

Definition at line 2667 of file TEcnaNumbering.cc.

Referenced by TEcnaHistos::SCCrystalNumbering(), and TEcnaHistos::ViewDeeSCNumberingPad().

2667  {
2668  //gives the Endcap (EE+ or EE-) of the Dee (H. Heath, CMS NOTE 2006/027)
2669 
2670  TString eetype = "EE+"; // => default
2671  if (n1DeeNumber == 1 || n1DeeNumber == 2) {
2672  eetype = "EE+";
2673  }
2674  if (n1DeeNumber == 3 || n1DeeNumber == 4) {
2675  eetype = "EE-";
2676  }
2677  return eetype;
2678 }

◆ GetEEDeeType()

TString TEcnaNumbering::GetEEDeeType ( const Int_t &  n1DeeNumber)

Definition at line 2679 of file TEcnaNumbering.cc.

Referenced by TEcnaHistos::DeeSCNumbering(), GetXDirectionEE(), GetYDirectionEE(), TEcnaHistos::SCCrystalNumbering(), TEcnaHistos::SetEcalSubDetector(), TEcnaParHistos::SetPaveStex(), and TEcnaHistos::ViewMatrix().

2679  {
2680  //gives the EE +/- and Forward/Near of the Dee (H. Heath, CMS NOTE 2006/027)
2681 
2682  TString type = "EE+F"; // => default
2683  if (n1DeeNumber == 1) {
2684  type = "EE+F";
2685  }
2686  if (n1DeeNumber == 2) {
2687  type = "EE+N";
2688  }
2689  if (n1DeeNumber == 3) {
2690  type = "EE-N";
2691  }
2692  if (n1DeeNumber == 4) {
2693  type = "EE-F";
2694  }
2695  return type;
2696 }

◆ GetEta()

Double_t TEcnaNumbering::GetEta ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow,
const Int_t &  i0TowEcha 
)

Definition at line 647 of file TEcnaNumbering.cc.

References gather_cfg::cout, PVValHelper::eta, fCodeChNumberingLvrbBot, fCodeChNumberingLvrbTop, fEcal, fTTBELL, GetSMHalfBarrel(), GetTowerLvrbType(), TEcnaParEcal::MaxCrysEtaInTow(), TEcnaParEcal::MaxSMInEB(), and TEcnaParEcal::MaxTowEtaInSM().

Referenced by TEcnaHistos::TowerCrystalNumbering(), TEcnaHistos::ViewSMTowerNumberingPad(), and TEcnaWrite::WriteAsciiHisto().

647  {
648  //Gives Eta for a given (n1EBSM, n1SMTow, i0TowEcha)
649 
650  Double_t eta = (Double_t)0.;
651 
652  Int_t max_crys_eta_in_tower = fEcal->MaxCrysEtaInTow();
653  Int_t max_tow_eta_in_sm = fEcal->MaxTowEtaInSM();
654  Int_t max_sm_in_barrel = fEcal->MaxSMInEB();
655 
656  if (n1EBSM >= 1 && n1EBSM <= max_sm_in_barrel) {
657  for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++) {
658  Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta * (max_crys_eta_in_tower - 1));
659  Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta + 1) * (max_crys_eta_in_tower - 1));
660  Int_t i_crys_eta = (Int_t)(i_sm_tow_eta * max_crys_eta_in_tower);
661  // = 0,..,16 -> last xtal in eta for the previous tower
662  Double_t d_echa_eta = (Double_t)(i0TowEcha / max_crys_eta_in_tower); // = 0,1,2,3,4
663 
664  if (n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max) {
665  if (GetTowerLvrbType(n1SMTow) == fCodeChNumberingLvrbTop) {
666  eta = (Double_t)(i_crys_eta) + d_echa_eta + 1;
667  }
668  if (GetTowerLvrbType(n1SMTow) == fCodeChNumberingLvrbBot) {
669  eta = (Double_t)(i_crys_eta + max_crys_eta_in_tower) - d_echa_eta;
670  }
671  }
672  }
673  if (GetSMHalfBarrel(n1EBSM) == "EB-") {
674  eta = -eta;
675  }
676  } else {
677  std::cout << "TEcnaNumbering::GetEta(...)> SM = " << n1EBSM << ". Out of range (range = [1," << fEcal->MaxSMInEB()
678  << "])" << fTTBELL << std::endl;
679  }
680  return eta;
681 }
Int_t MaxCrysEtaInTow()
TString GetSMHalfBarrel(const Int_t &)
TString GetTowerLvrbType(const Int_t &)
TEcnaParEcal * fEcal
Int_t MaxTowEtaInSM()
Int_t MaxSMInEB()
TString fCodeChNumberingLvrbBot
TString fCodeChNumberingLvrbTop

◆ GetEtaMax()

Double_t TEcnaNumbering::GetEtaMax ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow 
)

Definition at line 708 of file TEcnaNumbering.cc.

References egammaIdentification::eta_max, fEcal, GetSMHalfBarrel(), TEcnaParEcal::MaxCrysEtaInTow(), and TEcnaParEcal::MaxTowEtaInSM().

Referenced by GetIEtaMax().

708  {
709  //Gives EtaMax for a given Tower
710 
711  Int_t max_tow_eta_in_sm = fEcal->MaxTowEtaInSM();
712  Int_t max_crys_eta_in_tower = fEcal->MaxCrysEtaInTow();
713 
714  Double_t eta_max = (max_crys_eta_in_tower - 1);
715 
716  for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++) {
717  Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta * (max_crys_eta_in_tower - 1));
718  Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta + 1) * (max_crys_eta_in_tower - 1));
719  Int_t i_crys_eta = (Int_t)(i_sm_tow_eta * max_crys_eta_in_tower);
720 
721  if (n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max) {
722  if (GetSMHalfBarrel(n1EBSM) == "EB+") {
723  eta_max = (Double_t)(i_crys_eta + max_crys_eta_in_tower);
724  }
725  if (GetSMHalfBarrel(n1EBSM) == "EB-") {
726  eta_max = -(Double_t)i_crys_eta;
727  }
728  }
729  }
730 
731  return eta_max;
732 }
Int_t MaxCrysEtaInTow()
TString GetSMHalfBarrel(const Int_t &)
TEcnaParEcal * fEcal
Int_t MaxTowEtaInSM()

◆ GetEtaMin()

Double_t TEcnaNumbering::GetEtaMin ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow 
)

Definition at line 683 of file TEcnaNumbering.cc.

References egammaIdentification::eta_min, fEcal, GetSMHalfBarrel(), TEcnaParEcal::MaxCrysEtaInTow(), and TEcnaParEcal::MaxTowEtaInSM().

Referenced by GetIEtaMin().

683  {
684  //Gives EtaMin for a given Tower
685 
686  Int_t max_tow_eta_in_sm = fEcal->MaxTowEtaInSM();
687  Int_t max_crys_eta_in_tower = fEcal->MaxCrysEtaInTow();
688 
689  Double_t eta_min = (Double_t)0.;
690 
691  for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++) {
692  Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta * (max_crys_eta_in_tower - 1));
693  Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta + 1) * (max_crys_eta_in_tower - 1));
694  Int_t i_crys_eta = (Int_t)(i_sm_tow_eta * max_crys_eta_in_tower);
695 
696  if (n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max) {
697  if (GetSMHalfBarrel(n1EBSM) == "EB+") {
698  eta_min = (Double_t)i_crys_eta;
699  }
700  if (GetSMHalfBarrel(n1EBSM) == "EB-") {
701  eta_min = -(Double_t)(i_crys_eta + max_crys_eta_in_tower);
702  }
703  }
704  }
705  return eta_min;
706 }
Int_t MaxCrysEtaInTow()
TString GetSMHalfBarrel(const Int_t &)
TEcnaParEcal * fEcal
Int_t MaxTowEtaInSM()

◆ GetHashedNumberFromIEtaAndIPhi()

Int_t TEcnaNumbering::GetHashedNumberFromIEtaAndIPhi ( const Int_t &  IEta,
const Int_t &  IPhi 
)

Definition at line 581 of file TEcnaNumbering.cc.

Referenced by TEcnaHistos::TowerCrystalNumbering().

581  {
582  Int_t Hashed = 0;
583 
584  if (IEta > 0) {
585  Hashed = (85 + IEta - 1) * 360 + IPhi - 1;
586  }
587  if (IEta < 0) {
588  Hashed = (85 + IEta) * 360 + IPhi - 1;
589  }
590 
591  return Hashed;
592 }

◆ GetIEtaFromHashed()

Int_t TEcnaNumbering::GetIEtaFromHashed ( const Int_t &  Hashed,
const Int_t &  SMNumber 
)

Definition at line 594 of file TEcnaNumbering.cc.

References GetSMHalfBarrel().

594  {
595  Int_t IEta = 0;
596 
597  if (GetSMHalfBarrel(SMNumber) == "EB+") {
598  IEta = Hashed / 360 - 85 + 1;
599  }
600  if (GetSMHalfBarrel(SMNumber) == "EB-") {
601  IEta = 85 + Hashed / 360;
602  }
603 
604  return IEta;
605 }
TString GetSMHalfBarrel(const Int_t &)

◆ GetIEtaMax() [1/2]

Double_t TEcnaNumbering::GetIEtaMax ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow 
)

Definition at line 749 of file TEcnaNumbering.cc.

References GetEtaMax(), and GetSMHalfBarrel().

Referenced by GetIEtaMax(), GetIHocoMax(), TEcnaHistos::ViewSMGrid(), and TEcnaHistos::ViewTowerGrid().

749  {
750  //Gives IEtaMax for a given (n1EBSM, n1SMTow)
751 
752  Double_t i_eta_max = (Int_t)0.;
753 
754  if (GetSMHalfBarrel(n1EBSM) == "EB+") {
755  i_eta_max = (Double_t)GetEtaMax(n1EBSM, n1SMTow) + (Double_t)0.5;
756  }
757  if (GetSMHalfBarrel(n1EBSM) == "EB-") {
758  i_eta_max = (Double_t)GetEtaMax(n1EBSM, n1SMTow) - (Double_t)0.5;
759  }
760 
761  return i_eta_max;
762 }
Double_t GetEtaMax(const Int_t &, const Int_t &)
TString GetSMHalfBarrel(const Int_t &)

◆ GetIEtaMax() [2/2]

Double_t TEcnaNumbering::GetIEtaMax ( const Int_t &  n1EBSM)

Definition at line 782 of file TEcnaNumbering.cc.

References fEcal, GetIEtaMax(), GetSMHalfBarrel(), and TEcnaParEcal::MaxTowInSM().

782  {
783  //Gives IEtaMax for a given (n1EBSM)
784 
785  Double_t i_eta_max = (Int_t)0.;
786 
787  Int_t n1SMTowPlus = (Int_t)fEcal->MaxTowInSM();
788  Int_t n1SMTowMinus = (Int_t)1;
789 
790  if (GetSMHalfBarrel(n1EBSM) == "EB+") {
791  i_eta_max = (Double_t)GetIEtaMax(n1EBSM, n1SMTowPlus);
792  }
793  if (GetSMHalfBarrel(n1EBSM) == "EB-") {
794  i_eta_max = (Double_t)GetIEtaMax(n1EBSM, n1SMTowMinus);
795  }
796 
797  return i_eta_max;
798 }
TString GetSMHalfBarrel(const Int_t &)
TEcnaParEcal * fEcal
Double_t GetIEtaMax(const Int_t &, const Int_t &)
Int_t MaxTowInSM()

◆ GetIEtaMin() [1/2]

Double_t TEcnaNumbering::GetIEtaMin ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow 
)

Definition at line 734 of file TEcnaNumbering.cc.

References GetEtaMin(), and GetSMHalfBarrel().

Referenced by GetIEtaMin(), GetIHocoMin(), TEcnaHistos::ViewSMGrid(), and TEcnaHistos::ViewTowerGrid().

734  {
735  //Gives IEtaMin for a given (n1EBSM, n1SMTow)
736 
737  Double_t i_eta_min = (Int_t)0.;
738 
739  if (GetSMHalfBarrel(n1EBSM) == "EB+") {
740  i_eta_min = (Double_t)GetEtaMin(n1EBSM, n1SMTow) + (Double_t)0.5;
741  }
742  if (GetSMHalfBarrel(n1EBSM) == "EB-") {
743  i_eta_min = (Double_t)GetEtaMin(n1EBSM, n1SMTow) - (Double_t)0.5;
744  }
745 
746  return i_eta_min;
747 }
TString GetSMHalfBarrel(const Int_t &)
Double_t GetEtaMin(const Int_t &, const Int_t &)

◆ GetIEtaMin() [2/2]

Double_t TEcnaNumbering::GetIEtaMin ( const Int_t &  n1EBSM)

Definition at line 764 of file TEcnaNumbering.cc.

References fEcal, GetIEtaMin(), GetSMHalfBarrel(), and TEcnaParEcal::MaxTowInSM().

764  {
765  //Gives IEtaMin for a given (n1EBSM)
766 
767  Double_t i_eta_min = (Int_t)0.;
768 
769  Int_t n1SMTowPlus = (Int_t)1;
770  Int_t n1SMTowMinus = (Int_t)fEcal->MaxTowInSM();
771 
772  if (GetSMHalfBarrel(n1EBSM) == "EB+") {
773  i_eta_min = (Double_t)GetIEtaMin(n1EBSM, n1SMTowPlus);
774  }
775  if (GetSMHalfBarrel(n1EBSM) == "EB-") {
776  i_eta_min = (Double_t)GetIEtaMin(n1EBSM, n1SMTowMinus);
777  }
778 
779  return i_eta_min;
780 }
TString GetSMHalfBarrel(const Int_t &)
TEcnaParEcal * fEcal
Double_t GetIEtaMin(const Int_t &, const Int_t &)
Int_t MaxTowInSM()

◆ GetIHocoMax()

Double_t TEcnaNumbering::GetIHocoMax ( const Int_t &  Stex,
const Int_t &  StexStin 
)

Definition at line 3020 of file TEcnaNumbering.cc.

References fFlagSubDet, GetIEtaMax(), and GetIIXMax().

3020  {
3021  Double_t IHocoMax = (Double_t)0.;
3022  if (fFlagSubDet == "EB") {
3023  IHocoMax = GetIEtaMax(Stex, StexStin);
3024  }
3025  if (fFlagSubDet == "EE") {
3026  IHocoMax = GetIIXMax(StexStin);
3027  }
3028  return IHocoMax;
3029 }
Double_t GetIIXMax()
TString fFlagSubDet
Double_t GetIEtaMax(const Int_t &, const Int_t &)

◆ GetIHocoMin()

Double_t TEcnaNumbering::GetIHocoMin ( const Int_t &  Stex,
const Int_t &  StexStin 
)

Definition at line 3009 of file TEcnaNumbering.cc.

References fFlagSubDet, GetIEtaMin(), and GetIIXMin().

3009  {
3010  Double_t IHocoMin = (Double_t)0.;
3011  if (fFlagSubDet == "EB") {
3012  IHocoMin = GetIEtaMin(Stex, StexStin);
3013  }
3014  if (fFlagSubDet == "EE") {
3015  IHocoMin = GetIIXMin(StexStin);
3016  }
3017  return IHocoMin;
3018 }
Double_t GetIEtaMin(const Int_t &, const Int_t &)
TString fFlagSubDet
Double_t GetIIXMin()

◆ GetIIXMax() [1/2]

Double_t TEcnaNumbering::GetIIXMax ( const Int_t &  DeeSC)

Definition at line 2814 of file TEcnaNumbering.cc.

References fEcal, TEcnaParEcal::MaxCrysIXInSC(), and TEcnaParEcal::MaxSCIYInDee().

Referenced by TEcnaHistos::EEGridAxis(), and TEcnaHistos::ViewSCGrid().

2814  {
2815  //Gives IIXMax for a given DeeSC , unit = crystal
2816 
2817  Double_t IX_max = ((Double_t)((DeeSC - 1) / fEcal->MaxSCIYInDee()) + 1.) * fEcal->MaxCrysIXInSC();
2818  return IX_max;
2819 }
Int_t MaxSCIYInDee()
TEcnaParEcal * fEcal
Int_t MaxCrysIXInSC()

◆ GetIIXMax() [2/2]

Double_t TEcnaNumbering::GetIIXMax ( )

Definition at line 2828 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxSCIXInDee().

Referenced by GetIHocoMax().

2828  {
2829  //Gives IIXMax for Dee , unit = Super-crystal
2830 
2831  Double_t i_IX_max = (Int_t)fEcal->MaxSCIXInDee();
2832  return i_IX_max;
2833 }
Int_t MaxSCIXInDee()
TEcnaParEcal * fEcal

◆ GetIIXMin() [1/2]

Double_t TEcnaNumbering::GetIIXMin ( const Int_t &  DeeSC)

Definition at line 2807 of file TEcnaNumbering.cc.

References fEcal, TEcnaParEcal::MaxCrysIXInSC(), and TEcnaParEcal::MaxSCIYInDee().

Referenced by TEcnaHistos::EEGridAxis(), and TEcnaHistos::ViewSCGrid().

2807  {
2808  //Gives IIXMin for a given DeeSC , unit = crystal
2809 
2810  Double_t IX_min = (Double_t)((DeeSC - 1) / fEcal->MaxSCIYInDee()) * fEcal->MaxCrysIXInSC() + 1.;
2811  return IX_min;
2812 }
Int_t MaxSCIYInDee()
TEcnaParEcal * fEcal
Int_t MaxCrysIXInSC()

◆ GetIIXMin() [2/2]

Double_t TEcnaNumbering::GetIIXMin ( )

Definition at line 2821 of file TEcnaNumbering.cc.

Referenced by GetIHocoMin().

2821  {
2822  //Gives IIXMin for Dee , unit = Super-crystal
2823 
2824  Double_t i_IX_min = (Int_t)1.;
2825  return i_IX_min;
2826 }

◆ GetIPhiFromHashed()

Int_t TEcnaNumbering::GetIPhiFromHashed ( const Int_t &  Hashed)

Definition at line 607 of file TEcnaNumbering.cc.

607  {
608  Int_t IPhi = Hashed % 360 + 1;
609 
610  return IPhi;
611 }

◆ GetIXCrysInDee()

Int_t TEcnaNumbering::GetIXCrysInDee ( const Int_t &  n1DeeNumber,
const Int_t &  DeeSC,
const Int_t &  i0SCEcha 
)

Definition at line 2749 of file TEcnaNumbering.cc.

References fEcal, GetIXCrysInSC(), GetIXSCInDee(), and TEcnaParEcal::MaxCrysIXInSC().

Referenced by TEcnaHistos::GetXCrysInStex(), and TEcnaWrite::WriteAsciiHisto().

2749  {
2750  //Gives Crys IX in Dee for a given (n1DeeNumber, DeeSC, i0SCEcha)
2751 
2752  Int_t IXCrysInDee = (GetIXSCInDee(DeeSC) - 1) * fEcal->MaxCrysIXInSC() + GetIXCrysInSC(n1DeeNumber, DeeSC, i0SCEcha);
2753  return IXCrysInDee; // possible values: 1,2,...,49,50
2754 }
Int_t GetIXSCInDee(const Int_t &)
TEcnaParEcal * fEcal
Int_t MaxCrysIXInSC()
Int_t GetIXCrysInSC(const Int_t &, const Int_t &, const Int_t &)

◆ GetIXCrysInSC()

Int_t TEcnaNumbering::GetIXCrysInSC ( const Int_t &  n1DeeNumber,
const Int_t &  DeeSC,
const Int_t &  i0SCEcha 
)

Definition at line 2732 of file TEcnaNumbering.cc.

References fT2d_ich_IX, GetDeeDirViewedFromIP(), GetSCQuadFrom1DeeSCEcna(), and GetSCQuadTypeIndex().

Referenced by GetIXCrysInDee(), and TEcnaHistos::GetXSampInStin().

2732  {
2733  //Gives Crys IX in SC for a given (n1DeeNumber, DeeSC, i0SCEcha)
2734 
2735  TString SCQuadType = GetSCQuadFrom1DeeSCEcna(DeeSC);
2736  TString sDeeDir = GetDeeDirViewedFromIP(n1DeeNumber);
2737  Int_t type_index = GetSCQuadTypeIndex(SCQuadType, sDeeDir);
2738  Int_t IXCrysInSC = fT2d_ich_IX[type_index][i0SCEcha + 1] + 1;
2739  return IXCrysInSC; // possible values: 1,2,3,4,5
2740 }
TString GetSCQuadFrom1DeeSCEcna(const Int_t &)
TString GetDeeDirViewedFromIP(const Int_t &)
Int_t ** fT2d_ich_IX
Int_t GetSCQuadTypeIndex(const TString &, const TString &)

◆ GetIXSCInDee()

Int_t TEcnaNumbering::GetIXSCInDee ( const Int_t &  DeeSC)

Definition at line 2742 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxSCIYInDee().

Referenced by GetIXCrysInDee().

2742  {
2743  //Gives SC IX in Dee for a given (DeeSC)
2744 
2745  Int_t IXSCInDee = (DeeSC - 1) / fEcal->MaxSCIYInDee() + 1;
2746  return IXSCInDee; // possible values: 1,2,...,9,10
2747 }
Int_t MaxSCIYInDee()
TEcnaParEcal * fEcal

◆ GetJIYMax() [1/2]

Double_t TEcnaNumbering::GetJIYMax ( const Int_t &  n1DeeNumber,
const Int_t &  DeeSC 
)

Definition at line 2853 of file TEcnaNumbering.cc.

References fEcal, TEcnaParEcal::MaxCrysIYInSC(), and TEcnaParEcal::MaxSCIYInDee().

Referenced by TEcnaHistos::EEGridAxis(), GetJVecoMax(), GetVecoMax(), and TEcnaHistos::ViewSCGrid().

2853  {
2854  //Gives JIYMax for a given Super-Crystal
2855 
2856  Double_t IY_DeeSC = DeeSC % fEcal->MaxSCIYInDee();
2857  if (IY_DeeSC == 0) {
2858  IY_DeeSC = fEcal->MaxSCIYInDee();
2859  }
2860 
2861  Double_t j_IY_max = IY_DeeSC * fEcal->MaxCrysIYInSC();
2862 
2863  return j_IY_max;
2864 }
Int_t MaxSCIYInDee()
TEcnaParEcal * fEcal
Int_t MaxCrysIYInSC()

◆ GetJIYMax() [2/2]

Double_t TEcnaNumbering::GetJIYMax ( const Int_t &  n1DeeNumber)

Definition at line 2875 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxSCIYInDee().

2875  {
2876  //Gives JIYMax for a given Dee
2877 
2878  Double_t j_IY_max = (Double_t)fEcal->MaxSCIYInDee();
2879 
2880  return j_IY_max;
2881 }
Int_t MaxSCIYInDee()
TEcnaParEcal * fEcal

◆ GetJIYMin() [1/2]

Double_t TEcnaNumbering::GetJIYMin ( const Int_t &  n1DeeNumber,
const Int_t &  DeeSC 
)

Definition at line 2840 of file TEcnaNumbering.cc.

References fEcal, TEcnaParEcal::MaxCrysIYInSC(), and TEcnaParEcal::MaxSCIYInDee().

Referenced by TEcnaHistos::EEGridAxis(), GetJVecoMin(), GetVecoMin(), and TEcnaHistos::ViewSCGrid().

2840  {
2841  //Gives JIYMin for a given Super-Crystal
2842 
2843  Double_t IY_DeeSC = DeeSC % fEcal->MaxSCIYInDee();
2844  if (IY_DeeSC == 0.) {
2845  IY_DeeSC = fEcal->MaxSCIYInDee();
2846  }
2847 
2848  Double_t j_IY_min = (IY_DeeSC - 1) * fEcal->MaxCrysIYInSC() + 1.;
2849 
2850  return j_IY_min;
2851 }
Int_t MaxSCIYInDee()
TEcnaParEcal * fEcal
Int_t MaxCrysIYInSC()

◆ GetJIYMin() [2/2]

Double_t TEcnaNumbering::GetJIYMin ( const Int_t &  n1DeeNumber)

Definition at line 2867 of file TEcnaNumbering.cc.

2867  {
2868  //Gives JIYMin for a given Dee
2869 
2870  Double_t j_IY_min = (Double_t)1.;
2871 
2872  return j_IY_min;
2873 }

◆ GetJPhiMax() [1/2]

Double_t TEcnaNumbering::GetJPhiMax ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow 
)

Definition at line 1033 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxCrysPhiInTow().

Referenced by GetJVecoMax(), TEcnaHistos::ViewSMGrid(), and TEcnaHistos::ViewTowerGrid().

1033  {
1034  //Gives JPhiMax for a given Tower
1035 
1036  Double_t j_phi_max = (Double_t)20.;
1037  Int_t max_crys_phi_in_tower = fEcal->MaxCrysPhiInTow();
1038  Int_t rest_temp = (Int_t)(n1SMTow % (max_crys_phi_in_tower - 1));
1039 
1040  if (rest_temp == 1) {
1041  j_phi_max = (Double_t)5. + (Double_t)0.5;
1042  }
1043  if (rest_temp == 2) {
1044  j_phi_max = (Double_t)10. + (Double_t)0.5;
1045  }
1046  if (rest_temp == 3) {
1047  j_phi_max = (Double_t)15. + (Double_t)0.5;
1048  }
1049  if (rest_temp == 0) {
1050  j_phi_max = (Double_t)20. + (Double_t)0.5;
1051  }
1052 
1053  return j_phi_max;
1054 }
Int_t MaxCrysPhiInTow()
TEcnaParEcal * fEcal

◆ GetJPhiMax() [2/2]

Double_t TEcnaNumbering::GetJPhiMax ( const Int_t &  n1EBSM)

Definition at line 1065 of file TEcnaNumbering.cc.

1065  {
1066  //Gives JPhiMax for a given SuperModule
1067 
1068  Double_t j_phi_max = (Double_t)20. + (Double_t)0.5;
1069 
1070  return j_phi_max;
1071 }

◆ GetJPhiMin() [1/2]

Double_t TEcnaNumbering::GetJPhiMin ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow 
)

Definition at line 1010 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxCrysPhiInTow().

Referenced by GetJVecoMin(), TEcnaHistos::ViewSMGrid(), and TEcnaHistos::ViewTowerGrid().

1010  {
1011  //Gives JPhiMin for a given Tower
1012 
1013  Double_t j_phi_min = (Double_t)1.;
1014  Int_t max_crys_phi_in_tower = fEcal->MaxCrysPhiInTow();
1015  Int_t rest_temp = (Int_t)(n1SMTow % (max_crys_phi_in_tower - 1));
1016 
1017  if (rest_temp == 1) {
1018  j_phi_min = (Double_t)1. - (Double_t)0.5;
1019  }
1020  if (rest_temp == 2) {
1021  j_phi_min = (Double_t)6. - (Double_t)0.5;
1022  }
1023  if (rest_temp == 3) {
1024  j_phi_min = (Double_t)11. - (Double_t)0.5;
1025  }
1026  if (rest_temp == 0) {
1027  j_phi_min = (Double_t)16. - (Double_t)0.5;
1028  }
1029 
1030  return j_phi_min;
1031 }
Int_t MaxCrysPhiInTow()
TEcnaParEcal * fEcal

◆ GetJPhiMin() [2/2]

Double_t TEcnaNumbering::GetJPhiMin ( const Int_t &  n1EBSM)

Definition at line 1057 of file TEcnaNumbering.cc.

1057  {
1058  //Gives JPhiMin for a given SuperModule
1059 
1060  Double_t j_phi_min = (Double_t)1. - (Double_t)0.5;
1061 
1062  return j_phi_min;
1063 }

◆ GetJVecoMax()

Double_t TEcnaNumbering::GetJVecoMax ( const Int_t &  Stex,
const Int_t &  StexStin 
)

Definition at line 3063 of file TEcnaNumbering.cc.

References fFlagSubDet, GetJIYMax(), and GetJPhiMax().

3063  {
3064  Double_t JVecoMax = (Double_t)0.;
3065  if (fFlagSubDet == "EB") {
3066  JVecoMax = GetJPhiMax(Stex, StexStin);
3067  }
3068  if (fFlagSubDet == "EE") {
3069  JVecoMax = GetJIYMax(Stex, StexStin);
3070  } // not used
3071  return JVecoMax;
3072 }
Double_t GetJPhiMax(const Int_t &, const Int_t &)
Double_t GetJIYMax(const Int_t &, const Int_t &)
TString fFlagSubDet

◆ GetJVecoMin()

Double_t TEcnaNumbering::GetJVecoMin ( const Int_t &  Stex,
const Int_t &  StexStin 
)

Definition at line 3053 of file TEcnaNumbering.cc.

References fFlagSubDet, GetJIYMin(), and GetJPhiMin().

3053  {
3054  Double_t JVecoMin = (Double_t)0.;
3055  if (fFlagSubDet == "EB") {
3056  JVecoMin = GetJPhiMin(Stex, StexStin);
3057  }
3058  if (fFlagSubDet == "EE") {
3059  JVecoMin = GetJIYMin(Stex, StexStin);
3060  } // not used
3061  return JVecoMin;
3062 }
Double_t GetJPhiMin(const Int_t &, const Int_t &)
Double_t GetJIYMin(const Int_t &, const Int_t &)
TString fFlagSubDet

◆ GetJYCrysInDee()

Int_t TEcnaNumbering::GetJYCrysInDee ( const Int_t &  n1DeeNumber,
const Int_t &  DeeSC,
const Int_t &  i0SCEcha 
)

Definition at line 2773 of file TEcnaNumbering.cc.

References fEcal, GetJYCrysInSC(), GetJYSCInDee(), and TEcnaParEcal::MaxCrysIYInSC().

Referenced by TEcnaHistos::GetYCrysInStex(), and TEcnaWrite::WriteAsciiHisto().

2773  {
2774  //Gives Crys JY in Dee for a given (n1DeeNumber, DeeSC, i0SCEcha)
2775 
2776  Int_t JYCrysInDee = (GetJYSCInDee(DeeSC) - 1) * fEcal->MaxCrysIYInSC() + GetJYCrysInSC(n1DeeNumber, DeeSC, i0SCEcha);
2777  return JYCrysInDee; // possible values: 1,2,...,99,100
2778 }
Int_t GetJYSCInDee(const Int_t &)
TEcnaParEcal * fEcal
Int_t MaxCrysIYInSC()
Int_t GetJYCrysInSC(const Int_t &, const Int_t &, const Int_t &)

◆ GetJYCrysInSC()

Int_t TEcnaNumbering::GetJYCrysInSC ( const Int_t &  n1DeeNumber,
const Int_t &  DeeSC,
const Int_t &  i0SCEcha 
)

Definition at line 2756 of file TEcnaNumbering.cc.

References fT2d_jch_JY, GetDeeDirViewedFromIP(), GetSCQuadFrom1DeeSCEcna(), and GetSCQuadTypeIndex().

Referenced by GetJYCrysInDee(), and TEcnaHistos::GetYSampInStin().

2756  {
2757  //Gives Crys JY in SC for a given (n1DeeNumber, DeeSC, i0SCEcha)
2758 
2759  TString SCQuadType = GetSCQuadFrom1DeeSCEcna(DeeSC);
2760  TString sDeeDir = GetDeeDirViewedFromIP(n1DeeNumber);
2761  Int_t type_index = GetSCQuadTypeIndex(SCQuadType, sDeeDir);
2762  Int_t JYCrysInSC = fT2d_jch_JY[type_index][i0SCEcha + 1] + 1;
2763  return JYCrysInSC; // possible values: 1,2,3,4,5
2764 }
TString GetSCQuadFrom1DeeSCEcna(const Int_t &)
TString GetDeeDirViewedFromIP(const Int_t &)
Int_t ** fT2d_jch_JY
Int_t GetSCQuadTypeIndex(const TString &, const TString &)

◆ GetJYDirectionEB()

TString TEcnaNumbering::GetJYDirectionEB ( const Int_t &  SMNumber)

Definition at line 1107 of file TEcnaNumbering.cc.

References GetSMHalfBarrel().

Referenced by TEcnaHistos::ViewSMGrid(), and TEcnaHistos::ViewTowerGrid().

1107  {
1108  TString jydirection = "-x"; // DEFAULT
1109 
1110  if (GetSMHalfBarrel(SMNumber) == "EB+") {
1111  jydirection = "x";
1112  }
1113  if (GetSMHalfBarrel(SMNumber) == "EB-") {
1114  jydirection = "-x";
1115  }
1116 
1117  return jydirection;
1118 }
TString GetSMHalfBarrel(const Int_t &)

◆ GetJYDirectionEE()

TString TEcnaNumbering::GetJYDirectionEE ( const Int_t &  n1DeeNumber)

Definition at line 2935 of file TEcnaNumbering.cc.

Referenced by TEcnaHistos::ViewSCGrid().

2935  {
2936  TString jydirection = "x"; // ALWAYS IN THIS CASE
2937  return jydirection;
2938 }

◆ GetJYSCInDee()

Int_t TEcnaNumbering::GetJYSCInDee ( const Int_t &  DeeSC)

Definition at line 2766 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxSCIYInDee().

Referenced by GetJYCrysInDee().

2766  {
2767  //Gives SC JY in Dee for a given (n1DeeNumber, DeeSC, i0SCEcha)
2768 
2769  Int_t JYSCInDee = (DeeSC - 1) % fEcal->MaxSCIYInDee() + 1;
2770  return JYSCInDee; // possible values: 1,2,...,19,20
2771 }
Int_t MaxSCIYInDee()
TEcnaParEcal * fEcal

◆ GetMaxSCInDS()

Int_t TEcnaNumbering::GetMaxSCInDS ( const Int_t &  DeeDS)

Definition at line 2780 of file TEcnaNumbering.cc.

Referenced by TEcnaHistos::GetDSOffset(), TEcnaHistos::HistoPlot(), and TEcnaHistos::ViewHisto().

2780  {
2781  // Gives the number of SC's in Data Sector DeeDS
2782 
2783  Int_t nb_of_sc = -1;
2784  if (DeeDS == 1 || DeeDS == 9) {
2785  nb_of_sc = 33;
2786  }
2787  if (DeeDS == 2 || DeeDS == 8) {
2788  nb_of_sc = 32;
2789  }
2790  if (DeeDS == 3 || DeeDS == 7) {
2791  nb_of_sc = 34;
2792  }
2793  if (DeeDS == 4 || DeeDS == 6) {
2794  nb_of_sc = 33;
2795  }
2796  if (DeeDS == 5) {
2797  nb_of_sc = 34;
2798  }
2799  return nb_of_sc;
2800 }

◆ GetPhi()

Double_t TEcnaNumbering::GetPhi ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow,
const Int_t &  i0TowEcha 
)

Definition at line 892 of file TEcnaNumbering.cc.

References gather_cfg::cout, fEcal, fTTBELL, GetPhiInSM(), GetSMCentralPhi(), TEcnaParEcal::MaxSMInEB(), and phi.

Referenced by TEcnaHistos::TowerCrystalNumbering(), and TEcnaHistos::ViewSMTowerNumberingPad().

892  {
893  //Gives Phi for a given (n1EBSM, n1SMTow, i0TowEcha)
894 
895  Double_t phi = (Double_t)0.;
896 
897  if (n1EBSM >= 1 && n1EBSM <= fEcal->MaxSMInEB()) {
898  Double_t phiInSM = GetPhiInSM(n1EBSM, n1SMTow, i0TowEcha);
899  Double_t phi_start = GetSMCentralPhi(n1EBSM);
900 
901  phi = 20 - phiInSM + phi_start - (Double_t)10.;
902  } else {
903  std::cout << "TEcnaNumbering::GetPhi(...)> SM = " << n1EBSM << ". Out of range (range = [1," << fEcal->MaxSMInEB()
904  << "])" << fTTBELL << std::endl;
905  }
906  return phi;
907 }
TEcnaParEcal * fEcal
Double_t GetPhiInSM(const Int_t &, const Int_t &, const Int_t &)
Int_t MaxSMInEB()
Double_t GetSMCentralPhi(const Int_t &)

◆ GetPhiInSM()

Double_t TEcnaNumbering::GetPhiInSM ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow,
const Int_t &  i0TowEcha 
)

Definition at line 821 of file TEcnaNumbering.cc.

References gather_cfg::cout, fCodeChNumberingLvrbBot, fCodeChNumberingLvrbTop, fEcal, fTTBELL, GetTowerLvrbType(), TEcnaParEcal::MaxCrysPhiInTow(), and TEcnaParEcal::MaxSMInEB().

Referenced by GetPhi(), and TEcnaWrite::WriteAsciiHisto().

821  {
822  //Gives Phi for a given (n1EBSM, n1SMTow, i0TowEcha)
823 
824  Double_t phi_in_SM = (Double_t)0.;
825 
826  Int_t rest_temp = (Int_t)(n1SMTow % (fEcal->MaxCrysPhiInTow() - 1)); // "Phi" of the tower = 1,2,3,0
827 
828  if (n1EBSM >= 1 && n1EBSM <= fEcal->MaxSMInEB()) {
829  if (rest_temp == 1) {
830  phi_in_SM = (Double_t)15.;
831  }
832  if (rest_temp == 2) {
833  phi_in_SM = (Double_t)10.;
834  }
835  if (rest_temp == 3) {
836  phi_in_SM = (Double_t)5.;
837  }
838  if (rest_temp == 0) {
839  phi_in_SM = (Double_t)0.;
840  }
841 
842  if (GetTowerLvrbType(n1SMTow) == fCodeChNumberingLvrbTop) {
843  if (i0TowEcha == 4 || i0TowEcha == 5 || i0TowEcha == 14 || i0TowEcha == 15 || i0TowEcha == 24) {
844  phi_in_SM = phi_in_SM + 0;
845  }
846 
847  if (i0TowEcha == 3 || i0TowEcha == 6 || i0TowEcha == 13 || i0TowEcha == 16 || i0TowEcha == 23) {
848  phi_in_SM = phi_in_SM + 1;
849  }
850 
851  if (i0TowEcha == 2 || i0TowEcha == 7 || i0TowEcha == 12 || i0TowEcha == 17 || i0TowEcha == 22) {
852  phi_in_SM = phi_in_SM + 2;
853  }
854 
855  if (i0TowEcha == 1 || i0TowEcha == 8 || i0TowEcha == 11 || i0TowEcha == 18 || i0TowEcha == 21) {
856  phi_in_SM = phi_in_SM + 3;
857  }
858 
859  if (i0TowEcha == 0 || i0TowEcha == 9 || i0TowEcha == 10 || i0TowEcha == 19 || i0TowEcha == 20) {
860  phi_in_SM = phi_in_SM + 4;
861  }
862  }
863  if (GetTowerLvrbType(n1SMTow) == fCodeChNumberingLvrbBot) {
864  if (i0TowEcha == 20 || i0TowEcha == 19 || i0TowEcha == 10 || i0TowEcha == 9 || i0TowEcha == 0) {
865  phi_in_SM = phi_in_SM + 0;
866  }
867 
868  if (i0TowEcha == 21 || i0TowEcha == 18 || i0TowEcha == 11 || i0TowEcha == 8 || i0TowEcha == 1) {
869  phi_in_SM = phi_in_SM + 1;
870  }
871 
872  if (i0TowEcha == 22 || i0TowEcha == 17 || i0TowEcha == 12 || i0TowEcha == 7 || i0TowEcha == 2) {
873  phi_in_SM = phi_in_SM + 2;
874  }
875 
876  if (i0TowEcha == 23 || i0TowEcha == 16 || i0TowEcha == 13 || i0TowEcha == 6 || i0TowEcha == 3) {
877  phi_in_SM = phi_in_SM + 3;
878  }
879 
880  if (i0TowEcha == 24 || i0TowEcha == 15 || i0TowEcha == 14 || i0TowEcha == 5 || i0TowEcha == 4) {
881  phi_in_SM = phi_in_SM + 4;
882  }
883  }
884  } else {
885  std::cout << "TEcnaNumbering::GetPhiInSM(...)> SM = " << n1EBSM << ". Out of range (range = [1,"
886  << fEcal->MaxSMInEB() << "])" << fTTBELL << std::endl;
887  }
888  phi_in_SM = 20 - phi_in_SM;
889  return phi_in_SM;
890 }
Int_t MaxCrysPhiInTow()
TString GetTowerLvrbType(const Int_t &)
TEcnaParEcal * fEcal
Int_t MaxSMInEB()
TString fCodeChNumberingLvrbBot
TString fCodeChNumberingLvrbTop

◆ GetPhiMax() [1/2]

Double_t TEcnaNumbering::GetPhiMax ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow 
)

Definition at line 951 of file TEcnaNumbering.cc.

References fEcal, GetSMCentralPhi(), GetSMHalfBarrel(), and TEcnaParEcal::MaxCrysPhiInTow().

Referenced by GetVecoMax(), TEcnaHistos::ViewSMGrid(), and TEcnaHistos::ViewTowerGrid().

951  {
952  //Gives PhiMax for a given Tower
953 
954  Int_t max_crys_phi_in_tower = fEcal->MaxCrysPhiInTow();
955 
956  Double_t phi_max = (Double_t)20.; // DEFAULT
957  Double_t phi_start = GetSMCentralPhi(n1EBSM);
958 
959  Int_t rest_temp = (Int_t)(n1SMTow % (max_crys_phi_in_tower - 1));
960 
961  if (GetSMHalfBarrel(n1EBSM) == "EB+") {
962  if (rest_temp == 1) {
963  phi_max = phi_start + (Double_t)10.;
964  }
965  if (rest_temp == 2) {
966  phi_max = phi_start + (Double_t)5.;
967  }
968  if (rest_temp == 3) {
969  phi_max = phi_start - (Double_t)0.;
970  }
971  if (rest_temp == 0) {
972  phi_max = phi_start - (Double_t)5.;
973  }
974  }
975 
976  if (GetSMHalfBarrel(n1EBSM) == "EB-") {
977  if (rest_temp == 0) {
978  phi_max = phi_start + (Double_t)10.;
979  }
980  if (rest_temp == 3) {
981  phi_max = phi_start + (Double_t)5.;
982  }
983  if (rest_temp == 2) {
984  phi_max = phi_start - (Double_t)0.;
985  }
986  if (rest_temp == 1) {
987  phi_max = phi_start - (Double_t)5.;
988  }
989  }
990 
991  return phi_max;
992 }
Int_t MaxCrysPhiInTow()
TString GetSMHalfBarrel(const Int_t &)
TEcnaParEcal * fEcal
Double_t GetSMCentralPhi(const Int_t &)

◆ GetPhiMax() [2/2]

Double_t TEcnaNumbering::GetPhiMax ( const Int_t &  n1EBSM)

Definition at line 1002 of file TEcnaNumbering.cc.

References GetSMCentralPhi().

1002  {
1003  //Gives PhiMax for a given SuperModule
1004 
1005  Double_t phi_max = GetSMCentralPhi(n1EBSM) + (Double_t)10.;
1006 
1007  return phi_max;
1008 }
Double_t GetSMCentralPhi(const Int_t &)

◆ GetPhiMin() [1/2]

Double_t TEcnaNumbering::GetPhiMin ( const Int_t &  n1EBSM,
const Int_t &  n1SMTow 
)

Definition at line 910 of file TEcnaNumbering.cc.

References fEcal, GetSMCentralPhi(), GetSMHalfBarrel(), and TEcnaParEcal::MaxCrysPhiInTow().

Referenced by GetVecoMin(), TEcnaHistos::ViewSMGrid(), TEcnaHistos::ViewSMTowerNumberingPad(), and TEcnaHistos::ViewTowerGrid().

910  {
911  //Gives PhiMin for a given Tower
912 
913  Int_t max_crys_phi_in_tower = fEcal->MaxCrysPhiInTow();
914 
915  Double_t phi_min = (Double_t)0.; // DEFAULT
916  Double_t phi_start = GetSMCentralPhi(n1EBSM);
917 
918  Int_t rest_temp = (Int_t)(n1SMTow % (max_crys_phi_in_tower - 1));
919 
920  if (GetSMHalfBarrel(n1EBSM) == "EB+") {
921  if (rest_temp == 1) {
922  phi_min = phi_start + (Double_t)5.;
923  }
924  if (rest_temp == 2) {
925  phi_min = phi_start + (Double_t)0.;
926  }
927  if (rest_temp == 3) {
928  phi_min = phi_start - (Double_t)5.;
929  }
930  if (rest_temp == 0) {
931  phi_min = phi_start - (Double_t)10.;
932  }
933  }
934  if (GetSMHalfBarrel(n1EBSM) == "EB-") {
935  if (rest_temp == 0) {
936  phi_min = phi_start + (Double_t)5.;
937  }
938  if (rest_temp == 3) {
939  phi_min = phi_start + (Double_t)0.;
940  }
941  if (rest_temp == 2) {
942  phi_min = phi_start - (Double_t)5.;
943  }
944  if (rest_temp == 1) {
945  phi_min = phi_start - (Double_t)10.;
946  }
947  }
948  return phi_min;
949 }
Int_t MaxCrysPhiInTow()
TString GetSMHalfBarrel(const Int_t &)
TEcnaParEcal * fEcal
Double_t GetSMCentralPhi(const Int_t &)

◆ GetPhiMin() [2/2]

Double_t TEcnaNumbering::GetPhiMin ( const Int_t &  n1EBSM)

Definition at line 994 of file TEcnaNumbering.cc.

References GetSMCentralPhi().

994  {
995  //Gives PhiMin for a given SuperModule
996 
997  Double_t phi_min = GetSMCentralPhi(n1EBSM) - (Double_t)10.;
998 
999  return phi_min;
1000 }
Double_t GetSMCentralPhi(const Int_t &)

◆ GetSCQuadFrom1DeeSCEcna()

TString TEcnaNumbering::GetSCQuadFrom1DeeSCEcna ( const Int_t &  n1DeeSCEcna)

Definition at line 2605 of file TEcnaNumbering.cc.

Referenced by GetIXCrysInSC(), GetJYCrysInSC(), TEcnaHistos::ModifiedSCEchaForNotConnectedSCs(), TEcnaHistos::SCCrystalNumbering(), TEcnaParHistos::SetPaveSC(), TEcnaHistos::ViewDeeSCNumberingPad(), and TEcnaHistos::ViewMatrix().

2605  {
2606  //gives the quadrant type ("top" or "bottom") from the SC number in Dee
2607 
2608  TString SCQuad = "top"; // => default value
2609 
2610  if (n1DeeSCEcna >= 1 && n1DeeSCEcna <= 10) {
2611  SCQuad = "bottom";
2612  }
2613  if (n1DeeSCEcna >= 21 && n1DeeSCEcna <= 30) {
2614  SCQuad = "bottom";
2615  }
2616  if (n1DeeSCEcna >= 41 && n1DeeSCEcna <= 50) {
2617  SCQuad = "bottom";
2618  }
2619  if (n1DeeSCEcna >= 61 && n1DeeSCEcna <= 70) {
2620  SCQuad = "bottom";
2621  }
2622  if (n1DeeSCEcna >= 81 && n1DeeSCEcna <= 90) {
2623  SCQuad = "bottom";
2624  }
2625  if (n1DeeSCEcna >= 101 && n1DeeSCEcna <= 110) {
2626  SCQuad = "bottom";
2627  }
2628  if (n1DeeSCEcna >= 121 && n1DeeSCEcna <= 130) {
2629  SCQuad = "bottom";
2630  }
2631  if (n1DeeSCEcna >= 141 && n1DeeSCEcna <= 150) {
2632  SCQuad = "bottom";
2633  }
2634  if (n1DeeSCEcna >= 161 && n1DeeSCEcna <= 170) {
2635  SCQuad = "bottom";
2636  }
2637  if (n1DeeSCEcna >= 181 && n1DeeSCEcna <= 190) {
2638  SCQuad = "bottom";
2639  }
2640 
2641  return SCQuad;
2642 }

◆ GetSCQuadTypeIndex()

Int_t TEcnaNumbering::GetSCQuadTypeIndex ( const TString &  SCQuadType,
const TString &  sDeeDir 
)

Definition at line 2643 of file TEcnaNumbering.cc.

Referenced by GetIXCrysInSC(), and GetJYCrysInSC().

2643  {
2644  //gives the index of the SC quadrant type (top/right, top/left, bottom/left, bottom/right)
2645  // = quadrant number - 1
2646 
2647  Int_t itype = 0; // => default
2648  if (SCQuadType == "top" && sDeeDir == "right") {
2649  itype = 0;
2650  }
2651  if (SCQuadType == "top" && sDeeDir == "left") {
2652  itype = 1;
2653  }
2654  if (SCQuadType == "bottom" && sDeeDir == "left") {
2655  itype = 2;
2656  }
2657  if (SCQuadType == "bottom" && sDeeDir == "right") {
2658  itype = 3;
2659  }
2660  return itype;
2661 }

◆ GetSCType()

TString TEcnaNumbering::GetSCType ( const Int_t &  nb_for_cons)

Definition at line 2546 of file TEcnaNumbering.cc.

Referenced by TEcnaHistos::ViewHisto().

2546  {
2547  // gives the special not connected SC's
2548 
2549  TString SCType = "Connected"; // => default type
2550 
2551  if (nb_for_cons == 182 || nb_for_cons == 33) {
2552  SCType = "NotConnected";
2553  } // (D1,S1) (D3,S9) || (D2,S9) (D4,S1)
2554 
2555  if (nb_for_cons == 178 || nb_for_cons == 29) {
2556  SCType = "NotConnected";
2557  } // (D1,S2) (D3,S8) || (D2,S8) (D4,S2)
2558  if (nb_for_cons == 207 || nb_for_cons == 58) {
2559  SCType = "NotConnected";
2560  }
2561 
2562  if (nb_for_cons == 298 || nb_for_cons == 149) {
2563  SCType = "NotConnected";
2564  } // (D1,S3) (D3,S7) || (D2,S7) (D4,S3)
2565 
2566  if (nb_for_cons == 261 || nb_for_cons == 112) {
2567  SCType = "NotConnected";
2568  } // (D1,S4) (D3,S6) || (D2,S6) (D4,S4)
2569  if (nb_for_cons == 268 || nb_for_cons == 119) {
2570  SCType = "NotConnected";
2571  }
2572 
2573  if (nb_for_cons == 281 || nb_for_cons == 132) {
2574  SCType = "NotConnected";
2575  } // (D1,S5) (D3,S5) || (D2,S5) (D4,S5)
2576 
2577  if (nb_for_cons == 161 || nb_for_cons == 12) {
2578  SCType = "NotComplete";
2579  } // (D1,S1) (D3,S9) || (D2,S9) (D4,S1)
2580  if (nb_for_cons == 216 || nb_for_cons == 67) {
2581  SCType = "NotComplete";
2582  } // (D1,S2) (D3,S8) || (D2,S8) (D4,S2)
2583  if (nb_for_cons == 224 || nb_for_cons == 75) {
2584  SCType = "NotComplete";
2585  } // (D1,S3) (D3,S7) || (D2,S7) (D4,S3)
2586  if (nb_for_cons == 286 || nb_for_cons == 137) {
2587  SCType = "NotComplete";
2588  } // (D1,S5) (D3,S5) || (D2,S5) (D4,S5)
2589 
2590  return SCType;
2591 }

◆ GetSMCentralPhi()

Double_t TEcnaNumbering::GetSMCentralPhi ( const Int_t &  n1EBSM)

Definition at line 806 of file TEcnaNumbering.cc.

References GetSMHalfBarrel().

Referenced by GetPhi(), GetPhiMax(), and GetPhiMin().

806  {
807  //Gives the central phi value of the SuperModule
808 
809  Double_t central_phi = (Double_t)10.; // DEFAULT = SM1
810 
811  if (GetSMHalfBarrel(n1EBSM) == "EB+") {
812  central_phi = 10. + (Double_t)20. * (n1EBSM - 1);
813  }
814  if (GetSMHalfBarrel(n1EBSM) == "EB-") {
815  central_phi = 10. + (Double_t)20. * (n1EBSM - 19);
816  }
817 
818  return central_phi;
819 }
TString GetSMHalfBarrel(const Int_t &)

◆ GetSMFromFED()

Int_t TEcnaNumbering::GetSMFromFED ( const Int_t &  FEDNumber)

Definition at line 3095 of file TEcnaNumbering.cc.

3095  {
3096  Int_t EBSMNumber = 0; // SM = Super Module
3097  if (FEDNumber >= 610 && FEDNumber <= 645) {
3098  EBSMNumber = FEDNumber - 609;
3099  }
3100  return EBSMNumber;
3101 }

◆ GetSMHalfBarrel()

TString TEcnaNumbering::GetSMHalfBarrel ( const Int_t &  SMNumber)

Definition at line 1121 of file TEcnaNumbering.cc.

References fEcal, TEcnaParEcal::MaxSMInEB(), and TEcnaParEcal::MaxSMInEBPlus().

Referenced by GetEta(), GetEtaMax(), GetEtaMin(), GetIEtaFromHashed(), GetIEtaMax(), GetIEtaMin(), GetJYDirectionEB(), GetPhiMax(), GetPhiMin(), GetSMCentralPhi(), GetStexHalfStas(), GetXDirectionEB(), GetYDirectionEB(), TEcnaHistos::SetEcalSubDetector(), TEcnaParHistos::SetPaveLVRB(), TEcnaParHistos::SetPaveStex(), TEcnaHistos::SMTowerNumbering(), TEcnaHistos::TowerCrystalNumbering(), TEcnaHistos::ViewMatrix(), TEcnaHistos::ViewSMGrid(), and TEcnaHistos::ViewSMTowerNumberingPad().

1121  {
1122  //gives the half-barrel of the SM ("EB+" or "EB-")
1123 
1124  TString type = "EB-"; // => default value
1125 
1126  if (SMNumber >= 1 && SMNumber <= fEcal->MaxSMInEBPlus()) {
1127  type = "EB+";
1128  }
1129  if (SMNumber > fEcal->MaxSMInEBPlus() && SMNumber <= fEcal->MaxSMInEB()) {
1130  type = "EB-";
1131  }
1132 
1133  return type;
1134 }
Int_t MaxSMInEBPlus()
TEcnaParEcal * fEcal
Int_t MaxSMInEB()

◆ GetStexHalfStas()

TString TEcnaNumbering::GetStexHalfStas ( const Int_t &  SMNumber)

Definition at line 3078 of file TEcnaNumbering.cc.

References fFlagSubDet, GetDeeHalfEndcap(), and GetSMHalfBarrel().

Referenced by TEcnaHistos::GetXCrysInStex(), TEcnaHistos::GetXSampInStin(), TEcnaHistos::GetXStinInStas(), TEcnaHistos::GetYCrysInStex(), TEcnaHistos::GetYSampInStin(), TEcnaHistos::GetYStinInStas(), and TEcnaHistos::StexHocoVecoLHFCorcc().

3078  {
3079  TString half_stas = "EB? EE?";
3080 
3081  if (fFlagSubDet == "EB") {
3082  half_stas = GetSMHalfBarrel(SMNumber);
3083  }
3084  if (fFlagSubDet == "EE") {
3085  half_stas = GetDeeHalfEndcap(SMNumber);
3086  }
3087 
3088  return half_stas;
3089 }
TString GetSMHalfBarrel(const Int_t &)
TString GetDeeHalfEndcap(const Int_t &)
TString fFlagSubDet

◆ GetStinLvrbType()

TString TEcnaNumbering::GetStinLvrbType ( const Int_t &  n1SMTow)

Definition at line 617 of file TEcnaNumbering.cc.

References GetTowerLvrbType().

Referenced by TEcnaHistos::GetXSampInStin(), and TEcnaHistos::GetYSampInStin().

617  {
618  TString lvrb_type = GetTowerLvrbType(n1SMTow);
619  return lvrb_type;
620 }
TString GetTowerLvrbType(const Int_t &)

◆ GetTowerLvrbType()

TString TEcnaNumbering::GetTowerLvrbType ( const Int_t &  n1SMTow)

Definition at line 621 of file TEcnaNumbering.cc.

References fCodeChNumberingLvrbBot, and fCodeChNumberingLvrbTop.

Referenced by GetEta(), GetPhiInSM(), GetStinLvrbType(), TEcnaParHistos::SetPaveLVRB(), TEcnaHistos::TowerCrystalNumbering(), and TEcnaHistos::ViewSMTowerNumberingPad().

621  {
622  //gives the LVRB type of the crystal numbering of tower
623 
624  TString type = fCodeChNumberingLvrbTop; // => default value
625 
626  if (n1SMTow >= 1 && n1SMTow <= 12) {
628  }
629  if (n1SMTow >= 21 && n1SMTow <= 28) {
631  }
632  if (n1SMTow >= 37 && n1SMTow <= 44) {
634  }
635  if (n1SMTow >= 53 && n1SMTow <= 60) {
637  }
638 
639  return type;
640 }
TString fCodeChNumberingLvrbBot
TString fCodeChNumberingLvrbTop

◆ GetVecoMax()

Double_t TEcnaNumbering::GetVecoMax ( const Int_t &  Stex,
const Int_t &  StexStin 
)

Definition at line 3042 of file TEcnaNumbering.cc.

References fFlagSubDet, GetJIYMax(), and GetPhiMax().

3042  {
3043  Double_t IVecoMax = (Double_t)0.;
3044  if (fFlagSubDet == "EB") {
3045  IVecoMax = GetPhiMax(Stex, StexStin);
3046  }
3047  if (fFlagSubDet == "EE") {
3048  IVecoMax = GetJIYMax(Stex, StexStin);
3049  }
3050  return IVecoMax;
3051 }
Double_t GetPhiMax(const Int_t &, const Int_t &)
Double_t GetJIYMax(const Int_t &, const Int_t &)
TString fFlagSubDet

◆ GetVecoMin()

Double_t TEcnaNumbering::GetVecoMin ( const Int_t &  Stex,
const Int_t &  StexStin 
)

Definition at line 3031 of file TEcnaNumbering.cc.

References fFlagSubDet, GetJIYMin(), and GetPhiMin().

3031  {
3032  Double_t IVecoMin = (Double_t)0.;
3033  if (fFlagSubDet == "EB") {
3034  IVecoMin = GetPhiMin(Stex, StexStin);
3035  }
3036  if (fFlagSubDet == "EE") {
3037  IVecoMin = GetJIYMin(Stex, StexStin);
3038  }
3039  return IVecoMin;
3040 }
Double_t GetPhiMin(const Int_t &, const Int_t &)
Double_t GetJIYMin(const Int_t &, const Int_t &)
TString fFlagSubDet

◆ GetXDirectionEB()

TString TEcnaNumbering::GetXDirectionEB ( const Int_t &  SMNumber)

Definition at line 1080 of file TEcnaNumbering.cc.

References GetSMHalfBarrel().

Referenced by TEcnaHistos::ViewEBGrid(), TEcnaHistos::ViewSMGrid(), and TEcnaHistos::ViewTowerGrid().

1080  {
1081  TString xdirection = "x"; // DEFAULT
1082 
1083  if (GetSMHalfBarrel(SMNumber) == "EB+") {
1084  xdirection = "x";
1085  }
1086  if (GetSMHalfBarrel(SMNumber) == "EB-") {
1087  xdirection = "x";
1088  }
1089 
1090  return xdirection;
1091 }
TString GetSMHalfBarrel(const Int_t &)

◆ GetXDirectionEE()

TString TEcnaNumbering::GetXDirectionEE ( const Int_t &  n1DeeNumber)

Definition at line 2902 of file TEcnaNumbering.cc.

References GetEEDeeType().

Referenced by TEcnaHistos::ViewSCGrid().

2902  {
2903  TString xdirection = "x"; // DEFAULT
2904 
2905  if (GetEEDeeType(n1DeeNumber) == "EE+F") {
2906  xdirection = "-x";
2907  } // Dee 1
2908  if (GetEEDeeType(n1DeeNumber) == "EE+N") {
2909  xdirection = "-x";
2910  } // Dee 2
2911  if (GetEEDeeType(n1DeeNumber) == "EE-N") {
2912  xdirection = "x";
2913  } // Dee 3
2914  if (GetEEDeeType(n1DeeNumber) == "EE-F") {
2915  xdirection = "x";
2916  } // Dee 4
2917 
2918  return xdirection;
2919 }
TString GetEEDeeType(const Int_t &)

◆ GetYDirectionEB()

TString TEcnaNumbering::GetYDirectionEB ( const Int_t &  SMNumber)

Definition at line 1093 of file TEcnaNumbering.cc.

References GetSMHalfBarrel().

Referenced by TEcnaHistos::ViewSMGrid(), and TEcnaHistos::ViewTowerGrid().

1093  {
1094  TString ydirection = "-x"; // DEFAULT
1095 
1096  if (GetSMHalfBarrel(SMNumber) == "EB+") {
1097  ydirection = "-x";
1098  }
1099  if (GetSMHalfBarrel(SMNumber) == "EB-") {
1100  ydirection = "-x";
1101  }
1102 
1103  return ydirection;
1104 }
TString GetSMHalfBarrel(const Int_t &)

◆ GetYDirectionEE()

TString TEcnaNumbering::GetYDirectionEE ( const Int_t &  n1DeeNumber)

Definition at line 2921 of file TEcnaNumbering.cc.

References GetEEDeeType().

2921  {
2922  TString ydirection = "-x"; // DEFAULT
2923 
2924  if (GetEEDeeType(n1DeeNumber) == "endcap+") {
2925  ydirection = "-x";
2926  }
2927  if (GetEEDeeType(n1DeeNumber) == "endcap-") {
2928  ydirection = "-x";
2929  }
2930 
2931  return ydirection;
2932 }
TString GetEEDeeType(const Int_t &)

◆ Init()

void TEcnaNumbering::Init ( void  )
protected

Definition at line 177 of file TEcnaNumbering.cc.

References fCodeChNumberingITP1Bot, fCodeChNumberingITP2Top, fCodeChNumberingLvrbBot, fCodeChNumberingLvrbTop, fEcal, fgMaxCar, fT1d_DeeSCCons, fT1d_DS, fT1d_DSSC, fT1d_ich_IX, fT1d_jch_JY, fT1d_RecovDeeSC, fT1dDeeCrys, fT1dDeeSC, fT1dSCEcha, fT1dSMCrys, fT1dSMTow, fT1dTowEcha, fT2d_DeeSCCons, fT2d_DS, fT2d_DSSC, fT2d_ich_IX, fT2d_jch_JY, fT2d_RecovDeeSC, fT2dDeeCrys, fT2dDeeSC, fT2dSCEcha, fT2dSMCrys, fT3dDeeCrys, and fTTBELL.

Referenced by TEcnaNumbering().

177  {
178  //Set default values and build crystal numbering table
179 
180  //.............................. Initialisations
181  fTTBELL = '\007';
182  fgMaxCar = (Int_t)512;
183 
184  //....................... Barrel
185  fT2dSMCrys = nullptr;
186  fT1dSMCrys = nullptr;
187  fT1dSMTow = nullptr;
188  fT1dTowEcha = nullptr;
189 
190  fCodeChNumberingLvrbBot = "bottom";
191  fCodeChNumberingLvrbTop = "top";
192 
193  //....................... Endcap
194  fT3dDeeCrys = nullptr;
195  fT2dDeeCrys = nullptr;
196  fT1dDeeCrys = nullptr;
197  fT2dDeeSC = nullptr;
198  fT1dDeeSC = nullptr;
199  fT2dSCEcha = nullptr;
200  fT1dSCEcha = nullptr;
201  fT2d_jch_JY = nullptr;
202  fT1d_jch_JY = nullptr;
203  fT2d_ich_IX = nullptr;
204  fT1d_ich_IX = nullptr;
205  fT2d_DS = nullptr;
206  fT1d_DS = nullptr;
207  fT2d_DSSC = nullptr;
208  fT1d_DSSC = nullptr;
209  fT2d_DeeSCCons = nullptr;
210  fT1d_DeeSCCons = nullptr;
211  fT2d_RecovDeeSC = nullptr;
212  fT1d_RecovDeeSC = nullptr;
213 
214  fCodeChNumberingITP1Bot = "bottom"; // ==> Type 1 Interface plate IPT1 (a faire)
215  fCodeChNumberingITP2Top = "top"; // ==> Type 2 Interface plate IPT2 (a faire)
216 
217  //------------------ Init pointers on the CNA objects
218  fEcal = nullptr;
219 }
Int_t * fT1dSCEcha
Int_t ** fT2d_DS
Int_t * fT1dDeeCrys
Int_t * fT1d_ich_IX
Int_t ** fT2d_ich_IX
Int_t ** fT2d_RecovDeeSC
Int_t * fT1d_DeeSCCons
Int_t ** fT2dDeeSC
TEcnaParEcal * fEcal
Int_t ** fT2d_DSSC
Int_t * fT1dSMCrys
Int_t ** fT2d_jch_JY
TString fCodeChNumberingITP2Top
Int_t * fT1d_RecovDeeSC
Int_t * fT1d_jch_JY
Int_t * fT1dTowEcha
Int_t ** fT2d_DeeSCCons
Int_t ** fT2dDeeCrys
Int_t ** fT2dSMCrys
TString fCodeChNumberingITP1Bot
TString fCodeChNumberingLvrbBot
TString fCodeChNumberingLvrbTop
Int_t *** fT3dDeeCrys
Int_t ** fT2dSCEcha

◆ MaxCrysInStinEcna()

Int_t TEcnaNumbering::MaxCrysInStinEcna ( const Int_t &  n1DeeNumber,
const Int_t &  n1DeeSCEcna,
const TString &  s_option 
)

Definition at line 3117 of file TEcnaNumbering.cc.

References gather_cfg::cout, fEcal, fFlagSubDet, fTTBELL, GetDeeSCConsFrom1DeeSCEcna(), and TEcnaParEcal::MaxCrysInStin().

Referenced by TEcnaRun::AverageHighFrequencyNoise(), TEcnaRun::AverageLowFrequencyNoise(), TEcnaRun::AverageMeanCorrelationsBetweenSamples(), TEcnaRun::AveragePedestals(), TEcnaRun::AverageSigmaOfCorrelationsBetweenSamples(), TEcnaRun::AverageTotalNoise(), and TEcnaRead::ReadAverageNumberOfEvents().

3117  {
3118  // Number of Xtals in "Ecna SC" for not complete and not connected SC's.
3119  // Also valid for all connected and complete SC's and for towers of EB
3120 
3121  Int_t max_crys = fEcal->MaxCrysInStin(); // valid for EB and for connected and complete SC's of EE
3122 
3123  // Number of Xtals in SC for not complete and not connected SC's
3124 
3125  if (fFlagSubDet == "EE") {
3126  Int_t n_for_cons = GetDeeSCConsFrom1DeeSCEcna(n1DeeNumber, n1DeeSCEcna);
3127 
3128  //............ not complete SC's (inner border)
3129  if (n_for_cons == 12 || n_for_cons == 67 || n_for_cons == 75 || n_for_cons == 137 || n_for_cons == 161 ||
3130  n_for_cons == 216 || n_for_cons == 224 || n_for_cons == 286) {
3131  max_crys = 20;
3132  }
3133 
3134  //............ not connected SC's
3135  if ((n_for_cons == 182 || n_for_cons == 33) && (n1DeeSCEcna == 60 || n1DeeSCEcna == 119)) {
3136  max_crys = 10;
3137  }
3138 
3139  if ((n_for_cons == 178 || n_for_cons == 29) && (n1DeeSCEcna == 138 || n1DeeSCEcna == 157)) {
3140  max_crys = 10;
3141  }
3142  if ((n_for_cons == 207 || n_for_cons == 58) && (n1DeeSCEcna == 176 || n1DeeSCEcna == 193)) {
3143  max_crys = 10;
3144  }
3145 
3146  if ((n_for_cons == 298 || n_for_cons == 149) && (n1DeeSCEcna == 188)) {
3147  max_crys = 10;
3148  }
3149 
3150  if ((n_for_cons == 261 || n_for_cons == 112) && (n1DeeSCEcna == 144 || n1DeeSCEcna == 165)) {
3151  max_crys = 10;
3152  }
3153  if ((n_for_cons == 268 || n_for_cons == 119) && (n1DeeSCEcna == 102 || n1DeeSCEcna == 123)) {
3154  max_crys = 10;
3155  }
3156 
3157  if ((n_for_cons == 281 || n_for_cons == 132) && (n1DeeSCEcna == 41)) {
3158  max_crys = 10;
3159  }
3160 
3161  //............. not connected and mixed Ecna SC's
3162  if (s_option == "TEcnaRun" || s_option == "TEcnaRead") {
3163  if (s_option == "TEcnaRun") {
3164  // special translation of Xtal 11 of SCEcna 29 and 32 to respectively Xtal 11 of SCEcna 10 and 11
3165  if (n1DeeSCEcna == 29 || n1DeeSCEcna == 32) {
3166  max_crys = 5;
3167  }
3168  if (n1DeeSCEcna == 10 || n1DeeSCEcna == 11) {
3169  max_crys = 1;
3170  }
3171  }
3172  if (s_option == "TEcnaRead") {
3173  //if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 ){max_crys = 6;}
3174  if (n1DeeSCEcna == 29 || n1DeeSCEcna == 32) {
3175  max_crys = 5;
3176  }
3177  if (n1DeeSCEcna == 10 || n1DeeSCEcna == 11) {
3178  max_crys = 1;
3179  }
3180  }
3181  } else {
3182  std::cout << "!TEcnaNumbering::MaxCrysInStinEcna(...)> " << s_option << ": unknown option." << fTTBELL
3183  << std::endl;
3184  }
3185  }
3186  return max_crys;
3187 }
TEcnaParEcal * fEcal
Int_t MaxCrysInStin()
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
TString fFlagSubDet

◆ PlusMinusSMNumber()

Int_t TEcnaNumbering::PlusMinusSMNumber ( const Int_t &  PlusSMNumber)

Definition at line 1136 of file TEcnaNumbering.cc.

References fEcal, and TEcnaParEcal::MaxSMPhiInEB().

Referenced by TEcnaWrite::NumberOfEventsAnalysis().

1136  {
1137  Int_t PMSMNumber = PlusSMNumber;
1138  if (PlusSMNumber > fEcal->MaxSMPhiInEB()) {
1139  PMSMNumber = -PlusSMNumber + fEcal->MaxSMPhiInEB();
1140  }
1141  return PMSMNumber;
1142 }
Int_t MaxSMPhiInEB()
TEcnaParEcal * fEcal

◆ SetEcalSubDetector() [1/2]

void TEcnaNumbering::SetEcalSubDetector ( const TString &  SubDet)

Definition at line 245 of file TEcnaNumbering.cc.

References BuildBarrelCrysTable(), BuildEndcapCrysTable(), BuildEndcapSCTable(), fEcal, fFlagSubDet, fgMaxCar, and TEcnaParEcal::GetEcalSubDetector().

Referenced by TEcnaNumbering().

245  {
246  //Set the current subdetector flag and the current subdetector parameters
247 
248  Int_t MaxCar = fgMaxCar;
249  fFlagSubDet.Resize(MaxCar);
250  fFlagSubDet = fEcal->GetEcalSubDetector(); // fFlagSubDet = "EB" or "EE"
251 
252  if (fFlagSubDet == "EB") {
254  }
255  if (fFlagSubDet == "EE") {
258  }
259 }
void BuildBarrelCrysTable()
void BuildEndcapCrysTable()
TEcnaParEcal * fEcal
TString fFlagSubDet
TString GetEcalSubDetector()

◆ SetEcalSubDetector() [2/2]

void TEcnaNumbering::SetEcalSubDetector ( const TString &  SubDet,
TEcnaParEcal pEcal 
)

Definition at line 222 of file TEcnaNumbering.cc.

References BuildBarrelCrysTable(), BuildEndcapCrysTable(), BuildEndcapSCTable(), fEcal, fFlagSubDet, fgMaxCar, TEcnaParEcal::GetEcalSubDetector(), and ntupleEnum::SubDet.

222  {
223  //Set the current subdetector flag and the current subdetector parameters
224 
225  fEcal = nullptr;
226  if (pEcal == nullptr) {
227  fEcal = new TEcnaParEcal(SubDet.Data()); /*fCnew++*/
228  } else {
229  fEcal = pEcal;
230  }
231 
232  Int_t MaxCar = fgMaxCar;
233  fFlagSubDet.Resize(MaxCar);
234  fFlagSubDet = fEcal->GetEcalSubDetector(); // fFlagSubDet = "EB" or "EE"
235 
236  if (fFlagSubDet == "EB") {
238  }
239  if (fFlagSubDet == "EE") {
242  }
243 }
void BuildBarrelCrysTable()
void BuildEndcapCrysTable()
TEcnaParEcal * fEcal
TString fFlagSubDet
TString GetEcalSubDetector()

◆ StexEchaForCons()

Int_t TEcnaNumbering::StexEchaForCons ( const Int_t &  n1DeeNumber,
const Int_t &  i0StexEcha 
)

Member Data Documentation

◆ fCdelete

Int_t TEcnaNumbering::fCdelete
private

Definition at line 27 of file TEcnaNumbering.h.

Referenced by BuildBarrelCrysTable(), BuildEndcapCrysTable(), and ~TEcnaNumbering().

◆ fCnew

Int_t TEcnaNumbering::fCnew
private

Definition at line 26 of file TEcnaNumbering.h.

Referenced by BuildBarrelCrysTable(), BuildEndcapCrysTable(), and BuildEndcapSCTable().

◆ fCodeChNumberingITP1Bot

TString TEcnaNumbering::fCodeChNumberingITP1Bot
private

Definition at line 64 of file TEcnaNumbering.h.

Referenced by Init().

◆ fCodeChNumberingITP2Top

TString TEcnaNumbering::fCodeChNumberingITP2Top
private

Definition at line 65 of file TEcnaNumbering.h.

Referenced by Init().

◆ fCodeChNumberingLvrbBot

TString TEcnaNumbering::fCodeChNumberingLvrbBot
private

Definition at line 43 of file TEcnaNumbering.h.

Referenced by GetEta(), GetPhiInSM(), GetTowerLvrbType(), and Init().

◆ fCodeChNumberingLvrbTop

TString TEcnaNumbering::fCodeChNumberingLvrbTop
private

Definition at line 44 of file TEcnaNumbering.h.

Referenced by GetEta(), GetPhiInSM(), GetTowerLvrbType(), and Init().

◆ fEcal

TEcnaParEcal* TEcnaNumbering::fEcal
private

◆ fFlagPrint

Int_t TEcnaNumbering::fFlagPrint
private

Definition at line 32 of file TEcnaNumbering.h.

◆ fFlagSubDet

TString TEcnaNumbering::fFlagSubDet
private

◆ fgMaxCar

Int_t TEcnaNumbering::fgMaxCar
private

Definition at line 25 of file TEcnaNumbering.h.

Referenced by Init(), and SetEcalSubDetector().

◆ fT1d_DeeSCCons

Int_t* TEcnaNumbering::fT1d_DeeSCCons
private

Definition at line 74 of file TEcnaNumbering.h.

Referenced by BuildEndcapSCTable(), Init(), and ~TEcnaNumbering().

◆ fT1d_DS

Int_t* TEcnaNumbering::fT1d_DS
private

Definition at line 68 of file TEcnaNumbering.h.

Referenced by BuildEndcapSCTable(), Init(), and ~TEcnaNumbering().

◆ fT1d_DSSC

Int_t* TEcnaNumbering::fT1d_DSSC
private

Definition at line 71 of file TEcnaNumbering.h.

Referenced by BuildEndcapSCTable(), Init(), and ~TEcnaNumbering().

◆ fT1d_ich_IX

Int_t* TEcnaNumbering::fT1d_ich_IX
private

Definition at line 62 of file TEcnaNumbering.h.

Referenced by BuildEndcapCrysTable(), Init(), and ~TEcnaNumbering().

◆ fT1d_jch_JY

Int_t* TEcnaNumbering::fT1d_jch_JY
private

Definition at line 59 of file TEcnaNumbering.h.

Referenced by BuildEndcapCrysTable(), Init(), and ~TEcnaNumbering().

◆ fT1d_RecovDeeSC

Int_t* TEcnaNumbering::fT1d_RecovDeeSC
private

Definition at line 77 of file TEcnaNumbering.h.

Referenced by BuildEndcapSCTable(), Init(), and ~TEcnaNumbering().

◆ fT1dDeeCrys

Int_t* TEcnaNumbering::fT1dDeeCrys
private

Definition at line 50 of file TEcnaNumbering.h.

Referenced by BuildEndcapCrysTable(), Init(), and ~TEcnaNumbering().

◆ fT1dDeeSC

Int_t* TEcnaNumbering::fT1dDeeSC
private

Definition at line 53 of file TEcnaNumbering.h.

Referenced by BuildEndcapCrysTable(), Init(), and ~TEcnaNumbering().

◆ fT1dSCEcha

Int_t* TEcnaNumbering::fT1dSCEcha
private

Definition at line 56 of file TEcnaNumbering.h.

Referenced by BuildEndcapCrysTable(), Init(), and ~TEcnaNumbering().

◆ fT1dSMCrys

Int_t* TEcnaNumbering::fT1dSMCrys
private

Definition at line 39 of file TEcnaNumbering.h.

Referenced by BuildBarrelCrysTable(), Init(), and ~TEcnaNumbering().

◆ fT1dSMTow

Int_t* TEcnaNumbering::fT1dSMTow
private

Definition at line 40 of file TEcnaNumbering.h.

Referenced by BuildBarrelCrysTable(), Get1SMTowFrom1SMCrys(), Init(), and ~TEcnaNumbering().

◆ fT1dTowEcha

Int_t* TEcnaNumbering::fT1dTowEcha
private

◆ fT2d_DeeSCCons

Int_t** TEcnaNumbering::fT2d_DeeSCCons
private

◆ fT2d_DS

Int_t** TEcnaNumbering::fT2d_DS
private

Definition at line 67 of file TEcnaNumbering.h.

Referenced by BuildEndcapSCTable(), GetDSFrom1DeeSCEcna(), Init(), and ~TEcnaNumbering().

◆ fT2d_DSSC

Int_t** TEcnaNumbering::fT2d_DSSC
private

Definition at line 70 of file TEcnaNumbering.h.

Referenced by BuildEndcapSCTable(), GetDSSCFrom1DeeSCEcna(), Init(), and ~TEcnaNumbering().

◆ fT2d_ich_IX

Int_t** TEcnaNumbering::fT2d_ich_IX
private

Definition at line 61 of file TEcnaNumbering.h.

Referenced by BuildEndcapCrysTable(), GetIXCrysInSC(), Init(), and ~TEcnaNumbering().

◆ fT2d_jch_JY

Int_t** TEcnaNumbering::fT2d_jch_JY
private

Definition at line 58 of file TEcnaNumbering.h.

Referenced by BuildEndcapCrysTable(), GetJYCrysInSC(), Init(), and ~TEcnaNumbering().

◆ fT2d_RecovDeeSC

Int_t** TEcnaNumbering::fT2d_RecovDeeSC
private

◆ fT2dDeeCrys

Int_t** TEcnaNumbering::fT2dDeeCrys
private

Definition at line 49 of file TEcnaNumbering.h.

Referenced by BuildEndcapCrysTable(), Init(), and ~TEcnaNumbering().

◆ fT2dDeeSC

Int_t** TEcnaNumbering::fT2dDeeSC
private

◆ fT2dSCEcha

Int_t** TEcnaNumbering::fT2dSCEcha
private

◆ fT2dSMCrys

Int_t** TEcnaNumbering::fT2dSMCrys
private

◆ fT3dDeeCrys

Int_t*** TEcnaNumbering::fT3dDeeCrys
private

◆ fTTBELL

TString TEcnaNumbering::fTTBELL
private