29 if (
nullptr == hcalGeometry->
parMgr())
33 edm::LogVerbatim(
"HCalGeom") <<
"FlexiGeometryLoader initialize with ncells " << fTopology.
ncells() <<
" and shapes " 35 <<
" with BH Flag " <<
isBH_;
55 std::vector<HcalFlexiHardcodeGeometryLoader::HBHOCellParameters>
result;
56 std::vector<std::pair<double, double> > gconsHB = hcons.
getConstHBHE(0);
61 for (
unsigned int k = 0;
k < gconsHB.size(); ++
k) {
62 edm::LogVerbatim(
"HCalGeom") <<
"gconsHB[" <<
k <<
"] = " << gconsHB[
k].first <<
" +- " << gconsHB[
k].second;
66 int iring = (etabin.zside >= 0) ? etabin.ieta : -etabin.ieta;
67 int depth = etabin.depthStart;
69 (etabin.phis.size() > 1) ? (etabin.phis[1].second - etabin.phis[0].second) : ((2.0 *
M_PI) /
MAX_HCAL_PHI);
70 for (
unsigned int k = 0;
k < etabin.layer.size(); ++
k) {
71 int layf = etabin.layer[
k].first - 1;
72 int layl = etabin.layer[
k].second - 1;
73 double rmin = gconsHB[layf].first - gconsHB[layf].second;
74 double rmax = gconsHB[layl].first + gconsHB[layl].second;
75 for (
unsigned int j = 0;
j < etabin.phis.size(); ++
j) {
77 edm::LogVerbatim(
"HCalGeom") <<
"HBRing " << iring <<
" eta " << etabin.etaMin <<
":" << etabin.etaMax
78 <<
" depth " <<
depth <<
" R " << rmin <<
":" << rmax <<
" Phi " 79 << etabin.phis[
j].first <<
":" << etabin.phis[
j].second <<
":" << dphi <<
" layer[" 80 <<
k <<
"]: " << etabin.layer[
k].first - 1 <<
":" << etabin.layer[
k].second;
83 iring,
depth, etabin.phis[
j].first, etabin.phis[
j].second, dphi, rmin, rmax, etabin.etaMin, etabin.etaMax));
93 const double HORMIN0 = 390.0;
94 const double HORMIN1 = 412.6;
95 const double HORMAX = 413.6;
99 0.000, 0.087, 0.174, 0.261, 0.3395, 0.435, 0.522, 0.609, 0.696, 0.783, 0.873, 0.957, 1.044, 1.131, 1.218};
101 0.087, 0.174, 0.261, 0.3075, 0.435, 0.522, 0.609, 0.696, 0.783, 0.8494, 0.957, 1.044, 1.131, 1.218, 1.305};
102 std::vector<HcalFlexiHardcodeGeometryLoader::HBHOCellParameters>
result;
104 double dphi = ((2.0 *
M_PI) /
nPhi);
106 double rmin = ((
i < 4) ? HORMIN0 : HORMIN1);
107 for (
int iside = -1; iside <= 1; iside += 2) {
108 for (
int j = 0;
j <
nPhi; ++
j) {
109 double phi = (
j + 0.5) * dphi;
123 HcalGeometry* fGeometry,
const std::vector<HcalFlexiHardcodeGeometryLoader::HBHOCellParameters>& fCells,
bool fHB) {
125 for (
const auto& param : fCells) {
127 float phiCenter = param.phi;
128 float etaCenter = 0.5 * (param.etaMin + param.etaMax);
129 float x = param.rMin *
cos(phiCenter);
130 float y = param.rMin *
sin(phiCenter);
131 float z = (param.ieta < 0) ? -(param.rMin * sinh(etaCenter)) : (param.rMin * sinh(etaCenter));
134 std::vector<CCGFloat> cellParams;
135 cellParams.reserve(5);
136 cellParams.emplace_back(0.5 * (param.etaMax - param.etaMin));
137 cellParams.emplace_back(0.5 * param.dphi);
138 cellParams.emplace_back(0.5 * (param.rMax - param.rMin) * cosh(etaCenter));
139 cellParams.emplace_back(fabs(refPoint.
eta()));
140 cellParams.emplace_back(fabs(refPoint.
z()));
142 edm::LogVerbatim(
"HCalGeom") <<
"HcalFlexiHardcodeGeometryLoader::fillHBHO-> " << hid <<
" " << hid.
rawId() <<
" " 143 << std::hex << hid.
rawId() <<
std::dec <<
" " << hid <<
" " << refPoint <<
'/' 144 << cellParams[0] <<
'/' << cellParams[1] <<
'/' << cellParams[2];
157 std::vector<HcalFlexiHardcodeGeometryLoader::HECellParameters>
result;
158 std::vector<std::pair<double, double> > gconsHE = hcons.
getConstHBHE(1);
160 edm::LogVerbatim(
"HCalGeom") <<
"HcalFlexiHardcodeGeometryLoader:HE with " << gconsHE.size() <<
" cells";
162 if (!gconsHE.empty()) {
166 edm::LogVerbatim(
"HCalGeom") <<
"FlexiGeometryLoader called for HE with " <<
etabins.size() <<
" Eta Bins and " 167 << gconsHE.size() <<
" depths";
168 std::ostringstream st1;
169 for (
unsigned int i = 0;
i < gconsHE.size(); ++
i)
170 st1 <<
" Depth[" <<
i <<
"] = " << gconsHE[
i].
first <<
" +- " << gconsHE[
i].
second;
174 int iring = (etabin.zside >= 0) ? etabin.ieta : -etabin.ieta;
175 int depth = etabin.depthStart;
177 (etabin.phis.size() > 1) ? (etabin.phis[1].second - etabin.phis[0].second) : ((2.0 *
M_PI) /
MAX_HCAL_PHI);
179 edm::LogVerbatim(
"HCalGeom") <<
"FlexiGeometryLoader::Ring " << iring <<
" nphi " << etabin.phis.size()
180 <<
" dstart " <<
depth <<
" dphi " << dphi <<
" layers " << etabin.layer.size();
181 std::ostringstream st2;
182 for (
unsigned int j = 0;
j < etabin.phis.size(); ++
j)
183 st2 <<
" [" <<
j <<
"] " << etabin.phis[
j].first <<
":" << etabin.phis[
j].second;
186 for (
unsigned int k = 0;
k < etabin.layer.size(); ++
k) {
187 int layf = etabin.layer[
k].first - 1;
188 int layl = etabin.layer[
k].second - 1;
189 double zmin = gconsHE[layf].first - gconsHE[layf].second;
190 double zmax = gconsHE[layl].first + gconsHE[layl].second;
192 for (
int k2 = layf;
k2 <= layl; ++
k2) {
194 zmin = gconsHE[
k2].first - gconsHE[
k2].second;
201 for (
unsigned int j = 0;
j < etabin.phis.size(); ++
j) {
203 edm::LogVerbatim(
"HCalGeom") <<
"HERing " << iring <<
" eta " << etabin.etaMin <<
":" << etabin.etaMax
205 <<
" Phi :" << etabin.phis[
j].first <<
":" << etabin.phis[
j].second <<
":" 206 << dphi <<
" layer[" <<
k <<
"]: " << etabin.layer[
k].first - 1 <<
":" 207 << etabin.layer[
k].second - 1;
210 iring,
depth, etabin.phis[
j].first, etabin.phis[
j].second, dphi,
zmin,
zmax, etabin.etaMin, etabin.etaMax));
221 const double HEZMIN_H2 = 400.715;
222 const double HEZMID_H2 = 436.285;
223 const double HEZMAX_H2 = 541.885;
224 const int nEtas = 10;
225 const int nDepth[nEtas] = {1, 2, 2, 2, 2, 2, 2, 2, 3, 3};
226 const int dStart[nEtas] = {3, 1, 1, 1, 1, 1, 1, 1, 1, 1};
227 const int nPhis[nEtas] = {8, 8, 8, 8, 8, 8, 4, 4, 4, 4};
228 const double etas[nEtas + 1] = {1.305, 1.373, 1.444, 1.521, 1.603, 1.693, 1.790, 1.880, 1.980, 2.090, 2.210};
229 const double zval[4 * nEtas] = {
230 409.885, 462.685, 0., 0., HEZMIN_H2, 427.485, 506.685, 0.0, HEZMIN_H2, HEZMID_H2,
231 524.285, 0., HEZMIN_H2, HEZMID_H2, HEZMAX_H2, 0., HEZMIN_H2, HEZMID_H2, HEZMAX_H2, 0.,
232 HEZMIN_H2, HEZMID_H2, HEZMAX_H2, 0., HEZMIN_H2, HEZMID_H2, HEZMAX_H2, 0., HEZMIN_H2, HEZMID_H2,
233 HEZMAX_H2, 0., HEZMIN_H2, 418.685, HEZMID_H2, HEZMAX_H2, HEZMIN_H2, 418.685, HEZMID_H2, HEZMAX_H2};
234 std::vector<HcalFlexiHardcodeGeometryLoader::HECellParameters>
result;
236 for (
int i = 0;
i < nEtas; ++
i) {
238 for (
int k = 0;
k < nDepth[
i]; ++
k) {
240 for (
int j = 0;
j < nPhis[
i]; ++
j) {
241 int iphi = (nPhis[
i] == 8) ? (
j + 1) : (2 *
j + 1);
243 double phi0 = (
j + 0.5) * dphi;
256 const float HFZMIN1 = 1115.;
257 const float HFZMIN2 = 1137.;
258 const float HFZMAX = 1280.1;
261 std::vector<HcalFlexiHardcodeGeometryLoader::HFCellParameters>
result;
263 for (
unsigned int i = 0;
i <
nCells; ++
i) {
291 HcalGeometry* fGeometry,
const std::vector<HcalFlexiHardcodeGeometryLoader::HECellParameters>& fCells) {
293 for (
const auto& param : fCells) {
295 float phiCenter = param.phi;
296 float etaCenter = 0.5 * (param.etaMin + param.etaMax);
297 int iside = (param.ieta >= 0) ? 1 : -1;
298 float z = (
isBH_) ? (iside * 0.5 * (param.zMin + param.zMax)) : (iside * param.zMin);
304 std::vector<CCGFloat> cellParams;
305 cellParams.reserve(5);
306 cellParams.emplace_back(0.5 * (param.etaMax - param.etaMin));
307 cellParams.emplace_back(0.5 * param.dphi);
308 cellParams.emplace_back(-0.5 * (param.zMax - param.zMin) /
tanh(etaCenter));
309 cellParams.emplace_back(fabs(refPoint.
eta()));
310 cellParams.emplace_back(fabs(refPoint.
z()));
312 edm::LogVerbatim(
"HCalGeom") <<
"HcalFlexiHardcodeGeometryLoader::fillHE-> " << hid <<
" " << hid.
rawId() <<
" " 313 << std::hex << hid.
rawId() <<
std::dec <<
" " << hid << refPoint <<
'/' 314 << cellParams[0] <<
'/' << cellParams[1] <<
'/' << cellParams[2];
325 HcalGeometry* fGeometry,
const std::vector<HcalFlexiHardcodeGeometryLoader::HFCellParameters>& fCells) {
327 for (
const auto& param : fCells) {
329 int iPhi = param.phiFirst +
kPhi * param.phiStep;
336 float oEta =
outer.eta();
337 float etaCenter = 0.5 * (
iEta + oEta);
339 float perp = param.zMin / sinh(etaCenter);
342 float z = (param.eta > 0) ? param.zMin : -param.zMin;
345 std::vector<CCGFloat> cellParams;
346 cellParams.reserve(5);
347 cellParams.emplace_back(0.5 * (
iEta - oEta));
348 cellParams.emplace_back(0.5 * param.dphi *
DEGREE2RAD);
349 cellParams.emplace_back(0.5 * (param.zMax - param.zMin));
350 cellParams.emplace_back(fabs(refPoint.eta()));
351 cellParams.emplace_back(fabs(refPoint.z()));
353 edm::LogVerbatim(
"HCalGeom") <<
"HcalFlexiHardcodeGeometryLoader::fillHF-> " << hid <<
" " << hid.
rawId() <<
" " 354 << std::hex << hid.
rawId() <<
std::dec <<
" " << hid <<
" " << refPoint <<
'/' 355 << cellParams[0] <<
'/' << cellParams[1] <<
'/' << cellParams[2];
Log< level::Info, true > LogVerbatim
void tanh(data_T data[CONFIG_T::n_in], res_T res[CONFIG_T::n_in])
std::vector< HFCellParameters > makeHFCells(const HcalDDDRecConstants &hcons)
Sin< T >::type sin(const T &t)
std::vector< HECellParameters > makeHECells_H2()
std::vector< HcalEtaBin > getEtaBins(const int &itype) const
void allocatePar(ParVec::size_type n, unsigned int m)
std::vector< HBHOCellParameters > makeHBCells(const HcalDDDRecConstants &hcons)
std::vector< HFCellParameters > getHFCellParameters() const
U second(std::pair< T, U > const &p)
void newCellFast(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
std::vector< HBHOCellParameters > makeHOCells()
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
HcalTopologyMode::Mode mode() const
CaloCellGeometry::CCGFloat CCGFloat
unsigned int getHFSize() const
void fillHE(HcalGeometry *fGeometry, const std::vector< HECellParameters > &fCells)
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
std::vector< HECellParameters > makeHECells(const HcalDDDRecConstants &hcons)
T perp() const
Magnitude of transverse component.
unsigned int ncells() const override
return a count of valid cells (for dense indexing use)
constexpr uint32_t rawId() const
get the raw id
unsigned int numberOfShapes() const override
CaloCellGeometry::CornersMgr * cornersMgr()
void increaseReserve(unsigned int extra)
void fillHBHO(HcalGeometry *fGeometry, const std::vector< HBHOCellParameters > &fCells, bool fHB)
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t * nCells
CaloSubdetectorGeometry * load(const HcalTopology &fTopology, const HcalDDDRecConstants &hcons)
std::vector< std::pair< double, double > > getConstHBHE(const int &type) const
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
HcalFlexiHardcodeGeometryLoader()
void fillHF(HcalGeometry *fGeometry, const std::vector< HFCellParameters > &fCells)