|
|
Go to the documentation of this file.
12 edm::LogInfo(
"HCalGeom") <<
"HcalDDDSimConstants::HcalDDDSimConstants (const HcalParameters* hp) constructor\n";
18 edm::LogVerbatim(
"HcalGeom") <<
"HcalDDDSimConstants: " << cellTypes.size() <<
" cells of type HCal (All)\n";
24 edm::LogInfo(
"HCalGeom") <<
"HcalDDDSimConstants::destructed!!!\n";
29 const int& idet,
const int&
zside,
const int&
depth,
const int& etaR,
const int&
iphi)
const {
39 double eta = 0, deta = 0,
phi = 0, dphi = 0, rz = 0, drz = 0;
40 bool ok =
false, flagrz =
true;
43 etaR >= etaMn && etaR <= etaMx && depth > 0)
60 }
else if (idet == static_cast<int>(
HcalEndcap)) {
69 phi = -fioff + (
iphi - 0.5) * fibin;
73 if (ir > 0 && ir <
nR) {
79 edm::LogInfo(
"HCalGeom") <<
"HcalDDDSimConstants: wrong eta " << etaR <<
" (" << ir <<
"/" <<
nR
80 <<
") Detector " << idet << std::endl;
83 }
else if (etaR <=
nEta) {
85 if (idet == static_cast<int>(
HcalOuter)) {
89 double d1 = 0, d2 = 0;
99 drz = 0.5 * (d2 -
d1);
102 edm::LogWarning(
"HCalGeom") <<
"HcalDDDSimConstants: wrong depth " <<
depth <<
" or etaR " << etaR
103 <<
" for detector " << idet;
113 <<
"phi " << idet <<
"/" <<
zside <<
"/" <<
depth <<
"/" << etaR <<
"/" <<
iphi
114 <<
" Cell Flag " <<
tmp.ok <<
" " <<
tmp.eta <<
" " <<
tmp.deta <<
" phi " <<
tmp.phi
115 <<
" " <<
tmp.dphi <<
" r(z) " <<
tmp.rz <<
" " <<
tmp.drz <<
" " <<
tmp.flagrz;
121 const int& det,
const int&
eta,
const int&
phi,
const int&
zside,
const int& lay)
const {
127 const std::vector<HcalParameters::LayerItem>& layerGroup)
const {
139 std::vector<std::pair<double, double> > gcons;
141 for (
unsigned int i = 0;
i <
hpar->
rHB.size(); ++
i) {
145 for (
unsigned int i = 0;
i <
hpar->
zHE.size(); ++
i) {
164 std::vector<int> phis;
167 int zside = (phis[0] > 0) ? 1 : -1;
168 int iphi = (phis[0] > 0) ? phis[0] : -phis[0];
170 if (det == 1 && depthsp >
depth)
172 if (det == 2 && depthsp <
depth)
187 if (
i == 0 && planOne) {
188 std::vector<int> phis;
191 int zside = (phis[0] > 0) ? 1 : -1;
192 int iphi = (phis[0] > 0) ? phis[0] : -phis[0];
202 int hsubdet(0),
ieta(0);
204 double heta = fabs(
eta);
210 (ieta <= hpar->
etaMax[1])) {
218 double theta = 2. * atan(
exp(-heta));
220 etaR = (
eta >= 0. ? hR : -hR);
222 return std::pair<int, double>(hsubdet, etaR);
229 for (
int i =
nR - 1;
i > 0;
i--)
230 if (hetaR < hpar->rTable[
i])
234 for (
int i = 0;
i <
nEta - 1;
i++)
244 }
else if (det == static_cast<int>(
HcalEndcap)) {
245 if (ieta <= hpar->
etaMin[1])
253 const int& det,
int etaR,
const int&
phi,
const int&
zside,
int depth,
const int& lay)
const {
255 edm::LogVerbatim(
"HcalGeom") <<
"HcalDDDEsimConstants:getEtaDepth: I/P " << det <<
":" << etaR <<
":" <<
phi <<
":"
259 if ((det == static_cast<int>(
HcalEndcap)) && (etaR == 17) && (lay == 1))
262 }
else if (det == static_cast<int>(
HcalOuter)) {
267 if (etaR ==
hpar->
noff[0] && lay > 1) {
269 kphi = (kphi - 1) % 4 + 1;
270 if (kphi == 2 || kphi == 3)
273 }
else if (det == static_cast<int>(
HcalBarrel)) {
292 return std::pair<int, int>(etaR,
depth);
297 double eta = fabs(etaR);
302 if (eta <= hpar->etaTable[10])
305 if (eta <= hpar->etaTable[4])
369 const int& det,
const int&
eta,
const int&
phi,
const int&
zside,
const int&
depth)
const {
372 if (det == 1 || det == 2) {
388 const int& det,
const int&
eta,
const int&
phi,
const int&
zside,
const int&
depth)
const {
391 if (det == 1 || det == 2) {
406 const int& det,
const int&
eta,
const int&
phi,
const int&
zside,
const bool& partialDetOnly)
const {
408 if (partialDetOnly) {
412 }
else if (det == 1 || det == 2) {
421 }
else if (det == 3) {
423 }
else if (det == 4) {
432 const int& det,
const int&
eta,
const int&
phi,
const int&
zside,
const bool& partialDetOnly)
const {
434 if (partialDetOnly) {
438 }
else if (det == 3) {
440 }
else if (det == 4) {
447 unsigned int type = (det == 1) ? 0 : 1;
466 double fioff(0), fibin(0);
481 return std::pair<double, double>(fioff, fibin);
485 std::vector<std::pair<int, double> > phis;
487 std::pair<double, double> ficons =
getPhiCons(subdet, ietaAbs);
488 int nphi =
int((2._pi + 0.1 * ficons.second) / ficons.second);
490 for (
int ifi = 0; ifi <
nphi; ++ifi) {
491 double phi = -ficons.first + (ifi + 0.5) * ficons.second;
493 phis.emplace_back(std::pair<int, double>(
iphi,
phi));
496 edm::LogVerbatim(
"HcalGeom") <<
"getPhis: subdet|ieta|iphi " << subdet <<
"|" <<
ieta <<
" with " << phis.size()
498 for (
unsigned int k = 0;
k < phis.size(); ++
k)
508 edm::LogInfo(
"HCalGeom") <<
"HcalDDDSimConstants: " << cellTypes.size() <<
" cells of type HCal Barrel\n";
509 for (
unsigned int i = 0;
i < cellTypes.size();
i++)
510 edm::LogInfo(
"HCalGeom") <<
"Cell " <<
i <<
" " << cellTypes[
i] <<
"\n";
515 edm::LogInfo(
"HCalGeom") <<
"HcalDDDSimConstants: " << hoCells.size() <<
" cells of type HCal Outer\n";
516 for (
unsigned int i = 0;
i < hoCells.size();
i++)
517 edm::LogInfo(
"HCalGeom") <<
"Cell " <<
i <<
" " << hoCells[
i] <<
"\n";
519 cellTypes.insert(cellTypes.end(), hoCells.begin(), hoCells.end());
523 edm::LogInfo(
"HCalGeom") <<
"HcalDDDSimConstants: " << heCells.size() <<
" cells of type HCal Endcap\n";
524 for (
unsigned int i = 0;
i < heCells.size();
i++)
525 edm::LogInfo(
"HCalGeom") <<
"Cell " <<
i <<
" " << heCells[
i] <<
"\n";
527 cellTypes.insert(cellTypes.end(), heCells.begin(), heCells.end());
531 edm::LogInfo(
"HCalGeom") <<
"HcalDDDSimConstants: " << hfCells.size() <<
" cells of type HCal Forward\n";
532 for (
unsigned int i = 0;
i < hfCells.size();
i++)
533 edm::LogInfo(
"HCalGeom") <<
"Cell " <<
i <<
" " << hfCells[
i] <<
"\n";
535 cellTypes.insert(cellTypes.end(), hfCells.begin(), hfCells.end());
543 std::vector<HcalCellType> cellTypes;
549 int dmin, dmax, indx, nz;
578 dmin = dmax = depthl;
581 int phi = (indx == 2) ? 3 : 1;
584 int subdet0 = static_cast<int>(subdet);
594 for (
int eta = ietamin;
eta <= ietamax;
eta++) {
595 for (
int iz = 0; iz < nz; ++iz) {
596 int zside = -2 * iz + 1;
599 std::vector<std::pair<int, double> > phis =
getPhis(subdet0,
eta);
602 std::vector<int> phiMiss2;
609 for (
int miss = 0; miss <
hpar->
noff[5 + iz]; miss++) {
625 temp2.
setPhi(phis, phiMiss2, fioff, dphi,
unit);
626 cellTypes.emplace_back(temp2);
630 std::vector<int> phiMiss3;
631 for (
auto&
phi : phis) {
640 phiMiss3.emplace_back(
phi.first);
645 temp3.
setPhi(phis, phiMiss2, fioff, dphi,
unit);
646 cellTypes.emplace_back(temp3);
660 if ((
eta ==
k.ieta()) && (
iphi ==
k.iphi())) {
672 unsigned int num = 0;
674 for (
auto& cellType : cellTypes) {
675 num += (
unsigned int)(cellType.nPhiBins());
678 edm::LogVerbatim(
"HcalGeom") <<
"HcalDDDSimConstants:numberOfCells " << cellTypes.size() <<
" " <<
num
679 <<
" for subdetector " << subdet;
687 iphi_skip = (
phi - 1) * 2 + 1;
689 iphi_skip = (
phi - 1) * 4 - 1;
696 std::vector<int> phis;
698 int kphi = (detsp > 0) ? phis[0] : 1;
699 int zside = (kphi > 0) ? 1 : -1;
700 int iphi = (kphi > 0) ? kphi : -kphi;
736 const double fiveDegInRad = 2 *
M_PI / 72;
737 int units =
int(dphi / fiveDegInRad + 0.5);
750 for (
int i = 0;
i <
nEta - 1; ++
i) {
751 edm::LogVerbatim(
"HcalGeom") <<
"HcalDDDSimConstants:Read LayerGroup" <<
i <<
":";
769 for (
int i = 0;
i <
nEta - 1; ++
i) {
771 int laymax = (imx > 0) ?
layerGroup(
i, imx - 1) : 0;
772 if (i < hpar->
etaMax[0]) {
773 int laymax0 = (imx > 16) ?
layerGroup(
i, 16) : laymax;
785 for (
int i = 0;
i < 4; ++
i)
791 for (
int i = 0;
i < maxdepth; ++
i) {
792 for (
int k = 0;
k <
nEta - 1; ++
k) {
795 for (
int l = layermx - 1;
l >= 0; --
l) {
806 for (
int k = 0;
k <
nEta - 1; ++
k)
817 <<
nmodHE <<
" endcap half-sectors";
822 for (
int k = 0;
k < 4; ++
k)
835 for (
int i = 0;
i < 4; ++
i)
837 for (
unsigned int i = 0;
i <
hpar->
zHO.size(); ++
i)
842 int noffl(noffsize + 5);
843 if ((
int)(
hpar->
noff.size()) > (noffsize + 3)) {
848 if ((
int)(
hpar->
noff.size()) > (noffsize + 4)) {
849 noffl += (2 *
hpar->
noff[noffsize + 4]);
850 if ((
int)(
hpar->
noff.size()) > noffl)
866 if ((
int)(
hpar->
noff.size()) > (noffsize + 4)) {
867 int npair =
hpar->
noff[noffsize + 4];
868 int kk = noffsize + 4;
869 for (
int k = 0;
k < npair; ++
k) {
898 int noffk(noffsize + 5);
899 if ((
int)(
hpar->
noff.size()) > (noffsize + 5)) {
900 noffk += (2 *
hpar->
noff[noffsize + 4]);
901 if ((
int)(
hpar->
noff.size()) >= noffk + 7) {
907 double wt = 0.1 * (
hpar->
noff[noffk + 6]);
908 if ((
int)(
hpar->
noff.size()) >= (noffk + 7 +
nphi + 3 * ndeps)) {
910 std::vector<int> ifi, iet, ily, idp;
912 ifi.emplace_back(
hpar->
noff[noffk + 7 +
i]);
913 for (
int i = 0;
i < ndeps; ++
i) {
925 for (
int i = 0;
i < ndeps; ++
i)
931 int zside = (ifi[0] > 0) ? 1 : -1;
932 int iphi = (ifi[0] > 0) ? ifi[0] : -ifi[0];
936 int noffm = (noffk + 7 +
nphi + 3 * ndeps);
937 if ((
int)(
hpar->
noff.size()) > noffm) {
939 if (ndnext > 4 && (
int)(
hpar->
noff.size()) >= noffm + ndnext) {
940 for (
int i = 0;
i < 2; ++
i)
942 for (
int i = 0;
i < 3; ++
i)
945 if (ndnext > 11 && (
int)(
hpar->
noff.size()) >= noffm + ndnext) {
946 for (
int i = 0;
i < 3; ++
i)
948 for (
int i = 0;
i < 4; ++
i)
983 if (ir > 0 && ir <
nR) {
990 if (etaR > 0 && etaR <
nEta) {
993 }
else if (det == static_cast<int>(
HcalOuter)) {
996 }
else if (etaR ==
hpar->
noff[2] + 1) {
1000 }
else if (etaR ==
hpar->
noff[3] + 1) {
1020 if (ir > 0 && ir <
nR) {
1027 if (etaR > 0 && etaR <
nEta) {
1030 }
else if (det == static_cast<int>(
HcalOuter)) {
1033 }
else if (etaR ==
hpar->
noff[2] + 1) {
1035 }
else if (etaR ==
hpar->
noff[3]) {
1037 }
else if (etaR ==
hpar->
noff[3] + 1) {
1108 double thetaL = 2. * atan(
exp(-etaL));
1110 double thetaH = 2. * atan(
exp(-etaH));
1116 for (
int lay = layL - 1; lay < layH; ++lay) {
1117 std::vector<double>
area(2, 0);
1120 for (
unsigned int k = 0;
k <
hpar->
layHB.size(); ++
k) {
1134 edm::LogVerbatim(
"HcalGeom") << std::setw(2) << lay <<
" Area " << std::setw(8) <<
area[0] <<
" " << std::setw(8)
1142 double thetaL = 2. * atan(
exp(-etaL));
1144 double thetaH = 2. * atan(
exp(-etaH));
1153 <<
":" << layH - 1 <<
" phi " <<
nphi;
1154 for (
int lay = layL - 1; lay < layH; ++lay) {
1155 std::vector<double>
area(4, 0);
1158 for (
unsigned int k = 0;
k <
hpar->
layHE.size(); ++
k) {
1162 if ((lay != 0 ||
eta == 18) &&
1168 double dx1 = rmin *
std::tan(phib);
1169 double dx2 = rmax *
std::tan(phib);
1170 double ar1 = 0, ar2 = 0;
1172 ar1 = 0.5 * (rmax - rmin) * (dx1 + dx2 - 4. *
hpar->
dx1HE[
k]);
1175 ar1 = 0.5 * (rmax - rmin) * (dx1 + dx2 - 2. *
hpar->
dx1HE[
k]);
1176 ar2 = 0.5 * (rmax - rmin) * ((rmax + rmin) *
tan(10._deg) - 4 *
hpar->
dx1HE[
k]) - ar1;
1177 mean += (ar1 + ar2);
1191 edm::LogVerbatim(
"HcalGeom") << std::setw(2) << lay0 <<
" Area " << std::setw(8) <<
area[0] <<
" "
1192 << std::setw(8) <<
area[1] <<
" Mean " <<
mean;
1195 edm::LogVerbatim(
"HcalGeom") << std::setw(2) << lay0 <<
" Area " << std::setw(8) <<
area[0] <<
" "
1196 << std::setw(8) <<
area[1] <<
":" << std::setw(8) <<
area[2] <<
" " << std::setw(8)
1206 if (it.layer == (
unsigned int)(
eta + 1)) {
1207 return it.layerGroup.size();
1209 if (it.layer > (
unsigned int)(
eta + 1))
1211 k = it.layerGroup.size();
1219 if (it.layer == (
unsigned int)(
eta + 1)) {
1220 return it.layerGroup.at(
i);
1222 if (it.layer > (
unsigned int)(
eta + 1))
1224 k = it.layerGroup.at(
i);
1231 unsigned int depth = (depth0 > 0) ? (
unsigned int)(depth0) :
layerGroup(
eta - 1, lay);
std::vector< HcalDetId > idHF2QIE
std::vector< double > HFGains
unsigned int numberOfCells(const HcalSubdetector &) const
std::vector< int > maxDepth
int getDepthEta16(const int &det, const int &phi, const int &zside) const
double getLayer0Wt(const int subdet, const int iphi, const int zside) const
std::vector< double > etaTable
int getEta(const int &det, const int &lay, const double &hetaR) const
constexpr NumType convertRadToDeg(NumType radians)
int getLayerFront(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
void setPhi(const std::vector< std::pair< int, double >> &phis, const std::vector< int > &iphiMiss, double foff, double dphi, int unit)
std::vector< double > HBGains
bool isValid(const int det, const int phi, const int zside) const
U second(std::pair< T, U > const &p)
int getDepth(const int subdet, const int ieta, const int iphi, const int zside, const int layer) const
std::vector< std::pair< double, double > > getConstHBHE(const int &type) const
std::vector< int > maxDepth
std::pair< int, double > getDetEta(const double &eta, const int &depth) const
std::vector< double > zHO
Log< level::Info, false > LogInfo
std::vector< HcalCellType > HcalCellTypes() const
Log< level::Warning, false > LogWarning
void initialize(const int subdet, const int ietaMax, const int dep16C, const int dep29C, const double wtl0C, std::vector< int > const &iphi, std::vector< int > const &ieta, std::vector< int > const &layer, std::vector< int > const &depth)
std::vector< LayerItem > layerGroupEtaSim
HcalCellType::HcalCell cell(const int &det, const int &zside, const int &depth, const int &etaR, const int &iphi) const
int findDepth(const int &det, const int &eta, const int &phi, const int &zside, const int &lay) const
int getMaxDepthLastHE(const int subdet, const int iphi, const int zside) const
std::vector< int > etaMax
Sin< T >::type sin(const T &t)
TString units(TString variable, Char_t axis)
unsigned int findLayer(const int &layer, const std::vector< HcalParameters::LayerItem > &layerGroup) const
double getEtaHO(const double &etaR, const double &x, const double &y, const double &z) const
Cos< T >::type cos(const T &t)
std::vector< double > dx1HE
std::vector< double > rhoxHE
double getGain(const HcalSubdetector &subdet, const int &depth) const
HcalDDDSimConstants(const HcalParameters *hp)
std::vector< double > rHO
std::vector< double > dxHB
static const int maxLayerHB_
std::vector< double > phitable
Geom::Theta< T > theta() const
std::vector< double > dzHE
int maxHFDepth(const int &ieta, const int &iphi) const
std::vector< double > rHB
int unitPhi(const int &det, const int &etaR) const
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned int layerGroupSize(int eta) const
std::pair< int, int > getDepths(const int eta) const
std::pair< int, int > getEtaDepth(const int &det, int etaR, const int &phi, const int &zside, int depth, const int &lay) const
std::vector< double > rTable
double getLayer0Wt(const int &det, const int &phi, const int &zside) const
unsigned int layerGroup(int eta, int i) const
std::pair< int, int > depthMaxSp_
int getLayerBack(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
std::vector< double > zxHE
std::vector< int > depths[nDepthMax]
const HcalParameters * hpar
Tan< T >::type tan(const T &t)
std::vector< double > zHE
int getMinDepth(const int &det, const int &eta, const int &phi, const int &zside, const bool &partialOnly) const
int phiNumber(const int &phi, const int &unit) const
int getLastLayer(const int &det, const int &eta) const
std::vector< double > phioff
std::vector< double > dyHE
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
int getDepthEta29(const int &phi, const int &zside, const int &i) const
Basic3DVector unit() const
int getLayerBack(const int &det, const int &eta, const int &phi, const int &zside, const int &depth) const
int getDepth16(const int subdet, const int iphi, const int zside) const
std::vector< double > dyHB
std::vector< int > HFShift
std::pair< int, int > depthMaxDf_
int getLayerFront(const int &det, const int &eta, const int &phi, const int &zside, const int &depth) const
void printTileHE(const int &eta, const int &phi, const int &zside, const int &depth) const
int getFrontLayer(const int &det, const int &eta) const
static unsigned const int shift
std::vector< double > Layer0Wt
Log< level::Info, true > LogVerbatim
std::pair< double, double > getPhiCons(const int &det, const int &ieta) const
int validDet(std::vector< int > &phis) const
std::vector< double > drHB
std::vector< int > HBShift
void printTileHB(const int &eta, const int &phi, const int &zside, const int &depth) const
std::vector< std::pair< int, double > > getPhis(const int &subdet, const int &ieta) const
int getDepthEta16M(const int &det) const
int getLayerMax(const int &eta, const int &depth) const
std::pair< int, int > getModHalfHBHE(const int &type) const
int getMaxDepth(const int &type) const
int getShift(const HcalSubdetector &subdet, const int &depth) const
std::vector< int > HEShift
std::vector< double > phibin
Abs< T >::type abs(const T &t)
std::vector< double > HEGains
int getDepthEta29M(const int &i, const bool &planOne) const
std::vector< int > etaMin
std::vector< double > gparHF
static const int maxLayer_
double deltaEta(const int &det, const int &eta, const int &depth) const
int getDepthMax(const int subdet, const int iphi, const int zside) const
static constexpr float d1
std::vector< double > rhoxHB