16 #include "CLHEP/Units/GlobalPhysicalConstants.h"
17 #include "CLHEP/Units/GlobalSystemOfUnits.h"
24 edm::LogInfo(
"HCalGeom") <<
"Creating HcalNumberingFromDDD";
29 edm::LogInfo(
"HCalGeom") <<
"Deleting HcalNumberingFromDDD";
33 CLHEP::Hep3Vector
point,
38 double hx = point.x();
39 double hy = point.y();
40 double hz = point.z();
41 double hR =
sqrt(hx*hx+hy*hy+hz*hz);
43 double hsintheta =
sin(htheta);
44 double hphi = (hR*hsintheta == 0. ? 0. :atan2(hy,hx));
45 double heta = (fabs(hsintheta) == 1.? 0. : -
log(fabs(
tan(htheta/2.))) );
53 hR =
sqrt(hx*hx+hy*hy);
54 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) {
189 int units =
unitPhi(det, etaR);
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 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<double> zho;
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]) {
916 zho.resize(zho.size()+2);
917 for (
unsigned int kz=zho.size()-1; kz>kk+1; kz=kz-2) {
919 zho[kz-1] = zho[kz-3];
931 LogDebug(
"HCalGeom") <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi <<
" " << ich <<
" z " << z1 <<
" " << z2;
934 }
else if (idet == 4) {
938 <<
" Layer " << lay <<
" Z " << t.z();
940 if (lay >=0 && lay < 20) {
943 if (thke[lay] <= 0) thke[lay] = dz;
945 for (
unsigned int k=0;
k<
zxe.size();
k++) {
957 dx1e.push_back(-dx1);
958 dx2e.push_back(-dx2);
962 if (copy[nsiz-1] == 21) {
963 int iz = copy[nsiz-7];
964 int fi = copy[nsiz-5];
965 unsigned int it1 =
find(iz, ize);
966 if (it1 == ize.size()) ize.push_back(iz);
967 unsigned int it2 =
find(fi, phie);
968 if (it2 == phie.size()) phie.push_back(fi);
970 }
else if (idet == 5) {
973 const std::vector<double> & paras = sol.
parameters();
976 <<
" Z " << t.z() <<
" with " << paras.size()
978 for (
unsigned j=0;
j<paras.size();
j++)
979 LogDebug(
"HCalGeom") <<
"HF Parameter[" <<
j <<
"] = " << paras[
j];
983 int nz = (int)(paras.size())-3;
985 dzVcal = 0.5*(paras[nz]-paras[3]);
995 LogDebug(
"HCalGeom") <<
"Unknown Detector " << idet <<
" for "
996 << sol.
name() <<
" Shape " << sol.
shape() <<
" R "
997 << t.Rho() <<
" Z " << t.z();
1003 int ibmx = 0, iemx = 0;
1004 for (
int i = 0;
i < 20;
i++) {
1006 rb[
i] /= (double)(ib[
i]);
1010 ze[
i] /= (double)(ie[
i]);
1014 LogDebug(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " << ib[
i] <<
" "
1015 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i];
1018 for (
int i = 4;
i >= 0;
i--) {
1019 if (ib[
i] == 0) {rb[
i] = rb[
i+1]; thkb[
i] = thkb[
i+1];}
1020 if (ie[
i] == 0) {ze[
i] = ze[
i+1]; thke[
i] = thke[
i+1];}
1022 if (ib[
i] == 0 || ie[
i] == 0)
1023 LogDebug(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " << ib[
i] <<
" "
1024 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i];
1029 for (
unsigned int k=0;
k<
layb.size(); ++
k)
1031 for (
unsigned int k=0;
k<
laye.size(); ++
k)
1035 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: Maximum Layer for HB "
1036 << ibmx <<
" for HE " << iemx <<
" Z for HF " << zf
1043 for (
int i=0;
i<ibmx;
i++) {
1047 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: rHB[" <<
i <<
"] = "
1048 <<
rHB[
i] <<
" drHB[" <<
i <<
"] = " <<
drHB[
i];
1055 for (
int i=0;
i<iemx;
i++) {
1059 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: zHE[" <<
i <<
"] = "
1060 <<
zHE[
i] <<
" dzHE[" <<
i <<
"] = " <<
dzHE[
i];
1065 nzHB = (int)(izb.size());
1066 nmodHB = (int)(phib.size());
1068 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nzHB
1069 <<
" barrel half-sectors";
1071 LogDebug(
"HCalGeom") <<
"Section " <<
i <<
" Copy number " << izb[
i];
1072 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nmodHB
1073 <<
" barrel modules";
1075 LogDebug(
"HCalGeom") <<
"Module " <<
i <<
" Copy number " << phib[
i];
1078 nzHE = (int)(ize.size());
1079 nmodHE = (int)(phie.size());
1081 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nzHE
1082 <<
" endcap half-sectors";
1084 LogDebug(
"HCalGeom") <<
"Section " <<
i <<
" Copy number " << ize[
i];
1085 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD::loadGeometry: " <<
nmodHE
1086 <<
" endcap modules";
1088 LogDebug(
"HCalGeom") <<
"Module " <<
i <<
" Copy number " << phie[
i];
1091 LogDebug(
"HCalGeom") <<
"HO has Z of size " << zho.size();
1092 for (
unsigned int kk=0; kk<zho.size(); kk++)
1093 LogDebug(
"HCalGeom") <<
"ZHO[" << kk <<
"] = " << zho[kk];
1094 if (ibmx > 17 && zho.size() > 2) {
1113 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD:getDDDArray called for "
1114 << str <<
" with nMin " << nmin;
1121 const std::vector<double> & fvec = value.
doubles();
1122 int nval = fvec.size();
1125 edm::LogError(
"HCalGeom") <<
"HcalNumberingFromDDD : # of " << str
1126 <<
" bins " << nval <<
" < " << nmin
1128 throw DDException(
"HcalNumberingFromDDD: cannot get array "+str);
1132 edm::LogError(
"HCalGeom") <<
"HcalNumberingFromDDD : # of " << str
1133 <<
" bins " << nval <<
" < 2 ==> illegal"
1134 <<
" (nmin=" << nmin <<
")";
1135 throw DDException(
"HcalNumberingFromDDD: cannot get array "+str);
1141 edm::LogError(
"HCalGeom") <<
"HcalNumberingFromDDD: cannot get array "
1143 throw DDException(
"HcalNumberingFromDDD: cannot get array "+str);
1182 std::vector<int> array)
const {
1184 unsigned int id = array.size();
1185 for (
unsigned int i = 0;
i < array.size();
i++) {
1186 if (element == array[
i]) {
1196 const double fiveDegInRad = 2*
M_PI/72;
1201 units=int(
phibin[etaR-1]/fiveDegInRad+0.5);
1209 double thetaL = 2.*atan(
exp(-etaL));
1211 double thetaH = 2.*atan(
exp(-etaH));
1219 std::cout <<
"\ntileHB:: eta|depth " << eta <<
"|" << depth <<
" theta " << thetaH/CLHEP::deg <<
":" << thetaL/CLHEP::deg <<
" Layer " << layL <<
":" << layH-1 <<
"\n";
1220 for (
int lay=layL; lay<layH; ++lay) {
1221 std::vector<double> area(2,0);
1223 for (
unsigned int k=0;
k<
layb.size(); ++
k) {
1224 if (lay ==
layb[
k]) {
1229 area[kk] = dz*
dyxb[
k];
1234 if (area[0] > 0)
std::cout << std::setw(2) << lay <<
" Area " << std::setw(8) << area[0] <<
" " << std::setw(8) << area[1] <<
"\n";
1241 double thetaL = 2.*atan(
exp(-etaL));
1243 double thetaH = 2.*atan(
exp(-etaH));
1247 }
else if (depth == 1) {
1249 }
else if (depth == 2) {
1256 double phib =
phibin[eta-1];
1258 if (phib > 6*CLHEP::deg) nphi = 1;
1259 std::cout <<
"\ntileHE:: Eta/depth " << eta <<
"|" << depth <<
" theta " << thetaH/CLHEP::deg <<
":" << thetaL/CLHEP::deg <<
" Layer " << layL <<
":" << layH-1 <<
" phi " << nphi <<
"\n";
1260 for (
int lay=layL; lay<layH; ++lay) {
1261 std::vector<double> area(4,0);
1263 for (
unsigned int k=0;
k<
laye.size(); ++
k) {
1264 if (lay ==
laye[
k]) {
1267 if ((lay != 0 || eta == 18) &&
1268 (lay != 1 || (eta == 18 &&
rhoxe[k]-
dyxe[k] > 1000) || (eta != 18 &&
rhoxe[k]-
dyxe[k] < 1000)) &&
1274 double ar1=0, ar2=0;
1276 ar1 = 0.5*(rmax-rmin)*(dx1+dx2-4.*
dx1e[k]);
1278 ar1 = 0.5*(rmax-rmin)*(dx1+dx2-2.*
dx1e[k]);
1279 ar2 = 0.5*(rmax-rmin)*((rmax+rmin)*
tan(10.*CLHEP::deg)-4*
dx1e[
k])-ar1;
1287 if (area[0] > 0 && area[1] > 0) {
1289 if (eta == 18) lay0++;
1291 std::cout << std::setw(2) << lay0 <<
" Area " << std::setw(8) << area[0] <<
" " << std::setw(8) << area[1] <<
"\n";
1293 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";
double halfZ() const
half of the z-Axis
std::vector< int > shiftHE
const std::vector< double > & parameters() const
Don't use (only meant to be used by DDbox(), DDtub(), ...)
std::vector< int > shiftHB
std::vector< double > dx2e
double y2() const
Half-length along y of the face at +pDz.
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)
std::vector< int > depth2
double x2() const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
DDSolidShape shape() const
The type of the solid.
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)
An exception for DDD errors.
void setMissingPhi(std::vector< int >, std::vector< int >)
std::vector< double > zxe
std::vector< double > etaTable
int getShift(HcalSubdetector subdet, int depth) const
std::vector< double > zxb
Geom::Theta< T > theta() const
int unitPhi(int det, int etaR) const
std::vector< double > rHB
Exp< T >::type exp(const T &t)
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
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
std::vector< double > dyxb
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)
std::vector< int > depth3
std::vector< double > rhoxb
unsigned find(int element, std::vector< int > array) const
double y1() const
Half-length along y of the face at -pDz.
std::vector< int > etaMin
std::vector< int > etaMax
double x4() const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
void loadGeometry(DDFilteredView)
Log< T >::type log(const T &t)
double deltaEta(int det, int eta, int depth) const
tuple filter
USE THIS FOR SKIMMED TRACKS process.p = cms.Path(process.hltLevel1GTSeed*process.skimming*process.offlineBeamSpot*process.TrackRefitter2) OTHERWISE USE THIS.
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)
std::vector< double > dzHE
double x3() const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
std::vector< std::vector< double > > tmp
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
bool firstChild()
set the current node to the first child ...
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
double x1() const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
*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
std::vector< double > rTable
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.