187 for(Int_t i_SMTow = 0 ; i_SMTow < MaxSMTow ; i_SMTow++){
189 for(Int_t
i=0;
i<MaxSMTow;
i++)
200 Int_t m26 = (Int_t)26;
203 Int_t** jch_type =
new Int_t*[m2];
fCnew++;
204 Int_t* jch_type_d1 =
new Int_t[m2*m26];
fCnew++;
205 for(Int_t i_m2 = 0 ; i_m2 < m2 ; i_m2++){
206 jch_type[i_m2] = &jch_type_d1[0] + i_m2*m26;}
208 for(Int_t
k=25;
k>=21;
k--){jch_type[0][
k] = 25-
k;}
209 for(Int_t
k=16;
k<=20;
k++){jch_type[0][
k] =
k-16;}
210 for(Int_t
k=15;
k>=11;
k--){jch_type[0][
k] = 15-
k;}
211 for(Int_t
k=6;
k<=10;
k++){jch_type[0][
k] =
k-6;}
212 for(Int_t
k=5;
k>=1;
k--){jch_type[0][
k] = 5-
k;}
214 for(Int_t
k=1;
k<=5;
k++){jch_type[1][
k] =
k-1;}
215 for(Int_t
k=10;
k>=6;
k--){jch_type[1][
k] = 10-
k;}
216 for(Int_t
k=11;
k<=15;
k++){jch_type[1][
k] =
k-11;}
217 for(Int_t
k=20;
k>=16;
k--){jch_type[1][
k] = 20-
k;}
218 for(Int_t
k=21;
k<=25;
k++){jch_type[1][
k] =
k-21;}
221 Int_t** ich_type =
new Int_t*[m2];
fCnew++;
222 Int_t* ich_type_d1 =
new Int_t[m2*m26];
fCnew++;
223 for(Int_t i_m2 = 0 ; i_m2 < m2 ; i_m2++){
224 ich_type[i_m2] = &ich_type_d1[0] + i_m2*m26;}
226 for(Int_t
k=25;
k>=21;
k--){ich_type[0][
k] = 0;}
227 for(Int_t
k=16;
k<=20;
k++){ich_type[0][
k] = 1;}
228 for(Int_t
k=15;
k>=11;
k--){ich_type[0][
k] = 2;}
229 for(Int_t
k=6;
k<=10;
k++){ich_type[0][
k] = 3;}
230 for(Int_t
k=5;
k>=1;
k--){ich_type[0][
k] = 4;}
232 for(Int_t
k=1;
k<=5;
k++){ich_type[1][
k] = 0;}
233 for(Int_t
k=10;
k>=6;
k--){ich_type[1][
k] = 1;}
234 for(Int_t
k=11;
k<=15;
k++){ich_type[1][
k] = 2;}
235 for(Int_t
k=20;
k>=16;
k--){ich_type[1][
k] = 3;}
236 for(Int_t
k=21;
k<=25;
k++){ich_type[1][
k] = 4;}
264 for(Int_t tow=0; tow<MaxSMTow; tow++)
266 for(Int_t ic=1; ic<=MaxTowEcha; ic++)
268 Int_t jtow = tow % 4;
269 Int_t itow = tow / 4;
271 Int_t icrys = itow*5 + ich_type[type[itow]][ic];
275 Int_t jcrys = jtow*5 + jch_type[type[itow]][ic];
279 Int_t n1SMCrys = icrys*20+jcrys+1;
307 const Int_t& i0TowEcha)
316 if (n1SMTow >= 1 && n1SMTow <= fEcal->MaxTowInSM())
318 if (i0TowEcha >=0 && i0TowEcha < fEcal->MaxCrysInTow())
325 cout <<
"!TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(...)> Electronic Channel in Tower out of range."
326 <<
" i0TowEcha = " << i0TowEcha <<
fTTBELL << endl;
332 cout <<
"!TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(...)> Tower number in SM out of range."
333 <<
" n1SMTow = " << n1SMTow <<
fTTBELL << endl;
349 Int_t i0TowEcha = -1;
351 if( n1SMCrys >= 1 && n1SMCrys <= fEcal->MaxCrysInSM() )
358 cout <<
"!TEcnaNumbering::Get0TowEchaFrom1SMCrys(...)> Crystal number in SM out of range."
359 <<
" n1SMCrys = " << n1SMCrys <<
fTTBELL << endl;
370 if( n1SMCrys >= 1 && n1SMCrys <= fEcal->MaxCrysInSM() )
377 cout <<
"!TEcnaNumbering::Get1SMTowFrom1SMCrys(...)> Crystal number in SM out of range."
378 <<
" n1SMCrys = " << n1SMCrys <<
fTTBELL << endl;
426 if( IEta > 0 ){Hashed = (85 + IEta - 1)*360 + IPhi - 1;}
427 if( IEta < 0 ){Hashed = (85 + IEta)*360 + IPhi - 1;}
444 Int_t IPhi = Hashed%360 + 1;
478 const Int_t& i0TowEcha)
482 Double_t
eta = (Double_t)0.;
488 if ( n1EBSM >= 1 && n1EBSM <= max_sm_in_barrel )
490 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++)
492 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta*(max_crys_eta_in_tower-1));
493 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta+1)*(max_crys_eta_in_tower-1));
494 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta*max_crys_eta_in_tower);
496 Double_t d_echa_eta = (Double_t)(i0TowEcha/max_crys_eta_in_tower);
498 if ( n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max )
501 {eta = (Double_t)(i_crys_eta) + d_echa_eta + 1;}
503 {eta = (Double_t)(i_crys_eta+max_crys_eta_in_tower)-d_echa_eta;}
510 cout <<
"TEcnaNumbering::GetEta(...)> SM = " << n1EBSM
524 Double_t eta_min = (Double_t)0.;
526 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++)
528 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta*(max_crys_eta_in_tower-1));
529 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta+1)*(max_crys_eta_in_tower-1));
530 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta*max_crys_eta_in_tower);
532 if ( n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max )
535 {eta_min = (Double_t)i_crys_eta;}
537 {eta_min = -(Double_t)(i_crys_eta + max_crys_eta_in_tower);}
550 Double_t eta_max = (max_crys_eta_in_tower-1);
552 for (Int_t i_sm_tow_eta = 0; i_sm_tow_eta < max_tow_eta_in_sm; i_sm_tow_eta++)
554 Int_t i_crys_eta_min = (Int_t)(1 + i_sm_tow_eta*(max_crys_eta_in_tower-1));
555 Int_t i_crys_eta_max = (Int_t)((i_sm_tow_eta+1)*(max_crys_eta_in_tower-1));
556 Int_t i_crys_eta = (Int_t)(i_sm_tow_eta*max_crys_eta_in_tower);
558 if ( n1SMTow >= i_crys_eta_min && n1SMTow <= i_crys_eta_max )
561 {eta_max = (Double_t)(i_crys_eta + max_crys_eta_in_tower);}
563 {eta_max = -(Double_t)i_crys_eta;}
574 Double_t i_eta_min = (Int_t)0.;
577 {i_eta_min = (Double_t)
GetEtaMin(n1EBSM, n1SMTow)+(Double_t)0.5;}
579 {i_eta_min = (Double_t)
GetEtaMin(n1EBSM, n1SMTow)-(Double_t)0.5;}
588 Double_t i_eta_max = (Int_t)0.;
591 {i_eta_max = (Double_t)
GetEtaMax(n1EBSM, n1SMTow)+(Double_t)0.5;}
593 {i_eta_max = (Double_t)
GetEtaMax(n1EBSM, n1SMTow)-(Double_t)0.5;}
602 Double_t i_eta_min = (Int_t)0.;
604 Int_t n1SMTowPlus = (Int_t)1;
608 {i_eta_min = (Double_t)
GetIEtaMin(n1EBSM, n1SMTowPlus );}
610 {i_eta_min = (Double_t)
GetIEtaMin(n1EBSM, n1SMTowMinus);}
619 Double_t i_eta_max = (Int_t)0.;
622 Int_t n1SMTowMinus = (Int_t)1;
625 {i_eta_max = (Double_t)
GetIEtaMax(n1EBSM, n1SMTowPlus );}
627 {i_eta_max = (Double_t)
GetIEtaMax(n1EBSM, n1SMTowMinus);}
642 Double_t central_phi = (Double_t)10.;
644 if (
GetSMHalfBarrel(n1EBSM) ==
"EB+"){central_phi = 10. + (Double_t)20.*(n1EBSM-1);}
645 if (
GetSMHalfBarrel(n1EBSM) ==
"EB-"){central_phi = 10. + (Double_t)20.*(n1EBSM-19);}
651 const Int_t& n1SMTow,
const Int_t& i0TowEcha)
655 Double_t phi_in_SM = (Double_t)0.;
659 if ( n1EBSM >= 1 && n1EBSM <= fEcal->MaxSMInEB() )
661 if( rest_temp == 1 ){phi_in_SM = (Double_t)15.;}
662 if( rest_temp == 2 ){phi_in_SM = (Double_t)10.;}
663 if( rest_temp == 3 ){phi_in_SM = (Double_t)5.;}
664 if( rest_temp == 0 ){phi_in_SM = (Double_t)0.;}
668 if( i0TowEcha == 4 || i0TowEcha == 5 || i0TowEcha == 14 || i0TowEcha == 15 || i0TowEcha == 24 )
669 {phi_in_SM = phi_in_SM + 0;}
671 if( i0TowEcha == 3 || i0TowEcha == 6 || i0TowEcha == 13 || i0TowEcha == 16 || i0TowEcha == 23 )
672 {phi_in_SM = phi_in_SM + 1;}
674 if( i0TowEcha == 2 || i0TowEcha == 7 || i0TowEcha == 12 || i0TowEcha == 17 || i0TowEcha == 22 )
675 {phi_in_SM = phi_in_SM + 2;}
677 if( i0TowEcha == 1 || i0TowEcha == 8 || i0TowEcha == 11 || i0TowEcha == 18 || i0TowEcha == 21 )
678 {phi_in_SM = phi_in_SM + 3;}
680 if( i0TowEcha == 0 || i0TowEcha == 9 || i0TowEcha == 10 || i0TowEcha == 19 || i0TowEcha == 20 )
681 {phi_in_SM = phi_in_SM + 4;}
685 if( i0TowEcha == 20 || i0TowEcha == 19 || i0TowEcha == 10 || i0TowEcha == 9 || i0TowEcha == 0 )
686 {phi_in_SM = phi_in_SM + 0;}
688 if( i0TowEcha == 21 || i0TowEcha == 18 || i0TowEcha == 11 || i0TowEcha == 8 || i0TowEcha == 1 )
689 {phi_in_SM = phi_in_SM + 1;}
691 if( i0TowEcha == 22 || i0TowEcha == 17 || i0TowEcha == 12 || i0TowEcha == 7 || i0TowEcha == 2 )
692 {phi_in_SM = phi_in_SM + 2;}
694 if( i0TowEcha == 23 || i0TowEcha == 16 || i0TowEcha == 13 || i0TowEcha == 6 || i0TowEcha == 3 )
695 {phi_in_SM = phi_in_SM + 3;}
697 if( i0TowEcha == 24 || i0TowEcha == 15 || i0TowEcha == 14 || i0TowEcha == 5 || i0TowEcha == 4 )
698 {phi_in_SM = phi_in_SM + 4;}
703 cout <<
"TEcnaNumbering::GetPhiInSM(...)> SM = " << n1EBSM
707 phi_in_SM = 20 - phi_in_SM;
712 const Int_t& n1SMTow,
const Int_t& i0TowEcha)
716 Double_t
phi = (Double_t)0.;
718 if ( n1EBSM >= 1 && n1EBSM <= fEcal->MaxSMInEB() )
720 Double_t phiInSM =
GetPhiInSM(n1EBSM, n1SMTow, i0TowEcha);
723 phi = 20 - phiInSM + phi_start -(Double_t)10.;
727 cout <<
"TEcnaNumbering::GetPhi(...)> SM = " << n1EBSM
741 Double_t phi_min = (Double_t)0.;
744 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
748 if ( rest_temp == 1 ) {phi_min = phi_start + (Double_t)5.;}
749 if ( rest_temp == 2 ) {phi_min = phi_start + (Double_t)0.;}
750 if ( rest_temp == 3 ) {phi_min = phi_start - (Double_t)5.;}
751 if ( rest_temp == 0 ) {phi_min = phi_start - (Double_t)10.;}
755 if ( rest_temp == 0 ) {phi_min = phi_start + (Double_t)5.;}
756 if ( rest_temp == 3 ) {phi_min = phi_start + (Double_t)0.;}
757 if ( rest_temp == 2 ) {phi_min = phi_start - (Double_t)5.;}
758 if ( rest_temp == 1 ) {phi_min = phi_start - (Double_t)10.;}
769 Double_t phi_max = (Double_t)20.;
772 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
776 if ( rest_temp == 1 ) {phi_max = phi_start + (Double_t)10.;}
777 if ( rest_temp == 2 ) {phi_max = phi_start + (Double_t)5.;}
778 if ( rest_temp == 3 ) {phi_max = phi_start - (Double_t)0.;}
779 if ( rest_temp == 0 ) {phi_max = phi_start - (Double_t)5.;}
784 if ( rest_temp == 0 ) {phi_max = phi_start + (Double_t)10.;}
785 if ( rest_temp == 3 ) {phi_max = phi_start + (Double_t)5.;}
786 if ( rest_temp == 2 ) {phi_max = phi_start - (Double_t)0.;}
787 if ( rest_temp == 1 ) {phi_max = phi_start - (Double_t)5.;}
815 Double_t j_phi_min = (Double_t)1.;
817 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
819 if ( rest_temp == 1 ){j_phi_min = (Double_t) 1. - (Double_t)0.5;}
820 if ( rest_temp == 2 ){j_phi_min = (Double_t) 6. - (Double_t)0.5;}
821 if ( rest_temp == 3 ){j_phi_min = (Double_t)11. - (Double_t)0.5;}
822 if ( rest_temp == 0 ){j_phi_min = (Double_t)16. - (Double_t)0.5;}
831 Double_t j_phi_max = (Double_t)20.;
833 Int_t rest_temp =(Int_t)(n1SMTow%(max_crys_phi_in_tower-1));
835 if ( rest_temp == 1 ){j_phi_max = (Double_t) 5. + (Double_t)0.5;}
836 if ( rest_temp == 2 ){j_phi_max = (Double_t)10. + (Double_t)0.5;}
837 if ( rest_temp == 3 ){j_phi_max = (Double_t)15. + (Double_t)0.5;}
838 if ( rest_temp == 0 ){j_phi_max = (Double_t)20. + (Double_t)0.5;}
848 Double_t j_phi_min = (Double_t)1. - (Double_t)0.5;
857 Double_t j_phi_max = (Double_t)20. + (Double_t)0.5;
871 TString xdirection =
"x";
881 TString ydirection =
"-x";
892 TString jydirection =
"-x";
905 TString
type =
"EB-";
907 if ( SMNumber >= 1 && SMNumber <= fEcal->MaxSMInEBPlus() ){type =
"EB+";}
952 Int_t MaxDirections = 2;
959 for(Int_t i_DeeSC = 0; i_DeeSC < MaxDeeSC; i_DeeSC++){
961 for(Int_t i_SCEcha = 0; i_SCEcha < MaxSCEcha; i_SCEcha++){
963 + (i_DeeSC*MaxSCEcha + i_SCEcha)*MaxDirections;}}
964 for(Int_t
i=0;
i<MaxDeeSC;
i++)
965 {
for(Int_t
j=0;
j<MaxSCEcha;
j++)
970 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxDeeCrys ; i_DeeCrys++){
972 for(Int_t
i=0;
i<MaxDeeCrys;
i++)
977 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxDeeCrys ; i_DeeCrys++){
979 for(Int_t
i=0;
i<MaxDeeCrys;
i++)
983 Int_t MaxTyp = (Int_t)4;
989 for(Int_t i_MaxTyp = 0 ; i_MaxTyp < MaxTyp ; i_MaxTyp++){
1022 for(Int_t i_MaxTyp = 0 ; i_MaxTyp < MaxTyp ; i_MaxTyp++){
1052 Int_t**
type =
new Int_t*[Nb_DeeSC_JY];
fCnew++;
1053 Int_t* type_d1 =
new Int_t[Nb_DeeSC_JY*MaxDirections];
fCnew++;
1054 for(Int_t i_DeeSC_JY = 0 ; i_DeeSC_JY < Nb_DeeSC_JY ; i_DeeSC_JY++){
1055 type[i_DeeSC_JY] = &type_d1[0] + i_DeeSC_JY*MaxDirections;}
1108 for(Int_t kSC=0; kSC<MaxDeeSC; kSC++)
1110 for(Int_t n_Echa=1; n_Echa<=MaxSCEcha; n_Echa++)
1112 for(Int_t idir=0; idir<2; idir++)
1114 Int_t ikSC = kSC / Nb_DeeSC_JY;
1115 Int_t jkSC = kSC % Nb_DeeSC_JY;
1117 Int_t icrys = ikSC*Nb_SCCrys_IX +
fT2d_ich_IX[type[jkSC][idir]][n_Echa];
1122 Int_t jcrys = jkSC*Nb_SCCrys_JY +
fT2d_jch_JY[type[jkSC][idir]][n_Echa];
1127 Int_t n_DeeCrys = icrys*Nb_DeeSC_JY*Nb_SCCrys_JY+jcrys+1;
1171 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
1173 for(Int_t
i=0;
i<MaxEEDee;
i++)
1178 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
1180 for(Int_t
i=0;
i<MaxEEDee;
i++)
1185 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
1187 for(Int_t
i=0;
i<MaxEEDee;
i++)
1192 for(Int_t i_DeeCrys = 0 ; i_DeeCrys < MaxEEDee ; i_DeeCrys++){
1194 for(Int_t
i=0;
i<MaxEEDee;
i++)
1203 for(Int_t dee = 1; dee<=4; dee++)
1205 if( dee == 1 || dee == 4 ){ids = 1;}
1206 if( dee == 2 || dee == 3 ){ids = 9;}
1207 for(Int_t isc= 13; isc<= 20; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1208 for(Int_t isc= 33; isc<= 40; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1209 for(Int_t isc= 54; isc<= 60; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1210 for(Int_t isc= 75; isc<= 79; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1211 for(Int_t isc= 96; isc<= 99; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1212 for(Int_t isc=118; isc<=119; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1215 for(Int_t dee = 1; dee<=4; dee++)
1217 if( dee == 1 || dee == 4 ){ids = 2;}
1218 if( dee == 2 || dee == 3 ){ids = 8;}
1219 for(Int_t isc= 32; isc<= 32; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1220 for(Int_t isc= 51; isc<= 53; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1221 for(Int_t isc= 72; isc<= 74; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1222 for(Int_t isc= 92; isc<= 95; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1223 for(Int_t isc=112; isc<=117; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1224 for(Int_t isc=132; isc<=138; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1225 for(Int_t isc=152; isc<=157; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1226 for(Int_t isc=173; isc<=176; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1227 for(Int_t isc=193; isc<=193; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1230 for(Int_t dee = 1; dee<=4; dee++)
1232 if( dee == 1 || dee == 4 ){ids = 3;}
1233 if( dee == 2 || dee == 3 ){ids = 7;}
1234 for(Int_t isc= 50; isc<= 50; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1235 for(Int_t isc= 69; isc<= 71; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1236 for(Int_t isc= 88; isc<= 91; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1237 for(Int_t isc=108; isc<=111; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1238 for(Int_t isc=127; isc<=131; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1239 for(Int_t isc=147; isc<=151; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1240 for(Int_t isc=166; isc<=172; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1241 for(Int_t isc=188; isc<=192; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1244 for(Int_t dee = 1; dee<=4; dee++)
1246 if( dee == 1 || dee == 4 ){ids = 4;}
1247 if( dee == 2 || dee == 3 ){ids = 6;}
1248 for(Int_t isc= 27; isc<= 29; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1249 for(Int_t isc= 44; isc<= 49; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1250 for(Int_t isc= 62; isc<= 68; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1251 for(Int_t isc= 82; isc<= 87; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1252 for(Int_t isc=102; isc<=107; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1253 for(Int_t isc=123; isc<=126; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1254 for(Int_t isc=144; isc<=146; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1255 for(Int_t isc=165; isc<=165; isc++)
fT2d_DS[dee-1][isc-1] = ids;
1258 for(Int_t dee = 1; dee<=4; dee++)
1260 for(Int_t isc= 1; isc<= 8; isc++)
fT2d_DS[dee-1][isc-1] = 5;
1261 for(Int_t isc= 21; isc<= 26; isc++)
fT2d_DS[dee-1][isc-1] = 5;
1262 for(Int_t isc= 41; isc<= 43; isc++)
fT2d_DS[dee-1][isc-1] = 5;
1267 for(Int_t dee=1; dee<=4; dee++)
1269 for(Int_t isc=1; isc<=MaxDeeSC; isc++)
1446 if(dee == 1 || dee == 3)
1469 if(dee == 2 || dee == 4)
1496 for(Int_t dee=1; dee<=4; dee++)
1497 {
for(Int_t isc=1; isc<=MaxDeeSC; isc++)
1500 for(Int_t i_dee_type=1; i_dee_type<=2; i_dee_type++)
1503 if( i_dee_type == 1 ){dee = 1;}
1504 if( i_dee_type == 2 ){dee = 3;}
1726 for(Int_t i0EEDee=0; i0EEDee<MaxEEDee; i0EEDee++)
1728 for(Int_t i_ecna=0; i_ecna<MaxDeeSC; i_ecna++)
1748 const Int_t& i0SCEcha,
1749 const TString sDeeDir)
1754 Int_t n1DeeCrys = 0;
1759 if( (n1DeeSCEcna >= 1) && (n1DeeSCEcna <= fEcal->MaxSCEcnaInDee()) )
1761 if (i0SCEcha >=0 && i0SCEcha < fEcal->MaxCrysInSC())
1763 n1DeeCrys =
fT3dDeeCrys[n1DeeSCEcna-1][i0SCEcha][i0DeeDir];
1768 cout <<
"!TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(...)> Electronic Channel in SuperCrystal = "
1775 cout <<
"!TEcnaNumbering::Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(...)> Super-Crystal number in Dee out of range."
1776 <<
" n1DeeSCEcna = " << n1DeeSCEcna <<
fTTBELL << endl;
1792 Int_t n1SCEcha = -1;
1795 if( n1DeeCrys >= 1 && n1DeeCrys <= fEcal->MaxCrysEcnaInDee() )
1802 cout <<
"!TEcnaNumbering::Get1SCEchaFrom1DeeCrys(...)> Crystal number in Dee out of range."
1812 Int_t n1DeeSCEcna = 0;
1815 if( n1DeeCrys >= 1 && n1DeeCrys <= fEcal->MaxCrysEcnaInDee() )
1817 n1DeeSCEcna =
fT2dDeeSC[n1DeeCrys-1][iDeeDir];
1822 cout <<
"!TEcnaNumbering::Get1DeeSCEcnaFrom1DeeCrys(...)> Crystal number in Dee out of range."
1869 Int_t data_sector = -1;
1871 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
1873 if( n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
1875 data_sector =
fT2d_DS[n1DeeNumber-1][n1DeeSCEcna-1];
1879 cout <<
"!TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> n1DeeSCEcna = " << n1DeeSCEcna
1886 if( n1DeeNumber != 0 )
1888 cout <<
"!TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
1894 cout <<
"TEcnaNumbering::GetDSFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
1903 const Int_t& n1SCEcha)
1908 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 )
1910 if( n1SCEcha == 11 )
1912 if( ds_sc == 14 ){ds_sc= 21;}
1914 if( n1SCEcha == 1 || n1SCEcha == 2 || n1SCEcha == 3 ||
1915 n1SCEcha == 6 || n1SCEcha == 7 )
1917 if( ds_sc == 3 ){ds_sc = 25;}
1929 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
1931 if( n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
1933 ds_sc =
fT2d_DSSC[n1DeeNumber-1][n1DeeSCEcna-1];
1938 cout <<
"!TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> n1DeeSCEcna = " << n1DeeSCEcna
1945 if( n1DeeNumber != 0 )
1947 cout <<
"!TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
1953 cout <<
"TEcnaNumbering::GetDSSCFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
1965 Int_t dee_sc_cons = -1;
1967 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
1969 if( n1DeeSCEcna > 0 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
1975 cout <<
"!TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> *** WARNING *** n1DeeSCEcna = " << n1DeeSCEcna
1977 <<
"] ). Nb for const. forced to " <<
fT2d_DeeSCCons[n1DeeNumber-1][19] <<
"." << endl;
1983 if( n1DeeNumber != 0 )
1985 cout <<
"!TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> n1DeeNumber = " << n1DeeNumber
1991 cout <<
"TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(...)> Dee = " << n1DeeNumber
2000 const Int_t& n1SCEcha)
2005 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 )
2007 if( n1SCEcha == 11 )
2009 if( dee_sc_cons == 261 ){dee_sc_cons = 268;}
2010 if( dee_sc_cons == 112 ){dee_sc_cons = 119;}
2012 if( n1SCEcha == 1 || n1SCEcha == 2 || n1SCEcha == 3 ||
2013 n1SCEcha == 6 || n1SCEcha == 7 )
2015 if( dee_sc_cons == 178 ){dee_sc_cons = 207;}
2016 if( dee_sc_cons == 29 ){dee_sc_cons = 58;}
2026 Int_t dee_sc_ecna = -1;
2028 if( n1DeeNumber > 0 && n1DeeNumber <= fEcal->MaxDeeInEE() )
2030 Int_t off_set_cons = 0;
2033 if( DeeSCCons > off_set_cons && DeeSCCons <= fEcal->MaxSCForConsInDee()+off_set_cons )
2039 cout <<
"!TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> DeeSCCons = " << DeeSCCons
2040 <<
". Out of range ( range = [ " << off_set_cons+1
2047 if( n1DeeNumber != 0 )
2049 cout <<
"!TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> n1DeeNumber = " << n1DeeNumber
2055 cout <<
"TEcnaNumbering::Get1DeeSCEcnaFromDeeSCCons(...)> Dee = " << n1DeeNumber
2067 TString SCType =
"Connected";
2069 if( nb_for_cons == 182 || nb_for_cons == 33 ){SCType =
"NotConnected";}
2071 if( nb_for_cons == 178 || nb_for_cons == 29 ){SCType =
"NotConnected";}
2072 if( nb_for_cons == 207 || nb_for_cons == 58 ){SCType =
"NotConnected";}
2074 if( nb_for_cons == 298 || nb_for_cons == 149 ){SCType =
"NotConnected";}
2076 if( nb_for_cons == 261 || nb_for_cons == 112 ){SCType =
"NotConnected";}
2077 if( nb_for_cons == 268 || nb_for_cons == 119 ){SCType =
"NotConnected";}
2079 if( nb_for_cons == 281 || nb_for_cons == 132 ){SCType =
"NotConnected";}
2081 if( nb_for_cons == 161 || nb_for_cons == 12 ){SCType =
"NotComplete";}
2082 if( nb_for_cons == 216 || nb_for_cons == 67 ){SCType =
"NotComplete";}
2083 if( nb_for_cons == 224 || nb_for_cons == 75 ){SCType =
"NotComplete";}
2084 if( nb_for_cons == 286 || nb_for_cons == 137 ){SCType =
"NotComplete";}
2106 TString SCQuad =
"top";
2108 if (n1DeeSCEcna >= 1 && n1DeeSCEcna <= 10){SCQuad =
"bottom";}
2109 if (n1DeeSCEcna >= 21 && n1DeeSCEcna <= 30){SCQuad =
"bottom";}
2110 if (n1DeeSCEcna >= 41 && n1DeeSCEcna <= 50){SCQuad =
"bottom";}
2111 if (n1DeeSCEcna >= 61 && n1DeeSCEcna <= 70){SCQuad =
"bottom";}
2112 if (n1DeeSCEcna >= 81 && n1DeeSCEcna <= 90){SCQuad =
"bottom";}
2113 if (n1DeeSCEcna >= 101 && n1DeeSCEcna <= 110){SCQuad =
"bottom";}
2114 if (n1DeeSCEcna >= 121 && n1DeeSCEcna <= 130){SCQuad =
"bottom";}
2115 if (n1DeeSCEcna >= 141 && n1DeeSCEcna <= 150){SCQuad =
"bottom";}
2116 if (n1DeeSCEcna >= 161 && n1DeeSCEcna <= 170){SCQuad =
"bottom";}
2117 if (n1DeeSCEcna >= 181 && n1DeeSCEcna <= 190){SCQuad =
"bottom";}
2127 if ( SCQuadType ==
"top" && sDeeDir ==
"right" ){itype = 0;}
2128 if ( SCQuadType ==
"top" && sDeeDir ==
"left" ){itype = 1;}
2129 if ( SCQuadType ==
"bottom" && sDeeDir ==
"left" ){itype = 2;}
2130 if ( SCQuadType ==
"bottom" && sDeeDir ==
"right" ){itype = 3;}
2142 TString eetype =
"EE+";
2143 if ( n1DeeNumber == 1 || n1DeeNumber == 2 ){eetype =
"EE+";}
2144 if ( n1DeeNumber == 3 || n1DeeNumber == 4 ){eetype =
"EE-";}
2151 TString
type =
"EE+F";
2152 if ( n1DeeNumber == 1 ){type =
"EE+F";}
2153 if ( n1DeeNumber == 2 ){type =
"EE+N";}
2154 if ( n1DeeNumber == 3 ){type =
"EE-N";}
2155 if ( n1DeeNumber == 4 ){type =
"EE-F";}
2164 TString sDeeDir =
"right";
2165 if ( (n1DeeNumber == 1) || (n1DeeNumber == 3) ){sDeeDir =
"right";}
2166 if ( (n1DeeNumber == 2) || (n1DeeNumber == 4) ){sDeeDir =
"left" ;}
2175 if ( sDeeDir ==
"right" ){iDeeDir = 0;}
2176 if ( sDeeDir ==
"left" ){iDeeDir = 1;}
2188 const Int_t& i0SCEcha)
2195 Int_t IXCrysInSC =
fT2d_ich_IX[type_index][i0SCEcha+1] + 1;
2208 const Int_t& i0SCEcha)
2219 const Int_t& i0SCEcha)
2226 Int_t JYCrysInSC =
fT2d_jch_JY[type_index][i0SCEcha+1] + 1;
2239 const Int_t& i0SCEcha)
2253 Int_t nb_of_sc = -1;
2254 if( DeeDS == 1 || DeeDS == 9 ){nb_of_sc = 33;}
2255 if( DeeDS == 2 || DeeDS == 8 ){nb_of_sc = 32;}
2256 if( DeeDS == 3 || DeeDS == 7 ){nb_of_sc = 34;}
2257 if( DeeDS == 4 || DeeDS == 6 ){nb_of_sc = 33;}
2258 if( DeeDS == 5){nb_of_sc = 34;}
2288 Double_t i_IX_min = (Int_t)1.;
2334 Double_t j_IY_min = (Double_t)1.;
2352 TString
type =
"EE-";
2354 if ( n1DeeNumber == 1 || n1DeeNumber == 2 ){type =
"EE+";}
2355 if ( n1DeeNumber == 3 || n1DeeNumber == 4 ){type =
"EE-";}
2366 TString xdirection =
"x";
2368 if(
GetEEDeeType(n1DeeNumber) ==
"EE+F" ){xdirection =
"-x";}
2369 if(
GetEEDeeType(n1DeeNumber) ==
"EE+N" ){xdirection =
"-x";}
2370 if(
GetEEDeeType(n1DeeNumber) ==
"EE-N" ){xdirection =
"x";}
2371 if(
GetEEDeeType(n1DeeNumber) ==
"EE-F" ){xdirection =
"x";}
2378 TString ydirection =
"-x";
2380 if(
GetEEDeeType(n1DeeNumber) ==
"endcap+" ){ydirection =
"-x";}
2381 if(
GetEEDeeType(n1DeeNumber) ==
"endcap-" ){ydirection =
"-x";}
2389 TString jydirection =
"x";
2411 Int_t n1StexStin = 0;
2420 const Int_t& i0StinEcha)
2425 Int_t StexEcha = (Int_t)(-1.);
2427 if ( n1StexStin > 0 && n1StexStin <= fEcal->MaxStinEcnaInStex() &&
2432 cout <<
"!TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha *** ERROR ***> VALUE"
2433 <<
" OUT OF RANGE. Forced to -1. Argument values: n1StexStin = " << n1StexStin
2434 <<
", channel = " << i0StinEcha
2440 const Int_t& i0StinEcha,
const Int_t& StexNumber)
2446 Int_t n1StexCrys = (Int_t)0;
2461 Double_t IHocoMin = (Double_t)0.;
2469 Double_t IHocoMax = (Double_t)0.;
2477 Double_t IVecoMin = (Double_t)0.;
2485 Double_t IVecoMax = (Double_t)0.;
2493 Double_t JVecoMin = (Double_t)0.;
2500 Double_t JVecoMax = (Double_t)0.;
2512 TString half_stas =
"EB? EE?";
2526 Int_t EBSMNumber = 0;
2527 if( FEDNumber >= 610 && FEDNumber <= 645 ){EBSMNumber = FEDNumber - 609;}
2533 Int_t EEDSNumber = 0;
2535 if( FEDNumber >= 600 && FEDNumber <= 609 ){EEDSNumber = FEDNumber - 599;}
2536 if( FEDNumber >= 646 && FEDNumber <= 655 ){EEDSNumber = FEDNumber - 645;}
2556 if( n_for_cons == 12 || n_for_cons == 67 || n_for_cons == 75 || n_for_cons == 137 ||
2557 n_for_cons == 161 || n_for_cons == 216 || n_for_cons == 224 || n_for_cons == 286 ){max_crys = 20;}
2560 if( (n_for_cons == 182 || n_for_cons == 33) && (n1DeeSCEcna == 60 || n1DeeSCEcna == 119) ){max_crys = 10;}
2562 if( (n_for_cons == 178 || n_for_cons == 29) && (n1DeeSCEcna == 138 || n1DeeSCEcna == 157) ){max_crys = 10;}
2563 if( (n_for_cons == 207 || n_for_cons == 58) && (n1DeeSCEcna == 176 || n1DeeSCEcna == 193) ){max_crys = 10;}
2565 if( (n_for_cons == 298 || n_for_cons == 149) && (n1DeeSCEcna == 188) ){max_crys = 10;}
2567 if( (n_for_cons == 261 || n_for_cons == 112) && (n1DeeSCEcna == 144 || n1DeeSCEcna == 165) ){max_crys = 10;}
2568 if( (n_for_cons == 268 || n_for_cons == 119) && (n1DeeSCEcna == 102 || n1DeeSCEcna == 123) ){max_crys = 10;}
2570 if( (n_for_cons == 281 || n_for_cons == 132) && (n1DeeSCEcna == 41) ){max_crys = 10;}
2573 if( s_option ==
"TEcnaRun" || s_option ==
"TEcnaRead" )
2575 if( s_option ==
"TEcnaRun" )
2578 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 ){max_crys = 5;}
2579 if( n1DeeSCEcna == 10 || n1DeeSCEcna == 11 ){max_crys = 1;}
2581 if( s_option ==
"TEcnaRead" )
2584 if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 ){max_crys = 5;}
2585 if( n1DeeSCEcna == 10 || n1DeeSCEcna == 11 ){max_crys = 1;}
2590 cout <<
"!TEcnaNumbering::MaxCrysInStinEcna(...)> " << s_option
2591 <<
": unknown option." <<
fTTBELL << 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 &)
Int_t Get1DeeSCEcnaFrom1DeeCrys(const Int_t &, const TString)
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 GetHashedNumberFromIEtaAndIPhi(const Int_t &, const Int_t &)
Int_t Get1SMTowFrom1SMCrys(const Int_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 GetDeeDirIndex(const TString)
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 MaxCrysInStinEcna(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 &)
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 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 GetIXCrysInDee(const Int_t &, const Int_t &, const Int_t &)
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
Int_t GetSCQuadTypeIndex(const TString, const TString)
Double_t GetIEtaMax(const Int_t &, const Int_t &)
TString GetStexHalfStas(const Int_t &)
TString GetEEDeeEndcap(const Int_t &)
void SetEcalSubDetector(const TString, const TEcnaParEcal *)
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 &)
Int_t Get1StexCrysFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &, const Int_t &)
TString fCodeChNumberingLvrbTop
TString GetXDirectionEB(const Int_t &)
Int_t Get1DeeCrysFrom1DeeSCEcnaAnd0SCEcha(const Int_t &, const Int_t &, const TString)