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 const 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;
438 int dmin, dmax, indx, nz, nmod;
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;
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 <<
"] = "
820 bool dodet=
true, hf=
false;
821 std::vector<double> rb(20,0.0), ze(20,0.0), thkb(20,-1.0), thke(20,-1.0);
822 std::vector<int>
ib(20,0), ie(20,0);
823 std::vector<int> izb, phib, ize, phie, izf, phif;
824 std::vector<double> rxb;
835 int idet = 0, lay = -1;
836 int nsiz = (int)(copy.size());
837 if (nsiz>0) lay = copy[nsiz-1]/10;
838 if (nsiz>1) idet = copy[nsiz-2]/1000;
839 double dx=0, dy=0, dz=0, dx1=0, dx2=0;
840 if (sol.
shape() == 1) {
845 }
else if (sol.
shape() == 3) {
849 dx = 0.25*(trp.
x1()+trp.
x2()+trp.
x3()+trp.
x4());
850 dy = 0.5*(trp.
y1()+trp.
y2());
852 }
else if (sol.
shape() == 2) {
862 <<
" Layer " << lay <<
" R " << t.Rho();
864 if (lay >=0 && lay < 20) {
867 if (thkb[lay] <= 0) {
868 if (lay < 17) thkb[lay] = dx;
873 for (
unsigned int k=0;
k<rxb.size();
k++) {
880 rxb.push_back(t.Rho());
883 dyxb.push_back(2.*dy);
884 dzxb.push_back(2.*dz);
890 int iz = copy[nsiz-5];
891 int fi = copy[nsiz-4];
892 unsigned int it1 =
find(iz, izb);
893 if (it1 == izb.size()) izb.push_back(iz);
894 unsigned int it2 =
find(fi, phib);
895 if (it2 == phib.size()) phib.push_back(fi);
899 if (nsiz>2) ifi = copy[nsiz-3];
900 if (nsiz>3) ich = copy[nsiz-4];
904 if (ifi == 1 && ich == 4) {
911 for (
unsigned int kk=0;
kk<
zho.size();
kk++) {
915 }
else if (z2 <
zho[kk]) {
917 for (
unsigned int kz=
zho.size()-1; kz>kk+1; kz=kz-2) {
932 LogDebug(
"HCalGeom") <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi <<
" " << ich <<
" z " << z1 <<
" " << z2;
936 }
else if (idet == 4) {
940 <<
" Layer " << lay <<
" Z " << t.z();
942 if (lay >=0 && lay < 20) {
945 if (thke[lay] <= 0) thke[lay] = dz;
947 for (
unsigned int k=0;
k<
zxe.size();
k++) {
959 dx1e.push_back(-dx1);
960 dx2e.push_back(-dx2);
964 if (copy[nsiz-1] == 21) {
965 int iz = copy[nsiz-7];
966 int fi = copy[nsiz-5];
967 unsigned int it1 =
find(iz, ize);
968 if (it1 == ize.size()) ize.push_back(iz);
969 unsigned int it2 =
find(fi, phie);
970 if (it2 == phie.size()) phie.push_back(fi);
972 }
else if (idet == 5) {
975 const std::vector<double> & paras = sol.
parameters();
978 <<
" Z " << t.z() <<
" with " << paras.size()
980 for (
unsigned j=0;
j<paras.size();
j++)
981 LogDebug(
"HCalGeom") <<
"HF Parameter[" <<
j <<
"] = " << paras[
j];
985 int nz = (int)(paras.size())-3;
987 dzVcal = 0.5*(paras[nz]-paras[3]);
997 LogDebug(
"HCalGeom") <<
"Unknown Detector " << idet <<
" for "
998 << sol.
name() <<
" Shape " << sol.
shape() <<
" R "
999 << t.Rho() <<
" Z " << t.z();
1005 int ibmx = 0, iemx = 0;
1006 for (
int i = 0;
i < 20;
i++) {
1008 rb[
i] /= (double)(
ib[
i]);
1012 ze[
i] /= (double)(ie[
i]);
1016 LogDebug(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " <<
ib[
i] <<
" "
1017 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i];
1020 for (
int i = 4;
i >= 0;
i--) {
1021 if (
ib[
i] == 0) {rb[
i] = rb[
i+1]; thkb[
i] = thkb[
i+1];}
1022 if (ie[
i] == 0) {ze[
i] = ze[
i+1]; thke[
i] = thke[
i+1];}
1024 if (
ib[
i] == 0 || ie[
i] == 0)
1025 LogDebug(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " <<
ib[
i] <<
" "
1026 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i];
1031 for (
unsigned int k=0;
k<
layb.size(); ++
k)
1033 for (
unsigned int k=0;
k<
laye.size(); ++
k)
1037 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: Maximum Layer for HB "
1038 << ibmx <<
" for HE " << iemx <<
" Z for HF " << zf
1045 for (
int i=0;
i<ibmx;
i++) {
1049 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: rHB[" <<
i <<
"] = "
1050 <<
rHB[
i] <<
" drHB[" <<
i <<
"] = " <<
drHB[
i];
1057 for (
int i=0;
i<iemx;
i++) {
1061 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: zHE[" <<
i <<
"] = "
1062 <<
zHE[
i] <<
" dzHE[" <<
i <<
"] = " <<
dzHE[
i];
1067 nzHB = (int)(izb.size());
1068 nmodHB = (int)(phib.size());
1070 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nzHB
1071 <<
" barrel half-sectors";
1073 LogDebug(
"HCalGeom") <<
"Section " <<
i <<
" Copy number " << izb[
i];
1074 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nmodHB
1075 <<
" barrel modules";
1077 LogDebug(
"HCalGeom") <<
"Module " <<
i <<
" Copy number " << phib[
i];
1080 nzHE = (int)(ize.size());
1081 nmodHE = (int)(phie.size());
1083 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nzHE
1084 <<
" endcap half-sectors";
1086 LogDebug(
"HCalGeom") <<
"Section " <<
i <<
" Copy number " << ize[
i];
1087 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nmodHE
1088 <<
" endcap modules";
1090 LogDebug(
"HCalGeom") <<
"Module " <<
i <<
" Copy number " << phie[
i];
1094 LogDebug(
"HCalGeom") <<
"HO has Z of size " <<
zho.size();
1095 for (
unsigned int kk=0;
kk<
zho.size();
kk++)
1098 if (ibmx > 17 && zho.size() > 4) {
1115 for (
int i=0;
i<4; ++
i)
std::cout <<
" eta[" <<
i <<
"] = " << etaHO[
i];
1116 for (
unsigned int i=0;
i<zho.size(); ++
i)
std::cout <<
" zho[" <<
i <<
"] = " << zho[
i];
1125 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD:getDDDArray called for "
1126 << str <<
" with nMin " << nmin;
1133 const std::vector<double> & fvec = value.
doubles();
1134 int nval = fvec.size();
1137 edm::LogError(
"HCalGeom") <<
"HcalNumberingFromDDD : # of " << str
1138 <<
" bins " << nval <<
" < " << nmin
1140 throw cms::Exception(
"DDException") <<
"HcalNumberingFromDDD: cannot get array " << str;
1144 edm::LogError(
"HCalGeom") <<
"HcalNumberingFromDDD : # of " << str
1145 <<
" bins " << nval <<
" < 2 ==> illegal"
1146 <<
" (nmin=" << nmin <<
")";
1147 throw cms::Exception(
"DDException") <<
"HcalNumberingFromDDD: cannot get array " << str;
1153 edm::LogError(
"HCalGeom") <<
"HcalNumberingFromDDD: cannot get array "
1155 throw cms::Exception(
"DDException") <<
"HcalNumberingFromDDD: cannot get array " << str;
1194 std::vector<int>& array)
const {
1196 unsigned int id = array.size();
1197 for (
unsigned int i = 0;
i < array.size();
i++) {
1198 if (element == array[
i]) {
1208 const double fiveDegInRad = 2*
M_PI/72;
1213 units=int(
phibin[etaR-1]/fiveDegInRad+0.5);
1221 double thetaL = 2.*atan(
exp(-etaL));
1223 double thetaH = 2.*atan(
exp(-etaH));
1231 std::cout <<
"\ntileHB:: eta|depth " << eta <<
"|" << depth <<
" theta " << thetaH/CLHEP::deg <<
":" << thetaL/CLHEP::deg <<
" Layer " << layL <<
":" << layH-1 <<
"\n";
1232 for (
int lay=layL; lay<layH; ++lay) {
1233 std::vector<double> area(2,0);
1235 for (
unsigned int k=0;
k<
layb.size(); ++
k) {
1236 if (lay ==
layb[
k]) {
1246 if (area[0] > 0)
std::cout << std::setw(2) << lay <<
" Area " << std::setw(8) << area[0] <<
" " << std::setw(8) << area[1] <<
"\n";
1253 double thetaL = 2.*atan(
exp(-etaL));
1255 double thetaH = 2.*atan(
exp(-etaH));
1259 }
else if (depth == 1) {
1261 }
else if (depth == 2) {
1268 double phib =
phibin[eta-1];
1270 if (phib > 6*CLHEP::deg) nphi = 1;
1271 std::cout <<
"\ntileHE:: Eta/depth " << eta <<
"|" << depth <<
" theta " << thetaH/CLHEP::deg <<
":" << thetaL/CLHEP::deg <<
" Layer " << layL <<
":" << layH-1 <<
" phi " << nphi <<
"\n";
1272 for (
int lay=layL; lay<layH; ++lay) {
1273 std::vector<double> area(4,0);
1275 for (
unsigned int k=0;
k<
laye.size(); ++
k) {
1276 if (lay ==
laye[
k]) {
1279 if ((lay != 0 || eta == 18) &&
1280 (lay != 1 || (eta == 18 &&
rhoxe[k]-
dyxe[k] > 1000) || (eta != 18 &&
rhoxe[k]-
dyxe[k] < 1000)) &&
1286 double ar1=0, ar2=0;
1288 ar1 = 0.5*(rmax-rmin)*(dx1+dx2-4.*
dx1e[k]);
1290 ar1 = 0.5*(rmax-rmin)*(dx1+dx2-2.*
dx1e[k]);
1291 ar2 = 0.5*(rmax-rmin)*((rmax+rmin)*
tan(10.*CLHEP::deg)-4*
dx1e[
k])-ar1;
1299 if (area[0] > 0 && area[1] > 0) {
1301 if (eta == 18) lay0++;
1303 std::cout << std::setw(2) << lay0 <<
" Area " << std::setw(8) << area[0] <<
" " << std::setw(8) << area[1] <<
"\n";
1305 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";
1314 double eta = fabs(etaR);
1317 double zz = fabs(z);
1320 }
else if (zz >
zho[1]) {
1324 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 setMissingPhi(std::vector< int > &, std::vector< int > &)
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)
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.
Abs< T >::type abs(const T &t)
DDSolidShape shape(void) const
The type of the solid.
std::vector< int > depth3
void loadSpecPars(const DDFilteredView &)
std::vector< double > rhoxb
std::vector< int > etaMin
std::vector< int > etaMax
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.
static unsigned int const shift
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
unsigned find(int element, std::vector< int > &array) const
void loadGeometry(const DDFilteredView &)
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, const 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.