15 #include "CLHEP/Units/GlobalPhysicalConstants.h"
16 #include "CLHEP/Units/GlobalSystemOfUnits.h"
23 edm::LogInfo(
"HCalGeom") <<
"Creating HcalNumberingFromDDD";
28 edm::LogInfo(
"HCalGeom") <<
"Deleting HcalNumberingFromDDD";
32 CLHEP::Hep3Vector
point,
37 double hx = point.x();
38 double hy = point.y();
39 double hz = point.z();
40 double hR =
sqrt(hx*hx+hy*hy+hz*hz);
42 double hsintheta =
sin(htheta);
43 double hphi = (hR*hsintheta == 0. ? 0. :atan2(hy,hx));
44 double heta = (fabs(hsintheta) == 1.? 0. : -
log(fabs(
tan(htheta/2.))) );
52 hR =
sqrt(hx*hx+hy*hy);
53 etaR = (heta >= 0. ? hR : -hR);
65 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: point = " << point <<
" det "
66 << hsubdet <<
" eta/R " << etaR <<
" phi " << hphi;
78 double heta = fabs(eta);
84 if ((ieta <=
etaMin[1] && depth==3) || ieta >
etaMax[0]) {
94 etaR = (eta >= 0. ? hR : -hR);
110 double hetaR = fabs(etaR);
116 for (
int i =
nR-1;
i > 0;
i--)
119 if (ieta >
etaMax[2]-2 ) {
124 for (
int i = 0;
i <
nEta-1;
i++)
129 if (lay == 18 &&
nOff.size() > 13) {
130 if (hetaR >
etaHO[1] && ieta ==
nOff[13]) ieta++;
139 int nphi = int((CLHEP::twopi+0.1*fibin)/fibin);
140 int zside = etaR>0 ? 1: 0;
141 double hphi = phi+fioff;
142 if (hphi < 0) hphi += CLHEP::twopi;
143 int iphi = int(hphi/fibin) + 1;
144 if (iphi > nphi) iphi = 1;
147 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: etaR = " << etaR <<
" : "
148 << zside <<
"/" << ieta <<
" phi " << hphi <<
" : "
165 double fibin =
phibin[etaR-1];
166 int depth0 =
depth1[etaR-1];
167 int kphi = phi + int((
phioff[3]+0.1)/fibin);
168 kphi = (kphi-1)%4 + 1;
169 if (etaR ==
nOff[0] && (kphi == 2 || kphi == 3)) depth0--;
170 if (lay <=
depth2[etaR-1]) {
171 if (lay <= depth0) depth = 1;
173 }
else if (lay <=
depth3[etaR-1]) {
176 }
else if (det == static_cast<int>(
HcalBarrel)) {
177 if (depth==3) depth = 2;
180 if (etaR <=
etaMin[1]) depth = 3;
183 if (etaR ==
nOff[1] && depth > 2 && det == static_cast<int>(
HcalEndcap))
185 if (det == static_cast<int>(
HcalBarrel) && depth == 4) {
191 if (units==2) iphi_skip = (phi-1)*2+1;
192 else if (units==4) iphi_skip = (phi-1)*4-1;
193 if (iphi_skip < 0) iphi_skip += 72;
196 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: phi units=" << units
197 <<
" iphi_skip=" << iphi_skip;
202 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: det = " << det <<
" "
203 << tmp.
subdet <<
" zside = " << tmp.
zside <<
" depth = "
204 << tmp.
depth <<
" eta/R = " << tmp.
etaR <<
" phi = "
205 << tmp.
phi <<
" layer = " << tmp.
lay;
212 int iphi,
bool corr)
const {
223 if (etaR >=
nOff[2] && depth == 3 && idet == static_cast<int>(
HcalBarrel))
226 double eta = 0, deta = 0,
phi = 0, dphi = 0, rz = 0, drz = 0;
227 bool ok =
false, flagrz =
true;
230 && etaR >=etaMn && etaR <= etaMx)
233 if (depth < 3 && etaR <=
etaMin[1]) ok =
false;
234 else if (depth > 2 && etaR ==
nOff[1]) ok =
false;
237 int maxlay = (int)(
rHB.size());
238 if (idet == static_cast<int>(
HcalEndcap)) maxlay = (
int)(
zHE.size());
239 eta =
getEta(idet, etaR, zside, depth);
246 }
else if (idet == static_cast<int>(
HcalEndcap)) {
252 if (etaR >
etaMax[2]-2 ) fioff += 0.5*fibin;
254 phi = fioff + (iphi - 0.5)*fibin;
258 if (ir > 0 && ir <
nR) {
264 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: wrong eta " << etaR
265 <<
" (" << ir <<
"/" <<
nR <<
") Detector "
269 if (depth != 1 && depth != 2) {
272 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: wrong depth " << depth
273 <<
" in Detector " << idet;
276 }
else if (etaR <=
nEta) {
277 int depth0 =
depth1[etaR-1];
278 int kphi = iphi + int((
phioff[3]+0.1)/fibin);
279 kphi = (kphi-1)%4 + 1;
280 if (etaR ==
nOff[0] && (kphi == 2 || kphi == 3)) depth0--;
284 if (idet==static_cast<int>(
HcalEndcap)) laymin = 2;
286 if (
nOff.size() > 12) {
287 if (etaR ==
nOff[6]) {
290 }
else if (etaR ==
nOff[9]) {
294 }
else if (depth == 2) {
299 if (
nOff.size() > 12) {
300 if (etaR ==
nOff[9]) laymax =
nOff[11];
301 if (etaR ==
nOff[6]) laymax =
nOff[12];
303 }
else if (depth == 3) {
304 laymin =
depth2[etaR-1]+1;
307 if (
nOff.size() > 4) laymin =
nOff[4];
308 if (
nOff.size() > 5) laymax =
nOff[5];
311 laymin =
depth3[etaR-1]+1;
314 if (idet == static_cast<int>(
HcalOuter) &&
nOff.size() > 13) {
315 if (etaR >
nOff[13] && laymin <= laymax) laymin = laymax;
318 if (laymin <= maxlay && laymax <= maxlay && laymin <= laymax) {
321 if (depth == 1 || laymin <= 1) d1 =
zHE[laymin-1] -
dzHE[laymin-1];
322 else d1 =
zHE[laymin-2] + dzHE[laymin-2];
323 d2 =
zHE[laymax-1] + dzHE[laymax-1];
325 if (idet == static_cast<int>(
HcalOuter) ||
326 depth == 1 || laymin <=1) d1 =
rHB[laymin-1] -
drHB[laymin-1];
327 else d1 =
rHB[laymin-2] +
drHB[laymin-1];
328 d2 =
rHB[laymax-1] + drHB[laymax-1];
335 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: wrong depth " << depth
336 <<
" (Layer minimum " << laymin <<
" maximum "
337 << laymax <<
" maxLay " << maxlay <<
")";
343 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: wrong eta " << etaR
344 <<
"/" <<
nEta <<
" Detector " << idet;
350 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: wrong eta " << etaR
357 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: det/side/depth/etaR/phi "
358 << det <<
"/" << zside <<
"/" << depth <<
"/" << etaR
359 <<
"/" << iphi <<
" Cell Flag " << tmp.
ok <<
" "
360 << tmp.
eta <<
" " << tmp.
deta <<
" phi " << tmp.
phi
361 <<
" " << tmp.
dphi <<
" r(z) " << tmp.
rz <<
" "
375 unsigned int num = 0;
377 for (
unsigned int i=0;
i<cellTypes.size();
i++) {
378 num += (
unsigned int)(cellTypes[
i].nPhiBins());
379 if (cellTypes[
i].nHalves() > 1)
380 num += (
unsigned int)(cellTypes[
i].nPhiBins());
381 num -= (
unsigned int)(cellTypes[
i].nPhiMissingBins());
384 LogDebug (
"HCalGeom") <<
"HcalNumberingFromDDD:numberOfCells "
385 << cellTypes.size() <<
" " << num
386 <<
" for subdetector " << subdet;
395 LogDebug (
"HCalGeom") <<
"HcalNumberingFromDDD: " << cellTypes.size()
396 <<
" cells of type HCal Barrel";
397 for (
unsigned int i=0;
i<cellTypes.size();
i++)
398 LogDebug (
"HCalGeom") <<
"Cell " <<
i <<
" " << cellTypes[
i];
403 LogDebug (
"HCalGeom") <<
"HcalNumberingFromDDD: " << hoCells.size()
404 <<
" cells of type HCal Outer";
405 for (
unsigned int i=0;
i<hoCells.size();
i++)
406 LogDebug (
"HCalGeom") <<
"Cell " <<
i <<
" " << hoCells[
i];
408 cellTypes.insert(cellTypes.end(), hoCells.begin(), hoCells.end());
412 LogDebug (
"HCalGeom") <<
"HcalNumberingFromDDD: " << heCells.size()
413 <<
" cells of type HCal Endcap";
414 for (
unsigned int i=0;
i<heCells.size();
i++)
415 LogDebug (
"HCalGeom") <<
"Cell " <<
i <<
" " << heCells[
i];
417 cellTypes.insert(cellTypes.end(), heCells.begin(), heCells.end());
421 LogDebug (
"HCalGeom") <<
"HcalNumberingFromDDD: " << hfCells.size()
422 <<
" cells of type HCal Forward";
423 for (
unsigned int i=0;
i<hfCells.size();
i++)
424 LogDebug (
"HCalGeom") <<
"Cell " <<
i <<
" " << hfCells[
i];
426 cellTypes.insert(cellTypes.end(), hfCells.begin(), hfCells.end());
433 std::vector<HcalCellType> cellTypes;
435 if (
dzVcal < 0)
return cellTypes;
442 dmin = 1; dmax = 3; indx = 1; nz =
nzHE; nmod =
nmodHE;
445 dmin = 1; dmax = 2; indx = 2; nz = 2; nmod = 18;
448 dmin = 4; dmax = 4; indx = 0; nz =
nzHB; nmod =
nmodHB;
451 dmin = 1; dmax = 3; indx = 0; nz =
nzHB; nmod =
nmodHB;
455 int phi = 1, zside = 1;
459 int subdet0 =
static_cast<int>(subdet);
460 for (
int depth=dmin; depth<=
dmax; depth++) {
462 double gain =
getGain (subdet, depth);
464 if (depth == 1) hsize =
dzVcal;
472 shift, gain, nz, nmod, hsize, units);
475 std::vector<int> missPlus, missMinus;
477 for (
int miss=0; miss<
nOff[16]; miss++) {
478 missPlus.push_back(nOff[kk]);
481 for (
int miss=0; miss<nOff[17]; miss++) {
482 missMinus.push_back(nOff[kk]);
488 cellTypes.push_back(temp2);
497 std::cout <<
"Tile Information for HB:\n" <<
"========================\n\n";
501 for (
int depth=1; depth<=
dmax; depth++)
505 std::cout <<
"\nTile Information for HE:\n" <<
"========================\n\n";
515 for (
int depth=dmin; depth<=
dmax; depth++)
526 if (ir > 0 && ir <
nR) {
532 if (etaR > 0 && etaR <
nEta) {
533 if (etaR ==
nOff[1]-1 && depth > 2) {
535 }
else if (det == static_cast<int>(
HcalOuter) &&
nOff.size() > 13) {
536 if (etaR ==
nOff[13]) {
538 }
else if (etaR ==
nOff[13]+1) {
540 }
else if (etaR ==
nOff[14]) {
542 }
else if (etaR ==
nOff[14]+1) {
552 if (zside == 0) tmp = -
tmp;
554 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::getEta " << etaR <<
" "
555 << zside <<
" " << depth <<
" ==> " <<
tmp;
563 if (z != 0) tmp = -
log(
tan(0.5*atan(r/z)));
565 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::getEta " << r <<
" " << z
576 if (ir > 0 && ir <
nR) {
582 if (etaR > 0 && etaR <
nEta) {
583 if (etaR ==
nOff[1]-1 && depth > 2) {
585 }
else if (det == static_cast<int>(
HcalOuter) &&
nOff.size() > 13) {
586 if (etaR ==
nOff[13]) {
588 }
else if (etaR ==
nOff[13]+1) {
590 }
else if (etaR ==
nOff[14]) {
592 }
else if (etaR ==
nOff[14]+1) {
603 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::deltaEta " << etaR <<
" "
604 << depth <<
" ==> " <<
tmp;
612 std::string attribute =
"ReadOutName";
613 edm::LogInfo(
"HCalGeom") <<
"HcalNumberingFromDDD: Initailise for " << name
614 <<
" as " << attribute;
630 edm::LogError(
"HCalGeom") <<
"HcalNumberingFromDDD: cannot get filtered "
631 <<
" view for " << attribute <<
" matching "
633 throw cms::Exception(
"DDException") <<
"HcalNumberingFromDDD: cannot match " << attribute <<
" to " <<
name;
638 LogDebug (
"HCalGeom") <<
"HcalNumberingFromDDD: " << cellTypes.size()
639 <<
" cells of type HCal (All)";
640 for (
unsigned int i=0;
i<cellTypes.size();
i++)
641 LogDebug (
"HCalGeom") <<
"Cell " <<
i <<
" " << cellTypes[
i];
651 std::vector<double> tmp1 =
getDDDArray(
"phioff",sv,nphi);
652 phioff.resize(tmp1.size());
653 for (i=0; i<nphi; i++) {
656 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: phioff[" << i <<
"] = "
665 for (i=0; i<
nEta; i++) {
668 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: etaTable[" << i <<
"] = "
676 rTable.resize(tmp3.size());
677 for (i=0; i<
nR; i++) {
680 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: rTable[" << i <<
"] = "
686 nPhi = nEta + nR - 2;
688 phibin.resize(tmp4.size());
689 for (i=0; i<
nPhi; i++) {
692 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: phibin[" << i <<
"] = "
705 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: " <<
nDepth <<
" Depths";
710 for (i=0; i<
nDepth; i++) {
711 depth1[
i] =
static_cast<int>(d1[
i]);
712 depth2[
i] =
static_cast<int>(d2[
i]);
713 depth3[
i] =
static_cast<int>(d3[
i]);
715 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: depth1[" << i <<
"] = "
717 <<
" depth3[" << i <<
"] = " <<
depth3[
i];
723 std::vector<double> tmp5 =
getDDDArray(
"etaMin",sv,ndx);
724 std::vector<double> tmp6 =
getDDDArray(
"etaMax",sv,ndx);
727 for (i=0; i<ndx; i++) {
728 etaMin[
i] =
static_cast<int>(tmp5[
i]);
729 etaMax[
i] =
static_cast<int>(tmp6[
i]);
735 for (i=0; i<ndx; i++)
736 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: etaMin[" << i <<
"] = "
742 std::vector<double> gpar =
getDDDArray(
"gparHF",sv,ngpar);
747 <<
" zVcal " <<
zVcal;
752 std::vector<double> nvec =
getDDDArray(
"noff",sv,noff);
754 for (i=0; i<noff; i++) {
755 nOff[
i] =
static_cast<int>(nvec[
i]);
757 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: nOff[" << i <<
"] = "
765 std::vector<double> tmp7 =
getDDDArray(
"HBShift",sv,ndx);
768 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD:: Gain factor and Shift for "
769 <<
"HB depth layers:";
771 for (i=0; i<ndx; i++) {
774 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD:: gainHB[" << i <<
"] = "
775 <<
gainHB[
i] <<
" shiftHB[" << i <<
"] = "
783 std::vector<double> tmp8 =
getDDDArray(
"HEShift",sv,ndx);
786 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD:: Gain factor and Shift for "
787 <<
"HE depth layers:";
789 for (i=0; i<ndx; i++) {
792 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD:: gainHE[" << i <<
"] = "
793 <<
gainHE[
i] <<
" shiftHE[" << i <<
"] = "
801 std::vector<double> tmp9 =
getDDDArray(
"HFShift",sv,ndx);
804 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD:: Gain factor and Shift for "
805 <<
"HF depth layers:";
807 for (i=0; i<ndx; i++) {
810 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD:: gainHF[" << i <<
"] = "
811 <<
gainHF[
i] <<
" shiftHF[" << i <<
"] = "
819 bool dodet=
true, hf=
false;
820 std::vector<double> rb(20,0.0), ze(20,0.0), thkb(20,-1.0), thke(20,-1.0);
821 std::vector<int> ib(20,0), ie(20,0);
822 std::vector<int> izb, phib, ize, phie, izf, phif;
823 std::vector<double> rxb;
834 int idet = 0, lay = -1;
835 int nsiz = (int)(copy.size());
836 if (nsiz>0) lay = copy[nsiz-1]/10;
837 if (nsiz>1) idet = copy[nsiz-2]/1000;
838 double dx=0, dy=0, dz=0, dx1=0, dx2=0;
839 if (sol.
shape() == 1) {
844 }
else if (sol.
shape() == 3) {
848 dx = 0.25*(trp.
x1()+trp.
x2()+trp.
x3()+trp.
x4());
849 dy = 0.5*(trp.
y1()+trp.
y2());
851 }
else if (sol.
shape() == 2) {
861 <<
" Layer " << lay <<
" R " << t.Rho();
863 if (lay >=0 && lay < 20) {
866 if (thkb[lay] <= 0) {
867 if (lay < 17) thkb[lay] = dx;
872 for (
unsigned int k=0;
k<rxb.size();
k++) {
879 rxb.push_back(t.Rho());
882 dyxb.push_back(2.*dy);
883 dzxb.push_back(2.*dz);
889 int iz = copy[nsiz-5];
890 int fi = copy[nsiz-4];
891 unsigned int it1 =
find(iz, izb);
892 if (it1 == izb.size()) izb.push_back(iz);
893 unsigned int it2 =
find(fi, phib);
894 if (it2 == phib.size()) phib.push_back(fi);
898 if (nsiz>2) ifi = copy[nsiz-3];
899 if (nsiz>3) ich = copy[nsiz-4];
903 if (ifi == 1 && ich == 4) {
910 for (
unsigned int kk=0;
kk<
zho.size();
kk++) {
914 }
else if (z2 <
zho[kk]) {
916 for (
unsigned int kz=
zho.size()-1; kz>kk+1; kz=kz-2) {
931 LogDebug(
"HCalGeom") <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi <<
" " << ich <<
" z " << z1 <<
" " << z2;
935 }
else if (idet == 4) {
939 <<
" Layer " << lay <<
" Z " << t.z();
941 if (lay >=0 && lay < 20) {
944 if (thke[lay] <= 0) thke[lay] = dz;
946 for (
unsigned int k=0;
k<
zxe.size();
k++) {
958 dx1e.push_back(-dx1);
959 dx2e.push_back(-dx2);
963 if (copy[nsiz-1] == 21) {
964 int iz = copy[nsiz-7];
965 int fi = copy[nsiz-5];
966 unsigned int it1 =
find(iz, ize);
967 if (it1 == ize.size()) ize.push_back(iz);
968 unsigned int it2 =
find(fi, phie);
969 if (it2 == phie.size()) phie.push_back(fi);
971 }
else if (idet == 5) {
974 const std::vector<double> & paras = sol.
parameters();
977 <<
" Z " << t.z() <<
" with " << paras.size()
979 for (
unsigned j=0;
j<paras.size();
j++)
980 LogDebug(
"HCalGeom") <<
"HF Parameter[" <<
j <<
"] = " << paras[
j];
984 int nz = (int)(paras.size())-3;
986 dzVcal = 0.5*(paras[nz]-paras[3]);
996 LogDebug(
"HCalGeom") <<
"Unknown Detector " << idet <<
" for "
997 << sol.
name() <<
" Shape " << sol.
shape() <<
" R "
998 << t.Rho() <<
" Z " << t.z();
1004 int ibmx = 0, iemx = 0;
1005 for (
int i = 0;
i < 20;
i++) {
1007 rb[
i] /= (double)(ib[
i]);
1011 ze[
i] /= (double)(ie[
i]);
1015 LogDebug(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " << ib[
i] <<
" "
1016 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i];
1019 for (
int i = 4;
i >= 0;
i--) {
1020 if (ib[
i] == 0) {rb[
i] = rb[
i+1]; thkb[
i] = thkb[
i+1];}
1021 if (ie[
i] == 0) {ze[
i] = ze[
i+1]; thke[
i] = thke[
i+1];}
1023 if (ib[
i] == 0 || ie[
i] == 0)
1024 LogDebug(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " << ib[
i] <<
" "
1025 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i];
1030 for (
unsigned int k=0;
k<
layb.size(); ++
k)
1032 for (
unsigned int k=0;
k<
laye.size(); ++
k)
1036 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: Maximum Layer for HB "
1037 << ibmx <<
" for HE " << iemx <<
" Z for HF " << zf
1044 for (
int i=0;
i<ibmx;
i++) {
1048 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: rHB[" <<
i <<
"] = "
1049 <<
rHB[
i] <<
" drHB[" <<
i <<
"] = " <<
drHB[
i];
1056 for (
int i=0;
i<iemx;
i++) {
1060 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: zHE[" <<
i <<
"] = "
1061 <<
zHE[
i] <<
" dzHE[" <<
i <<
"] = " <<
dzHE[
i];
1066 nzHB = (int)(izb.size());
1067 nmodHB = (int)(phib.size());
1069 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nzHB
1070 <<
" barrel half-sectors";
1072 LogDebug(
"HCalGeom") <<
"Section " <<
i <<
" Copy number " << izb[
i];
1073 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nmodHB
1074 <<
" barrel modules";
1076 LogDebug(
"HCalGeom") <<
"Module " <<
i <<
" Copy number " << phib[
i];
1079 nzHE = (int)(ize.size());
1080 nmodHE = (int)(phie.size());
1082 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nzHE
1083 <<
" endcap half-sectors";
1085 LogDebug(
"HCalGeom") <<
"Section " <<
i <<
" Copy number " << ize[
i];
1086 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nmodHE
1087 <<
" endcap modules";
1089 LogDebug(
"HCalGeom") <<
"Module " <<
i <<
" Copy number " << phie[
i];
1093 LogDebug(
"HCalGeom") <<
"HO has Z of size " <<
zho.size();
1094 for (
unsigned int kk=0;
kk<
zho.size();
kk++)
1097 if (ibmx > 17 && zho.size() > 4) {
1114 for (
int i=0;
i<4; ++
i)
std::cout <<
" eta[" <<
i <<
"] = " << etaHO[
i];
1115 for (
unsigned int i=0;
i<zho.size(); ++
i)
std::cout <<
" zho[" <<
i <<
"] = " << zho[
i];
1124 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD:getDDDArray called for "
1125 << str <<
" with nMin " << nmin;
1132 const std::vector<double> & fvec = value.
doubles();
1133 int nval = fvec.size();
1136 edm::LogError(
"HCalGeom") <<
"HcalNumberingFromDDD : # of " << str
1137 <<
" bins " << nval <<
" < " << nmin
1139 throw cms::Exception(
"DDException") <<
"HcalNumberingFromDDD: cannot get array " << str;
1143 edm::LogError(
"HCalGeom") <<
"HcalNumberingFromDDD : # of " << str
1144 <<
" bins " << nval <<
" < 2 ==> illegal"
1145 <<
" (nmin=" << nmin <<
")";
1146 throw cms::Exception(
"DDException") <<
"HcalNumberingFromDDD: cannot get array " << str;
1152 edm::LogError(
"HCalGeom") <<
"HcalNumberingFromDDD: cannot get array "
1154 throw cms::Exception(
"DDException") <<
"HcalNumberingFromDDD: cannot get array " << str;
1193 std::vector<int> array)
const {
1195 unsigned int id = array.size();
1196 for (
unsigned int i = 0;
i < array.size();
i++) {
1197 if (element == array[
i]) {
1207 const double fiveDegInRad = 2*
M_PI/72;
1212 units=int(
phibin[etaR-1]/fiveDegInRad+0.5);
1220 double thetaL = 2.*atan(
exp(-etaL));
1222 double thetaH = 2.*atan(
exp(-etaH));
1230 std::cout <<
"\ntileHB:: eta|depth " << eta <<
"|" << depth <<
" theta " << thetaH/CLHEP::deg <<
":" << thetaL/CLHEP::deg <<
" Layer " << layL <<
":" << layH-1 <<
"\n";
1231 for (
int lay=layL; lay<layH; ++lay) {
1232 std::vector<double> area(2,0);
1234 for (
unsigned int k=0;
k<
layb.size(); ++
k) {
1235 if (lay ==
layb[
k]) {
1245 if (area[0] > 0)
std::cout << std::setw(2) << lay <<
" Area " << std::setw(8) << area[0] <<
" " << std::setw(8) << area[1] <<
"\n";
1252 double thetaL = 2.*atan(
exp(-etaL));
1254 double thetaH = 2.*atan(
exp(-etaH));
1258 }
else if (depth == 1) {
1260 }
else if (depth == 2) {
1267 double phib =
phibin[eta-1];
1269 if (phib > 6*CLHEP::deg) nphi = 1;
1270 std::cout <<
"\ntileHE:: Eta/depth " << eta <<
"|" << depth <<
" theta " << thetaH/CLHEP::deg <<
":" << thetaL/CLHEP::deg <<
" Layer " << layL <<
":" << layH-1 <<
" phi " << nphi <<
"\n";
1271 for (
int lay=layL; lay<layH; ++lay) {
1272 std::vector<double> area(4,0);
1274 for (
unsigned int k=0;
k<
laye.size(); ++
k) {
1275 if (lay ==
laye[
k]) {
1278 if ((lay != 0 || eta == 18) &&
1279 (lay != 1 || (eta == 18 &&
rhoxe[k]-
dyxe[k] > 1000) || (eta != 18 &&
rhoxe[k]-
dyxe[k] < 1000)) &&
1285 double ar1=0, ar2=0;
1287 ar1 = 0.5*(rmax-rmin)*(dx1+dx2-4.*
dx1e[k]);
1289 ar1 = 0.5*(rmax-rmin)*(dx1+dx2-2.*
dx1e[k]);
1290 ar2 = 0.5*(rmax-rmin)*((rmax+rmin)*
tan(10.*CLHEP::deg)-4*
dx1e[
k])-ar1;
1298 if (area[0] > 0 && area[1] > 0) {
1300 if (eta == 18) lay0++;
1302 std::cout << std::setw(2) << lay0 <<
" Area " << std::setw(8) << area[0] <<
" " << std::setw(8) << area[1] <<
"\n";
1304 std::cout << std::setw(2) << lay0 <<
" Area " << std::setw(8) << area[0] <<
" " << std::setw(8) << area[1] <<
":" << std::setw(8) << area[2] <<
" " << std::setw(8) << area[3] <<
"\n";
1313 double eta = fabs(etaR);
1316 double zz = fabs(z);
1319 }
else if (zz >
zho[1]) {
1323 eta = (z >= 0. ? eta : -
eta);
std::vector< int > shiftHE
std::vector< int > shiftHB
std::vector< double > dx2e
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
double halfZ(void) const
half of the z-Axis
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
void addFilter(const DDFilter &, log_op op=AND)
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
std::vector< int > depth2
nav_type copyNumbers() const
return the stack of copy numbers
std::vector< double > dyxe
void tileHB(int eta, int depth)
Sin< T >::type sin(const T &t)
void setMissingPhi(std::vector< int >, std::vector< int >)
std::vector< double > zxe
std::vector< double > etaTable
Geom::Theta< T > theta() const
int getShift(HcalSubdetector subdet, int depth) const
std::vector< double > zxb
int unitPhi(int det, int etaR) const
std::vector< double > rHB
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< HcalCellType > HcalCellTypes() const
std::vector< double > drHB
double getGain(HcalSubdetector subdet, int depth) const
type of data representation of DDCompactView
std::vector< double > phibin
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
std::vector< double > rhoxe
A DDSolid represents the shape of a part.
unsigned int numberOfCells(HcalSubdetector) const
std::vector< double > zho
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
HcalNumberingFromDDD(std::string &name, const DDCompactView &cpv)
std::vector< double > dzxb
std::vector< double > gainHF
std::vector< int > shiftHF
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
std::vector< double > dyxb
double getEtaHO(double &etaR, double &x, double &y, double &z) const
const T & max(const T &a, const T &b)
bool next()
set current node to the next node in the filtered tree
std::vector< double > phioff
std::vector< double > dx1e
void initialize(std::string &name, const DDCompactView &cpv)
Cos< T >::type cos(const T &t)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Interface to a Trapezoid.
Tan< T >::type tan(const T &t)
double y1(void) const
Half-length along y of the face at -pDz.
DDSolidShape shape(void) const
The type of the solid.
std::vector< int > depth3
std::vector< double > rhoxb
unsigned find(int element, std::vector< int > array) const
std::vector< int > etaMin
std::vector< int > etaMax
void loadGeometry(DDFilteredView)
double deltaEta(int det, int eta, int depth) const
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &, int &) const
double getEta(int det, int etaR, int zside, int depth=1) const
std::vector< double > gainHB
std::vector< double > gainHE
std::vector< int > depth1
DDsvalues_type mergedSpecifics() const
std::vector< double > zHE
void tileHE(int eta, int depth)
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
std::vector< double > dzHE
std::vector< std::vector< double > > tmp
bool firstChild()
set the current node to the first child ...
double y2(void) const
Half-length along y of the face at +pDz.
void loadSpecPars(DDFilteredView)
static unsigned int const shift
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
std::vector< double > getEtaTable() const
HcalCellType::HcalCell cell(int det, int zside, int depth, int etaR, int iphi, bool corr=true) const
const DDTranslation & translation() const
The absolute translation of the current node.
HcalID unitID(int det, CLHEP::Hep3Vector pos, int depth, int lay=-1) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
std::vector< double > rTable
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.