48 Long_t i_this = (Long_t)
this;
225 for(Int_t i_SMTow = 0 ; i_SMTow < MaxSMTow ; i_SMTow++){
227 for(Int_t
i=0;
i<MaxSMTow;
i++)
238 Int_t m26 = (Int_t)26;
241 Int_t** jch_type =
new Int_t*[m2];
fCnew++;
242 Int_t* jch_type_d1 =
new Int_t[m2*m26];
fCnew++;
243 for(Int_t i_m2 = 0 ; i_m2 < m2 ; i_m2++){
244 jch_type[i_m2] = &jch_type_d1[0] + i_m2*m26;}
246 for(Int_t
k=25;
k>=21;
k--){jch_type[0][
k] = 25-
k;}
247 for(Int_t
k=16;
k<=20;
k++){jch_type[0][
k] =
k-16;}
248 for(Int_t
k=15;
k>=11;
k--){jch_type[0][
k] = 15-
k;}
249 for(Int_t
k=6;
k<=10;
k++){jch_type[0][
k] =
k-6;}
250 for(Int_t
k=5;
k>=1;
k--){jch_type[0][
k] = 5-
k;}
252 for(Int_t
k=1;
k<=5;
k++){jch_type[1][
k] =
k-1;}
253 for(Int_t
k=10;
k>=6;
k--){jch_type[1][
k] = 10-
k;}
254 for(Int_t
k=11;
k<=15;
k++){jch_type[1][
k] =
k-11;}
255 for(Int_t
k=20;
k>=16;
k--){jch_type[1][
k] = 20-
k;}
256 for(Int_t
k=21;
k<=25;
k++){jch_type[1][
k] =
k-21;}
259 Int_t** ich_type =
new Int_t*[m2];
fCnew++;
260 Int_t* ich_type_d1 =
new Int_t[m2*m26];
fCnew++;
261 for(Int_t i_m2 = 0 ; i_m2 < m2 ; i_m2++){
262 ich_type[i_m2] = &ich_type_d1[0] + i_m2*m26;}
264 for(Int_t
k=25;
k>=21;
k--){ich_type[0][
k] = 0;}
265 for(Int_t
k=16;
k<=20;
k++){ich_type[0][
k] = 1;}
266 for(Int_t
k=15;
k>=11;
k--){ich_type[0][
k] = 2;}
267 for(Int_t
k=6;
k<=10;
k++){ich_type[0][
k] = 3;}
268 for(Int_t
k=5;
k>=1;
k--){ich_type[0][
k] = 4;}
270 for(Int_t
k=1;
k<=5;
k++){ich_type[1][
k] = 0;}
271 for(Int_t
k=10;
k>=6;
k--){ich_type[1][
k] = 1;}
272 for(Int_t
k=11;
k<=15;
k++){ich_type[1][
k] = 2;}
273 for(Int_t
k=20;
k>=16;
k--){ich_type[1][
k] = 3;}
274 for(Int_t
k=21;
k<=25;
k++){ich_type[1][
k] = 4;}
302 for(Int_t tow=0; tow<MaxSMTow; tow++)
304 for(Int_t ic=1; ic<=MaxTowEcha; ic++)
306 Int_t jtow = tow % 4;
307 Int_t itow = tow / 4;
309 Int_t icrys = itow*5 + ich_type[type[itow]][ic];
313 Int_t jcrys = jtow*5 + jch_type[type[itow]][ic];
317 Int_t n1SMCrys = icrys*20+jcrys+1;
345 const Int_t& i0TowEcha)
354 if (n1SMTow >= 1 && n1SMTow <= fEcal->MaxTowInSM())
356 if (i0TowEcha >=0 && i0TowEcha < fEcal->MaxCrysInTow())
363 std::cout <<
"!TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(...)> Electronic Channel in Tower out of range." 364 <<
" i0TowEcha = " << i0TowEcha <<
"(n1SMTow = " << n1SMTow <<
")" <<
fTTBELL << std::endl;
370 std::cout <<
"!TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(...)> Tower number in SM out of range." 371 <<
" n1SMTow = " << n1SMTow <<
"(i0TowEcha = " << i0TowEcha <<
")" <<
fTTBELL << std::endl;
387 Int_t i0TowEcha = -1;
389 if( n1SMCrys >= 1 && n1SMCrys <= fEcal->MaxCrysInSM() )
396 std::cout <<
"!TEcnaNumbering::Get0TowEchaFrom1SMCrys(...)> Crystal number in SM out of range." 397 <<
" n1SMCrys = " << n1SMCrys <<
fTTBELL << std::endl;
408 if( n1SMCrys >= 1 && n1SMCrys <= fEcal->MaxCrysInSM() )
415 std::cout <<
"!TEcnaNumbering::Get1SMTowFrom1SMCrys(...)> Crystal number in SM out of range." 416 <<
" n1SMCrys = " << n1SMCrys <<
fTTBELL << std::endl;
464 if( IEta > 0 ){Hashed = (85 + IEta - 1)*360 + IPhi - 1;}
465 if( IEta < 0 ){Hashed = (85 + IEta)*360 + IPhi - 1;}
482 Int_t IPhi = Hashed%360 + 1;
516 const Int_t& i0TowEcha)
520 Double_t
eta = (Double_t)0.;
526 if ( n1EBSM >= 1 && n1EBSM <= max_sm_in_barrel )
528 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++)
530 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta*(max_crys_eta_in_tower-1));
531 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta+1)*(max_crys_eta_in_tower-1));
532 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta*max_crys_eta_in_tower);
534 Double_t d_echa_eta = (Double_t)(i0TowEcha/max_crys_eta_in_tower);
536 if ( n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max )
539 {eta = (Double_t)(i_crys_eta) + d_echa_eta + 1;}
541 {eta = (Double_t)(i_crys_eta+max_crys_eta_in_tower)-d_echa_eta;}
548 std::cout <<
"TEcnaNumbering::GetEta(...)> SM = " << n1EBSM
562 Double_t
eta_min = (Double_t)0.;
564 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++)
566 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta*(max_crys_eta_in_tower-1));
567 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta+1)*(max_crys_eta_in_tower-1));
568 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta*max_crys_eta_in_tower);
570 if ( n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max )
573 {eta_min = (Double_t)i_crys_eta;}
575 {eta_min = -(Double_t)(i_crys_eta + max_crys_eta_in_tower);}
588 Double_t
eta_max = (max_crys_eta_in_tower-1);
590 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++)
592 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta*(max_crys_eta_in_tower-1));
593 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta+1)*(max_crys_eta_in_tower-1));
594 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta*max_crys_eta_in_tower);
596 if ( n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max )
599 {eta_max = (Double_t)(i_crys_eta + max_crys_eta_in_tower);}
601 {eta_max = -(Double_t)i_crys_eta;}
612 Double_t i_eta_min = (Int_t)0.;
615 {i_eta_min = (Double_t)
GetEtaMin(n1EBSM, n1SMTow)+(Double_t)0.5;}
617 {i_eta_min = (Double_t)
GetEtaMin(n1EBSM, n1SMTow)-(Double_t)0.5;}
626 Double_t i_eta_max = (Int_t)0.;
629 {i_eta_max = (Double_t)
GetEtaMax(n1EBSM, n1SMTow)+(Double_t)0.5;}
631 {i_eta_max = (Double_t)
GetEtaMax(n1EBSM, n1SMTow)-(Double_t)0.5;}
640 Double_t i_eta_min = (Int_t)0.;
642 Int_t n1SMTowPlus = (Int_t)1;
646 {i_eta_min = (Double_t)
GetIEtaMin(n1EBSM, n1SMTowPlus );}
648 {i_eta_min = (Double_t)
GetIEtaMin(n1EBSM, n1SMTowMinus);}
657 Double_t i_eta_max = (Int_t)0.;
660 Int_t n1SMTowMinus = (Int_t)1;
663 {i_eta_max = (Double_t)
GetIEtaMax(n1EBSM, n1SMTowPlus );}
665 {i_eta_max = (Double_t)
GetIEtaMax(n1EBSM, n1SMTowMinus);}
680 Double_t central_phi = (Double_t)10.;
682 if (
GetSMHalfBarrel(n1EBSM) ==
"EB+"){central_phi = 10. + (Double_t)20.*(n1EBSM-1);}
683 if (
GetSMHalfBarrel(n1EBSM) ==
"EB-"){central_phi = 10. + (Double_t)20.*(n1EBSM-19);}
689 const Int_t& n1SMTow,
const Int_t& i0TowEcha)
693 Double_t phi_in_SM = (Double_t)0.;
697 if ( n1EBSM >= 1 && n1EBSM <= fEcal->MaxSMInEB() )
699 if( rest_temp == 1 ){phi_in_SM = (Double_t)15.;}
700 if( rest_temp == 2 ){phi_in_SM = (Double_t)10.;}
701 if( rest_temp == 3 ){phi_in_SM = (Double_t)5.;}
702 if( rest_temp == 0 ){phi_in_SM = (Double_t)0.;}
706 if( i0TowEcha == 4 || i0TowEcha == 5 || i0TowEcha == 14 || i0TowEcha == 15 || i0TowEcha == 24 )
707 {phi_in_SM = phi_in_SM + 0;}
709 if( i0TowEcha == 3 || i0TowEcha == 6 || i0TowEcha == 13 || i0TowEcha == 16 || i0TowEcha == 23 )
710 {phi_in_SM = phi_in_SM + 1;}
712 if( i0TowEcha == 2 || i0TowEcha == 7 || i0TowEcha == 12 || i0TowEcha == 17 || i0TowEcha == 22 )
713 {phi_in_SM = phi_in_SM + 2;}
715 if( i0TowEcha == 1 || i0TowEcha == 8 || i0TowEcha == 11 || i0TowEcha == 18 || i0TowEcha == 21 )
716 {phi_in_SM = phi_in_SM + 3;}
718 if( i0TowEcha == 0 || i0TowEcha == 9 || i0TowEcha == 10 || i0TowEcha == 19 || i0TowEcha == 20 )
719 {phi_in_SM = phi_in_SM + 4;}
723 if( i0TowEcha == 20 || i0TowEcha == 19 || i0TowEcha == 10 || i0TowEcha == 9 || i0TowEcha == 0 )
724 {phi_in_SM = phi_in_SM + 0;}
726 if( i0TowEcha == 21 || i0TowEcha == 18 || i0TowEcha == 11 || i0TowEcha == 8 || i0TowEcha == 1 )
727 {phi_in_SM = phi_in_SM + 1;}
729 if( i0TowEcha == 22 || i0TowEcha == 17 || i0TowEcha == 12 || i0TowEcha == 7 || i0TowEcha == 2 )
730 {phi_in_SM = phi_in_SM + 2;}
732 if( i0TowEcha == 23 || i0TowEcha == 16 || i0TowEcha == 13 || i0TowEcha == 6 || i0TowEcha == 3 )
733 {phi_in_SM = phi_in_SM + 3;}
735 if( i0TowEcha == 24 || i0TowEcha == 15 || i0TowEcha == 14 || i0TowEcha == 5 || i0TowEcha == 4 )
736 {phi_in_SM = phi_in_SM + 4;}
741 std::cout <<
"TEcnaNumbering::GetPhiInSM(...)> SM = " << n1EBSM
745 phi_in_SM = 20 - phi_in_SM;
750 const Int_t& n1SMTow,
const Int_t& i0TowEcha)
754 Double_t
phi = (Double_t)0.;
756 if ( n1EBSM >= 1 && n1EBSM <= fEcal->MaxSMInEB() )
758 Double_t phiInSM =
GetPhiInSM(n1EBSM, n1SMTow, i0TowEcha);
761 phi = 20 - phiInSM + phi_start -(Double_t)10.;
765 std::cout <<
"TEcnaNumbering::GetPhi(...)> SM = " << n1EBSM
779 Double_t phi_min = (Double_t)0.;
782 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
786 if ( rest_temp == 1 ) {phi_min = phi_start + (Double_t)5.;}
787 if ( rest_temp == 2 ) {phi_min = phi_start + (Double_t)0.;}
788 if ( rest_temp == 3 ) {phi_min = phi_start - (Double_t)5.;}
789 if ( rest_temp == 0 ) {phi_min = phi_start - (Double_t)10.;}
793 if ( rest_temp == 0 ) {phi_min = phi_start + (Double_t)5.;}
794 if ( rest_temp == 3 ) {phi_min = phi_start + (Double_t)0.;}
795 if ( rest_temp == 2 ) {phi_min = phi_start - (Double_t)5.;}
796 if ( rest_temp == 1 ) {phi_min = phi_start - (Double_t)10.;}
807 Double_t phi_max = (Double_t)20.;
810 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
814 if ( rest_temp == 1 ) {phi_max = phi_start + (Double_t)10.;}
815 if ( rest_temp == 2 ) {phi_max = phi_start + (Double_t)5.;}
816 if ( rest_temp == 3 ) {phi_max = phi_start - (Double_t)0.;}
817 if ( rest_temp == 0 ) {phi_max = phi_start - (Double_t)5.;}
822 if ( rest_temp == 0 ) {phi_max = phi_start + (Double_t)10.;}
823 if ( rest_temp == 3 ) {phi_max = phi_start + (Double_t)5.;}
824 if ( rest_temp == 2 ) {phi_max = phi_start - (Double_t)0.;}
825 if ( rest_temp == 1 ) {phi_max = phi_start - (Double_t)5.;}
853 Double_t j_phi_min = (Double_t)1.;
855 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
857 if ( rest_temp == 1 ){j_phi_min = (Double_t) 1. - (Double_t)0.5;}
858 if ( rest_temp == 2 ){j_phi_min = (Double_t) 6. - (Double_t)0.5;}
859 if ( rest_temp == 3 ){j_phi_min = (Double_t)11. - (Double_t)0.5;}
860 if ( rest_temp == 0 ){j_phi_min = (Double_t)16. - (Double_t)0.5;}
869 Double_t j_phi_max = (Double_t)20.;
871 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
873 if ( rest_temp == 1 ){j_phi_max = (Double_t) 5. + (Double_t)0.5;}
874 if ( rest_temp == 2 ){j_phi_max = (Double_t)10. + (Double_t)0.5;}
875 if ( rest_temp == 3 ){j_phi_max = (Double_t)15. + (Double_t)0.5;}
876 if ( rest_temp == 0 ){j_phi_max = (Double_t)20. + (Double_t)0.5;}
886 Double_t j_phi_min = (Double_t)1. - (Double_t)0.5;
895 Double_t j_phi_max = (Double_t)20. + (Double_t)0.5;
909 TString xdirection =
"x";
919 TString ydirection =
"-x";
930 TString jydirection =
"-x";
943 TString
type =
"EB-";
945 if ( SMNumber >= 1 && SMNumber <= fEcal->MaxSMInEBPlus() ){type =
"EB+";}
953 Int_t PMSMNumber = PlusSMNumber;
996 Int_t MaxDirections = 2;
1003 for(Int_t i_DeeSC = 0; i_DeeSC < MaxDeeSC; i_DeeSC++){
1005 for(Int_t i_SCEcha = 0; i_SCEcha < MaxSCEcha; i_SCEcha++){
1007 + (i_DeeSC*MaxSCEcha + i_SCEcha)*MaxDirections;}}
1008 for(Int_t
i=0;
i<MaxDeeSC;
i++)
1009 {
for(Int_t
j=0;
j<MaxSCEcha;
j++)
1014 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxDeeCrys ; i_DeeCrys++){
1016 for(Int_t
i=0;
i<MaxDeeCrys;
i++)
1021 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxDeeCrys ; i_DeeCrys++){
1023 for(Int_t
i=0;
i<MaxDeeCrys;
i++)
1027 Int_t MaxTyp = (Int_t)4;
1033 for(Int_t i_MaxTyp = 0 ; i_MaxTyp < MaxTyp ; i_MaxTyp++){
1066 for(Int_t i_MaxTyp = 0 ; i_MaxTyp < MaxTyp ; i_MaxTyp++){
1096 Int_t**
type =
new Int_t*[Nb_DeeSC_JY];
fCnew++;
1097 Int_t* type_d1 =
new Int_t[Nb_DeeSC_JY*MaxDirections];
fCnew++;
1098 for(Int_t i_DeeSC_JY = 0 ; i_DeeSC_JY < Nb_DeeSC_JY ; i_DeeSC_JY++){
1099 type[i_DeeSC_JY] = &type_d1[0] + i_DeeSC_JY*MaxDirections;}
1152 for(Int_t kSC=0; kSC<MaxDeeSC; kSC++)
1154 for(Int_t n_Echa=1; n_Echa<=MaxSCEcha; n_Echa++)
1156 for(Int_t idir=0; idir<2; idir++)
1158 Int_t ikSC = kSC / Nb_DeeSC_JY;
1159 Int_t jkSC = kSC % Nb_DeeSC_JY;
1161 Int_t icrys = ikSC*Nb_SCCrys_IX +
fT2d_ich_IX[type[jkSC][idir]][n_Echa];
1166 Int_t jcrys = jkSC*Nb_SCCrys_JY +
fT2d_jch_JY[type[jkSC][idir]][n_Echa];
1171 Int_t n_DeeCrys = icrys*Nb_DeeSC_JY*Nb_SCCrys_JY+jcrys+1;
1215 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
1217 for(Int_t
i=0;
i<MaxEEDee;
i++)
1222 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
1224 for(Int_t
i=0;
i<MaxEEDee;
i++)
1229 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
1231 for(Int_t
i=0;
i<MaxEEDee;
i++)
1236 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
1238 for(Int_t
i=0;
i<MaxEEDee;
i++)
1247 for(Int_t dee = 1; dee<=4; dee++)
1249 if( dee == 1 || dee == 4 ){ids = 1;}
1250 if( dee == 2 || dee == 3 ){ids = 9;}
1251 for(Int_t isc= 13; isc<= 20; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1252 for(Int_t isc= 33; isc<= 40; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1253 for(Int_t isc= 54; isc<= 60; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1254 for(Int_t isc= 75; isc<= 79; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1255 for(Int_t isc= 96; isc<= 99; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1256 for(Int_t isc=118; isc<=119; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1259 for(Int_t dee = 1; dee<=4; dee++)
1261 if( dee == 1 || dee == 4 ){ids = 2;}
1262 if( dee == 2 || dee == 3 ){ids = 8;}
1263 for(Int_t isc= 32; isc<= 32; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1264 for(Int_t isc= 51; isc<= 53; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1265 for(Int_t isc= 72; isc<= 74; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1266 for(Int_t isc= 92; isc<= 95; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1267 for(Int_t isc=112; isc<=117; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1268 for(Int_t isc=132; isc<=138; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1269 for(Int_t isc=152; isc<=157; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1270 for(Int_t isc=173; isc<=176; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1271 for(Int_t isc=193; isc<=193; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1274 for(Int_t dee = 1; dee<=4; dee++)
1276 if( dee == 1 || dee == 4 ){ids = 3;}
1277 if( dee == 2 || dee == 3 ){ids = 7;}
1278 for(Int_t isc= 50; isc<= 50; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1279 for(Int_t isc= 69; isc<= 71; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1280 for(Int_t isc= 88; isc<= 91; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1281 for(Int_t isc=108; isc<=111; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1282 for(Int_t isc=127; isc<=131; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1283 for(Int_t isc=147; isc<=151; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1284 for(Int_t isc=166; isc<=172; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1285 for(Int_t isc=188; isc<=192; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1288 for(Int_t dee = 1; dee<=4; dee++)
1290 if( dee == 1 || dee == 4 ){ids = 4;}
1291 if( dee == 2 || dee == 3 ){ids = 6;}
1292 for(Int_t isc= 27; isc<= 29; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1293 for(Int_t isc= 44; isc<= 49; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1294 for(Int_t isc= 62; isc<= 68; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1295 for(Int_t isc= 82; isc<= 87; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1296 for(Int_t isc=102; isc<=107; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1297 for(Int_t isc=123; isc<=126; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1298 for(Int_t isc=144; isc<=146; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1299 for(Int_t isc=165; isc<=165; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1302 for(Int_t dee = 1; dee<=4; dee++)
1304 for(Int_t isc= 1; isc<= 8; isc++)
fT2d_DS[dee-1][isc-1] = 5;
1305 for(Int_t isc= 21; isc<= 26; isc++)
fT2d_DS[dee-1][isc-1] = 5;
1306 for(Int_t isc= 41; isc<= 43; isc++)
fT2d_DS[dee-1][isc-1] = 5;
1311 for(Int_t dee=1; dee<=4; dee++)
1313 for(Int_t isc=1; isc<=MaxDeeSC; isc++)
1490 if(dee == 1 || dee == 3)
1513 if(dee == 2 || dee == 4)
1540 for(Int_t dee=1; dee<=4; dee++)
1541 {
for(Int_t isc=1; isc<=MaxDeeSC; isc++)
1544 for(Int_t i_dee_type=1; i_dee_type<=2; i_dee_type++)
1547 if( i_dee_type == 1 ){dee = 1;}
1548 if( i_dee_type == 2 ){dee = 3;}
1770 for(Int_t i0EEDee=0; i0EEDee<MaxEEDee; i0EEDee++)
1772 for(Int_t i_ecna=0; i_ecna<MaxDeeSC; i_ecna++)
1792 const Int_t& i0SCEcha,
1793 const TString& sDeeDir)
1798 Int_t n1DeeCrys = 0;
1803 if( (n1DeeSCEcna >= 1) && (n1DeeSCEcna <= fEcal->MaxSCEcnaInDee()) )
1805 if (i0SCEcha >=0 && i0SCEcha < fEcal->MaxCrysInSC())
1807 n1DeeCrys =
fT3dDeeCrys[n1DeeSCEcna-1][i0SCEcha][i0DeeDir];
1812 std::cout <<
"!TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(...)> Electronic Channel in SuperCrystal = " 1819 std::cout <<
"!TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(...)> Super-Crystal number in Dee out of range." 1820 <<
" n1DeeSCEcna = " << n1DeeSCEcna <<
fTTBELL << std::endl;
1836 Int_t n1SCEcha = -1;
1839 if( n1DeeCrys >= 1 && n1DeeCrys <= fEcal->MaxCrysEcnaInDee() )
1846 std::cout <<
"!TEcnaNumbering::Get1SCEchaFrom1DeeCrys(...)> Crystal number in Dee out of range." 1856 Int_t n1DeeSCEcna = 0;
1859 if( n1DeeCrys >= 1 && n1DeeCrys <= fEcal->MaxCrysEcnaInDee() )
1861 n1DeeSCEcna =
fT2dDeeSC[n1DeeCrys-1][iDeeDir];
1866 std::cout <<
"!TEcnaNumbering::Get1DeeSCEcnaFrom1DeeCrys(...)> Crystal number in Dee out of range." 1913 Int_t data_sector = -1;
1915 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
1917 if( n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
1919 data_sector =
fT2d_DS[n1DeeNumber-1][n1DeeSCEcna-1];
1923 std::cout <<
"!TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> n1DeeSCEcna = " << n1DeeSCEcna
1930 if( n1DeeNumber != 0 )
1932 std::cout <<
"!TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
1938 std::cout <<
"TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
1947 const Int_t& n1SCEcha)
1952 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 )
1954 if( n1SCEcha == 11 )
1956 if( ds_sc == 14 ){ds_sc= 21;}
1958 if( n1SCEcha == 1 || n1SCEcha == 2 || n1SCEcha == 3 ||
1959 n1SCEcha == 6 || n1SCEcha == 7 )
1961 if( ds_sc == 3 ){ds_sc = 25;}
1973 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
1975 if( n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
1977 ds_sc =
fT2d_DSSC[n1DeeNumber-1][n1DeeSCEcna-1];
1982 std::cout <<
"!TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> n1DeeSCEcna = " << n1DeeSCEcna
1989 if( n1DeeNumber != 0 )
1991 std::cout <<
"!TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
1997 std::cout <<
"TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
2009 Int_t dee_sc_cons = -1;
2011 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
2013 if( n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
2019 std::cout <<
"!TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> *** WARNING *** n1DeeSCEcna = " << n1DeeSCEcna
2021 <<
"] ). Nb for const. forced to " <<
fT2d_DeeSCCons[n1DeeNumber-1][19] <<
"." << std::endl;
2027 if( n1DeeNumber != 0 )
2029 std::cout <<
"!TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
2035 std::cout <<
"TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
2044 const Int_t& n1SCEcha)
2049 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 )
2051 if( n1SCEcha == 11 )
2053 if( dee_sc_cons == 261 ){dee_sc_cons = 268;}
2054 if( dee_sc_cons == 112 ){dee_sc_cons = 119;}
2056 if( n1SCEcha == 1 || n1SCEcha == 2 || n1SCEcha == 3 ||
2057 n1SCEcha == 6 || n1SCEcha == 7 )
2059 if( dee_sc_cons == 178 ){dee_sc_cons = 207;}
2060 if( dee_sc_cons == 29 ){dee_sc_cons = 58;}
2070 Int_t dee_sc_ecna = -1;
2072 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
2074 Int_t off_set_cons = 0;
2077 if( DeeSCCons > off_set_cons && DeeSCCons <= fEcal->MaxSCForConsInDee()+off_set_cons )
2083 std::cout <<
"!TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> DeeSCCons = " << DeeSCCons
2084 <<
". Out of range ( range = [ " << off_set_cons+1
2091 if( n1DeeNumber != 0 )
2093 std::cout <<
"!TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> n1DeeNumber = " << n1DeeNumber
2099 std::cout <<
"TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> Dee = " << n1DeeNumber
2111 TString SCType =
"Connected";
2113 if( nb_for_cons == 182 || nb_for_cons == 33 ){SCType =
"NotConnected";}
2115 if( nb_for_cons == 178 || nb_for_cons == 29 ){SCType =
"NotConnected";}
2116 if( nb_for_cons == 207 || nb_for_cons == 58 ){SCType =
"NotConnected";}
2118 if( nb_for_cons == 298 || nb_for_cons == 149 ){SCType =
"NotConnected";}
2120 if( nb_for_cons == 261 || nb_for_cons == 112 ){SCType =
"NotConnected";}
2121 if( nb_for_cons == 268 || nb_for_cons == 119 ){SCType =
"NotConnected";}
2123 if( nb_for_cons == 281 || nb_for_cons == 132 ){SCType =
"NotConnected";}
2125 if( nb_for_cons == 161 || nb_for_cons == 12 ){SCType =
"NotComplete";}
2126 if( nb_for_cons == 216 || nb_for_cons == 67 ){SCType =
"NotComplete";}
2127 if( nb_for_cons == 224 || nb_for_cons == 75 ){SCType =
"NotComplete";}
2128 if( nb_for_cons == 286 || nb_for_cons == 137 ){SCType =
"NotComplete";}
2150 TString SCQuad =
"top";
2152 if (n1DeeSCEcna >= 1 && n1DeeSCEcna <= 10){SCQuad =
"bottom";}
2153 if (n1DeeSCEcna >= 21 && n1DeeSCEcna <= 30){SCQuad =
"bottom";}
2154 if (n1DeeSCEcna >= 41 && n1DeeSCEcna <= 50){SCQuad =
"bottom";}
2155 if (n1DeeSCEcna >= 61 && n1DeeSCEcna <= 70){SCQuad =
"bottom";}
2156 if (n1DeeSCEcna >= 81 && n1DeeSCEcna <= 90){SCQuad =
"bottom";}
2157 if (n1DeeSCEcna >= 101 && n1DeeSCEcna <= 110){SCQuad =
"bottom";}
2158 if (n1DeeSCEcna >= 121 && n1DeeSCEcna <= 130){SCQuad =
"bottom";}
2159 if (n1DeeSCEcna >= 141 && n1DeeSCEcna <= 150){SCQuad =
"bottom";}
2160 if (n1DeeSCEcna >= 161 && n1DeeSCEcna <= 170){SCQuad =
"bottom";}
2161 if (n1DeeSCEcna >= 181 && n1DeeSCEcna <= 190){SCQuad =
"bottom";}
2171 if ( SCQuadType ==
"top" && sDeeDir ==
"right" ){itype = 0;}
2172 if ( SCQuadType ==
"top" && sDeeDir ==
"left" ){itype = 1;}
2173 if ( SCQuadType ==
"bottom" && sDeeDir ==
"left" ){itype = 2;}
2174 if ( SCQuadType ==
"bottom" && sDeeDir ==
"right" ){itype = 3;}
2186 TString eetype =
"EE+";
2187 if ( n1DeeNumber == 1 || n1DeeNumber == 2 ){eetype =
"EE+";}
2188 if ( n1DeeNumber == 3 || n1DeeNumber == 4 ){eetype =
"EE-";}
2195 TString
type =
"EE+F";
2196 if ( n1DeeNumber == 1 ){type =
"EE+F";}
2197 if ( n1DeeNumber == 2 ){type =
"EE+N";}
2198 if ( n1DeeNumber == 3 ){type =
"EE-N";}
2199 if ( n1DeeNumber == 4 ){type =
"EE-F";}
2208 TString sDeeDir =
"right";
2209 if ( (n1DeeNumber == 1) || (n1DeeNumber == 3) ){sDeeDir =
"right";}
2210 if ( (n1DeeNumber == 2) || (n1DeeNumber == 4) ){sDeeDir =
"left" ;}
2219 if ( sDeeDir ==
"right" ){iDeeDir = 0;}
2220 if ( sDeeDir ==
"left" ){iDeeDir = 1;}
2232 const Int_t& i0SCEcha)
2239 Int_t IXCrysInSC =
fT2d_ich_IX[type_index][i0SCEcha+1] + 1;
2252 const Int_t& i0SCEcha)
2263 const Int_t& i0SCEcha)
2270 Int_t JYCrysInSC =
fT2d_jch_JY[type_index][i0SCEcha+1] + 1;
2283 const Int_t& i0SCEcha)
2297 Int_t nb_of_sc = -1;
2298 if( DeeDS == 1 || DeeDS == 9 ){nb_of_sc = 33;}
2299 if( DeeDS == 2 || DeeDS == 8 ){nb_of_sc = 32;}
2300 if( DeeDS == 3 || DeeDS == 7 ){nb_of_sc = 34;}
2301 if( DeeDS == 4 || DeeDS == 6 ){nb_of_sc = 33;}
2302 if( DeeDS == 5){nb_of_sc = 34;}
2332 Double_t i_IX_min = (Int_t)1.;
2378 Double_t j_IY_min = (Double_t)1.;
2396 TString
type =
"EE-";
2398 if ( n1DeeNumber == 1 || n1DeeNumber == 2 ){type =
"EE+";}
2399 if ( n1DeeNumber == 3 || n1DeeNumber == 4 ){type =
"EE-";}
2410 TString xdirection =
"x";
2412 if(
GetEEDeeType(n1DeeNumber) ==
"EE+F" ){xdirection =
"-x";}
2413 if(
GetEEDeeType(n1DeeNumber) ==
"EE+N" ){xdirection =
"-x";}
2414 if(
GetEEDeeType(n1DeeNumber) ==
"EE-N" ){xdirection =
"x";}
2415 if(
GetEEDeeType(n1DeeNumber) ==
"EE-F" ){xdirection =
"x";}
2422 TString ydirection =
"-x";
2424 if(
GetEEDeeType(n1DeeNumber) ==
"endcap+" ){ydirection =
"-x";}
2425 if(
GetEEDeeType(n1DeeNumber) ==
"endcap-" ){ydirection =
"-x";}
2433 TString jydirection =
"x";
2455 Int_t n1StexStin = 0;
2464 const Int_t& i0StinEcha)
2469 Int_t StexEcha = (Int_t)(-1.);
2471 if ( n1StexStin > 0 && n1StexStin <= fEcal->MaxStinEcnaInStex() &&
2476 std::cout <<
"!TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha *** ERROR ***> VALUE" 2477 <<
" OUT OF RANGE. Forced to -1. Argument values: n1StexStin = " << n1StexStin
2478 <<
", channel = " << i0StinEcha
2484 const Int_t& i0StinEcha,
const Int_t& StexNumber)
2490 Int_t n1StexCrys = (Int_t)0;
2505 Double_t IHocoMin = (Double_t)0.;
2513 Double_t IHocoMax = (Double_t)0.;
2521 Double_t IVecoMin = (Double_t)0.;
2529 Double_t IVecoMax = (Double_t)0.;
2537 Double_t JVecoMin = (Double_t)0.;
2544 Double_t JVecoMax = (Double_t)0.;
2556 TString half_stas =
"EB? EE?";
2570 Int_t EBSMNumber = 0;
2571 if( FEDNumber >= 610 && FEDNumber <= 645 ){EBSMNumber = FEDNumber - 609;}
2577 Int_t EEDSNumber = 0;
2579 if( FEDNumber >= 600 && FEDNumber <= 609 ){EEDSNumber = FEDNumber - 599;}
2580 if( FEDNumber >= 646 && FEDNumber <= 655 ){EEDSNumber = FEDNumber - 645;}
2600 if( n_for_cons == 12 || n_for_cons == 67 || n_for_cons == 75 || n_for_cons == 137 ||
2601 n_for_cons == 161 || n_for_cons == 216 || n_for_cons == 224 || n_for_cons == 286 ){max_crys = 20;}
2604 if( (n_for_cons == 182 || n_for_cons == 33) && (n1DeeSCEcna == 60 || n1DeeSCEcna == 119) ){max_crys = 10;}
2606 if( (n_for_cons == 178 || n_for_cons == 29) && (n1DeeSCEcna == 138 || n1DeeSCEcna == 157) ){max_crys = 10;}
2607 if( (n_for_cons == 207 || n_for_cons == 58) && (n1DeeSCEcna == 176 || n1DeeSCEcna == 193) ){max_crys = 10;}
2609 if( (n_for_cons == 298 || n_for_cons == 149) && (n1DeeSCEcna == 188) ){max_crys = 10;}
2611 if( (n_for_cons == 261 || n_for_cons == 112) && (n1DeeSCEcna == 144 || n1DeeSCEcna == 165) ){max_crys = 10;}
2612 if( (n_for_cons == 268 || n_for_cons == 119) && (n1DeeSCEcna == 102 || n1DeeSCEcna == 123) ){max_crys = 10;}
2614 if( (n_for_cons == 281 || n_for_cons == 132) && (n1DeeSCEcna == 41) ){max_crys = 10;}
2617 if( s_option ==
"TEcnaRun" || s_option ==
"TEcnaRead" )
2619 if( s_option ==
"TEcnaRun" )
2622 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 ){max_crys = 5;}
2623 if( n1DeeSCEcna == 10 || n1DeeSCEcna == 11 ){max_crys = 1;}
2625 if( s_option ==
"TEcnaRead" )
2628 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 ){max_crys = 5;}
2629 if( n1DeeSCEcna == 10 || n1DeeSCEcna == 11 ){max_crys = 1;}
2634 std::cout <<
"!TEcnaNumbering::MaxCrysInStinEcna(...)> " << s_option
2635 <<
": unknown option." <<
fTTBELL << std::endl;
Double_t GetEtaMax(const Int_t &, const Int_t &)
Int_t Get1StexStinFrom0StexEcha(const Int_t &)
void BuildBarrelCrysTable()
TString GetSCQuadFrom1DeeSCEcna(const Int_t &)
Double_t GetVecoMin(const Int_t &, const Int_t &)
Int_t Get0SMEchaFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
Int_t Get1DeeSCEcnaFromDeeSCCons(const Int_t &, const Int_t &)
Double_t GetPhiMin(const Int_t &, const Int_t &)
Int_t GetSMFromFED(const Int_t &)
TString GetYDirectionEB(const Int_t &)
TString GetSMHalfBarrel(const Int_t &)
TString GetDeeDirViewedFromIP(const Int_t &)
TString GetJYDirectionEB(const Int_t &)
Double_t GetJPhiMax(const Int_t &, const Int_t &)
Int_t Get1DeeSCEcnaFrom0DeeEcha(const Int_t &)
TString GetEEDeeType(const Int_t &)
TString GetStinLvrbType(const Int_t &)
Double_t GetPhiMax(const Int_t &, const Int_t &)
Int_t Get1SCEchaFrom0DeeEcha(const Int_t &)
Double_t GetEtaMin(const Int_t &, const Int_t &)
Int_t Get0TowEchaFrom1SMCrys(const Int_t &)
Int_t GetIXSCInDee(const Int_t &)
Double_t GetIHocoMin(const Int_t &, const Int_t &)
Int_t Get1DeeSCEcnaFrom1DeeCrys(const Int_t &, const TString &)
Int_t GetHashedNumberFromIEtaAndIPhi(const Int_t &, const Int_t &)
Int_t Get1SMTowFrom1SMCrys(const Int_t &)
Bool_t RegisterPointer(const TString &, const Long_t &)
Int_t GetJYSCInDee(const Int_t &)
TString GetXDirectionEE(const Int_t &)
void BuildEndcapCrysTable()
TString GetTowerLvrbType(const Int_t &)
Double_t GetJVecoMin(const Int_t &, const Int_t &)
Int_t Get0TowEchaFrom0SMEcha(const Int_t &)
Double_t GetJIYMax(const Int_t &, const Int_t &)
Int_t GetJYCrysInDee(const Int_t &, const Int_t &, const Int_t &)
Int_t Get1SCEchaFrom1DeeCrys(const Int_t &, const TString &)
TString GetDeeHalfEndcap(const Int_t &)
Double_t GetJPhiMin(const Int_t &, const Int_t &)
TString GetYDirectionEE(const Int_t &)
Int_t Get1SMTowFrom0SMEcha(const Int_t &)
Int_t GetDSSCFrom1DeeSCEcna(const Int_t &, const Int_t &, const Int_t &)
Int_t GetDSFromFED(const Int_t &)
Double_t GetVecoMax(const Int_t &, const Int_t &)
Int_t StexEchaForCons(const Int_t &, const Int_t &)
Double_t GetJIYMin(const Int_t &, const Int_t &)
Int_t GetDSFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(const Int_t &, const Int_t &, const TString &)
Double_t GetEta(const Int_t &, const Int_t &, const Int_t &)
Int_t Get1SMCrysFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
Int_t MaxCrysInStinEcna(const Int_t &, const Int_t &, const TString &)
void BuildEndcapSCTable()
TString fCodeChNumberingITP2Top
Int_t GetIXCrysInSC(const Int_t &, const Int_t &, const Int_t &)
Double_t GetIEtaMin(const Int_t &, const Int_t &)
Int_t GetIPhiFromHashed(const Int_t &)
Int_t GetMaxSCInDS(const Int_t &)
Double_t GetPhiInSM(const Int_t &, const Int_t &, const Int_t &)
Int_t GetSCQuadTypeIndex(const TString &, const TString &)
Int_t MaxSCForConsInDee()
Int_t GetIEtaFromHashed(const Int_t &, const Int_t &)
Int_t GetJYCrysInSC(const Int_t &, const Int_t &, const Int_t &)
Double_t GetPhi(const Int_t &, const Int_t &, const Int_t &)
TString GetSCType(const Int_t &)
Double_t GetIHocoMax(const Int_t &, const Int_t &)
Int_t GetDeeDirIndex(const TString &)
Int_t GetIXCrysInDee(const Int_t &, const Int_t &, const Int_t &)
Int_t PlusMinusSMNumber(const Int_t &)
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
Double_t GetIEtaMax(const Int_t &, const Int_t &)
TString GetStexHalfStas(const Int_t &)
TString GetEEDeeEndcap(const Int_t &)
TString GetEcalSubDetector()
TString fCodeChNumberingITP1Bot
Double_t GetSMCentralPhi(const Int_t &)
TString fCodeChNumberingLvrbBot
TString GetJYDirectionEE(const Int_t &)
Double_t GetJVecoMax(const Int_t &, const Int_t &)
void SetEcalSubDetector(const TString &)
Int_t Get1StexCrysFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &, const Int_t &)
TString fCodeChNumberingLvrbTop
TString GetXDirectionEB(const Int_t &)
Long_t GetPointerValue(const TString &)
ClassImp(TEcnaNumbering) TEcnaNumbering