00001
00002
00003
00004
00005 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaNumbering.h"
00006
00007 ClassImp(TEcnaNumbering)
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 TEcnaNumbering::TEcnaNumbering() {
00029
00030
00031
00032
00033 Init();
00034 }
00035
00036 TEcnaNumbering::TEcnaNumbering(const TString SubDet, const TEcnaParEcal* pEcal) {
00037
00038
00039
00040
00041 Init();
00042 SetEcalSubDetector(SubDet.Data(), pEcal);
00043 }
00044
00045
00046 TEcnaNumbering::~TEcnaNumbering() {
00047
00048
00049
00050
00051
00052 if (fT2dSMCrys != 0){delete [] fT2dSMCrys; fCdelete++;}
00053 if (fT1dSMCrys != 0){delete [] fT1dSMCrys; fCdelete++;}
00054 if (fT1dSMTow != 0){delete [] fT1dSMTow; fCdelete++;}
00055 if (fT1dTowEcha != 0){delete [] fT1dTowEcha; fCdelete++;}
00056
00057
00058 if (fT3dDeeCrys != 0){delete [] fT3dDeeCrys; fCdelete++;}
00059 if (fT2dDeeCrys != 0){delete [] fT2dDeeCrys; fCdelete++;}
00060 if (fT1dDeeCrys != 0){delete [] fT1dDeeCrys; fCdelete++;}
00061 if (fT2dDeeSC != 0){delete [] fT2dDeeSC; fCdelete++;}
00062 if (fT1dDeeSC != 0){delete [] fT1dDeeSC; fCdelete++;}
00063 if (fT2dSCEcha != 0){delete [] fT2dSCEcha; fCdelete++;}
00064 if (fT1dSCEcha != 0){delete [] fT1dSCEcha; fCdelete++;}
00065 if (fT2d_jch_JY != 0){delete [] fT2d_jch_JY; fCdelete++;}
00066 if (fT1d_jch_JY != 0){delete [] fT1d_jch_JY; fCdelete++;}
00067 if (fT2d_ich_IX != 0){delete [] fT2d_ich_IX; fCdelete++;}
00068 if (fT1d_ich_IX != 0){delete [] fT1d_ich_IX; fCdelete++;}
00069 if (fT2d_DS != 0){delete [] fT2d_DS; fCdelete++;}
00070 if (fT1d_DS != 0){delete [] fT1d_DS; fCdelete++;}
00071 if (fT2d_DSSC != 0){delete [] fT2d_DSSC; fCdelete++;}
00072 if (fT1d_DSSC != 0){delete [] fT1d_DSSC; fCdelete++;}
00073 if (fT2d_DeeSCCons != 0){delete [] fT2d_DeeSCCons; fCdelete++;}
00074 if (fT1d_DeeSCCons != 0){delete [] fT1d_DeeSCCons; fCdelete++;}
00075 if (fT2d_RecovDeeSC != 0){delete [] fT2d_RecovDeeSC; fCdelete++;}
00076 if (fT1d_RecovDeeSC != 0){delete [] fT1d_RecovDeeSC; fCdelete++;}
00077
00078
00079
00080 }
00081
00082 void TEcnaNumbering::Init()
00083 {
00084
00085
00086
00087 fTTBELL = '\007';
00088 fgMaxCar = 512;
00089
00090
00091 fT2dSMCrys = 0;
00092 fT1dSMCrys = 0;
00093 fT1dSMTow = 0;
00094 fT1dTowEcha = 0;
00095
00096 fCodeChNumberingLvrbBot = "bottom";
00097 fCodeChNumberingLvrbTop = "top";
00098
00099
00100 fT3dDeeCrys = 0;
00101 fT2dDeeCrys = 0;
00102 fT1dDeeCrys = 0;
00103 fT2dDeeSC = 0;
00104 fT1dDeeSC = 0;
00105 fT2dSCEcha = 0;
00106 fT1dSCEcha = 0;
00107 fT2d_jch_JY = 0;
00108 fT1d_jch_JY = 0;
00109 fT2d_ich_IX = 0;
00110 fT1d_ich_IX = 0;
00111 fT2d_DS = 0;
00112 fT1d_DS = 0;
00113 fT2d_DSSC = 0;
00114 fT1d_DSSC = 0;
00115 fT2d_DeeSCCons = 0;
00116 fT1d_DeeSCCons = 0;
00117 fT2d_RecovDeeSC = 0;
00118 fT1d_RecovDeeSC = 0;
00119
00120 fCodeChNumberingITP1Bot = "bottom";
00121 fCodeChNumberingITP2Top = "top";
00122
00123
00124 fEcal = 0;
00125 }
00126
00127
00128 void TEcnaNumbering::SetEcalSubDetector(const TString SubDet, const TEcnaParEcal* pEcal){
00129
00130
00131 fEcal = 0;
00132 if( pEcal == 0 )
00133 {fEcal = new TEcnaParEcal(SubDet.Data()); ;}
00134 else
00135 {fEcal = (TEcnaParEcal*)pEcal;}
00136
00137 Int_t MaxCar = fgMaxCar;
00138 fFlagSubDet.Resize(MaxCar);
00139 fFlagSubDet = fEcal->GetEcalSubDetector();
00140
00141 if( fFlagSubDet == "EB" ){BuildBarrelCrysTable();}
00142 if( fFlagSubDet == "EE" ){BuildEndcapCrysTable(); BuildEndcapSCTable();}
00143 }
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 void TEcnaNumbering::BuildBarrelCrysTable()
00157 {
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 if ( fT2dSMCrys == 0 )
00178 {
00179 Int_t MaxSMTow = fEcal->MaxTowInSM();
00180 Int_t MaxTowEcha = fEcal->MaxCrysInTow();
00181 Int_t MaxSMCrys = fEcal->MaxCrysInSM();
00182
00183
00184
00185 fT2dSMCrys = new Int_t*[MaxSMTow]; fCnew++;
00186 fT1dSMCrys = new Int_t[MaxSMTow*MaxTowEcha]; fCnew++;
00187 for(Int_t i_SMTow = 0 ; i_SMTow < MaxSMTow ; i_SMTow++){
00188 fT2dSMCrys[i_SMTow] = &fT1dSMCrys[0] + i_SMTow*MaxTowEcha;}
00189 for(Int_t i=0; i<MaxSMTow; i++)
00190 {for(Int_t j=0; j<MaxTowEcha; j++){fT2dSMCrys[i][j]=0;}}
00191
00192 fT1dSMTow = new Int_t[MaxSMCrys]; fCnew++;
00193 for(Int_t i=0; i<MaxSMCrys; i++){fT1dSMTow[i]=0;}
00194
00195 fT1dTowEcha = new Int_t[MaxSMCrys]; fCnew++;
00196 for(Int_t i=0; i<MaxSMCrys; i++){fT1dTowEcha[i]=0;}
00197
00198
00199 Int_t m2 = (Int_t)2;
00200 Int_t m26 = (Int_t)26;
00201
00202
00203 Int_t** jch_type = new Int_t*[m2]; fCnew++;
00204 Int_t* jch_type_d1 = new Int_t[m2*m26]; fCnew++;
00205 for(Int_t i_m2 = 0 ; i_m2 < m2 ; i_m2++){
00206 jch_type[i_m2] = &jch_type_d1[0] + i_m2*m26;}
00207
00208 for(Int_t k=25;k>=21;k--){jch_type[0][k] = 25-k;}
00209 for(Int_t k=16;k<=20;k++){jch_type[0][k] = k-16;}
00210 for(Int_t k=15;k>=11;k--){jch_type[0][k] = 15-k;}
00211 for(Int_t k=6; k<=10;k++){jch_type[0][k] = k-6;}
00212 for(Int_t k=5; k>=1; k--){jch_type[0][k] = 5-k;}
00213
00214 for(Int_t k=1; k<=5; k++){jch_type[1][k] = k-1;}
00215 for(Int_t k=10;k>=6; k--){jch_type[1][k] = 10-k;}
00216 for(Int_t k=11;k<=15;k++){jch_type[1][k] = k-11;}
00217 for(Int_t k=20;k>=16;k--){jch_type[1][k] = 20-k;}
00218 for(Int_t k=21;k<=25;k++){jch_type[1][k] = k-21;}
00219
00220
00221 Int_t** ich_type = new Int_t*[m2]; fCnew++;
00222 Int_t* ich_type_d1 = new Int_t[m2*m26]; fCnew++;
00223 for(Int_t i_m2 = 0 ; i_m2 < m2 ; i_m2++){
00224 ich_type[i_m2] = &ich_type_d1[0] + i_m2*m26;}
00225
00226 for(Int_t k=25;k>=21;k--){ich_type[0][k] = 0;}
00227 for(Int_t k=16;k<=20;k++){ich_type[0][k] = 1;}
00228 for(Int_t k=15;k>=11;k--){ich_type[0][k] = 2;}
00229 for(Int_t k=6; k<=10;k++){ich_type[0][k] = 3;}
00230 for(Int_t k=5; k>=1; k--){ich_type[0][k] = 4;}
00231
00232 for(Int_t k=1; k<=5; k++){ich_type[1][k] = 0;}
00233 for(Int_t k=10;k>=6; k--){ich_type[1][k] = 1;}
00234 for(Int_t k=11;k<=15;k++){ich_type[1][k] = 2;}
00235 for(Int_t k=20;k>=16;k--){ich_type[1][k] = 3;}
00236 for(Int_t k=21;k<=25;k++){ich_type[1][k] = 4;}
00237
00238
00239 Int_t m17 =17;
00240 Int_t* type = new Int_t[m17]; fCnew++;
00241
00242
00243 type[0] = 0;
00244 type[1] = 0;
00245 type[2] = 0;
00246 type[3] = 1;
00247 type[4] = 1;
00248
00249 type[5] = 0;
00250 type[6] = 0;
00251 type[7] = 1;
00252 type[8] = 1;
00253
00254 type[9] = 0;
00255 type[10] = 0;
00256 type[11] = 1;
00257 type[12] = 1;
00258
00259 type[13] = 0;
00260 type[14] = 0;
00261 type[15] = 1;
00262 type[16] = 1;
00263
00264 for(Int_t tow=0; tow<MaxSMTow; tow++)
00265 {
00266 for(Int_t ic=1; ic<=MaxTowEcha; ic++)
00267 {
00268 Int_t jtow = tow % 4;
00269 Int_t itow = tow / 4;
00270
00271 Int_t icrys = itow*5 + ich_type[type[itow]][ic];
00272
00273
00274
00275 Int_t jcrys = jtow*5 + jch_type[type[itow]][ic];
00276
00277
00278
00279 Int_t n1SMCrys = icrys*20+jcrys+1;
00280
00281 fT2dSMCrys[tow][ic-1] = n1SMCrys;
00282 fT1dSMTow[n1SMCrys-1] = tow+1;
00283 fT1dTowEcha[n1SMCrys-1] = ic-1;
00284 }
00285 }
00286
00287
00288 delete [] jch_type; fCdelete++;
00289 delete [] jch_type_d1; fCdelete++;
00290 delete [] ich_type; fCdelete++;
00291 delete [] ich_type_d1; fCdelete++;
00292 delete [] type; fCdelete++;
00293 }
00294 else
00295 {
00296
00297 }
00298 }
00299
00300
00301
00302
00303
00304
00305
00306 Int_t TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(const Int_t& n1SMTow,
00307 const Int_t& i0TowEcha)
00308 {
00309
00310
00311
00312 Int_t n1SMCrys = 0;
00313
00314 if( fT2dSMCrys == 0 ){BuildBarrelCrysTable();}
00315
00316 if (n1SMTow >= 1 && n1SMTow <= fEcal->MaxTowInSM())
00317 {
00318 if (i0TowEcha >=0 && i0TowEcha < fEcal->MaxCrysInTow())
00319 {
00320 n1SMCrys = fT2dSMCrys[n1SMTow-1][i0TowEcha];
00321 }
00322 else
00323 {
00324 n1SMCrys = -2;
00325 cout << "!TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(...)> Electronic Channel in Tower out of range."
00326 << " i0TowEcha = " << i0TowEcha << fTTBELL << endl;
00327 }
00328 }
00329 else
00330 {
00331 n1SMCrys = -3;
00332 cout << "!TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(...)> Tower number in SM out of range."
00333 << " n1SMTow = " << n1SMTow << fTTBELL << endl;
00334 }
00335
00336 return n1SMCrys;
00337 }
00338
00339
00340
00341
00342
00343
00344
00345 Int_t TEcnaNumbering::Get0TowEchaFrom1SMCrys(const Int_t& n1SMCrys)
00346 {
00347
00348
00349 Int_t i0TowEcha = -1;
00350
00351 if( n1SMCrys >= 1 && n1SMCrys <= fEcal->MaxCrysInSM() )
00352 {
00353 i0TowEcha = fT1dTowEcha[n1SMCrys-1];
00354 }
00355 else
00356 {
00357 i0TowEcha = -2;
00358 cout << "!TEcnaNumbering::Get0TowEchaFrom1SMCrys(...)> Crystal number in SM out of range."
00359 << " n1SMCrys = " << n1SMCrys << fTTBELL << endl;
00360 }
00361 return i0TowEcha;
00362 }
00363
00364 Int_t TEcnaNumbering::Get1SMTowFrom1SMCrys(const Int_t& n1SMCrys)
00365 {
00366
00367
00368 Int_t n1SMtox = 0;
00369
00370 if( n1SMCrys >= 1 && n1SMCrys <= fEcal->MaxCrysInSM() )
00371 {
00372 n1SMtox = fT1dSMTow[n1SMCrys-1];
00373 }
00374 else
00375 {
00376 n1SMtox = -1;
00377 cout << "!TEcnaNumbering::Get1SMTowFrom1SMCrys(...)> Crystal number in SM out of range."
00378 << " n1SMCrys = " << n1SMCrys << fTTBELL << endl;
00379 }
00380 return n1SMtox;
00381 }
00382
00383
00384
00385
00386
00387
00388
00389
00390 Int_t TEcnaNumbering::Get0TowEchaFrom0SMEcha(const Int_t& i0SMEcha)
00391 {
00392
00393
00394 Int_t n1SMTow = i0SMEcha/fEcal->MaxCrysInTow()+1;
00395 Int_t i0TowEcha = i0SMEcha - fEcal->MaxCrysInTow()*(n1SMTow-1);
00396
00397 return i0TowEcha;
00398 }
00399
00400 Int_t TEcnaNumbering::Get1SMTowFrom0SMEcha(const Int_t& i0SMEcha)
00401 {
00402
00403
00404 Int_t n1SMTow = i0SMEcha/fEcal->MaxCrysInTow()+1;
00405
00406 return n1SMTow;
00407 }
00408
00409 Int_t TEcnaNumbering::Get0SMEchaFrom1SMTowAnd0TowEcha(const Int_t& n1SMTow, const Int_t& i0TowEcha)
00410 {
00411
00412
00413 Int_t i0SMEcha = (n1SMTow-1)*fEcal->MaxCrysInTow()+i0TowEcha;
00414
00415 return i0SMEcha;
00416 }
00417
00418
00419
00420
00421
00422 Int_t TEcnaNumbering::GetHashedNumberFromIEtaAndIPhi(const Int_t& IEta, const Int_t& IPhi)
00423 {
00424 Int_t Hashed = 0;
00425
00426 if( IEta > 0 ){Hashed = (85 + IEta - 1)*360 + IPhi - 1;}
00427 if( IEta < 0 ){Hashed = (85 + IEta)*360 + IPhi - 1;}
00428
00429 return Hashed;
00430 }
00431
00432 Int_t TEcnaNumbering::GetIEtaFromHashed(const Int_t& Hashed, const Int_t& SMNumber)
00433 {
00434 Int_t IEta = 0;
00435
00436 if( GetSMHalfBarrel(SMNumber) == "EB+" ){IEta = Hashed/360 - 85 + 1;}
00437 if( GetSMHalfBarrel(SMNumber) == "EB-" ){IEta = 85 + Hashed/360;}
00438
00439 return IEta;
00440 }
00441
00442 Int_t TEcnaNumbering::GetIPhiFromHashed(const Int_t& Hashed)
00443 {
00444 Int_t IPhi = Hashed%360 + 1;
00445
00446 return IPhi;
00447 }
00448
00449
00450
00451
00452
00453 TString TEcnaNumbering::GetStinLvrbType(const Int_t& n1SMTow)
00454 {
00455 TString lvrb_type = GetTowerLvrbType(n1SMTow);
00456 return lvrb_type;
00457 }
00458 TString TEcnaNumbering::GetTowerLvrbType(const Int_t& n1SMTow)
00459 {
00460
00461
00462 TString type = fCodeChNumberingLvrbTop;
00463
00464 if (n1SMTow >= 1 && n1SMTow <= 12){type = fCodeChNumberingLvrbBot;}
00465 if (n1SMTow >= 21 && n1SMTow <= 28){type = fCodeChNumberingLvrbBot;}
00466 if (n1SMTow >= 37 && n1SMTow <= 44){type = fCodeChNumberingLvrbBot;}
00467 if (n1SMTow >= 53 && n1SMTow <= 60){type = fCodeChNumberingLvrbBot;}
00468
00469 return type;
00470 }
00471
00472
00473
00474
00475
00476
00477 Double_t TEcnaNumbering::GetEta(const Int_t& n1EBSM, const Int_t& n1SMTow,
00478 const Int_t& i0TowEcha)
00479 {
00480
00481
00482 Double_t eta = (Double_t)0.;
00483
00484 Int_t max_crys_eta_in_tower = fEcal->MaxCrysEtaInTow();
00485 Int_t max_tow_eta_in_sm = fEcal->MaxTowEtaInSM();
00486 Int_t max_sm_in_barrel = fEcal->MaxSMInEB();
00487
00488 if ( n1EBSM >= 1 && n1EBSM <= max_sm_in_barrel )
00489 {
00490 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++)
00491 {
00492 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta*(max_crys_eta_in_tower-1));
00493 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta+1)*(max_crys_eta_in_tower-1));
00494 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta*max_crys_eta_in_tower);
00495
00496 Double_t d_echa_eta = (Double_t)(i0TowEcha/max_crys_eta_in_tower);
00497
00498 if ( n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max )
00499 {
00500 if (GetTowerLvrbType(n1SMTow) == fCodeChNumberingLvrbTop)
00501 {eta = (Double_t)(i_crys_eta) + d_echa_eta + 1;}
00502 if (GetTowerLvrbType(n1SMTow) == fCodeChNumberingLvrbBot)
00503 {eta = (Double_t)(i_crys_eta+max_crys_eta_in_tower)-d_echa_eta;}
00504 }
00505 }
00506 if ( GetSMHalfBarrel(n1EBSM) == "EB-" ){eta = - eta;}
00507 }
00508 else
00509 {
00510 cout << "TEcnaNumbering::GetEta(...)> SM = " << n1EBSM
00511 << ". Out of range (range = [1," << fEcal->MaxSMInEB() << "])"
00512 << fTTBELL << endl;
00513 }
00514 return eta;
00515 }
00516
00517 Double_t TEcnaNumbering::GetEtaMin(const Int_t& n1EBSM, const Int_t& n1SMTow)
00518 {
00519
00520
00521 Int_t max_tow_eta_in_sm = fEcal->MaxTowEtaInSM();
00522 Int_t max_crys_eta_in_tower = fEcal->MaxCrysEtaInTow();
00523
00524 Double_t eta_min = (Double_t)0.;
00525
00526 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++)
00527 {
00528 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta*(max_crys_eta_in_tower-1));
00529 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta+1)*(max_crys_eta_in_tower-1));
00530 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta*max_crys_eta_in_tower);
00531
00532 if ( n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max )
00533 {
00534 if (GetSMHalfBarrel(n1EBSM) == "EB+")
00535 {eta_min = (Double_t)i_crys_eta;}
00536 if (GetSMHalfBarrel(n1EBSM) == "EB-")
00537 {eta_min = -(Double_t)(i_crys_eta + max_crys_eta_in_tower);}
00538 }
00539 }
00540 return eta_min;
00541 }
00542
00543 Double_t TEcnaNumbering::GetEtaMax(const Int_t& n1EBSM, const Int_t& n1SMTow)
00544 {
00545
00546
00547 Int_t max_tow_eta_in_sm = fEcal->MaxTowEtaInSM();
00548 Int_t max_crys_eta_in_tower = fEcal->MaxCrysEtaInTow();
00549
00550 Double_t eta_max = (max_crys_eta_in_tower-1);
00551
00552 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++)
00553 {
00554 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta*(max_crys_eta_in_tower-1));
00555 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta+1)*(max_crys_eta_in_tower-1));
00556 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta*max_crys_eta_in_tower);
00557
00558 if ( n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max )
00559 {
00560 if (GetSMHalfBarrel(n1EBSM) == "EB+")
00561 {eta_max = (Double_t)(i_crys_eta + max_crys_eta_in_tower);}
00562 if (GetSMHalfBarrel(n1EBSM) == "EB-")
00563 {eta_max = -(Double_t)i_crys_eta;}
00564 }
00565 }
00566
00567 return eta_max;
00568 }
00569
00570 Double_t TEcnaNumbering::GetIEtaMin(const Int_t& n1EBSM, const Int_t& n1SMTow)
00571 {
00572
00573
00574 Double_t i_eta_min = (Int_t)0.;
00575
00576 if(GetSMHalfBarrel(n1EBSM) == "EB+")
00577 {i_eta_min = (Double_t)GetEtaMin(n1EBSM, n1SMTow)+(Double_t)0.5;}
00578 if(GetSMHalfBarrel(n1EBSM) == "EB-")
00579 {i_eta_min = (Double_t)GetEtaMin(n1EBSM, n1SMTow)-(Double_t)0.5;}
00580
00581 return i_eta_min;
00582 }
00583
00584 Double_t TEcnaNumbering::GetIEtaMax(const Int_t& n1EBSM, const Int_t& n1SMTow)
00585 {
00586
00587
00588 Double_t i_eta_max = (Int_t)0.;
00589
00590 if(GetSMHalfBarrel(n1EBSM) == "EB+")
00591 {i_eta_max = (Double_t)GetEtaMax(n1EBSM, n1SMTow)+(Double_t)0.5;}
00592 if(GetSMHalfBarrel(n1EBSM) == "EB-")
00593 {i_eta_max = (Double_t)GetEtaMax(n1EBSM, n1SMTow)-(Double_t)0.5;}
00594
00595 return i_eta_max;
00596 }
00597
00598 Double_t TEcnaNumbering::GetIEtaMin(const Int_t& n1EBSM)
00599 {
00600
00601
00602 Double_t i_eta_min = (Int_t)0.;
00603
00604 Int_t n1SMTowPlus = (Int_t)1;
00605 Int_t n1SMTowMinus = (Int_t)fEcal->MaxTowInSM();
00606
00607 if( GetSMHalfBarrel(n1EBSM) == "EB+" )
00608 {i_eta_min = (Double_t)GetIEtaMin(n1EBSM, n1SMTowPlus );}
00609 if( GetSMHalfBarrel(n1EBSM) == "EB-" )
00610 {i_eta_min = (Double_t)GetIEtaMin(n1EBSM, n1SMTowMinus);}
00611
00612 return i_eta_min;
00613 }
00614
00615 Double_t TEcnaNumbering::GetIEtaMax(const Int_t& n1EBSM)
00616 {
00617
00618
00619 Double_t i_eta_max = (Int_t)0.;
00620
00621 Int_t n1SMTowPlus = (Int_t)fEcal->MaxTowInSM();
00622 Int_t n1SMTowMinus = (Int_t)1;
00623
00624 if( GetSMHalfBarrel(n1EBSM) == "EB+")
00625 {i_eta_max = (Double_t)GetIEtaMax(n1EBSM, n1SMTowPlus );}
00626 if( GetSMHalfBarrel(n1EBSM) == "EB-")
00627 {i_eta_max = (Double_t)GetIEtaMax(n1EBSM, n1SMTowMinus);}
00628
00629 return i_eta_max;
00630 }
00631
00632
00633
00634
00635
00636
00637
00638 Double_t TEcnaNumbering::GetSMCentralPhi(const Int_t& n1EBSM)
00639 {
00640
00641
00642 Double_t central_phi = (Double_t)10.;
00643
00644 if (GetSMHalfBarrel(n1EBSM) == "EB+"){central_phi = 10. + (Double_t)20.*(n1EBSM-1);}
00645 if (GetSMHalfBarrel(n1EBSM) == "EB-"){central_phi = 10. + (Double_t)20.*(n1EBSM-19);}
00646
00647 return central_phi;
00648 }
00649
00650 Double_t TEcnaNumbering::GetPhiInSM(const Int_t& n1EBSM,
00651 const Int_t& n1SMTow, const Int_t& i0TowEcha)
00652 {
00653
00654
00655 Double_t phi_in_SM = (Double_t)0.;
00656
00657 Int_t rest_temp =(Int_t)(n1SMTow%(fEcal->MaxCrysPhiInTow()-1));
00658
00659 if ( n1EBSM >= 1 && n1EBSM <= fEcal->MaxSMInEB() )
00660 {
00661 if( rest_temp == 1 ){phi_in_SM = (Double_t)15.;}
00662 if( rest_temp == 2 ){phi_in_SM = (Double_t)10.;}
00663 if( rest_temp == 3 ){phi_in_SM = (Double_t)5.;}
00664 if( rest_temp == 0 ){phi_in_SM = (Double_t)0.;}
00665
00666 if (GetTowerLvrbType(n1SMTow) == fCodeChNumberingLvrbTop)
00667 {
00668 if( i0TowEcha == 4 || i0TowEcha == 5 || i0TowEcha == 14 || i0TowEcha == 15 || i0TowEcha == 24 )
00669 {phi_in_SM = phi_in_SM + 0;}
00670
00671 if( i0TowEcha == 3 || i0TowEcha == 6 || i0TowEcha == 13 || i0TowEcha == 16 || i0TowEcha == 23 )
00672 {phi_in_SM = phi_in_SM + 1;}
00673
00674 if( i0TowEcha == 2 || i0TowEcha == 7 || i0TowEcha == 12 || i0TowEcha == 17 || i0TowEcha == 22 )
00675 {phi_in_SM = phi_in_SM + 2;}
00676
00677 if( i0TowEcha == 1 || i0TowEcha == 8 || i0TowEcha == 11 || i0TowEcha == 18 || i0TowEcha == 21 )
00678 {phi_in_SM = phi_in_SM + 3;}
00679
00680 if( i0TowEcha == 0 || i0TowEcha == 9 || i0TowEcha == 10 || i0TowEcha == 19 || i0TowEcha == 20 )
00681 {phi_in_SM = phi_in_SM + 4;}
00682 }
00683 if (GetTowerLvrbType(n1SMTow) == fCodeChNumberingLvrbBot)
00684 {
00685 if( i0TowEcha == 20 || i0TowEcha == 19 || i0TowEcha == 10 || i0TowEcha == 9 || i0TowEcha == 0 )
00686 {phi_in_SM = phi_in_SM + 0;}
00687
00688 if( i0TowEcha == 21 || i0TowEcha == 18 || i0TowEcha == 11 || i0TowEcha == 8 || i0TowEcha == 1 )
00689 {phi_in_SM = phi_in_SM + 1;}
00690
00691 if( i0TowEcha == 22 || i0TowEcha == 17 || i0TowEcha == 12 || i0TowEcha == 7 || i0TowEcha == 2 )
00692 {phi_in_SM = phi_in_SM + 2;}
00693
00694 if( i0TowEcha == 23 || i0TowEcha == 16 || i0TowEcha == 13 || i0TowEcha == 6 || i0TowEcha == 3 )
00695 {phi_in_SM = phi_in_SM + 3;}
00696
00697 if( i0TowEcha == 24 || i0TowEcha == 15 || i0TowEcha == 14 || i0TowEcha == 5 || i0TowEcha == 4 )
00698 {phi_in_SM = phi_in_SM + 4;}
00699 }
00700 }
00701 else
00702 {
00703 cout << "TEcnaNumbering::GetPhiInSM(...)> SM = " << n1EBSM
00704 << ". Out of range (range = [1," << fEcal->MaxSMInEB() << "])"
00705 << fTTBELL << endl;
00706 }
00707 phi_in_SM = 20 - phi_in_SM;
00708 return phi_in_SM;
00709 }
00710
00711 Double_t TEcnaNumbering::GetPhi(const Int_t& n1EBSM,
00712 const Int_t& n1SMTow, const Int_t& i0TowEcha)
00713 {
00714
00715
00716 Double_t phi = (Double_t)0.;
00717
00718 if ( n1EBSM >= 1 && n1EBSM <= fEcal->MaxSMInEB() )
00719 {
00720 Double_t phiInSM = GetPhiInSM(n1EBSM, n1SMTow, i0TowEcha);
00721 Double_t phi_start = GetSMCentralPhi(n1EBSM);
00722
00723 phi = 20 - phiInSM + phi_start -(Double_t)10.;
00724 }
00725 else
00726 {
00727 cout << "TEcnaNumbering::GetPhi(...)> SM = " << n1EBSM
00728 << ". Out of range (range = [1," << fEcal->MaxSMInEB() << "])"
00729 << fTTBELL << endl;
00730 }
00731 return phi;
00732 }
00733
00734
00735 Double_t TEcnaNumbering::GetPhiMin(const Int_t& n1EBSM, const Int_t& n1SMTow)
00736 {
00737
00738
00739 Int_t max_crys_phi_in_tower = fEcal->MaxCrysPhiInTow();
00740
00741 Double_t phi_min = (Double_t)0.;
00742 Double_t phi_start = GetSMCentralPhi(n1EBSM);
00743
00744 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
00745
00746 if(GetSMHalfBarrel(n1EBSM) == "EB+")
00747 {
00748 if ( rest_temp == 1 ) {phi_min = phi_start + (Double_t)5.;}
00749 if ( rest_temp == 2 ) {phi_min = phi_start + (Double_t)0.;}
00750 if ( rest_temp == 3 ) {phi_min = phi_start - (Double_t)5.;}
00751 if ( rest_temp == 0 ) {phi_min = phi_start - (Double_t)10.;}
00752 }
00753 if(GetSMHalfBarrel(n1EBSM) == "EB-")
00754 {
00755 if ( rest_temp == 0 ) {phi_min = phi_start + (Double_t)5.;}
00756 if ( rest_temp == 3 ) {phi_min = phi_start + (Double_t)0.;}
00757 if ( rest_temp == 2 ) {phi_min = phi_start - (Double_t)5.;}
00758 if ( rest_temp == 1 ) {phi_min = phi_start - (Double_t)10.;}
00759 }
00760 return phi_min;
00761 }
00762
00763 Double_t TEcnaNumbering::GetPhiMax(const Int_t& n1EBSM, const Int_t& n1SMTow)
00764 {
00765
00766
00767 Int_t max_crys_phi_in_tower = fEcal->MaxCrysPhiInTow();
00768
00769 Double_t phi_max = (Double_t)20.;
00770 Double_t phi_start = GetSMCentralPhi(n1EBSM);
00771
00772 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
00773
00774 if(GetSMHalfBarrel(n1EBSM) == "EB+")
00775 {
00776 if ( rest_temp == 1 ) {phi_max = phi_start + (Double_t)10.;}
00777 if ( rest_temp == 2 ) {phi_max = phi_start + (Double_t)5.;}
00778 if ( rest_temp == 3 ) {phi_max = phi_start - (Double_t)0.;}
00779 if ( rest_temp == 0 ) {phi_max = phi_start - (Double_t)5.;}
00780 }
00781
00782 if(GetSMHalfBarrel(n1EBSM) == "EB-")
00783 {
00784 if ( rest_temp == 0 ) {phi_max = phi_start + (Double_t)10.;}
00785 if ( rest_temp == 3 ) {phi_max = phi_start + (Double_t)5.;}
00786 if ( rest_temp == 2 ) {phi_max = phi_start - (Double_t)0.;}
00787 if ( rest_temp == 1 ) {phi_max = phi_start - (Double_t)5.;}
00788 }
00789
00790 return phi_max;
00791 }
00792
00793 Double_t TEcnaNumbering::GetPhiMin(const Int_t& n1EBSM)
00794 {
00795
00796
00797 Double_t phi_min = GetSMCentralPhi(n1EBSM) - (Double_t)10.;
00798
00799 return phi_min;
00800 }
00801
00802 Double_t TEcnaNumbering::GetPhiMax(const Int_t& n1EBSM)
00803 {
00804
00805
00806 Double_t phi_max = GetSMCentralPhi(n1EBSM) + (Double_t)10.;
00807
00808 return phi_max;
00809 }
00810
00811 Double_t TEcnaNumbering::GetJPhiMin(const Int_t& n1EBSM, const Int_t& n1SMTow)
00812 {
00813
00814
00815 Double_t j_phi_min = (Double_t)1.;
00816 Int_t max_crys_phi_in_tower = fEcal->MaxCrysPhiInTow();
00817 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
00818
00819 if ( rest_temp == 1 ){j_phi_min = (Double_t) 1. - (Double_t)0.5;}
00820 if ( rest_temp == 2 ){j_phi_min = (Double_t) 6. - (Double_t)0.5;}
00821 if ( rest_temp == 3 ){j_phi_min = (Double_t)11. - (Double_t)0.5;}
00822 if ( rest_temp == 0 ){j_phi_min = (Double_t)16. - (Double_t)0.5;}
00823
00824 return j_phi_min;
00825 }
00826
00827 Double_t TEcnaNumbering::GetJPhiMax(const Int_t& n1EBSM, const Int_t& n1SMTow)
00828 {
00829
00830
00831 Double_t j_phi_max = (Double_t)20.;
00832 Int_t max_crys_phi_in_tower = fEcal->MaxCrysPhiInTow();
00833 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
00834
00835 if ( rest_temp == 1 ){j_phi_max = (Double_t) 5. + (Double_t)0.5;}
00836 if ( rest_temp == 2 ){j_phi_max = (Double_t)10. + (Double_t)0.5;}
00837 if ( rest_temp == 3 ){j_phi_max = (Double_t)15. + (Double_t)0.5;}
00838 if ( rest_temp == 0 ){j_phi_max = (Double_t)20. + (Double_t)0.5;}
00839
00840 return j_phi_max;
00841 }
00842
00843
00844 Double_t TEcnaNumbering::GetJPhiMin(const Int_t& n1EBSM)
00845 {
00846
00847
00848 Double_t j_phi_min = (Double_t)1. - (Double_t)0.5;
00849
00850 return j_phi_min;
00851 }
00852
00853 Double_t TEcnaNumbering::GetJPhiMax(const Int_t& n1EBSM)
00854 {
00855
00856
00857 Double_t j_phi_max = (Double_t)20. + (Double_t)0.5;
00858
00859 return j_phi_max;
00860 }
00861
00862
00863
00864
00865
00866
00867
00868
00869 TString TEcnaNumbering::GetXDirectionEB(const Int_t& SMNumber)
00870 {
00871 TString xdirection = "x";
00872
00873 if( GetSMHalfBarrel(SMNumber) == "EB+" ){xdirection = "x";}
00874 if( GetSMHalfBarrel(SMNumber) == "EB-" ){xdirection = "x";}
00875
00876 return xdirection;
00877 }
00878
00879 TString TEcnaNumbering::GetYDirectionEB(const Int_t& SMNumber)
00880 {
00881 TString ydirection = "-x";
00882
00883 if( GetSMHalfBarrel(SMNumber) == "EB+" ){ydirection = "-x";}
00884 if( GetSMHalfBarrel(SMNumber) == "EB-" ){ydirection = "-x";}
00885
00886 return ydirection;
00887 }
00888
00889
00890 TString TEcnaNumbering::GetJYDirectionEB(const Int_t& SMNumber)
00891 {
00892 TString jydirection = "-x";
00893
00894 if( GetSMHalfBarrel(SMNumber) == "EB+" ){jydirection = "x";}
00895 if( GetSMHalfBarrel(SMNumber) == "EB-" ){jydirection = "-x";}
00896
00897 return jydirection;
00898 }
00899
00900
00901 TString TEcnaNumbering::GetSMHalfBarrel(const Int_t& SMNumber)
00902 {
00903
00904
00905 TString type = "EB-";
00906
00907 if ( SMNumber >= 1 && SMNumber <= fEcal->MaxSMInEBPlus() ){type = "EB+";}
00908 if ( SMNumber > fEcal->MaxSMInEBPlus() && SMNumber <= fEcal->MaxSMInEB() ){type = "EB-";}
00909
00910 return type;
00911 }
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925 void TEcnaNumbering::BuildEndcapCrysTable()
00926 {
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946 if ( fT3dDeeCrys == 0 )
00947 {
00948 Int_t MaxDeeSC = fEcal->MaxSCEcnaInDee();
00949 Int_t MaxSCEcha = fEcal->MaxCrysInSC();
00950 Int_t MaxDeeCrys = fEcal->MaxCrysEcnaInDee();
00951
00952 Int_t MaxDirections = 2;
00953
00954
00955 fT3dDeeCrys = new Int_t**[MaxDeeSC]; fCnew++;
00956 fT2dDeeCrys = new Int_t*[MaxDeeSC*MaxSCEcha]; fCnew++;
00957 fT1dDeeCrys = new Int_t[MaxDeeSC*MaxSCEcha*MaxDirections]; fCnew++;
00958
00959 for(Int_t i_DeeSC = 0; i_DeeSC < MaxDeeSC; i_DeeSC++){
00960 fT3dDeeCrys[i_DeeSC] = &fT2dDeeCrys[0] + i_DeeSC*MaxSCEcha;
00961 for(Int_t i_SCEcha = 0; i_SCEcha < MaxSCEcha; i_SCEcha++){
00962 fT2dDeeCrys[i_DeeSC*MaxSCEcha + i_SCEcha] = &fT1dDeeCrys[0]
00963 + (i_DeeSC*MaxSCEcha + i_SCEcha)*MaxDirections;}}
00964 for(Int_t i=0; i<MaxDeeSC; i++)
00965 {for(Int_t j=0; j<MaxSCEcha; j++)
00966 {for(Int_t k=0; k<MaxDirections; k++){fT3dDeeCrys[i][j][k]=0;}}}
00967
00968 fT2dDeeSC = new Int_t*[MaxDeeCrys]; fCnew++;
00969 fT1dDeeSC = new Int_t[MaxDeeCrys*MaxDirections]; fCnew++;
00970 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxDeeCrys ; i_DeeCrys++){
00971 fT2dDeeSC[i_DeeCrys] = &fT1dDeeSC[0] + i_DeeCrys*MaxDirections;}
00972 for(Int_t i=0; i<MaxDeeCrys; i++)
00973 {for(Int_t j=0; j<MaxDirections; j++){fT2dDeeSC[i][j]=0;}}
00974
00975 fT2dSCEcha = new Int_t*[MaxDeeCrys]; fCnew++;
00976 fT1dSCEcha = new Int_t[MaxDeeCrys*MaxDirections]; fCnew++;
00977 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxDeeCrys ; i_DeeCrys++){
00978 fT2dSCEcha[i_DeeCrys] = &fT1dSCEcha[0] + i_DeeCrys*MaxDirections;}
00979 for(Int_t i=0; i<MaxDeeCrys; i++)
00980 {for(Int_t j=0; j<MaxDirections; j++){fT2dSCEcha[i][j]=0;}}
00981
00982
00983 Int_t MaxTyp = (Int_t)4;
00984 Int_t MaxCrysP1 = (Int_t)(fEcal->MaxCrysInSC()+1);
00985
00986
00987 fT2d_jch_JY = new Int_t*[MaxTyp]; fCnew++;
00988 fT1d_jch_JY = new Int_t[MaxTyp*MaxCrysP1]; fCnew++;
00989 for(Int_t i_MaxTyp = 0 ; i_MaxTyp < MaxTyp ; i_MaxTyp++){
00990 fT2d_jch_JY[i_MaxTyp] = &fT1d_jch_JY[0] + i_MaxTyp*MaxCrysP1;}
00991
00992
00993
00994
00995 for(Int_t k= 5;k>= 1;k--){fT2d_jch_JY[0][k] = 4;}
00996 for(Int_t k=10;k>= 6;k--){fT2d_jch_JY[0][k] = 3;}
00997 for(Int_t k=15;k>=11;k--){fT2d_jch_JY[0][k] = 2;}
00998 for(Int_t k=20;k>=16;k--){fT2d_jch_JY[0][k] = 1;}
00999 for(Int_t k=25;k>=21;k--){fT2d_jch_JY[0][k] = 0;}
01000
01001 for(Int_t k= 5;k>= 1;k--){fT2d_jch_JY[1][k] = 5-k;}
01002 for(Int_t k=10;k>= 6;k--){fT2d_jch_JY[1][k] = 10-k;}
01003 for(Int_t k=15;k>=11;k--){fT2d_jch_JY[1][k] = 15-k;}
01004 for(Int_t k=20;k>=16;k--){fT2d_jch_JY[1][k] = 20-k;}
01005 for(Int_t k=25;k>=21;k--){fT2d_jch_JY[1][k] = 25-k;}
01006
01007 for(Int_t k= 1;k<=5; k++){fT2d_jch_JY[2][k] = 0;}
01008 for(Int_t k= 6;k<=10;k++){fT2d_jch_JY[2][k] = 1;}
01009 for(Int_t k=11;k<=15;k++){fT2d_jch_JY[2][k] = 2;}
01010 for(Int_t k=16;k<=20;k++){fT2d_jch_JY[2][k] = 3;}
01011 for(Int_t k=21;k<=25;k++){fT2d_jch_JY[2][k] = 4;}
01012
01013 for(Int_t k= 1;k<=5; k++){fT2d_jch_JY[3][k] = k-1;}
01014 for(Int_t k= 6;k<=10;k++){fT2d_jch_JY[3][k] = k-6;}
01015 for(Int_t k=11;k<=15;k++){fT2d_jch_JY[3][k] = k-11;}
01016 for(Int_t k=16;k<=20;k++){fT2d_jch_JY[3][k] = k-16;}
01017 for(Int_t k=21;k<=25;k++){fT2d_jch_JY[3][k] = k-21;}
01018
01019
01020 fT2d_ich_IX = new Int_t*[MaxTyp]; fCnew++;
01021 fT1d_ich_IX = new Int_t[MaxTyp*MaxCrysP1]; fCnew++;
01022 for(Int_t i_MaxTyp = 0 ; i_MaxTyp < MaxTyp ; i_MaxTyp++){
01023 fT2d_ich_IX[i_MaxTyp] = &fT1d_ich_IX[0] + i_MaxTyp*MaxCrysP1;}
01024
01025
01026 for(Int_t k= 5;k>= 1;k--){fT2d_ich_IX[0][k] = 5-k;}
01027 for(Int_t k=10;k>= 6;k--){fT2d_ich_IX[0][k] = 10-k;}
01028 for(Int_t k=15;k>=11;k--){fT2d_ich_IX[0][k] = 15-k;}
01029 for(Int_t k=20;k>=16;k--){fT2d_ich_IX[0][k] = 20-k;}
01030 for(Int_t k=25;k>=21;k--){fT2d_ich_IX[0][k] = 25-k;}
01031
01032 for(Int_t k= 5;k>= 1;k--){fT2d_ich_IX[1][k] = 4;}
01033 for(Int_t k=10;k>= 6;k--){fT2d_ich_IX[1][k] = 3;}
01034 for(Int_t k=15;k>=11;k--){fT2d_ich_IX[1][k] = 2;}
01035 for(Int_t k=20;k>=16;k--){fT2d_ich_IX[1][k] = 1;}
01036 for(Int_t k=25;k>=21;k--){fT2d_ich_IX[1][k] = 0;}
01037
01038 for(Int_t k=1; k<=5; k++){fT2d_ich_IX[2][k] = 5-k;}
01039 for(Int_t k=6; k<=10;k++){fT2d_ich_IX[2][k] = 10-k;}
01040 for(Int_t k=11;k<=15;k++){fT2d_ich_IX[2][k] = 15-k;}
01041 for(Int_t k=16;k<=20;k++){fT2d_ich_IX[2][k] = 20-k;}
01042 for(Int_t k=21;k<=25;k++){fT2d_ich_IX[2][k] = 25-k;}
01043
01044 for(Int_t k= 1;k<= 5;k++){fT2d_ich_IX[3][k] = 4;}
01045 for(Int_t k= 6;k<=10;k++){fT2d_ich_IX[3][k] = 3;}
01046 for(Int_t k=11;k<=15;k++){fT2d_ich_IX[3][k] = 2;}
01047 for(Int_t k=16;k<=20;k++){fT2d_ich_IX[3][k] = 1;}
01048 for(Int_t k=21;k<=25;k++){fT2d_ich_IX[3][k] = 0;}
01049
01050
01051 Int_t Nb_DeeSC_JY = fEcal->MaxSCIYInDee();
01052 Int_t** type = new Int_t*[Nb_DeeSC_JY]; fCnew++;
01053 Int_t* type_d1 = new Int_t[Nb_DeeSC_JY*MaxDirections]; fCnew++;
01054 for(Int_t i_DeeSC_JY = 0 ; i_DeeSC_JY < Nb_DeeSC_JY ; i_DeeSC_JY++){
01055 type[i_DeeSC_JY] = &type_d1[0] + i_DeeSC_JY*MaxDirections;}
01056
01057
01058
01059
01060
01061 type[10][0] = 0;
01062 type[11][0] = 0;
01063 type[12][0] = 0;
01064 type[13][0] = 0;
01065 type[14][0] = 0;
01066 type[15][0] = 0;
01067 type[16][0] = 0;
01068 type[17][0] = 0;
01069 type[18][0] = 0;
01070 type[19][0] = 0;
01071
01072 type[10][1] = 1;
01073 type[11][1] = 1;
01074 type[12][1] = 1;
01075 type[13][1] = 1;
01076 type[14][1] = 1;
01077 type[15][1] = 1;
01078 type[16][1] = 1;
01079 type[17][1] = 1;
01080 type[18][1] = 1;
01081 type[19][1] = 1;
01082
01083 type[ 0][1] = 2;
01084 type[ 1][1] = 2;
01085 type[ 2][1] = 2;
01086 type[ 3][1] = 2;
01087 type[ 4][1] = 2;
01088 type[ 5][1] = 2;
01089 type[ 6][1] = 2;
01090 type[ 7][1] = 2;
01091 type[ 8][1] = 2;
01092 type[ 9][1] = 2;
01093
01094 type[ 0][0] = 3;
01095 type[ 1][0] = 3;
01096 type[ 2][0] = 3;
01097 type[ 3][0] = 3;
01098 type[ 4][0] = 3;
01099 type[ 5][0] = 3;
01100 type[ 6][0] = 3;
01101 type[ 7][0] = 3;
01102 type[ 8][0] = 3;
01103 type[ 9][0] = 3;
01104
01105 Int_t Nb_SCCrys_IX = fEcal->MaxCrysIXInSC();
01106 Int_t Nb_SCCrys_JY = fEcal->MaxCrysIYInSC();
01107
01108 for(Int_t kSC=0; kSC<MaxDeeSC; kSC++)
01109 {
01110 for(Int_t n_Echa=1; n_Echa<=MaxSCEcha; n_Echa++)
01111 {
01112 for(Int_t idir=0; idir<2; idir++)
01113 {
01114 Int_t ikSC = kSC / Nb_DeeSC_JY;
01115 Int_t jkSC = kSC % Nb_DeeSC_JY;
01116
01117 Int_t icrys = ikSC*Nb_SCCrys_IX + fT2d_ich_IX[type[jkSC][idir]][n_Echa];
01118
01119
01120
01121
01122 Int_t jcrys = jkSC*Nb_SCCrys_JY + fT2d_jch_JY[type[jkSC][idir]][n_Echa];
01123
01124
01125
01126
01127 Int_t n_DeeCrys = icrys*Nb_DeeSC_JY*Nb_SCCrys_JY+jcrys+1;
01128
01129 fT3dDeeCrys[kSC][n_Echa-1][idir] = n_DeeCrys;
01130 fT2dDeeSC[n_DeeCrys-1][idir] = kSC+1;
01131 fT2dSCEcha[n_DeeCrys-1][idir] = n_Echa;
01132 }
01133 }
01134 }
01135
01136
01137 delete [] type; fCdelete++;
01138 delete [] type_d1; fCdelete++;
01139 }
01140 else
01141 {
01142
01143 }
01144 }
01145
01146 void TEcnaNumbering::BuildEndcapSCTable()
01147 {
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165 Int_t MaxEEDee = fEcal->MaxDeeInEE();
01166 Int_t MaxDeeSC = fEcal->MaxSCEcnaInDee();
01167 Int_t MaxEESCForCons = 2*fEcal->MaxSCForConsInDee();
01168
01169 fT2d_DS = new Int_t*[MaxEEDee]; fCnew++;
01170 fT1d_DS = new Int_t[MaxEEDee*MaxDeeSC]; fCnew++;
01171 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
01172 fT2d_DS[i_DeeCrys] = &fT1d_DS[0] + i_DeeCrys*MaxDeeSC;}
01173 for(Int_t i=0; i<MaxEEDee; i++)
01174 {for(Int_t j=0; j<MaxDeeSC; j++){fT2d_DS[i][j]=0;}}
01175
01176 fT2d_DSSC = new Int_t*[MaxEEDee]; fCnew++;
01177 fT1d_DSSC = new Int_t[MaxEEDee*MaxDeeSC]; fCnew++;
01178 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
01179 fT2d_DSSC[i_DeeCrys] = &fT1d_DSSC[0] + i_DeeCrys*MaxDeeSC;}
01180 for(Int_t i=0; i<MaxEEDee; i++)
01181 {for(Int_t j=0; j<MaxDeeSC; j++){fT2d_DSSC[i][j]=0;}}
01182
01183 fT2d_DeeSCCons = new Int_t*[MaxEEDee]; fCnew++;
01184 fT1d_DeeSCCons = new Int_t[MaxEEDee*MaxDeeSC]; fCnew++;
01185 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
01186 fT2d_DeeSCCons[i_DeeCrys] = &fT1d_DeeSCCons[0] + i_DeeCrys*MaxDeeSC;}
01187 for(Int_t i=0; i<MaxEEDee; i++)
01188 {for(Int_t j=0; j<MaxDeeSC; j++){fT2d_DeeSCCons[i][j]=0;}}
01189
01190 fT2d_RecovDeeSC = new Int_t*[MaxEEDee]; fCnew++;
01191 fT1d_RecovDeeSC = new Int_t[MaxEEDee*MaxEESCForCons]; fCnew++;
01192 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
01193 fT2d_RecovDeeSC[i_DeeCrys] = &fT1d_RecovDeeSC[0] + i_DeeCrys*MaxEESCForCons;}
01194 for(Int_t i=0; i<MaxEEDee; i++)
01195 {for(Int_t j=0; j<MaxEESCForCons; j++){fT2d_RecovDeeSC[i][j]=0;}}
01196
01197
01198
01199
01200 Int_t ids = 0;
01201
01202
01203 for(Int_t dee = 1; dee<=4; dee++)
01204 {
01205 if( dee == 1 || dee == 4 ){ids = 1;}
01206 if( dee == 2 || dee == 3 ){ids = 9;}
01207 for(Int_t isc= 13; isc<= 20; isc++)fT2d_DS[dee-1][isc-1] = ids;
01208 for(Int_t isc= 33; isc<= 40; isc++)fT2d_DS[dee-1][isc-1] = ids;
01209 for(Int_t isc= 54; isc<= 60; isc++)fT2d_DS[dee-1][isc-1] = ids;
01210 for(Int_t isc= 75; isc<= 79; isc++)fT2d_DS[dee-1][isc-1] = ids;
01211 for(Int_t isc= 96; isc<= 99; isc++)fT2d_DS[dee-1][isc-1] = ids;
01212 for(Int_t isc=118; isc<=119; isc++)fT2d_DS[dee-1][isc-1] = ids;
01213 }
01214
01215 for(Int_t dee = 1; dee<=4; dee++)
01216 {
01217 if( dee == 1 || dee == 4 ){ids = 2;}
01218 if( dee == 2 || dee == 3 ){ids = 8;}
01219 for(Int_t isc= 32; isc<= 32; isc++)fT2d_DS[dee-1][isc-1] = ids;
01220 for(Int_t isc= 51; isc<= 53; isc++)fT2d_DS[dee-1][isc-1] = ids;
01221 for(Int_t isc= 72; isc<= 74; isc++)fT2d_DS[dee-1][isc-1] = ids;
01222 for(Int_t isc= 92; isc<= 95; isc++)fT2d_DS[dee-1][isc-1] = ids;
01223 for(Int_t isc=112; isc<=117; isc++)fT2d_DS[dee-1][isc-1] = ids;
01224 for(Int_t isc=132; isc<=138; isc++)fT2d_DS[dee-1][isc-1] = ids;
01225 for(Int_t isc=152; isc<=157; isc++)fT2d_DS[dee-1][isc-1] = ids;
01226 for(Int_t isc=173; isc<=176; isc++)fT2d_DS[dee-1][isc-1] = ids;
01227 for(Int_t isc=193; isc<=193; isc++)fT2d_DS[dee-1][isc-1] = ids;
01228 }
01229
01230 for(Int_t dee = 1; dee<=4; dee++)
01231 {
01232 if( dee == 1 || dee == 4 ){ids = 3;}
01233 if( dee == 2 || dee == 3 ){ids = 7;}
01234 for(Int_t isc= 50; isc<= 50; isc++)fT2d_DS[dee-1][isc-1] = ids;
01235 for(Int_t isc= 69; isc<= 71; isc++)fT2d_DS[dee-1][isc-1] = ids;
01236 for(Int_t isc= 88; isc<= 91; isc++)fT2d_DS[dee-1][isc-1] = ids;
01237 for(Int_t isc=108; isc<=111; isc++)fT2d_DS[dee-1][isc-1] = ids;
01238 for(Int_t isc=127; isc<=131; isc++)fT2d_DS[dee-1][isc-1] = ids;
01239 for(Int_t isc=147; isc<=151; isc++)fT2d_DS[dee-1][isc-1] = ids;
01240 for(Int_t isc=166; isc<=172; isc++)fT2d_DS[dee-1][isc-1] = ids;
01241 for(Int_t isc=188; isc<=192; isc++)fT2d_DS[dee-1][isc-1] = ids;
01242 }
01243
01244 for(Int_t dee = 1; dee<=4; dee++)
01245 {
01246 if( dee == 1 || dee == 4 ){ids = 4;}
01247 if( dee == 2 || dee == 3 ){ids = 6;}
01248 for(Int_t isc= 27; isc<= 29; isc++)fT2d_DS[dee-1][isc-1] = ids;
01249 for(Int_t isc= 44; isc<= 49; isc++)fT2d_DS[dee-1][isc-1] = ids;
01250 for(Int_t isc= 62; isc<= 68; isc++)fT2d_DS[dee-1][isc-1] = ids;
01251 for(Int_t isc= 82; isc<= 87; isc++)fT2d_DS[dee-1][isc-1] = ids;
01252 for(Int_t isc=102; isc<=107; isc++)fT2d_DS[dee-1][isc-1] = ids;
01253 for(Int_t isc=123; isc<=126; isc++)fT2d_DS[dee-1][isc-1] = ids;
01254 for(Int_t isc=144; isc<=146; isc++)fT2d_DS[dee-1][isc-1] = ids;
01255 for(Int_t isc=165; isc<=165; isc++)fT2d_DS[dee-1][isc-1] = ids;
01256 }
01257
01258 for(Int_t dee = 1; dee<=4; dee++)
01259 {
01260 for(Int_t isc= 1; isc<= 8; isc++)fT2d_DS[dee-1][isc-1] = 5;
01261 for(Int_t isc= 21; isc<= 26; isc++)fT2d_DS[dee-1][isc-1] = 5;
01262 for(Int_t isc= 41; isc<= 43; isc++)fT2d_DS[dee-1][isc-1] = 5;
01263 }
01264
01265
01266
01267 for(Int_t dee=1; dee<=4; dee++)
01268 {
01269 for(Int_t isc=1; isc<=MaxDeeSC; isc++)
01270 {fT2d_DSSC[dee-1][isc-1] = -1;}
01271
01272 fT2d_DSSC[dee-1][13-1] = 12;
01273 fT2d_DSSC[dee-1][14-1] = 11;
01274 fT2d_DSSC[dee-1][15-1] = 10;
01275 fT2d_DSSC[dee-1][16-1] = 9;
01276 fT2d_DSSC[dee-1][17-1] = 4;
01277 fT2d_DSSC[dee-1][18-1] = 3;
01278 fT2d_DSSC[dee-1][19-1] = 2;
01279 fT2d_DSSC[dee-1][20-1] = 1;
01280
01281 fT2d_DSSC[dee-1][33-1] = 16;
01282 fT2d_DSSC[dee-1][34-1] = 15;
01283 fT2d_DSSC[dee-1][35-1] = 14;
01284 fT2d_DSSC[dee-1][36-1] = 13;
01285 fT2d_DSSC[dee-1][37-1] = 8;
01286 fT2d_DSSC[dee-1][38-1] = 7;
01287 fT2d_DSSC[dee-1][39-1] = 6;
01288 fT2d_DSSC[dee-1][40-1] = 5;
01289
01290 fT2d_DSSC[dee-1][54-1] = 33;
01291 fT2d_DSSC[dee-1][55-1] = 31;
01292 fT2d_DSSC[dee-1][56-1] = 27;
01293 fT2d_DSSC[dee-1][57-1] = 24;
01294 fT2d_DSSC[dee-1][58-1] = 20;
01295 fT2d_DSSC[dee-1][59-1] = 17;
01296 fT2d_DSSC[dee-1][60-1] = 30;
01297
01298 fT2d_DSSC[dee-1][75-1] = 32;
01299 fT2d_DSSC[dee-1][76-1] = 28;
01300 fT2d_DSSC[dee-1][77-1] = 25;
01301 fT2d_DSSC[dee-1][78-1] = 21;
01302 fT2d_DSSC[dee-1][79-1] = 18;
01303
01304 fT2d_DSSC[dee-1][96-1] = 29;
01305 fT2d_DSSC[dee-1][97-1] = 26;
01306 fT2d_DSSC[dee-1][98-1] = 22;
01307 fT2d_DSSC[dee-1][99-1] = 19;
01308
01309 fT2d_DSSC[dee-1][118-1] = 23;
01310 fT2d_DSSC[dee-1][119-1] = 30;
01311
01312
01313 fT2d_DSSC[dee-1][32-1] = 25;
01314
01315 fT2d_DSSC[dee-1][51-1] = 32;
01316 fT2d_DSSC[dee-1][52-1] = 26;
01317 fT2d_DSSC[dee-1][53-1] = 18;
01318
01319 fT2d_DSSC[dee-1][72-1] = 27;
01320 fT2d_DSSC[dee-1][73-1] = 19;
01321 fT2d_DSSC[dee-1][74-1] = 12;
01322
01323 fT2d_DSSC[dee-1][92-1] = 28;
01324 fT2d_DSSC[dee-1][93-1] = 20;
01325 fT2d_DSSC[dee-1][94-1] = 13;
01326 fT2d_DSSC[dee-1][95-1] = 7;
01327
01328 fT2d_DSSC[dee-1][112-1] = 29;
01329 fT2d_DSSC[dee-1][113-1] = 21;
01330 fT2d_DSSC[dee-1][114-1] = 14;
01331 fT2d_DSSC[dee-1][115-1] = 8;
01332 fT2d_DSSC[dee-1][116-1] = 4;
01333 fT2d_DSSC[dee-1][117-1] = 1;
01334
01335 fT2d_DSSC[dee-1][132-1] = 30;
01336 fT2d_DSSC[dee-1][133-1] = 22;
01337 fT2d_DSSC[dee-1][134-1] = 15;
01338 fT2d_DSSC[dee-1][135-1] = 9;
01339 fT2d_DSSC[dee-1][136-1] = 5;
01340 fT2d_DSSC[dee-1][137-1] = 2;
01341 fT2d_DSSC[dee-1][138-1] = 3;
01342
01343 fT2d_DSSC[dee-1][152-1] = 31;
01344 fT2d_DSSC[dee-1][153-1] = 23;
01345 fT2d_DSSC[dee-1][154-1] = 16;
01346 fT2d_DSSC[dee-1][155-1] = 10;
01347 fT2d_DSSC[dee-1][156-1] = 6;
01348 fT2d_DSSC[dee-1][157-1] = 3;
01349
01350 fT2d_DSSC[dee-1][173-1] = 24;
01351 fT2d_DSSC[dee-1][174-1] = 17;
01352 fT2d_DSSC[dee-1][175-1] = 11;
01353 fT2d_DSSC[dee-1][176-1] = 25;
01354
01355 fT2d_DSSC[dee-1][193-1] = 25;
01356
01357
01358 fT2d_DSSC[dee-1][50-1] = 10;
01359
01360 fT2d_DSSC[dee-1][69-1] = 18;
01361 fT2d_DSSC[dee-1][70-1] = 11;
01362 fT2d_DSSC[dee-1][71-1] = 3;
01363
01364 fT2d_DSSC[dee-1][88-1] = 25;
01365 fT2d_DSSC[dee-1][89-1] = 19;
01366 fT2d_DSSC[dee-1][90-1] = 12;
01367 fT2d_DSSC[dee-1][91-1] = 4;
01368
01369 fT2d_DSSC[dee-1][108-1] = 26;
01370 fT2d_DSSC[dee-1][109-1] = 20;
01371 fT2d_DSSC[dee-1][110-1] = 13;
01372 fT2d_DSSC[dee-1][111-1] = 5;
01373
01374 fT2d_DSSC[dee-1][127-1] = 31;
01375 fT2d_DSSC[dee-1][128-1] = 27;
01376 fT2d_DSSC[dee-1][129-1] = 21;
01377 fT2d_DSSC[dee-1][130-1] = 14;
01378 fT2d_DSSC[dee-1][131-1] = 6;
01379
01380 fT2d_DSSC[dee-1][147-1] = 32;
01381 fT2d_DSSC[dee-1][148-1] = 28;
01382 fT2d_DSSC[dee-1][149-1] = 22;
01383 fT2d_DSSC[dee-1][150-1] = 15;
01384 fT2d_DSSC[dee-1][151-1] = 7;
01385
01386 fT2d_DSSC[dee-1][166-1] = 33;
01387 fT2d_DSSC[dee-1][167-1] = 30;
01388 fT2d_DSSC[dee-1][168-1] = 29;
01389 fT2d_DSSC[dee-1][169-1] = 23;
01390 fT2d_DSSC[dee-1][170-1] = 16;
01391 fT2d_DSSC[dee-1][171-1] = 8;
01392 fT2d_DSSC[dee-1][172-1] = 1;
01393
01394 fT2d_DSSC[dee-1][188-1] = 34;
01395 fT2d_DSSC[dee-1][189-1] = 24;
01396 fT2d_DSSC[dee-1][190-1] = 17;
01397 fT2d_DSSC[dee-1][191-1] = 9;
01398 fT2d_DSSC[dee-1][192-1] = 2;
01399
01400
01401 fT2d_DSSC[dee-1][27-1] = 33;
01402 fT2d_DSSC[dee-1][28-1] = 32;
01403 fT2d_DSSC[dee-1][29-1] = 14;
01404
01405 fT2d_DSSC[dee-1][44-1] = 22;
01406 fT2d_DSSC[dee-1][45-1] = 15;
01407 fT2d_DSSC[dee-1][46-1] = 8;
01408 fT2d_DSSC[dee-1][47-1] = 4;
01409 fT2d_DSSC[dee-1][48-1] = 2;
01410 fT2d_DSSC[dee-1][49-1] = 1;
01411
01412 fT2d_DSSC[dee-1][62-1] = 29;
01413 fT2d_DSSC[dee-1][63-1] = 28;
01414 fT2d_DSSC[dee-1][64-1] = 23;
01415 fT2d_DSSC[dee-1][65-1] = 16;
01416 fT2d_DSSC[dee-1][66-1] = 9;
01417 fT2d_DSSC[dee-1][67-1] = 5;
01418 fT2d_DSSC[dee-1][68-1] = 3;
01419
01420 fT2d_DSSC[dee-1][82-1] = 31;
01421 fT2d_DSSC[dee-1][83-1] = 30;
01422 fT2d_DSSC[dee-1][84-1] = 24;
01423 fT2d_DSSC[dee-1][85-1] = 17;
01424 fT2d_DSSC[dee-1][86-1] = 10;
01425 fT2d_DSSC[dee-1][87-1] = 6;
01426
01427 fT2d_DSSC[dee-1][102-1] = 21;
01428 fT2d_DSSC[dee-1][103-1] = 27;
01429 fT2d_DSSC[dee-1][104-1] = 25;
01430 fT2d_DSSC[dee-1][105-1] = 18;
01431 fT2d_DSSC[dee-1][106-1] = 11;
01432 fT2d_DSSC[dee-1][107-1] = 7;
01433
01434 fT2d_DSSC[dee-1][123-1] = 21;
01435 fT2d_DSSC[dee-1][124-1] = 26;
01436 fT2d_DSSC[dee-1][125-1] = 19;
01437 fT2d_DSSC[dee-1][126-1] = 12;
01438
01439 fT2d_DSSC[dee-1][144-1] = 14;
01440 fT2d_DSSC[dee-1][145-1] = 20;
01441 fT2d_DSSC[dee-1][146-1] = 13;
01442
01443 fT2d_DSSC[dee-1][165-1] = 14;
01444
01445
01446 if(dee == 1 || dee == 3)
01447 {
01448 fT2d_DSSC[dee-1][1-1] = 34;
01449 fT2d_DSSC[dee-1][2-1] = 33;
01450 fT2d_DSSC[dee-1][3-1] = 32;
01451 fT2d_DSSC[dee-1][4-1] = 31;
01452 fT2d_DSSC[dee-1][5-1] = 26;
01453 fT2d_DSSC[dee-1][6-1] = 25;
01454 fT2d_DSSC[dee-1][7-1] = 24;
01455 fT2d_DSSC[dee-1][8-1] = 23;
01456
01457 fT2d_DSSC[dee-1][21-1] = 30;
01458 fT2d_DSSC[dee-1][22-1] = 29;
01459 fT2d_DSSC[dee-1][23-1] = 28;
01460 fT2d_DSSC[dee-1][24-1] = 27;
01461 fT2d_DSSC[dee-1][25-1] = 22;
01462 fT2d_DSSC[dee-1][26-1] = 21;
01463
01464 fT2d_DSSC[dee-1][41-1] = 20;
01465 fT2d_DSSC[dee-1][42-1] = 19;
01466 fT2d_DSSC[dee-1][43-1] = 18;
01467 }
01468
01469 if(dee == 2 || dee == 4)
01470 {
01471 fT2d_DSSC[dee-1][1-1] = 17;
01472 fT2d_DSSC[dee-1][2-1] = 16;
01473 fT2d_DSSC[dee-1][3-1] = 15;
01474 fT2d_DSSC[dee-1][4-1] = 14;
01475 fT2d_DSSC[dee-1][5-1] = 9;
01476 fT2d_DSSC[dee-1][6-1] = 8;
01477 fT2d_DSSC[dee-1][7-1] = 7;
01478 fT2d_DSSC[dee-1][8-1] = 6;
01479
01480 fT2d_DSSC[dee-1][21-1] = 13;
01481 fT2d_DSSC[dee-1][22-1] = 12;
01482 fT2d_DSSC[dee-1][23-1] = 11;
01483 fT2d_DSSC[dee-1][24-1] = 10;
01484 fT2d_DSSC[dee-1][25-1] = 5;
01485 fT2d_DSSC[dee-1][26-1] = 4;
01486
01487 fT2d_DSSC[dee-1][41-1] = 3;
01488 fT2d_DSSC[dee-1][42-1] = 2;
01489 fT2d_DSSC[dee-1][43-1] = 1;
01490 }
01491 }
01492
01493
01494
01495
01496 for(Int_t dee=1; dee<=4; dee++)
01497 {for(Int_t isc=1; isc<=MaxDeeSC; isc++)
01498 {fT2d_DeeSCCons[dee-1][isc-1] = -1;}}
01499
01500 for(Int_t i_dee_type=1; i_dee_type<=2; i_dee_type++)
01501 {
01502 Int_t dee = -1;
01503 if( i_dee_type == 1 ){dee = 1;}
01504 if( i_dee_type == 2 ){dee = 3;}
01505
01506
01507
01508 fT2d_DeeSCCons[dee-1][13-1] = 161; fT2d_DeeSCCons[dee][13-1] = 12;
01509 fT2d_DeeSCCons[dee-1][14-1] = 160; fT2d_DeeSCCons[dee][14-1] = 11;
01510 fT2d_DeeSCCons[dee-1][15-1] = 159; fT2d_DeeSCCons[dee][15-1] = 10;
01511 fT2d_DeeSCCons[dee-1][16-1] = 158; fT2d_DeeSCCons[dee][16-1] = 9;
01512 fT2d_DeeSCCons[dee-1][17-1] = 153; fT2d_DeeSCCons[dee][17-1] = 4;
01513 fT2d_DeeSCCons[dee-1][18-1] = 152; fT2d_DeeSCCons[dee][18-1] = 3;
01514 fT2d_DeeSCCons[dee-1][19-1] = 151; fT2d_DeeSCCons[dee][19-1] = 2;
01515 fT2d_DeeSCCons[dee-1][20-1] = 150; fT2d_DeeSCCons[dee][20-1] = 1;
01516
01517 fT2d_DeeSCCons[dee-1][33-1] = 165; fT2d_DeeSCCons[dee][33-1] = 16;
01518 fT2d_DeeSCCons[dee-1][34-1] = 164; fT2d_DeeSCCons[dee][34-1] = 15;
01519 fT2d_DeeSCCons[dee-1][35-1] = 163; fT2d_DeeSCCons[dee][35-1] = 14;
01520 fT2d_DeeSCCons[dee-1][36-1] = 162; fT2d_DeeSCCons[dee][36-1] = 13;
01521 fT2d_DeeSCCons[dee-1][37-1] = 157; fT2d_DeeSCCons[dee][37-1] = 8;
01522 fT2d_DeeSCCons[dee-1][38-1] = 156; fT2d_DeeSCCons[dee][38-1] = 7;
01523 fT2d_DeeSCCons[dee-1][39-1] = 155; fT2d_DeeSCCons[dee][39-1] = 6;
01524 fT2d_DeeSCCons[dee-1][40-1] = 154; fT2d_DeeSCCons[dee][40-1] = 5;
01525
01526 fT2d_DeeSCCons[dee-1][54-1] = 193; fT2d_DeeSCCons[dee][54-1] = 44;
01527 fT2d_DeeSCCons[dee-1][55-1] = 186; fT2d_DeeSCCons[dee][55-1] = 37;
01528 fT2d_DeeSCCons[dee-1][56-1] = 179; fT2d_DeeSCCons[dee][56-1] = 30;
01529 fT2d_DeeSCCons[dee-1][57-1] = 173; fT2d_DeeSCCons[dee][57-1] = 24;
01530 fT2d_DeeSCCons[dee-1][58-1] = 169; fT2d_DeeSCCons[dee][58-1] = 20;
01531 fT2d_DeeSCCons[dee-1][59-1] = 166; fT2d_DeeSCCons[dee][59-1] = 17;
01532 fT2d_DeeSCCons[dee-1][60-1] = 182; fT2d_DeeSCCons[dee][60-1] = 33;
01533
01534 fT2d_DeeSCCons[dee-1][75-1] = 187; fT2d_DeeSCCons[dee][75-1] = 38;
01535 fT2d_DeeSCCons[dee-1][76-1] = 180; fT2d_DeeSCCons[dee][76-1] = 31;
01536 fT2d_DeeSCCons[dee-1][77-1] = 174; fT2d_DeeSCCons[dee][77-1] = 25;
01537 fT2d_DeeSCCons[dee-1][78-1] = 170; fT2d_DeeSCCons[dee][78-1] = 21;
01538 fT2d_DeeSCCons[dee-1][79-1] = 167; fT2d_DeeSCCons[dee][79-1] = 18;
01539
01540 fT2d_DeeSCCons[dee-1][96-1] = 181; fT2d_DeeSCCons[dee][96-1] = 32;
01541 fT2d_DeeSCCons[dee-1][97-1] = 175; fT2d_DeeSCCons[dee][97-1] = 26;
01542 fT2d_DeeSCCons[dee-1][98-1] = 171; fT2d_DeeSCCons[dee][98-1] = 22;
01543 fT2d_DeeSCCons[dee-1][99-1] = 168; fT2d_DeeSCCons[dee][99-1] = 19;
01544
01545 fT2d_DeeSCCons[dee-1][118-1] = 172; fT2d_DeeSCCons[dee][118-1] = 23;
01546 fT2d_DeeSCCons[dee-1][119-1] = 182; fT2d_DeeSCCons[dee][119-1] = 33;
01547
01548
01549 fT2d_DeeSCCons[dee-1][32-1] = 178; fT2d_DeeSCCons[dee][32-1] = 29;
01550
01551 fT2d_DeeSCCons[dee-1][51-1] = 216; fT2d_DeeSCCons[dee][51-1] = 67;
01552 fT2d_DeeSCCons[dee-1][52-1] = 208; fT2d_DeeSCCons[dee][52-1] = 59;
01553 fT2d_DeeSCCons[dee-1][53-1] = 200; fT2d_DeeSCCons[dee][53-1] = 51;
01554
01555 fT2d_DeeSCCons[dee-1][72-1] = 209; fT2d_DeeSCCons[dee][72-1] = 60;
01556 fT2d_DeeSCCons[dee-1][73-1] = 201; fT2d_DeeSCCons[dee][73-1] = 52;
01557 fT2d_DeeSCCons[dee-1][74-1] = 194; fT2d_DeeSCCons[dee][74-1] = 45;
01558
01559 fT2d_DeeSCCons[dee-1][92-1] = 210; fT2d_DeeSCCons[dee][92-1] = 61;
01560 fT2d_DeeSCCons[dee-1][93-1] = 202; fT2d_DeeSCCons[dee][93-1] = 53;
01561 fT2d_DeeSCCons[dee-1][94-1] = 195; fT2d_DeeSCCons[dee][94-1] = 46;
01562 fT2d_DeeSCCons[dee-1][95-1] = 188; fT2d_DeeSCCons[dee][95-1] = 39;
01563
01564 fT2d_DeeSCCons[dee-1][112-1] = 211; fT2d_DeeSCCons[dee][112-1] = 62;
01565 fT2d_DeeSCCons[dee-1][113-1] = 203; fT2d_DeeSCCons[dee][113-1] = 54;
01566 fT2d_DeeSCCons[dee-1][114-1] = 196; fT2d_DeeSCCons[dee][114-1] = 47;
01567 fT2d_DeeSCCons[dee-1][115-1] = 189; fT2d_DeeSCCons[dee][115-1] = 40;
01568 fT2d_DeeSCCons[dee-1][116-1] = 183; fT2d_DeeSCCons[dee][116-1] = 34;
01569 fT2d_DeeSCCons[dee-1][117-1] = 176; fT2d_DeeSCCons[dee][117-1] = 27;
01570
01571 fT2d_DeeSCCons[dee-1][132-1] = 212; fT2d_DeeSCCons[dee][132-1] = 63;
01572 fT2d_DeeSCCons[dee-1][133-1] = 204; fT2d_DeeSCCons[dee][133-1] = 55;
01573 fT2d_DeeSCCons[dee-1][134-1] = 197; fT2d_DeeSCCons[dee][134-1] = 48;
01574 fT2d_DeeSCCons[dee-1][135-1] = 190; fT2d_DeeSCCons[dee][135-1] = 41;
01575 fT2d_DeeSCCons[dee-1][136-1] = 184; fT2d_DeeSCCons[dee][136-1] = 35;
01576 fT2d_DeeSCCons[dee-1][137-1] = 177; fT2d_DeeSCCons[dee][137-1] = 28;
01577 fT2d_DeeSCCons[dee-1][138-1] = 178; fT2d_DeeSCCons[dee][138-1] = 29;
01578
01579 fT2d_DeeSCCons[dee-1][152-1] = 213; fT2d_DeeSCCons[dee][152-1] = 64;
01580 fT2d_DeeSCCons[dee-1][153-1] = 205; fT2d_DeeSCCons[dee][153-1] = 56;
01581 fT2d_DeeSCCons[dee-1][154-1] = 198; fT2d_DeeSCCons[dee][154-1] = 49;
01582 fT2d_DeeSCCons[dee-1][155-1] = 191; fT2d_DeeSCCons[dee][155-1] = 42;
01583 fT2d_DeeSCCons[dee-1][156-1] = 185; fT2d_DeeSCCons[dee][156-1] = 36;
01584 fT2d_DeeSCCons[dee-1][157-1] = 178; fT2d_DeeSCCons[dee][157-1] = 29;
01585
01586 fT2d_DeeSCCons[dee-1][173-1] = 206; fT2d_DeeSCCons[dee][173-1] = 57;
01587 fT2d_DeeSCCons[dee-1][174-1] = 199; fT2d_DeeSCCons[dee][174-1] = 50;
01588 fT2d_DeeSCCons[dee-1][175-1] = 192; fT2d_DeeSCCons[dee][175-1] = 43;
01589 fT2d_DeeSCCons[dee-1][176-1] = 207; fT2d_DeeSCCons[dee][176-1] = 58;
01590
01591 fT2d_DeeSCCons[dee-1][193-1] = 207; fT2d_DeeSCCons[dee][193-1] = 58;
01592
01593
01594 fT2d_DeeSCCons[dee-1][50-1] = 224; fT2d_DeeSCCons[dee][50-1] = 75;
01595
01596 fT2d_DeeSCCons[dee-1][69-1] = 233; fT2d_DeeSCCons[dee][69-1] = 84;
01597 fT2d_DeeSCCons[dee-1][70-1] = 225; fT2d_DeeSCCons[dee][70-1] = 76;
01598 fT2d_DeeSCCons[dee-1][71-1] = 217; fT2d_DeeSCCons[dee][71-1] = 68;
01599
01600 fT2d_DeeSCCons[dee-1][88-1] = 242; fT2d_DeeSCCons[dee][88-1] = 93;
01601 fT2d_DeeSCCons[dee-1][89-1] = 234; fT2d_DeeSCCons[dee][89-1] = 85;
01602 fT2d_DeeSCCons[dee-1][90-1] = 226; fT2d_DeeSCCons[dee][90-1] = 77;
01603 fT2d_DeeSCCons[dee-1][91-1] = 218; fT2d_DeeSCCons[dee][91-1] = 69;
01604
01605 fT2d_DeeSCCons[dee-1][108-1] = 243; fT2d_DeeSCCons[dee][108-1] = 94;
01606 fT2d_DeeSCCons[dee-1][109-1] = 235; fT2d_DeeSCCons[dee][109-1] = 86;
01607 fT2d_DeeSCCons[dee-1][110-1] = 227; fT2d_DeeSCCons[dee][110-1] = 78;
01608 fT2d_DeeSCCons[dee-1][111-1] = 219; fT2d_DeeSCCons[dee][111-1] = 70;
01609
01610 fT2d_DeeSCCons[dee-1][127-1] = 252; fT2d_DeeSCCons[dee][127-1] = 103;
01611 fT2d_DeeSCCons[dee-1][128-1] = 244; fT2d_DeeSCCons[dee][128-1] = 95;
01612 fT2d_DeeSCCons[dee-1][129-1] = 236; fT2d_DeeSCCons[dee][129-1] = 87;
01613 fT2d_DeeSCCons[dee-1][130-1] = 228; fT2d_DeeSCCons[dee][130-1] = 79;
01614 fT2d_DeeSCCons[dee-1][131-1] = 220; fT2d_DeeSCCons[dee][131-1] = 71;
01615
01616 fT2d_DeeSCCons[dee-1][147-1] = 253; fT2d_DeeSCCons[dee][147-1] = 104;
01617 fT2d_DeeSCCons[dee-1][148-1] = 245; fT2d_DeeSCCons[dee][148-1] = 96;
01618 fT2d_DeeSCCons[dee-1][149-1] = 237; fT2d_DeeSCCons[dee][149-1] = 88;
01619 fT2d_DeeSCCons[dee-1][150-1] = 229; fT2d_DeeSCCons[dee][150-1] = 80;
01620 fT2d_DeeSCCons[dee-1][151-1] = 221; fT2d_DeeSCCons[dee][151-1] = 72;
01621
01622 fT2d_DeeSCCons[dee-1][166-1] = 254; fT2d_DeeSCCons[dee][166-1] = 105;
01623 fT2d_DeeSCCons[dee-1][167-1] = 247; fT2d_DeeSCCons[dee][167-1] = 98;
01624 fT2d_DeeSCCons[dee-1][168-1] = 246; fT2d_DeeSCCons[dee][168-1] = 97;
01625 fT2d_DeeSCCons[dee-1][169-1] = 238; fT2d_DeeSCCons[dee][169-1] = 89;
01626 fT2d_DeeSCCons[dee-1][170-1] = 230; fT2d_DeeSCCons[dee][170-1] = 81;
01627 fT2d_DeeSCCons[dee-1][171-1] = 222; fT2d_DeeSCCons[dee][171-1] = 73;
01628 fT2d_DeeSCCons[dee-1][172-1] = 214; fT2d_DeeSCCons[dee][172-1] = 65;
01629
01630 fT2d_DeeSCCons[dee-1][188-1] = 298; fT2d_DeeSCCons[dee][188-1] = 149;
01631 fT2d_DeeSCCons[dee-1][189-1] = 239; fT2d_DeeSCCons[dee][189-1] = 90;
01632 fT2d_DeeSCCons[dee-1][190-1] = 231; fT2d_DeeSCCons[dee][190-1] = 82;
01633 fT2d_DeeSCCons[dee-1][191-1] = 223; fT2d_DeeSCCons[dee][191-1] = 74;
01634 fT2d_DeeSCCons[dee-1][192-1] = 215; fT2d_DeeSCCons[dee][192-1] = 66;
01635
01636
01637 fT2d_DeeSCCons[dee-1][29-1] = 261; fT2d_DeeSCCons[dee][29-1] = 112;
01638 fT2d_DeeSCCons[dee-1][27-1] = 283; fT2d_DeeSCCons[dee][27-1] = 134;
01639 fT2d_DeeSCCons[dee-1][28-1] = 282; fT2d_DeeSCCons[dee][28-1] = 133;
01640
01641 fT2d_DeeSCCons[dee-1][44-1] = 269; fT2d_DeeSCCons[dee][44-1] = 120;
01642 fT2d_DeeSCCons[dee-1][45-1] = 262; fT2d_DeeSCCons[dee][45-1] = 113;
01643 fT2d_DeeSCCons[dee-1][46-1] = 255; fT2d_DeeSCCons[dee][46-1] = 106;
01644 fT2d_DeeSCCons[dee-1][47-1] = 248; fT2d_DeeSCCons[dee][47-1] = 99;
01645 fT2d_DeeSCCons[dee-1][48-1] = 240; fT2d_DeeSCCons[dee][48-1] = 91;
01646 fT2d_DeeSCCons[dee-1][49-1] = 232; fT2d_DeeSCCons[dee][49-1] = 83;
01647
01648 fT2d_DeeSCCons[dee-1][62-1] = 276; fT2d_DeeSCCons[dee][62-1] = 127;
01649 fT2d_DeeSCCons[dee-1][63-1] = 275; fT2d_DeeSCCons[dee][63-1] = 126;
01650 fT2d_DeeSCCons[dee-1][64-1] = 270; fT2d_DeeSCCons[dee][64-1] = 121;
01651 fT2d_DeeSCCons[dee-1][65-1] = 263; fT2d_DeeSCCons[dee][65-1] = 114;
01652 fT2d_DeeSCCons[dee-1][66-1] = 256; fT2d_DeeSCCons[dee][66-1] = 107;
01653 fT2d_DeeSCCons[dee-1][67-1] = 249; fT2d_DeeSCCons[dee][67-1] = 100;
01654 fT2d_DeeSCCons[dee-1][68-1] = 241; fT2d_DeeSCCons[dee][68-1] = 92;
01655
01656 fT2d_DeeSCCons[dee-1][82-1] = 278; fT2d_DeeSCCons[dee][82-1] = 129;
01657 fT2d_DeeSCCons[dee-1][83-1] = 277; fT2d_DeeSCCons[dee][83-1] = 128;
01658 fT2d_DeeSCCons[dee-1][84-1] = 271; fT2d_DeeSCCons[dee][84-1] = 122;
01659 fT2d_DeeSCCons[dee-1][85-1] = 264; fT2d_DeeSCCons[dee][85-1] = 115;
01660 fT2d_DeeSCCons[dee-1][86-1] = 257; fT2d_DeeSCCons[dee][86-1] = 108;
01661 fT2d_DeeSCCons[dee-1][87-1] = 250; fT2d_DeeSCCons[dee][87-1] = 101;
01662
01663 fT2d_DeeSCCons[dee-1][102-1] = 268; fT2d_DeeSCCons[dee][102-1] = 119;
01664 fT2d_DeeSCCons[dee-1][103-1] = 274; fT2d_DeeSCCons[dee][103-1] = 125;
01665 fT2d_DeeSCCons[dee-1][104-1] = 272; fT2d_DeeSCCons[dee][104-1] = 123;
01666 fT2d_DeeSCCons[dee-1][105-1] = 265; fT2d_DeeSCCons[dee][105-1] = 116;
01667 fT2d_DeeSCCons[dee-1][106-1] = 258; fT2d_DeeSCCons[dee][106-1] = 109;
01668 fT2d_DeeSCCons[dee-1][107-1] = 251; fT2d_DeeSCCons[dee][107-1] = 102;
01669
01670 fT2d_DeeSCCons[dee-1][123-1] = 268; fT2d_DeeSCCons[dee][123-1] = 119;
01671 fT2d_DeeSCCons[dee-1][124-1] = 273; fT2d_DeeSCCons[dee][124-1] = 124;
01672 fT2d_DeeSCCons[dee-1][125-1] = 266; fT2d_DeeSCCons[dee][125-1] = 117;
01673 fT2d_DeeSCCons[dee-1][126-1] = 259; fT2d_DeeSCCons[dee][126-1] = 110;
01674
01675 fT2d_DeeSCCons[dee-1][144-1] = 261; fT2d_DeeSCCons[dee][144-1] = 112;
01676 fT2d_DeeSCCons[dee-1][145-1] = 267; fT2d_DeeSCCons[dee][145-1] = 118;
01677 fT2d_DeeSCCons[dee-1][146-1] = 260; fT2d_DeeSCCons[dee][146-1] = 111;
01678
01679 fT2d_DeeSCCons[dee-1][165-1] = 261; fT2d_DeeSCCons[dee][165-1] = 112;
01680
01681
01682 fT2d_DeeSCCons[dee-1][1-1] = 297;
01683 fT2d_DeeSCCons[dee-1][2-1] = 296;
01684 fT2d_DeeSCCons[dee-1][3-1] = 295;
01685 fT2d_DeeSCCons[dee-1][4-1] = 294;
01686 fT2d_DeeSCCons[dee-1][5-1] = 289;
01687 fT2d_DeeSCCons[dee-1][6-1] = 288;
01688 fT2d_DeeSCCons[dee-1][7-1] = 287;
01689 fT2d_DeeSCCons[dee-1][8-1] = 286;
01690
01691 fT2d_DeeSCCons[dee-1][21-1] = 293;
01692 fT2d_DeeSCCons[dee-1][22-1] = 292;
01693 fT2d_DeeSCCons[dee-1][23-1] = 291;
01694 fT2d_DeeSCCons[dee-1][24-1] = 290;
01695 fT2d_DeeSCCons[dee-1][25-1] = 285;
01696 fT2d_DeeSCCons[dee-1][26-1] = 284;
01697
01698 fT2d_DeeSCCons[dee-1][41-1] = 281;
01699 fT2d_DeeSCCons[dee-1][42-1] = 280;
01700 fT2d_DeeSCCons[dee-1][43-1] = 279;
01701
01702
01703 fT2d_DeeSCCons[dee][1-1] = 148;
01704 fT2d_DeeSCCons[dee][2-1] = 147;
01705 fT2d_DeeSCCons[dee][3-1] = 146;
01706 fT2d_DeeSCCons[dee][4-1] = 145;
01707 fT2d_DeeSCCons[dee][5-1] = 140;
01708 fT2d_DeeSCCons[dee][6-1] = 139;
01709 fT2d_DeeSCCons[dee][7-1] = 138;
01710 fT2d_DeeSCCons[dee][8-1] = 137;
01711
01712 fT2d_DeeSCCons[dee][21-1] = 144;
01713 fT2d_DeeSCCons[dee][22-1] = 143;
01714 fT2d_DeeSCCons[dee][23-1] = 142;
01715 fT2d_DeeSCCons[dee][24-1] = 141;
01716 fT2d_DeeSCCons[dee][25-1] = 136;
01717 fT2d_DeeSCCons[dee][26-1] = 135;
01718
01719 fT2d_DeeSCCons[dee][41-1] = 132;
01720 fT2d_DeeSCCons[dee][42-1] = 131;
01721 fT2d_DeeSCCons[dee][43-1] = 130;
01722 }
01723
01724
01725
01726 for(Int_t i0EEDee=0; i0EEDee<MaxEEDee; i0EEDee++)
01727 {
01728 for(Int_t i_ecna=0; i_ecna<MaxDeeSC; i_ecna++)
01729 {
01730
01731
01732 if( fT2d_DeeSCCons[i0EEDee][i_ecna] >= 0 && fT2d_DeeSCCons[i0EEDee][i_ecna] <= MaxEESCForCons )
01733 {
01734 fT2d_RecovDeeSC[i0EEDee][fT2d_DeeSCCons[i0EEDee][i_ecna]-1] = i_ecna+1;
01735 }
01736 }
01737 }
01738 }
01739
01740
01741
01742
01743
01744
01745
01746
01747 Int_t TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(const Int_t& n1DeeSCEcna,
01748 const Int_t& i0SCEcha,
01749 const TString sDeeDir)
01750 {
01751
01752
01753
01754 Int_t n1DeeCrys = 0;
01755 Int_t i0DeeDir = GetDeeDirIndex(sDeeDir);
01756
01757 if( fT3dDeeCrys == 0 ){BuildEndcapCrysTable();}
01758
01759 if( (n1DeeSCEcna >= 1) && (n1DeeSCEcna <= fEcal->MaxSCEcnaInDee()) )
01760 {
01761 if (i0SCEcha >=0 && i0SCEcha < fEcal->MaxCrysInSC())
01762 {
01763 n1DeeCrys = fT3dDeeCrys[n1DeeSCEcna-1][i0SCEcha][i0DeeDir];
01764 }
01765 else
01766 {
01767 n1DeeCrys = -2;
01768 cout << "!TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(...)> Electronic Channel in SuperCrystal = "
01769 << i0SCEcha+1 << ". Out of range (range = [1," << fEcal->MaxCrysInSC() << "])" << fTTBELL << endl;
01770 }
01771 }
01772 else
01773 {
01774 n1DeeCrys = -3;
01775 cout << "!TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(...)> Super-Crystal number in Dee out of range."
01776 << " n1DeeSCEcna = " << n1DeeSCEcna << fTTBELL << endl;
01777 }
01778
01779 return n1DeeCrys;
01780 }
01781
01782
01783
01784
01785
01786
01787
01788 Int_t TEcnaNumbering::Get1SCEchaFrom1DeeCrys(const Int_t& n1DeeCrys, const TString sDeeDir)
01789 {
01790
01791
01792 Int_t n1SCEcha = -1;
01793 Int_t iDeeDir = GetDeeDirIndex(sDeeDir);
01794
01795 if( n1DeeCrys >= 1 && n1DeeCrys <= fEcal->MaxCrysEcnaInDee() )
01796 {
01797 n1SCEcha = fT2dSCEcha[n1DeeCrys-1][iDeeDir];
01798 }
01799 else
01800 {
01801 n1SCEcha = -2;
01802 cout << "!TEcnaNumbering::Get1SCEchaFrom1DeeCrys(...)> Crystal number in Dee out of range."
01803 << " n1DeeCrys = " << n1DeeCrys << "(max = " << fEcal->MaxCrysEcnaInDee() << ")" << fTTBELL << endl;
01804 }
01805 return n1SCEcha;
01806 }
01807
01808 Int_t TEcnaNumbering::Get1DeeSCEcnaFrom1DeeCrys(const Int_t& n1DeeCrys, const TString sDeeDir)
01809 {
01810
01811
01812 Int_t n1DeeSCEcna = 0;
01813 Int_t iDeeDir = GetDeeDirIndex(sDeeDir);
01814
01815 if( n1DeeCrys >= 1 && n1DeeCrys <= fEcal->MaxCrysEcnaInDee() )
01816 {
01817 n1DeeSCEcna = fT2dDeeSC[n1DeeCrys-1][iDeeDir];
01818 }
01819 else
01820 {
01821 n1DeeSCEcna = -1;
01822 cout << "!TEcnaNumbering::Get1DeeSCEcnaFrom1DeeCrys(...)> Crystal number in Dee out of range."
01823 << " n1DeeCrys = " << n1DeeCrys << "(max = " << fEcal->MaxCrysEcnaInDee() << ")" << fTTBELL << endl;
01824 }
01825 return n1DeeSCEcna;
01826 }
01827
01828
01829
01830
01831
01832
01833
01834
01835 Int_t TEcnaNumbering::Get1SCEchaFrom0DeeEcha(const Int_t& i0DeeEcha)
01836 {
01837
01838
01839 Int_t i0DeeSC = i0DeeEcha/fEcal->MaxCrysInSC();
01840 Int_t n1SCEcha = i0DeeEcha - fEcal->MaxCrysInSC()*i0DeeSC + 1;
01841
01842 return n1SCEcha;
01843 }
01844
01845 Int_t TEcnaNumbering::Get1DeeSCEcnaFrom0DeeEcha(const Int_t& i0DeeEcha)
01846 {
01847
01848
01849 Int_t n1DeeSC = i0DeeEcha/fEcal->MaxCrysInSC()+1;
01850
01851 return n1DeeSC;
01852 }
01853
01854
01855
01856
01857
01858
01859
01860
01861
01862
01863
01864
01865 Int_t TEcnaNumbering::GetDSFrom1DeeSCEcna(const Int_t& n1DeeNumber, const Int_t& n1DeeSCEcna)
01866 {
01867
01868
01869 Int_t data_sector = -1;
01870
01871 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
01872 {
01873 if( n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
01874 {
01875 data_sector = fT2d_DS[n1DeeNumber-1][n1DeeSCEcna-1];
01876 }
01877 else
01878 {
01879 cout << "!TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> n1DeeSCEcna = " << n1DeeSCEcna
01880 << ". Out of range ( range = [1," << fEcal->MaxSCEcnaInDee() << "] )"
01881 << fTTBELL << endl;
01882 }
01883 }
01884 else
01885 {
01886 if( n1DeeNumber != 0 )
01887 {
01888 cout << "!TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
01889 << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )"
01890 << fTTBELL << endl;
01891 }
01892 else
01893 {
01894 cout << "TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
01895 << ". Out of range (range = [1," << fEcal->MaxDeeInEE() << "])"
01896 << fTTBELL << endl;
01897 }
01898 }
01899 return data_sector;
01900 }
01901
01902 Int_t TEcnaNumbering::GetDSSCFrom1DeeSCEcna(const Int_t& n1DeeNumber, const Int_t& n1DeeSCEcna,
01903 const Int_t& n1SCEcha)
01904 {
01905
01906 Int_t ds_sc = GetDSSCFrom1DeeSCEcna(n1DeeNumber, n1DeeSCEcna);
01907
01908 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 )
01909 {
01910 if( n1SCEcha == 11 )
01911 {
01912 if( ds_sc == 14 ){ds_sc= 21;}
01913 }
01914 if( n1SCEcha == 1 || n1SCEcha == 2 || n1SCEcha == 3 ||
01915 n1SCEcha == 6 || n1SCEcha == 7 )
01916 {
01917 if( ds_sc == 3 ){ds_sc = 25;}
01918 }
01919 }
01920 return ds_sc;
01921 }
01922
01923 Int_t TEcnaNumbering::GetDSSCFrom1DeeSCEcna(const Int_t& n1DeeNumber, const Int_t& n1DeeSCEcna)
01924 {
01925
01926
01927 Int_t ds_sc = -1;
01928
01929 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
01930 {
01931 if( n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
01932 {
01933 ds_sc = fT2d_DSSC[n1DeeNumber-1][n1DeeSCEcna-1];
01934
01935 }
01936 else
01937 {
01938 cout << "!TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> n1DeeSCEcna = " << n1DeeSCEcna
01939 << ". Out of range ( range = [1," << fEcal->MaxSCEcnaInDee() << "] )"
01940 << fTTBELL << endl;
01941 }
01942 }
01943 else
01944 {
01945 if( n1DeeNumber != 0 )
01946 {
01947 cout << "!TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
01948 << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )"
01949 << fTTBELL << endl;
01950 }
01951 else
01952 {
01953 cout << "TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
01954 << ". Out of range (range = [1," << fEcal->MaxDeeInEE() << "])"
01955 << fTTBELL << endl;
01956 }
01957 }
01958 return ds_sc;
01959 }
01960
01961 Int_t TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(const Int_t& n1DeeNumber, const Int_t& n1DeeSCEcna)
01962 {
01963
01964
01965 Int_t dee_sc_cons = -1;
01966
01967 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
01968 {
01969 if( n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
01970 {
01971 dee_sc_cons = fT2d_DeeSCCons[n1DeeNumber-1][n1DeeSCEcna-1];
01972 }
01973 else
01974 {
01975 cout << "!TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> *** WARNING *** n1DeeSCEcna = " << n1DeeSCEcna
01976 << ". Out of range ( range = [1," << fEcal->MaxSCEcnaInDee()
01977 << "] ). Nb for const. forced to " << fT2d_DeeSCCons[n1DeeNumber-1][19] << "." << endl;
01978 dee_sc_cons = fT2d_DeeSCCons[n1DeeNumber-1][19];
01979 }
01980 }
01981 else
01982 {
01983 if( n1DeeNumber != 0 )
01984 {
01985 cout << "!TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
01986 << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )"
01987 << fTTBELL << endl;
01988 }
01989 else
01990 {
01991 cout << "TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
01992 << ". Out of range (range = [1," << fEcal->MaxDeeInEE() << "])"
01993 << fTTBELL << endl;
01994 }
01995 }
01996 return dee_sc_cons;
01997 }
01998
01999 Int_t TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(const Int_t& n1DeeNumber, const Int_t& n1DeeSCEcna,
02000 const Int_t& n1SCEcha)
02001 {
02002
02003 Int_t dee_sc_cons = GetDeeSCConsFrom1DeeSCEcna(n1DeeNumber, n1DeeSCEcna);
02004
02005 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 )
02006 {
02007 if( n1SCEcha == 11 )
02008 {
02009 if( dee_sc_cons == 261 ){dee_sc_cons = 268;}
02010 if( dee_sc_cons == 112 ){dee_sc_cons = 119;}
02011 }
02012 if( n1SCEcha == 1 || n1SCEcha == 2 || n1SCEcha == 3 ||
02013 n1SCEcha == 6 || n1SCEcha == 7 )
02014 {
02015 if( dee_sc_cons == 178 ){dee_sc_cons = 207;}
02016 if( dee_sc_cons == 29 ){dee_sc_cons = 58;}
02017 }
02018 }
02019 return dee_sc_cons;
02020 }
02021
02022 Int_t TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(const Int_t& n1DeeNumber, const Int_t& DeeSCCons)
02023 {
02024
02025
02026 Int_t dee_sc_ecna = -1;
02027
02028 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
02029 {
02030 Int_t off_set_cons = 0;
02031 if( n1DeeNumber == 1 || n1DeeNumber == 3 ){off_set_cons = fEcal->MaxSCForConsInDee();}
02032
02033 if( DeeSCCons > off_set_cons && DeeSCCons <= fEcal->MaxSCForConsInDee()+off_set_cons )
02034 {
02035 dee_sc_ecna = fT2d_RecovDeeSC[n1DeeNumber-1][DeeSCCons-1];
02036 }
02037 else
02038 {
02039 cout << "!TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> DeeSCCons = " << DeeSCCons
02040 << ". Out of range ( range = [ " << off_set_cons+1
02041 << "," << fEcal->MaxSCForConsInDee()+off_set_cons << "] )"
02042 << fTTBELL << endl;
02043 }
02044 }
02045 else
02046 {
02047 if( n1DeeNumber != 0 )
02048 {
02049 cout << "!TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> n1DeeNumber = " << n1DeeNumber
02050 << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )"
02051 << fTTBELL << endl;
02052 }
02053 else
02054 {
02055 cout << "TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> Dee = " << n1DeeNumber
02056 << ". Out of range (range = [1," << fEcal->MaxDeeInEE() << "])"
02057 << fTTBELL << endl;
02058 }
02059 }
02060 return dee_sc_ecna;
02061 }
02062
02063 TString TEcnaNumbering::GetSCType(const Int_t& nb_for_cons)
02064 {
02065
02066
02067 TString SCType = "Connected";
02068
02069 if( nb_for_cons == 182 || nb_for_cons == 33 ){SCType = "NotConnected";}
02070
02071 if( nb_for_cons == 178 || nb_for_cons == 29 ){SCType = "NotConnected";}
02072 if( nb_for_cons == 207 || nb_for_cons == 58 ){SCType = "NotConnected";}
02073
02074 if( nb_for_cons == 298 || nb_for_cons == 149 ){SCType = "NotConnected";}
02075
02076 if( nb_for_cons == 261 || nb_for_cons == 112 ){SCType = "NotConnected";}
02077 if( nb_for_cons == 268 || nb_for_cons == 119 ){SCType = "NotConnected";}
02078
02079 if( nb_for_cons == 281 || nb_for_cons == 132 ){SCType = "NotConnected";}
02080
02081 if( nb_for_cons == 161 || nb_for_cons == 12 ){SCType = "NotComplete";}
02082 if( nb_for_cons == 216 || nb_for_cons == 67 ){SCType = "NotComplete";}
02083 if( nb_for_cons == 224 || nb_for_cons == 75 ){SCType = "NotComplete";}
02084 if( nb_for_cons == 286 || nb_for_cons == 137 ){SCType = "NotComplete";}
02085
02086 return SCType;
02087 }
02088
02089 Int_t TEcnaNumbering::StexEchaForCons(const Int_t& n1DeeNumber, const Int_t& i0StexEcha)
02090 {
02091 Int_t n1StexStin = Get1StexStinFrom0StexEcha(i0StexEcha);
02092 return fT2d_DeeSCCons[n1DeeNumber-1][n1StexStin-1];
02093 }
02094
02095
02096
02097
02098
02099
02100
02101
02102 TString TEcnaNumbering::GetSCQuadFrom1DeeSCEcna(const Int_t& n1DeeSCEcna)
02103 {
02104
02105
02106 TString SCQuad = "top";
02107
02108 if (n1DeeSCEcna >= 1 && n1DeeSCEcna <= 10){SCQuad = "bottom";}
02109 if (n1DeeSCEcna >= 21 && n1DeeSCEcna <= 30){SCQuad = "bottom";}
02110 if (n1DeeSCEcna >= 41 && n1DeeSCEcna <= 50){SCQuad = "bottom";}
02111 if (n1DeeSCEcna >= 61 && n1DeeSCEcna <= 70){SCQuad = "bottom";}
02112 if (n1DeeSCEcna >= 81 && n1DeeSCEcna <= 90){SCQuad = "bottom";}
02113 if (n1DeeSCEcna >= 101 && n1DeeSCEcna <= 110){SCQuad = "bottom";}
02114 if (n1DeeSCEcna >= 121 && n1DeeSCEcna <= 130){SCQuad = "bottom";}
02115 if (n1DeeSCEcna >= 141 && n1DeeSCEcna <= 150){SCQuad = "bottom";}
02116 if (n1DeeSCEcna >= 161 && n1DeeSCEcna <= 170){SCQuad = "bottom";}
02117 if (n1DeeSCEcna >= 181 && n1DeeSCEcna <= 190){SCQuad = "bottom";}
02118
02119 return SCQuad;
02120 }
02121 Int_t TEcnaNumbering::GetSCQuadTypeIndex(const TString SCQuadType, const TString sDeeDir)
02122 {
02123
02124
02125
02126 Int_t itype = 0;
02127 if ( SCQuadType == "top" && sDeeDir == "right" ){itype = 0;}
02128 if ( SCQuadType == "top" && sDeeDir == "left" ){itype = 1;}
02129 if ( SCQuadType == "bottom" && sDeeDir == "left" ){itype = 2;}
02130 if ( SCQuadType == "bottom" && sDeeDir == "right" ){itype = 3;}
02131 return itype;
02132 }
02133
02134
02135
02136
02137
02138 TString TEcnaNumbering::GetEEDeeEndcap(const Int_t& n1DeeNumber)
02139 {
02140
02141
02142 TString eetype = "EE+";
02143 if ( n1DeeNumber == 1 || n1DeeNumber == 2 ){eetype = "EE+";}
02144 if ( n1DeeNumber == 3 || n1DeeNumber == 4 ){eetype = "EE-";}
02145 return eetype;
02146 }
02147 TString TEcnaNumbering::GetEEDeeType(const Int_t& n1DeeNumber)
02148 {
02149
02150
02151 TString type = "EE+F";
02152 if ( n1DeeNumber == 1 ){type = "EE+F";}
02153 if ( n1DeeNumber == 2 ){type = "EE+N";}
02154 if ( n1DeeNumber == 3 ){type = "EE-N";}
02155 if ( n1DeeNumber == 4 ){type = "EE-F";}
02156 return type;
02157 }
02158
02159 TString TEcnaNumbering::GetDeeDirViewedFromIP(const Int_t& n1DeeNumber)
02160 {
02161
02162
02163
02164 TString sDeeDir = "right";
02165 if ( (n1DeeNumber == 1) || (n1DeeNumber == 3) ){sDeeDir = "right";}
02166 if ( (n1DeeNumber == 2) || (n1DeeNumber == 4) ){sDeeDir = "left" ;}
02167 return sDeeDir;
02168 }
02169 Int_t TEcnaNumbering::GetDeeDirIndex(const TString sDeeDir)
02170 {
02171
02172
02173
02174 Int_t iDeeDir = 0;
02175 if ( sDeeDir == "right" ){iDeeDir = 0;}
02176 if ( sDeeDir == "left" ){iDeeDir = 1;}
02177 return iDeeDir;
02178 }
02179
02180
02181
02182
02183
02184
02185
02186
02187 Int_t TEcnaNumbering::GetIXCrysInSC(const Int_t& n1DeeNumber, const Int_t& DeeSC,
02188 const Int_t& i0SCEcha)
02189 {
02190
02191
02192 TString SCQuadType = GetSCQuadFrom1DeeSCEcna(DeeSC);
02193 TString sDeeDir = GetDeeDirViewedFromIP(n1DeeNumber);
02194 Int_t type_index = GetSCQuadTypeIndex(SCQuadType, sDeeDir);
02195 Int_t IXCrysInSC = fT2d_ich_IX[type_index][i0SCEcha+1] + 1;
02196 return IXCrysInSC;
02197 }
02198
02199 Int_t TEcnaNumbering::GetIXSCInDee(const Int_t& DeeSC)
02200 {
02201
02202
02203 Int_t IXSCInDee = (DeeSC-1)/fEcal->MaxSCIYInDee() + 1;
02204 return IXSCInDee;
02205 }
02206
02207 Int_t TEcnaNumbering::GetIXCrysInDee(const Int_t& n1DeeNumber, const Int_t& DeeSC,
02208 const Int_t& i0SCEcha)
02209 {
02210
02211
02212 Int_t IXCrysInDee =
02213 (GetIXSCInDee(DeeSC)-1)*fEcal->MaxCrysIXInSC() +
02214 GetIXCrysInSC(n1DeeNumber, DeeSC, i0SCEcha);
02215 return IXCrysInDee;
02216 }
02217
02218 Int_t TEcnaNumbering::GetJYCrysInSC(const Int_t& n1DeeNumber, const Int_t& DeeSC,
02219 const Int_t& i0SCEcha)
02220 {
02221
02222
02223 TString SCQuadType = GetSCQuadFrom1DeeSCEcna(DeeSC);
02224 TString sDeeDir = GetDeeDirViewedFromIP(n1DeeNumber);
02225 Int_t type_index = GetSCQuadTypeIndex(SCQuadType, sDeeDir);
02226 Int_t JYCrysInSC = fT2d_jch_JY[type_index][i0SCEcha+1] + 1;
02227 return JYCrysInSC;
02228 }
02229
02230 Int_t TEcnaNumbering::GetJYSCInDee(const Int_t& DeeSC)
02231 {
02232
02233
02234 Int_t JYSCInDee = (DeeSC-1)%fEcal->MaxSCIYInDee() + 1;
02235 return JYSCInDee;
02236 }
02237
02238 Int_t TEcnaNumbering::GetJYCrysInDee(const Int_t& n1DeeNumber, const Int_t& DeeSC,
02239 const Int_t& i0SCEcha)
02240 {
02241
02242
02243 Int_t JYCrysInDee =
02244 (GetJYSCInDee(DeeSC)-1)*fEcal->MaxCrysIYInSC() +
02245 GetJYCrysInSC(n1DeeNumber, DeeSC, i0SCEcha);
02246 return JYCrysInDee;
02247 }
02248
02249 Int_t TEcnaNumbering::GetMaxSCInDS(const Int_t& DeeDS)
02250 {
02251
02252
02253 Int_t nb_of_sc = -1;
02254 if( DeeDS == 1 || DeeDS == 9 ){nb_of_sc = 33;}
02255 if( DeeDS == 2 || DeeDS == 8 ){nb_of_sc = 32;}
02256 if( DeeDS == 3 || DeeDS == 7 ){nb_of_sc = 34;}
02257 if( DeeDS == 4 || DeeDS == 6 ){nb_of_sc = 33;}
02258 if( DeeDS == 5){nb_of_sc = 34;}
02259 return nb_of_sc;
02260 }
02261
02262
02263
02264
02265
02266
02267
02268 Double_t TEcnaNumbering::GetIIXMin(const Int_t& DeeSC)
02269 {
02270
02271
02272 Double_t IX_min = (Double_t)((DeeSC-1)/fEcal->MaxSCIYInDee())*fEcal->MaxCrysIXInSC() + 1.;
02273 return IX_min;
02274 }
02275
02276 Double_t TEcnaNumbering::GetIIXMax(const Int_t& DeeSC)
02277 {
02278
02279
02280 Double_t IX_max = ((Double_t)((DeeSC-1)/fEcal->MaxSCIYInDee())+1.)*fEcal->MaxCrysIXInSC();
02281 return IX_max;
02282 }
02283
02284 Double_t TEcnaNumbering::GetIIXMin()
02285 {
02286
02287
02288 Double_t i_IX_min = (Int_t)1.;
02289 return i_IX_min;
02290 }
02291
02292 Double_t TEcnaNumbering::GetIIXMax()
02293 {
02294
02295
02296 Double_t i_IX_max = (Int_t)fEcal->MaxSCIXInDee();
02297 return i_IX_max;
02298 }
02299
02300
02301
02302
02303
02304
02305 Double_t TEcnaNumbering::GetJIYMin(const Int_t& n1DeeNumber, const Int_t& DeeSC)
02306 {
02307
02308
02309 Double_t IY_DeeSC = DeeSC%fEcal->MaxSCIYInDee();
02310 if( IY_DeeSC == 0. ){IY_DeeSC = fEcal->MaxSCIYInDee();}
02311
02312 Double_t j_IY_min = (IY_DeeSC-1)*fEcal->MaxCrysIYInSC() + 1.;
02313
02314 return j_IY_min;
02315 }
02316
02317 Double_t TEcnaNumbering::GetJIYMax(const Int_t& n1DeeNumber, const Int_t& DeeSC)
02318 {
02319
02320
02321 Double_t IY_DeeSC = DeeSC%fEcal->MaxSCIYInDee();
02322 if( IY_DeeSC == 0 ){IY_DeeSC = fEcal->MaxSCIYInDee();}
02323
02324 Double_t j_IY_max = IY_DeeSC*fEcal->MaxCrysIYInSC();
02325
02326 return j_IY_max;
02327 }
02328
02329
02330 Double_t TEcnaNumbering::GetJIYMin(const Int_t& n1DeeNumber)
02331 {
02332
02333
02334 Double_t j_IY_min = (Double_t)1.;
02335
02336 return j_IY_min;
02337 }
02338
02339 Double_t TEcnaNumbering::GetJIYMax(const Int_t& n1DeeNumber)
02340 {
02341
02342
02343 Double_t j_IY_max = (Double_t)fEcal->MaxSCIYInDee();
02344
02345 return j_IY_max;
02346 }
02347
02348 TString TEcnaNumbering::GetDeeHalfEndcap(const Int_t& n1DeeNumber)
02349 {
02350
02351
02352 TString type = "EE-";
02353
02354 if ( n1DeeNumber == 1 || n1DeeNumber == 2 ){type = "EE+";}
02355 if ( n1DeeNumber == 3 || n1DeeNumber == 4 ){type = "EE-";}
02356
02357 return type;
02358 }
02359
02360
02361
02362
02363
02364 TString TEcnaNumbering::GetXDirectionEE(const Int_t& n1DeeNumber)
02365 {
02366 TString xdirection = "x";
02367
02368 if( GetEEDeeType(n1DeeNumber) == "EE+F" ){xdirection = "-x";}
02369 if( GetEEDeeType(n1DeeNumber) == "EE+N" ){xdirection = "-x";}
02370 if( GetEEDeeType(n1DeeNumber) == "EE-N" ){xdirection = "x";}
02371 if( GetEEDeeType(n1DeeNumber) == "EE-F" ){xdirection = "x";}
02372
02373 return xdirection;
02374 }
02375
02376 TString TEcnaNumbering::GetYDirectionEE(const Int_t& n1DeeNumber)
02377 {
02378 TString ydirection = "-x";
02379
02380 if( GetEEDeeType(n1DeeNumber) == "endcap+" ){ydirection = "-x";}
02381 if( GetEEDeeType(n1DeeNumber) == "endcap-" ){ydirection = "-x";}
02382
02383 return ydirection;
02384 }
02385
02386
02387 TString TEcnaNumbering::GetJYDirectionEE(const Int_t& n1DeeNumber)
02388 {
02389 TString jydirection = "x";
02390 return jydirection;
02391 }
02392
02393
02394
02395
02396
02397
02398
02399
02400
02401
02402
02403
02404
02405
02406
02407
02408
02409 Int_t TEcnaNumbering::Get1StexStinFrom0StexEcha(const Int_t& i0StexEcha)
02410 {
02411 Int_t n1StexStin = 0;
02412
02413 if( fFlagSubDet == "EB" ){n1StexStin = Get1SMTowFrom0SMEcha(i0StexEcha);}
02414 if( fFlagSubDet == "EE" ){n1StexStin = Get1DeeSCEcnaFrom0DeeEcha(i0StexEcha);}
02415
02416 return n1StexStin;
02417 }
02418
02419 Int_t TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t& n1StexStin,
02420 const Int_t& i0StinEcha)
02421 {
02422
02423
02424
02425 Int_t StexEcha = (Int_t)(-1.);
02426
02427 if ( n1StexStin > 0 && n1StexStin <= fEcal->MaxStinEcnaInStex() &&
02428 i0StinEcha >= 0 && i0StinEcha < fEcal->MaxCrysInStin() )
02429 {StexEcha = (n1StexStin-1)*fEcal->MaxCrysInStin() + i0StinEcha;}
02430 else
02431 {
02432 cout << "!TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha *** ERROR ***> VALUE"
02433 << " OUT OF RANGE. Forced to -1. Argument values: n1StexStin = " << n1StexStin
02434 << ", channel = " << i0StinEcha
02435 << fTTBELL << endl;
02436 }
02437 return StexEcha;
02438 }
02439 Int_t TEcnaNumbering::Get1StexCrysFrom1StexStinAnd0StinEcha(const Int_t& n1StexStin,
02440 const Int_t& i0StinEcha, const Int_t& StexNumber)
02441 {
02442
02443
02444
02445
02446 Int_t n1StexCrys = (Int_t)0;
02447 if( fFlagSubDet == "EB" ){n1StexCrys = Get1SMCrysFrom1SMTowAnd0TowEcha(n1StexStin, i0StinEcha);}
02448 if( fFlagSubDet == "EE" ){TString sDeeDir = GetDeeDirViewedFromIP(StexNumber);
02449 n1StexCrys = Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(n1StexStin, i0StinEcha, sDeeDir);}
02450
02451 return n1StexCrys;
02452 }
02453
02454
02455
02456
02457
02458
02459 Double_t TEcnaNumbering::GetIHocoMin(const Int_t& Stex, const Int_t& StexStin)
02460 {
02461 Double_t IHocoMin = (Double_t)0.;
02462 if(fFlagSubDet == "EB" ){IHocoMin = GetIEtaMin(Stex, StexStin);}
02463 if(fFlagSubDet == "EE" ){IHocoMin = GetIIXMin(StexStin);}
02464 return IHocoMin;
02465 }
02466
02467 Double_t TEcnaNumbering::GetIHocoMax(const Int_t& Stex, const Int_t& StexStin)
02468 {
02469 Double_t IHocoMax = (Double_t)0.;
02470 if(fFlagSubDet == "EB" ){IHocoMax = GetIEtaMax(Stex, StexStin);}
02471 if(fFlagSubDet == "EE" ){IHocoMax = GetIIXMax(StexStin);}
02472 return IHocoMax;
02473 }
02474
02475 Double_t TEcnaNumbering::GetVecoMin(const Int_t& Stex, const Int_t& StexStin)
02476 {
02477 Double_t IVecoMin = (Double_t)0.;
02478 if(fFlagSubDet == "EB" ){IVecoMin = GetPhiMin(Stex, StexStin);}
02479 if(fFlagSubDet == "EE" ){IVecoMin = GetJIYMin(Stex, StexStin);}
02480 return IVecoMin;
02481 }
02482
02483 Double_t TEcnaNumbering::GetVecoMax(const Int_t& Stex, const Int_t& StexStin)
02484 {
02485 Double_t IVecoMax = (Double_t)0.;
02486 if(fFlagSubDet == "EB" ){IVecoMax = GetPhiMax(Stex, StexStin);}
02487 if(fFlagSubDet == "EE" ){IVecoMax = GetJIYMax(Stex, StexStin);}
02488 return IVecoMax;
02489 }
02490
02491 Double_t TEcnaNumbering::GetJVecoMin(const Int_t& Stex, const Int_t& StexStin)
02492 {
02493 Double_t JVecoMin = (Double_t)0.;
02494 if(fFlagSubDet == "EB" ){JVecoMin = GetJPhiMin(Stex, StexStin);}
02495 if(fFlagSubDet == "EE" ){JVecoMin = GetJIYMin(Stex, StexStin);}
02496 return JVecoMin;
02497 }
02498 Double_t TEcnaNumbering::GetJVecoMax(const Int_t& Stex, const Int_t& StexStin)
02499 {
02500 Double_t JVecoMax = (Double_t)0.;
02501 if(fFlagSubDet == "EB" ){JVecoMax = GetJPhiMax(Stex, StexStin);}
02502 if(fFlagSubDet == "EE" ){JVecoMax = GetJIYMax(Stex, StexStin);}
02503 return JVecoMax;
02504 }
02505
02506
02507
02508
02509
02510 TString TEcnaNumbering::GetStexHalfStas(const Int_t& SMNumber)
02511 {
02512 TString half_stas = "EB? EE?";
02513
02514 if( fFlagSubDet == "EB" ){half_stas = GetSMHalfBarrel(SMNumber);}
02515 if( fFlagSubDet == "EE" ){half_stas = GetDeeHalfEndcap(SMNumber);}
02516
02517 return half_stas;
02518 }
02519
02520
02521
02522
02523
02524 Int_t TEcnaNumbering::GetSMFromFED(const Int_t& FEDNumber)
02525 {
02526 Int_t EBSMNumber = 0;
02527 if( FEDNumber >= 610 && FEDNumber <= 645 ){EBSMNumber = FEDNumber - 609;}
02528 return EBSMNumber;
02529 }
02530
02531 Int_t TEcnaNumbering::GetDSFromFED(const Int_t& FEDNumber)
02532 {
02533 Int_t EEDSNumber = 0;
02534
02535 if( FEDNumber >= 600 && FEDNumber <= 609 ){EEDSNumber = FEDNumber - 599;}
02536 if( FEDNumber >= 646 && FEDNumber <= 655 ){EEDSNumber = FEDNumber - 645;}
02537
02538 return EEDSNumber;
02539 }
02540
02541
02542 Int_t TEcnaNumbering::MaxCrysInStinEcna(const Int_t& n1DeeNumber, const Int_t& n1DeeSCEcna, const TString s_option)
02543 {
02544
02545
02546
02547 Int_t max_crys = fEcal->MaxCrysInStin();
02548
02549
02550
02551 if(fFlagSubDet == "EE")
02552 {
02553 Int_t n_for_cons = GetDeeSCConsFrom1DeeSCEcna(n1DeeNumber, n1DeeSCEcna);
02554
02555
02556 if( n_for_cons == 12 || n_for_cons == 67 || n_for_cons == 75 || n_for_cons == 137 ||
02557 n_for_cons == 161 || n_for_cons == 216 || n_for_cons == 224 || n_for_cons == 286 ){max_crys = 20;}
02558
02559
02560 if( (n_for_cons == 182 || n_for_cons == 33) && (n1DeeSCEcna == 60 || n1DeeSCEcna == 119) ){max_crys = 10;}
02561
02562 if( (n_for_cons == 178 || n_for_cons == 29) && (n1DeeSCEcna == 138 || n1DeeSCEcna == 157) ){max_crys = 10;}
02563 if( (n_for_cons == 207 || n_for_cons == 58) && (n1DeeSCEcna == 176 || n1DeeSCEcna == 193) ){max_crys = 10;}
02564
02565 if( (n_for_cons == 298 || n_for_cons == 149) && (n1DeeSCEcna == 188) ){max_crys = 10;}
02566
02567 if( (n_for_cons == 261 || n_for_cons == 112) && (n1DeeSCEcna == 144 || n1DeeSCEcna == 165) ){max_crys = 10;}
02568 if( (n_for_cons == 268 || n_for_cons == 119) && (n1DeeSCEcna == 102 || n1DeeSCEcna == 123) ){max_crys = 10;}
02569
02570 if( (n_for_cons == 281 || n_for_cons == 132) && (n1DeeSCEcna == 41) ){max_crys = 10;}
02571
02572
02573 if( s_option == "TEcnaRun" || s_option == "TEcnaRead" )
02574 {
02575 if( s_option == "TEcnaRun" )
02576 {
02577
02578 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 ){max_crys = 5;}
02579 if( n1DeeSCEcna == 10 || n1DeeSCEcna == 11 ){max_crys = 1;}
02580 }
02581 if( s_option == "TEcnaRead" )
02582 {
02583
02584 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 ){max_crys = 5;}
02585 if( n1DeeSCEcna == 10 || n1DeeSCEcna == 11 ){max_crys = 1;}
02586 }
02587 }
02588 else
02589 {
02590 cout << "!TEcnaNumbering::MaxCrysInStinEcna(...)> " << s_option
02591 << ": unknown option." << fTTBELL << endl;
02592 }
02593 }
02594 return max_crys;
02595 }