48 Long_t i_this = (Long_t)
this;
226 if (pEcal ==
nullptr) {
302 fT1dSMCrys =
new Int_t[MaxSMTow * MaxTowEcha];
304 for (Int_t i_SMTow = 0; i_SMTow < MaxSMTow; i_SMTow++) {
307 for (Int_t
i = 0;
i < MaxSMTow;
i++) {
308 for (Int_t
j = 0;
j < MaxTowEcha;
j++) {
315 for (Int_t
i = 0;
i < MaxSMCrys;
i++) {
321 for (Int_t
i = 0;
i < MaxSMCrys;
i++) {
327 Int_t m26 = (Int_t)26;
330 Int_t** jch_type =
new Int_t*[m2];
332 Int_t* jch_type_d1 =
new Int_t[m2 * m26];
334 for (Int_t i_m2 = 0; i_m2 < m2; i_m2++) {
335 jch_type[i_m2] = &jch_type_d1[0] + i_m2 * m26;
338 for (Int_t
k = 25;
k >= 21;
k--) {
339 jch_type[0][
k] = 25 -
k;
341 for (Int_t
k = 16;
k <= 20;
k++) {
342 jch_type[0][
k] =
k - 16;
344 for (Int_t
k = 15;
k >= 11;
k--) {
345 jch_type[0][
k] = 15 -
k;
347 for (Int_t
k = 6;
k <= 10;
k++) {
348 jch_type[0][
k] =
k - 6;
350 for (Int_t
k = 5;
k >= 1;
k--) {
351 jch_type[0][
k] = 5 -
k;
354 for (Int_t
k = 1;
k <= 5;
k++) {
355 jch_type[1][
k] =
k - 1;
357 for (Int_t
k = 10;
k >= 6;
k--) {
358 jch_type[1][
k] = 10 -
k;
360 for (Int_t
k = 11;
k <= 15;
k++) {
361 jch_type[1][
k] =
k - 11;
363 for (Int_t
k = 20;
k >= 16;
k--) {
364 jch_type[1][
k] = 20 -
k;
366 for (Int_t
k = 21;
k <= 25;
k++) {
367 jch_type[1][
k] =
k - 21;
371 Int_t** ich_type =
new Int_t*[m2];
373 Int_t* ich_type_d1 =
new Int_t[m2 * m26];
375 for (Int_t i_m2 = 0; i_m2 < m2; i_m2++) {
376 ich_type[i_m2] = &ich_type_d1[0] + i_m2 * m26;
379 for (Int_t
k = 25;
k >= 21;
k--) {
382 for (Int_t
k = 16;
k <= 20;
k++) {
385 for (Int_t
k = 15;
k >= 11;
k--) {
388 for (Int_t
k = 6;
k <= 10;
k++) {
391 for (Int_t
k = 5;
k >= 1;
k--) {
395 for (Int_t
k = 1;
k <= 5;
k++) {
398 for (Int_t
k = 10;
k >= 6;
k--) {
401 for (Int_t
k = 11;
k <= 15;
k++) {
404 for (Int_t
k = 20;
k >= 16;
k--) {
407 for (Int_t
k = 21;
k <= 25;
k++) {
413 Int_t*
type =
new Int_t[m17];
438 for (Int_t tow = 0; tow < MaxSMTow; tow++)
440 for (Int_t ic = 1; ic <= MaxTowEcha; ic++)
442 Int_t jtow = tow % 4;
443 Int_t itow = tow / 4;
445 Int_t icrys = itow * 5 + ich_type[
type[itow]][ic];
449 Int_t jcrys = jtow * 5 + jch_type[
type[itow]][ic];
453 Int_t n1SMCrys = icrys * 20 + jcrys + 1;
464 delete[] jch_type_d1;
468 delete[] ich_type_d1;
493 if (n1SMTow >= 1 && n1SMTow <= fEcal->MaxTowInSM()) {
494 if (i0TowEcha >= 0 && i0TowEcha < fEcal->MaxCrysInTow()) {
495 n1SMCrys =
fT2dSMCrys[n1SMTow - 1][i0TowEcha];
498 std::cout <<
"!TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(...)> Electronic Channel in Tower out of range."
499 <<
" i0TowEcha = " << i0TowEcha <<
"(n1SMTow = " << n1SMTow <<
")" <<
fTTBELL << std::endl;
503 std::cout <<
"!TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(...)> Tower number in SM out of range."
504 <<
" n1SMTow = " << n1SMTow <<
"(i0TowEcha = " << i0TowEcha <<
")" <<
fTTBELL << std::endl;
519 Int_t i0TowEcha = -1;
521 if (n1SMCrys >= 1 && n1SMCrys <= fEcal->MaxCrysInSM()) {
525 std::cout <<
"!TEcnaNumbering::Get0TowEchaFrom1SMCrys(...)> Crystal number in SM out of range."
526 <<
" n1SMCrys = " << n1SMCrys <<
fTTBELL << std::endl;
536 if (n1SMCrys >= 1 && n1SMCrys <= fEcal->MaxCrysInSM()) {
540 std::cout <<
"!TEcnaNumbering::Get1SMTowFrom1SMCrys(...)> Crystal number in SM out of range."
541 <<
" n1SMCrys = " << n1SMCrys <<
fTTBELL << std::endl;
586 Hashed = (85 + IEta - 1) * 360 + IPhi - 1;
589 Hashed = (85 + IEta) * 360 + IPhi - 1;
599 IEta = Hashed / 360 - 85 + 1;
602 IEta = 85 + Hashed / 360;
609 Int_t IPhi = Hashed % 360 + 1;
627 if (n1SMTow >= 1 && n1SMTow <= 12) {
630 if (n1SMTow >= 21 && n1SMTow <= 28) {
633 if (n1SMTow >= 37 && n1SMTow <= 44) {
636 if (n1SMTow >= 53 && n1SMTow <= 60) {
651 Double_t
eta = (Double_t)0.;
657 if (n1EBSM >= 1 && n1EBSM <= max_sm_in_barrel) {
658 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++) {
659 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta * (max_crys_eta_in_tower - 1));
660 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta + 1) * (max_crys_eta_in_tower - 1));
661 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta * max_crys_eta_in_tower);
663 Double_t d_echa_eta = (Double_t)(i0TowEcha / max_crys_eta_in_tower);
665 if (n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max) {
667 eta = (Double_t)(i_crys_eta) + d_echa_eta + 1;
670 eta = (Double_t)(i_crys_eta + max_crys_eta_in_tower) - d_echa_eta;
678 std::cout <<
"TEcnaNumbering::GetEta(...)> SM = " << n1EBSM <<
". Out of range (range = [1," <<
fEcal->
MaxSMInEB()
679 <<
"])" <<
fTTBELL << std::endl;
690 Double_t
eta_min = (Double_t)0.;
692 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++) {
693 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta * (max_crys_eta_in_tower - 1));
694 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta + 1) * (max_crys_eta_in_tower - 1));
695 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta * max_crys_eta_in_tower);
697 if (n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max) {
699 eta_min = (Double_t)i_crys_eta;
702 eta_min = -(Double_t)(i_crys_eta + max_crys_eta_in_tower);
715 Double_t
eta_max = (max_crys_eta_in_tower - 1);
717 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++) {
718 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta * (max_crys_eta_in_tower - 1));
719 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta + 1) * (max_crys_eta_in_tower - 1));
720 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta * max_crys_eta_in_tower);
722 if (n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max) {
724 eta_max = (Double_t)(i_crys_eta + max_crys_eta_in_tower);
727 eta_max = -(Double_t)i_crys_eta;
738 Double_t i_eta_min = (Int_t)0.;
741 i_eta_min = (Double_t)
GetEtaMin(n1EBSM, n1SMTow) + (Double_t)0.5;
744 i_eta_min = (Double_t)
GetEtaMin(n1EBSM, n1SMTow) - (Double_t)0.5;
753 Double_t i_eta_max = (Int_t)0.;
756 i_eta_max = (Double_t)
GetEtaMax(n1EBSM, n1SMTow) + (Double_t)0.5;
759 i_eta_max = (Double_t)
GetEtaMax(n1EBSM, n1SMTow) - (Double_t)0.5;
768 Double_t i_eta_min = (Int_t)0.;
770 Int_t n1SMTowPlus = (Int_t)1;
774 i_eta_min = (Double_t)
GetIEtaMin(n1EBSM, n1SMTowPlus);
777 i_eta_min = (Double_t)
GetIEtaMin(n1EBSM, n1SMTowMinus);
786 Double_t i_eta_max = (Int_t)0.;
789 Int_t n1SMTowMinus = (Int_t)1;
792 i_eta_max = (Double_t)
GetIEtaMax(n1EBSM, n1SMTowPlus);
795 i_eta_max = (Double_t)
GetIEtaMax(n1EBSM, n1SMTowMinus);
810 Double_t central_phi = (Double_t)10.;
813 central_phi = 10. + (Double_t)20. * (n1EBSM - 1);
816 central_phi = 10. + (Double_t)20. * (n1EBSM - 19);
825 Double_t phi_in_SM = (Double_t)0.;
829 if (n1EBSM >= 1 && n1EBSM <= fEcal->MaxSMInEB()) {
830 if (rest_temp == 1) {
831 phi_in_SM = (Double_t)15.;
833 if (rest_temp == 2) {
834 phi_in_SM = (Double_t)10.;
836 if (rest_temp == 3) {
837 phi_in_SM = (Double_t)5.;
839 if (rest_temp == 0) {
840 phi_in_SM = (Double_t)0.;
844 if (i0TowEcha == 4 || i0TowEcha == 5 || i0TowEcha == 14 || i0TowEcha == 15 || i0TowEcha == 24) {
845 phi_in_SM = phi_in_SM + 0;
848 if (i0TowEcha == 3 || i0TowEcha == 6 || i0TowEcha == 13 || i0TowEcha == 16 || i0TowEcha == 23) {
849 phi_in_SM = phi_in_SM + 1;
852 if (i0TowEcha == 2 || i0TowEcha == 7 || i0TowEcha == 12 || i0TowEcha == 17 || i0TowEcha == 22) {
853 phi_in_SM = phi_in_SM + 2;
856 if (i0TowEcha == 1 || i0TowEcha == 8 || i0TowEcha == 11 || i0TowEcha == 18 || i0TowEcha == 21) {
857 phi_in_SM = phi_in_SM + 3;
860 if (i0TowEcha == 0 || i0TowEcha == 9 || i0TowEcha == 10 || i0TowEcha == 19 || i0TowEcha == 20) {
861 phi_in_SM = phi_in_SM + 4;
865 if (i0TowEcha == 20 || i0TowEcha == 19 || i0TowEcha == 10 || i0TowEcha == 9 || i0TowEcha == 0) {
866 phi_in_SM = phi_in_SM + 0;
869 if (i0TowEcha == 21 || i0TowEcha == 18 || i0TowEcha == 11 || i0TowEcha == 8 || i0TowEcha == 1) {
870 phi_in_SM = phi_in_SM + 1;
873 if (i0TowEcha == 22 || i0TowEcha == 17 || i0TowEcha == 12 || i0TowEcha == 7 || i0TowEcha == 2) {
874 phi_in_SM = phi_in_SM + 2;
877 if (i0TowEcha == 23 || i0TowEcha == 16 || i0TowEcha == 13 || i0TowEcha == 6 || i0TowEcha == 3) {
878 phi_in_SM = phi_in_SM + 3;
881 if (i0TowEcha == 24 || i0TowEcha == 15 || i0TowEcha == 14 || i0TowEcha == 5 || i0TowEcha == 4) {
882 phi_in_SM = phi_in_SM + 4;
886 std::cout <<
"TEcnaNumbering::GetPhiInSM(...)> SM = " << n1EBSM <<
". Out of range (range = [1,"
889 phi_in_SM = 20 - phi_in_SM;
896 Double_t
phi = (Double_t)0.;
898 if (n1EBSM >= 1 && n1EBSM <= fEcal->MaxSMInEB()) {
899 Double_t phiInSM =
GetPhiInSM(n1EBSM, n1SMTow, i0TowEcha);
902 phi = 20 - phiInSM + phi_start - (Double_t)10.;
904 std::cout <<
"TEcnaNumbering::GetPhi(...)> SM = " << n1EBSM <<
". Out of range (range = [1," <<
fEcal->
MaxSMInEB()
905 <<
"])" <<
fTTBELL << std::endl;
916 Double_t phi_min = (Double_t)0.;
919 Int_t rest_temp = (Int_t)(n1SMTow % (max_crys_phi_in_tower - 1));
922 if (rest_temp == 1) {
923 phi_min = phi_start + (Double_t)5.;
925 if (rest_temp == 2) {
926 phi_min = phi_start + (Double_t)0.;
928 if (rest_temp == 3) {
929 phi_min = phi_start - (Double_t)5.;
931 if (rest_temp == 0) {
932 phi_min = phi_start - (Double_t)10.;
936 if (rest_temp == 0) {
937 phi_min = phi_start + (Double_t)5.;
939 if (rest_temp == 3) {
940 phi_min = phi_start + (Double_t)0.;
942 if (rest_temp == 2) {
943 phi_min = phi_start - (Double_t)5.;
945 if (rest_temp == 1) {
946 phi_min = phi_start - (Double_t)10.;
957 Double_t phi_max = (Double_t)20.;
960 Int_t rest_temp = (Int_t)(n1SMTow % (max_crys_phi_in_tower - 1));
963 if (rest_temp == 1) {
964 phi_max = phi_start + (Double_t)10.;
966 if (rest_temp == 2) {
967 phi_max = phi_start + (Double_t)5.;
969 if (rest_temp == 3) {
970 phi_max = phi_start - (Double_t)0.;
972 if (rest_temp == 0) {
973 phi_max = phi_start - (Double_t)5.;
978 if (rest_temp == 0) {
979 phi_max = phi_start + (Double_t)10.;
981 if (rest_temp == 3) {
982 phi_max = phi_start + (Double_t)5.;
984 if (rest_temp == 2) {
985 phi_max = phi_start - (Double_t)0.;
987 if (rest_temp == 1) {
988 phi_max = phi_start - (Double_t)5.;
1014 Double_t j_phi_min = (Double_t)1.;
1016 Int_t rest_temp = (Int_t)(n1SMTow % (max_crys_phi_in_tower - 1));
1018 if (rest_temp == 1) {
1019 j_phi_min = (Double_t)1. - (Double_t)0.5;
1021 if (rest_temp == 2) {
1022 j_phi_min = (Double_t)6. - (Double_t)0.5;
1024 if (rest_temp == 3) {
1025 j_phi_min = (Double_t)11. - (Double_t)0.5;
1027 if (rest_temp == 0) {
1028 j_phi_min = (Double_t)16. - (Double_t)0.5;
1037 Double_t j_phi_max = (Double_t)20.;
1039 Int_t rest_temp = (Int_t)(n1SMTow % (max_crys_phi_in_tower - 1));
1041 if (rest_temp == 1) {
1042 j_phi_max = (Double_t)5. + (Double_t)0.5;
1044 if (rest_temp == 2) {
1045 j_phi_max = (Double_t)10. + (Double_t)0.5;
1047 if (rest_temp == 3) {
1048 j_phi_max = (Double_t)15. + (Double_t)0.5;
1050 if (rest_temp == 0) {
1051 j_phi_max = (Double_t)20. + (Double_t)0.5;
1061 Double_t j_phi_min = (Double_t)1. - (Double_t)0.5;
1069 Double_t j_phi_max = (Double_t)20. + (Double_t)0.5;
1082 TString xdirection =
"x";
1095 TString ydirection =
"-x";
1109 TString jydirection =
"-x";
1125 TString
type =
"EB-";
1127 if (SMNumber >= 1 && SMNumber <= fEcal->MaxSMInEBPlus()) {
1138 Int_t PMSMNumber = PlusSMNumber;
1181 Int_t MaxDirections = 2;
1188 fT1dDeeCrys =
new Int_t[MaxDeeSC * MaxSCEcha * MaxDirections];
1191 for (Int_t i_DeeSC = 0; i_DeeSC < MaxDeeSC; i_DeeSC++) {
1193 for (Int_t i_SCEcha = 0; i_SCEcha < MaxSCEcha; i_SCEcha++) {
1195 &
fT1dDeeCrys[0] + (i_DeeSC * MaxSCEcha + i_SCEcha) * MaxDirections;
1198 for (Int_t
i = 0;
i < MaxDeeSC;
i++) {
1199 for (Int_t
j = 0;
j < MaxSCEcha;
j++) {
1200 for (Int_t
k = 0;
k < MaxDirections;
k++) {
1208 fT1dDeeSC =
new Int_t[MaxDeeCrys * MaxDirections];
1210 for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxDeeCrys; i_DeeCrys++) {
1213 for (Int_t
i = 0;
i < MaxDeeCrys;
i++) {
1214 for (Int_t
j = 0;
j < MaxDirections;
j++) {
1221 fT1dSCEcha =
new Int_t[MaxDeeCrys * MaxDirections];
1223 for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxDeeCrys; i_DeeCrys++) {
1226 for (Int_t
i = 0;
i < MaxDeeCrys;
i++) {
1227 for (Int_t
j = 0;
j < MaxDirections;
j++) {
1233 Int_t MaxTyp = (Int_t)4;
1241 for (Int_t i_MaxTyp = 0; i_MaxTyp < MaxTyp; i_MaxTyp++) {
1248 for (Int_t
k = 5;
k >= 1;
k--) {
1251 for (Int_t
k = 10;
k >= 6;
k--) {
1254 for (Int_t
k = 15;
k >= 11;
k--) {
1257 for (Int_t
k = 20;
k >= 16;
k--) {
1260 for (Int_t
k = 25;
k >= 21;
k--) {
1264 for (Int_t
k = 5;
k >= 1;
k--) {
1267 for (Int_t
k = 10;
k >= 6;
k--) {
1270 for (Int_t
k = 15;
k >= 11;
k--) {
1273 for (Int_t
k = 20;
k >= 16;
k--) {
1276 for (Int_t
k = 25;
k >= 21;
k--) {
1280 for (Int_t
k = 1;
k <= 5;
k++) {
1283 for (Int_t
k = 6;
k <= 10;
k++) {
1286 for (Int_t
k = 11;
k <= 15;
k++) {
1289 for (Int_t
k = 16;
k <= 20;
k++) {
1292 for (Int_t
k = 21;
k <= 25;
k++) {
1296 for (Int_t
k = 1;
k <= 5;
k++) {
1299 for (Int_t
k = 6;
k <= 10;
k++) {
1302 for (Int_t
k = 11;
k <= 15;
k++) {
1305 for (Int_t
k = 16;
k <= 20;
k++) {
1308 for (Int_t
k = 21;
k <= 25;
k++) {
1317 for (Int_t i_MaxTyp = 0; i_MaxTyp < MaxTyp; i_MaxTyp++) {
1322 for (Int_t
k = 5;
k >= 1;
k--) {
1325 for (Int_t
k = 10;
k >= 6;
k--) {
1328 for (Int_t
k = 15;
k >= 11;
k--) {
1331 for (Int_t
k = 20;
k >= 16;
k--) {
1334 for (Int_t
k = 25;
k >= 21;
k--) {
1338 for (Int_t
k = 5;
k >= 1;
k--) {
1341 for (Int_t
k = 10;
k >= 6;
k--) {
1344 for (Int_t
k = 15;
k >= 11;
k--) {
1347 for (Int_t
k = 20;
k >= 16;
k--) {
1350 for (Int_t
k = 25;
k >= 21;
k--) {
1354 for (Int_t
k = 1;
k <= 5;
k++) {
1357 for (Int_t
k = 6;
k <= 10;
k++) {
1360 for (Int_t
k = 11;
k <= 15;
k++) {
1363 for (Int_t
k = 16;
k <= 20;
k++) {
1366 for (Int_t
k = 21;
k <= 25;
k++) {
1370 for (Int_t
k = 1;
k <= 5;
k++) {
1373 for (Int_t
k = 6;
k <= 10;
k++) {
1376 for (Int_t
k = 11;
k <= 15;
k++) {
1379 for (Int_t
k = 16;
k <= 20;
k++) {
1382 for (Int_t
k = 21;
k <= 25;
k++) {
1388 Int_t**
type =
new Int_t*[Nb_DeeSC_JY];
1390 Int_t* type_d1 =
new Int_t[Nb_DeeSC_JY * MaxDirections];
1392 for (Int_t i_DeeSC_JY = 0; i_DeeSC_JY < Nb_DeeSC_JY; i_DeeSC_JY++) {
1393 type[i_DeeSC_JY] = &type_d1[0] + i_DeeSC_JY * MaxDirections;
1447 for (Int_t kSC = 0; kSC < MaxDeeSC; kSC++)
1449 for (Int_t n_Echa = 1; n_Echa <= MaxSCEcha; n_Echa++)
1451 for (Int_t idir = 0; idir < 2; idir++) {
1452 Int_t ikSC = kSC / Nb_DeeSC_JY;
1453 Int_t jkSC = kSC % Nb_DeeSC_JY;
1455 Int_t icrys = ikSC * Nb_SCCrys_IX +
fT2d_ich_IX[
type[jkSC][idir]][n_Echa];
1460 Int_t jcrys = jkSC * Nb_SCCrys_JY +
fT2d_jch_JY[
type[jkSC][idir]][n_Echa];
1465 Int_t n_DeeCrys = icrys * Nb_DeeSC_JY * Nb_SCCrys_JY + jcrys + 1;
1468 fT2dDeeSC[n_DeeCrys - 1][idir] = kSC + 1;
1506 fT2d_DS =
new Int_t*[MaxEEDee];
1508 fT1d_DS =
new Int_t[MaxEEDee * MaxDeeSC];
1510 for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxEEDee; i_DeeCrys++) {
1513 for (Int_t
i = 0;
i < MaxEEDee;
i++) {
1514 for (Int_t
j = 0;
j < MaxDeeSC;
j++) {
1521 fT1d_DSSC =
new Int_t[MaxEEDee * MaxDeeSC];
1523 for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxEEDee; i_DeeCrys++) {
1526 for (Int_t
i = 0;
i < MaxEEDee;
i++) {
1527 for (Int_t
j = 0;
j < MaxDeeSC;
j++) {
1536 for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxEEDee; i_DeeCrys++) {
1539 for (Int_t
i = 0;
i < MaxEEDee;
i++) {
1540 for (Int_t
j = 0;
j < MaxDeeSC;
j++) {
1549 for (Int_t i_DeeCrys = 0; i_DeeCrys < MaxEEDee; i_DeeCrys++) {
1552 for (Int_t
i = 0;
i < MaxEEDee;
i++) {
1553 for (Int_t
j = 0;
j < MaxEESCForCons;
j++) {
1564 for (Int_t dee = 1; dee <= 4; dee++) {
1565 if (dee == 1 || dee == 4) {
1568 if (dee == 2 || dee == 3) {
1571 for (Int_t isc = 13; isc <= 20; isc++)
1572 fT2d_DS[dee - 1][isc - 1] = ids;
1573 for (Int_t isc = 33; isc <= 40; isc++)
1574 fT2d_DS[dee - 1][isc - 1] = ids;
1575 for (Int_t isc = 54; isc <= 60; isc++)
1576 fT2d_DS[dee - 1][isc - 1] = ids;
1577 for (Int_t isc = 75; isc <= 79; isc++)
1578 fT2d_DS[dee - 1][isc - 1] = ids;
1579 for (Int_t isc = 96; isc <= 99; isc++)
1580 fT2d_DS[dee - 1][isc - 1] = ids;
1581 for (Int_t isc = 118; isc <= 119; isc++)
1582 fT2d_DS[dee - 1][isc - 1] = ids;
1585 for (Int_t dee = 1; dee <= 4; dee++) {
1586 if (dee == 1 || dee == 4) {
1589 if (dee == 2 || dee == 3) {
1592 for (Int_t isc = 32; isc <= 32; isc++)
1593 fT2d_DS[dee - 1][isc - 1] = ids;
1594 for (Int_t isc = 51; isc <= 53; isc++)
1595 fT2d_DS[dee - 1][isc - 1] = ids;
1596 for (Int_t isc = 72; isc <= 74; isc++)
1597 fT2d_DS[dee - 1][isc - 1] = ids;
1598 for (Int_t isc = 92; isc <= 95; isc++)
1599 fT2d_DS[dee - 1][isc - 1] = ids;
1600 for (Int_t isc = 112; isc <= 117; isc++)
1601 fT2d_DS[dee - 1][isc - 1] = ids;
1602 for (Int_t isc = 132; isc <= 138; isc++)
1603 fT2d_DS[dee - 1][isc - 1] = ids;
1604 for (Int_t isc = 152; isc <= 157; isc++)
1605 fT2d_DS[dee - 1][isc - 1] = ids;
1606 for (Int_t isc = 173; isc <= 176; isc++)
1607 fT2d_DS[dee - 1][isc - 1] = ids;
1608 for (Int_t isc = 193; isc <= 193; isc++)
1609 fT2d_DS[dee - 1][isc - 1] = ids;
1612 for (Int_t dee = 1; dee <= 4; dee++) {
1613 if (dee == 1 || dee == 4) {
1616 if (dee == 2 || dee == 3) {
1619 for (Int_t isc = 50; isc <= 50; isc++)
1620 fT2d_DS[dee - 1][isc - 1] = ids;
1621 for (Int_t isc = 69; isc <= 71; isc++)
1622 fT2d_DS[dee - 1][isc - 1] = ids;
1623 for (Int_t isc = 88; isc <= 91; isc++)
1624 fT2d_DS[dee - 1][isc - 1] = ids;
1625 for (Int_t isc = 108; isc <= 111; isc++)
1626 fT2d_DS[dee - 1][isc - 1] = ids;
1627 for (Int_t isc = 127; isc <= 131; isc++)
1628 fT2d_DS[dee - 1][isc - 1] = ids;
1629 for (Int_t isc = 147; isc <= 151; isc++)
1630 fT2d_DS[dee - 1][isc - 1] = ids;
1631 for (Int_t isc = 166; isc <= 172; isc++)
1632 fT2d_DS[dee - 1][isc - 1] = ids;
1633 for (Int_t isc = 188; isc <= 192; isc++)
1634 fT2d_DS[dee - 1][isc - 1] = ids;
1637 for (Int_t dee = 1; dee <= 4; dee++) {
1638 if (dee == 1 || dee == 4) {
1641 if (dee == 2 || dee == 3) {
1644 for (Int_t isc = 27; isc <= 29; isc++)
1645 fT2d_DS[dee - 1][isc - 1] = ids;
1646 for (Int_t isc = 44; isc <= 49; isc++)
1647 fT2d_DS[dee - 1][isc - 1] = ids;
1648 for (Int_t isc = 62; isc <= 68; isc++)
1649 fT2d_DS[dee - 1][isc - 1] = ids;
1650 for (Int_t isc = 82; isc <= 87; isc++)
1651 fT2d_DS[dee - 1][isc - 1] = ids;
1652 for (Int_t isc = 102; isc <= 107; isc++)
1653 fT2d_DS[dee - 1][isc - 1] = ids;
1654 for (Int_t isc = 123; isc <= 126; isc++)
1655 fT2d_DS[dee - 1][isc - 1] = ids;
1656 for (Int_t isc = 144; isc <= 146; isc++)
1657 fT2d_DS[dee - 1][isc - 1] = ids;
1658 for (Int_t isc = 165; isc <= 165; isc++)
1659 fT2d_DS[dee - 1][isc - 1] = ids;
1662 for (Int_t dee = 1; dee <= 4; dee++) {
1663 for (Int_t isc = 1; isc <= 8; isc++)
1664 fT2d_DS[dee - 1][isc - 1] = 5;
1665 for (Int_t isc = 21; isc <= 26; isc++)
1666 fT2d_DS[dee - 1][isc - 1] = 5;
1667 for (Int_t isc = 41; isc <= 43; isc++)
1668 fT2d_DS[dee - 1][isc - 1] = 5;
1673 for (Int_t dee = 1; dee <= 4; dee++) {
1674 for (Int_t isc = 1; isc <= MaxDeeSC; isc++) {
1852 if (dee == 1 || dee == 3) {
1874 if (dee == 2 || dee == 4) {
1900 for (Int_t dee = 1; dee <= 4; dee++) {
1901 for (Int_t isc = 1; isc <= MaxDeeSC; isc++) {
1906 for (Int_t i_dee_type = 1; i_dee_type <= 2; i_dee_type++) {
1908 if (i_dee_type == 1) {
1911 if (i_dee_type == 2) {
2274 for (Int_t i0EEDee = 0; i0EEDee < MaxEEDee; i0EEDee++) {
2275 for (Int_t i_ecna = 0; i_ecna < MaxDeeSC; i_ecna++) {
2293 const Int_t& i0SCEcha,
2294 const TString& sDeeDir) {
2298 Int_t n1DeeCrys = 0;
2305 if ((n1DeeSCEcna >= 1) && (n1DeeSCEcna <= fEcal->MaxSCEcnaInDee())) {
2306 if (i0SCEcha >= 0 && i0SCEcha < fEcal->MaxCrysInSC()) {
2307 n1DeeCrys =
fT3dDeeCrys[n1DeeSCEcna - 1][i0SCEcha][i0DeeDir];
2310 std::cout <<
"!TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(...)> Electronic Channel in SuperCrystal = "
2316 std::cout <<
"!TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(...)> Super-Crystal number in Dee out of range."
2317 <<
" n1DeeSCEcna = " << n1DeeSCEcna <<
fTTBELL << std::endl;
2332 Int_t n1SCEcha = -1;
2335 if (n1DeeCrys >= 1 && n1DeeCrys <= fEcal->MaxCrysEcnaInDee()) {
2336 n1SCEcha =
fT2dSCEcha[n1DeeCrys - 1][iDeeDir];
2339 std::cout <<
"!TEcnaNumbering::Get1SCEchaFrom1DeeCrys(...)> Crystal number in Dee out of range."
2348 Int_t n1DeeSCEcna = 0;
2351 if (n1DeeCrys >= 1 && n1DeeCrys <= fEcal->MaxCrysEcnaInDee()) {
2352 n1DeeSCEcna =
fT2dDeeSC[n1DeeCrys - 1][iDeeDir];
2355 std::cout <<
"!TEcnaNumbering::Get1DeeSCEcnaFrom1DeeCrys(...)> Crystal number in Dee out of range."
2399 Int_t data_sector = -1;
2401 if (n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE()) {
2402 if (n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee()) {
2403 data_sector =
fT2d_DS[n1DeeNumber - 1][n1DeeSCEcna - 1];
2405 std::cout <<
"!TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> n1DeeSCEcna = " << n1DeeSCEcna
2409 if (n1DeeNumber != 0) {
2410 std::cout <<
"!TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
2413 std::cout <<
"TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber <<
". Out of range (range = [1,"
2424 if (n1DeeSCEcna == 29 || n1DeeSCEcna == 32) {
2425 if (n1SCEcha == 11) {
2430 if (n1SCEcha == 1 || n1SCEcha == 2 || n1SCEcha == 3 || n1SCEcha == 6 || n1SCEcha == 7) {
2444 if (n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE()) {
2445 if (n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee()) {
2446 ds_sc =
fT2d_DSSC[n1DeeNumber - 1][n1DeeSCEcna - 1];
2449 std::cout <<
"!TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> n1DeeSCEcna = " << n1DeeSCEcna
2453 if (n1DeeNumber != 0) {
2454 std::cout <<
"!TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
2457 std::cout <<
"TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber <<
". Out of range (range = [1,"
2467 Int_t dee_sc_cons = -1;
2469 if (n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE()) {
2470 if (n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee()) {
2473 std::cout <<
"!TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> *** WARNING *** n1DeeSCEcna = " << n1DeeSCEcna
2474 <<
". Out of range ( range = [1," <<
fEcal->
MaxSCEcnaInDee() <<
"] ). Nb for const. forced to "
2479 if (n1DeeNumber != 0) {
2480 std::cout <<
"!TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
2483 std::cout <<
"TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
2491 const Int_t& n1DeeSCEcna,
2492 const Int_t& n1SCEcha) {
2496 if (n1DeeSCEcna == 29 || n1DeeSCEcna == 32) {
2497 if (n1SCEcha == 11) {
2498 if (dee_sc_cons == 261) {
2501 if (dee_sc_cons == 112) {
2505 if (n1SCEcha == 1 || n1SCEcha == 2 || n1SCEcha == 3 || n1SCEcha == 6 || n1SCEcha == 7) {
2506 if (dee_sc_cons == 178) {
2509 if (dee_sc_cons == 29) {
2520 Int_t dee_sc_ecna = -1;
2522 if (n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE()) {
2523 Int_t off_set_cons = 0;
2524 if (n1DeeNumber == 1 || n1DeeNumber == 3) {
2528 if (DeeSCCons > off_set_cons && DeeSCCons <= fEcal->MaxSCForConsInDee() + off_set_cons) {
2531 std::cout <<
"!TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> DeeSCCons = " << DeeSCCons
2533 <<
"] )" <<
fTTBELL << std::endl;
2536 if (n1DeeNumber != 0) {
2537 std::cout <<
"!TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> n1DeeNumber = " << n1DeeNumber
2540 std::cout <<
"TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> Dee = " << n1DeeNumber
2550 TString SCType =
"Connected";
2552 if (nb_for_cons == 182 || nb_for_cons == 33) {
2553 SCType =
"NotConnected";
2556 if (nb_for_cons == 178 || nb_for_cons == 29) {
2557 SCType =
"NotConnected";
2559 if (nb_for_cons == 207 || nb_for_cons == 58) {
2560 SCType =
"NotConnected";
2563 if (nb_for_cons == 298 || nb_for_cons == 149) {
2564 SCType =
"NotConnected";
2567 if (nb_for_cons == 261 || nb_for_cons == 112) {
2568 SCType =
"NotConnected";
2570 if (nb_for_cons == 268 || nb_for_cons == 119) {
2571 SCType =
"NotConnected";
2574 if (nb_for_cons == 281 || nb_for_cons == 132) {
2575 SCType =
"NotConnected";
2578 if (nb_for_cons == 161 || nb_for_cons == 12) {
2579 SCType =
"NotComplete";
2581 if (nb_for_cons == 216 || nb_for_cons == 67) {
2582 SCType =
"NotComplete";
2584 if (nb_for_cons == 224 || nb_for_cons == 75) {
2585 SCType =
"NotComplete";
2587 if (nb_for_cons == 286 || nb_for_cons == 137) {
2588 SCType =
"NotComplete";
2609 TString SCQuad =
"top";
2611 if (n1DeeSCEcna >= 1 && n1DeeSCEcna <= 10) {
2614 if (n1DeeSCEcna >= 21 && n1DeeSCEcna <= 30) {
2617 if (n1DeeSCEcna >= 41 && n1DeeSCEcna <= 50) {
2620 if (n1DeeSCEcna >= 61 && n1DeeSCEcna <= 70) {
2623 if (n1DeeSCEcna >= 81 && n1DeeSCEcna <= 90) {
2626 if (n1DeeSCEcna >= 101 && n1DeeSCEcna <= 110) {
2629 if (n1DeeSCEcna >= 121 && n1DeeSCEcna <= 130) {
2632 if (n1DeeSCEcna >= 141 && n1DeeSCEcna <= 150) {
2635 if (n1DeeSCEcna >= 161 && n1DeeSCEcna <= 170) {
2638 if (n1DeeSCEcna >= 181 && n1DeeSCEcna <= 190) {
2649 if (SCQuadType ==
"top" && sDeeDir ==
"right") {
2652 if (SCQuadType ==
"top" && sDeeDir ==
"left") {
2655 if (SCQuadType ==
"bottom" && sDeeDir ==
"left") {
2658 if (SCQuadType ==
"bottom" && sDeeDir ==
"right") {
2671 TString eetype =
"EE+";
2672 if (n1DeeNumber == 1 || n1DeeNumber == 2) {
2675 if (n1DeeNumber == 3 || n1DeeNumber == 4) {
2683 TString
type =
"EE+F";
2684 if (n1DeeNumber == 1) {
2687 if (n1DeeNumber == 2) {
2690 if (n1DeeNumber == 3) {
2693 if (n1DeeNumber == 4) {
2703 TString sDeeDir =
"right";
2704 if ((n1DeeNumber == 1) || (n1DeeNumber == 3)) {
2707 if ((n1DeeNumber == 2) || (n1DeeNumber == 4)) {
2717 if (sDeeDir ==
"right") {
2720 if (sDeeDir ==
"left") {
2739 Int_t IXCrysInSC =
fT2d_ich_IX[type_index][i0SCEcha + 1] + 1;
2763 Int_t JYCrysInSC =
fT2d_jch_JY[type_index][i0SCEcha + 1] + 1;
2784 Int_t nb_of_sc = -1;
2785 if (DeeDS == 1 || DeeDS == 9) {
2788 if (DeeDS == 2 || DeeDS == 8) {
2791 if (DeeDS == 3 || DeeDS == 7) {
2794 if (DeeDS == 4 || DeeDS == 6) {
2825 Double_t i_IX_min = (Int_t)1.;
2845 if (IY_DeeSC == 0.) {
2858 if (IY_DeeSC == 0) {
2871 Double_t j_IY_min = (Double_t)1.;
2887 TString
type =
"EE-";
2889 if (n1DeeNumber == 1 || n1DeeNumber == 2) {
2892 if (n1DeeNumber == 3 || n1DeeNumber == 4) {
2904 TString xdirection =
"x";
2923 TString ydirection =
"-x";
2937 TString jydirection =
"x";
2958 Int_t n1StexStin = 0;
2974 Int_t StexEcha = (Int_t)(-1.);
2976 if (n1StexStin > 0 && n1StexStin <= fEcal->MaxStinEcnaInStex() && i0StinEcha >= 0 &&
2980 std::cout <<
"!TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha *** ERROR ***> VALUE"
2981 <<
" OUT OF RANGE. Forced to -1. Argument values: n1StexStin = " << n1StexStin
2982 <<
", channel = " << i0StinEcha <<
fTTBELL << std::endl;
2987 const Int_t& i0StinEcha,
2988 const Int_t& StexNumber) {
2993 Int_t n1StexCrys = (Int_t)0;
3011 Double_t IHocoMin = (Double_t)0.;
3022 Double_t IHocoMax = (Double_t)0.;
3033 Double_t IVecoMin = (Double_t)0.;
3044 Double_t IVecoMax = (Double_t)0.;
3055 Double_t JVecoMin = (Double_t)0.;
3065 Double_t JVecoMax = (Double_t)0.;
3080 TString half_stas =
"EB? EE?";
3097 Int_t EBSMNumber = 0;
3098 if (FEDNumber >= 610 && FEDNumber <= 645) {
3099 EBSMNumber = FEDNumber - 609;
3105 Int_t EEDSNumber = 0;
3107 if (FEDNumber >= 600 && FEDNumber <= 609) {
3108 EEDSNumber = FEDNumber - 599;
3110 if (FEDNumber >= 646 && FEDNumber <= 655) {
3111 EEDSNumber = FEDNumber - 645;
3130 if (n_for_cons == 12 || n_for_cons == 67 || n_for_cons == 75 || n_for_cons == 137 || n_for_cons == 161 ||
3131 n_for_cons == 216 || n_for_cons == 224 || n_for_cons == 286) {
3136 if ((n_for_cons == 182 || n_for_cons == 33) && (n1DeeSCEcna == 60 || n1DeeSCEcna == 119)) {
3140 if ((n_for_cons == 178 || n_for_cons == 29) && (n1DeeSCEcna == 138 || n1DeeSCEcna == 157)) {
3143 if ((n_for_cons == 207 || n_for_cons == 58) && (n1DeeSCEcna == 176 || n1DeeSCEcna == 193)) {
3147 if ((n_for_cons == 298 || n_for_cons == 149) && (n1DeeSCEcna == 188)) {
3151 if ((n_for_cons == 261 || n_for_cons == 112) && (n1DeeSCEcna == 144 || n1DeeSCEcna == 165)) {
3154 if ((n_for_cons == 268 || n_for_cons == 119) && (n1DeeSCEcna == 102 || n1DeeSCEcna == 123)) {
3158 if ((n_for_cons == 281 || n_for_cons == 132) && (n1DeeSCEcna == 41)) {
3163 if (s_option ==
"TEcnaRun" || s_option ==
"TEcnaRead") {
3164 if (s_option ==
"TEcnaRun") {
3166 if (n1DeeSCEcna == 29 || n1DeeSCEcna == 32) {
3169 if (n1DeeSCEcna == 10 || n1DeeSCEcna == 11) {
3173 if (s_option ==
"TEcnaRead") {
3175 if (n1DeeSCEcna == 29 || n1DeeSCEcna == 32) {
3178 if (n1DeeSCEcna == 10 || n1DeeSCEcna == 11) {
3183 std::cout <<
"!TEcnaNumbering::MaxCrysInStinEcna(...)> " << s_option <<
": unknown option." <<
fTTBELL