32 std::cout <<
"FlexiGeometryLoader initialize with ncells " 33 << fTopology.
ncells() <<
" and shapes " 36 <<
" with BH Flag " <<
isBH_ << std::endl;
57 std::vector<HcalFlexiHardcodeGeometryLoader::HBHOCellParameters>
result;
58 std::vector<std::pair<double,double> > gconsHB = hcons.
getConstHBHE(0);
59 std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = hcons.
getEtaBins(0);
62 std::cout <<
"FlexiGeometryLoader called for " << etabins.size()
63 <<
" Eta Bins" << std::endl;
64 for (
unsigned int k=0;
k<gconsHB.size(); ++
k) {
65 std::cout <<
"gconsHB[" <<
k <<
"] = " << gconsHB[
k].first <<
" +- " 66 << gconsHB[
k].second << std::endl;
69 for (
auto & etabin : etabins) {
70 int iring = (etabin.zside >= 0) ? etabin.ieta : -etabin.ieta;
71 int depth = etabin.depthStart;
72 double dphi = (etabin.phis.size() > 1) ?
73 (etabin.phis[1].second-etabin.phis[0].second) :
75 for (
unsigned int k=0;
k<etabin.layer.size(); ++
k) {
76 int layf = etabin.layer[
k].first-1;
77 int layl = etabin.layer[
k].second-1;
78 double rmin = gconsHB[layf].first-gconsHB[layf].second;
79 double rmax = gconsHB[layl].first+gconsHB[layl].second;
80 for (
unsigned int j=0; j<etabin.phis.size(); ++j) {
82 std::cout <<
"HBRing " << iring <<
" eta " << etabins[
i].etaMin <<
":" 83 << etabins[
i].etaMax <<
" depth " <<
depth <<
" R " << rmin
84 <<
":" << rmax <<
" Phi " << etabins[
i].phis[j].first <<
":" 85 << etabins[
i].phis[j].second <<
":" << dphi <<
" layer[" <<
k 86 <<
"]: " << etabins[
i].layer[
k].first-1 <<
":" 87 << etabins[
i].layer[
k].second << std::endl;
100 const double HORMIN0 = 390.0;
101 const double HORMIN1 = 412.6;
102 const double HORMAX = 413.6;
103 const int nCells = 15;
105 const double etamin[nCells] = {0.000,0.087,0.174, 0.261, 0.3395,0.435,0.522,
106 0.609,0.696,0.783, 0.873, 0.957, 1.044,1.131,
108 const double etamax[nCells] = {0.087,0.174,0.261, 0.3075,0.435, 0.522,0.609,
109 0.696,0.783,0.8494,0.957, 1.044, 1.131,1.218,
111 std::vector<HcalFlexiHardcodeGeometryLoader::HBHOCellParameters>
result;
112 result.reserve (nCells*nPhi);
113 double dphi = ((2.0*
M_PI)/nPhi);
114 for (
int i = 0;
i < nCells; ++
i) {
115 double rmin = ((
i < 4) ? HORMIN0 : HORMIN1);
116 for (
int iside = -1; iside <= 1; iside += 2) {
117 for (
int j=0; j <
nPhi; ++j) {
118 double phi = (j+0.5)*dphi;
134 for (
const auto & param : fCells) {
136 float phiCenter = param.phi;
137 float etaCenter = 0.5*(param.etaMin + param.etaMax);
138 float x = param.rMin*
cos (phiCenter);
139 float y = param.rMin*
sin (phiCenter);
140 float z = (param.ieta < 0) ? -(param.rMin*sinh(etaCenter)) : (param.rMin*sinh(etaCenter));
143 std::vector<CCGFloat> cellParams;
144 cellParams.reserve (5);
145 cellParams.emplace_back (0.5 * (param.etaMax - param.etaMin));
146 cellParams.emplace_back (0.5 * param.dphi);
147 cellParams.emplace_back (0.5 * (param.rMax - param.rMin) * cosh (etaCenter));
148 cellParams.emplace_back ( fabs( refPoint.
eta() ) ) ;
149 cellParams.emplace_back ( fabs( refPoint.
z() ) ) ;
151 std::cout <<
"HcalFlexiHardcodeGeometryLoader::fillHBHO-> " << hid
152 <<
" " << hid.
rawId() <<
" " << std::hex << hid.
rawId()
153 <<
std::dec <<
" " << hid <<
" " << refPoint <<
'/' 154 << cellParams [0] <<
'/' << cellParams [1] <<
'/' 155 << cellParams [2] << std::endl;
157 fGeometry->
newCellFast(refPoint, refPoint, refPoint,
169 std::vector<HcalFlexiHardcodeGeometryLoader::HECellParameters>
result;
170 std::vector<std::pair<double,double> > gconsHE = hcons.
getConstHBHE(1);
172 std::cout <<
"HcalFlexiHardcodeGeometryLoader:HE with " << gconsHE.size()
173 <<
" cells" << std::endl;
175 if (!gconsHE.empty()) {
176 std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = hcons.
getEtaBins(1);
179 std::cout <<
"FlexiGeometryLoader called for HE with " << etabins.size()
180 <<
" Eta Bins and " << gconsHE.size() <<
" depths" 182 for (
unsigned int i=0;
i<gconsHE.size(); ++
i)
187 for (
auto & etabin : etabins) {
188 int iring = (etabin.zside >= 0) ? etabin.ieta : -etabin.ieta;
189 int depth = etabin.depthStart;
190 double dphi = (etabin.phis.size() > 1) ?
191 (etabin.phis[1].second-etabin.phis[0].second) :
194 std::cout <<
"FlexiGeometryLoader::Ring " << iring <<
" nphi " << nphi
195 <<
" dstart " <<
depth <<
" dphi " << dphi <<
" units " 196 <<
units <<
" fioff " << fioff <<
" layers " 197 << etabins[
i].layer.size() << std::endl;
199 for (
unsigned int k=0;
k<etabin.layer.size(); ++
k) {
200 int layf = etabin.layer[
k].first-1;
201 int layl = etabin.layer[
k].second-1;
202 double zmin = gconsHE[layf].first-gconsHE[layf].second;
203 double zmax = gconsHE[layl].first+gconsHE[layl].second;
205 for (
int k2=layf; k2<=layl; ++k2) {
206 if (gconsHE[k2].
first > 10) {
207 zmin = gconsHE[k2].first-gconsHE[k2].second;
212 if (zmin >= zmax) zmax = zmin+10.;
213 for (
unsigned int j=0; j<etabin.phis.size(); ++j) {
215 std::cout <<
"HERing " << iring <<
" eta " << etabins[
i].etaMin <<
":" 216 << etabins[
i].etaMax <<
" depth " <<
depth <<
" Z " << zmin
217 <<
":" << zmax <<
" Phi :" << etabins[
i].phis[j].first
218 <<
":" << etabins[
i].phis[j].second <<
":" << dphi
219 <<
" layer[" <<
k <<
"]: " << etabins[
i].layer[
k].first-1
220 <<
":" << etabins[
i].layer[
k].second-1 << std::endl;
235 const double HEZMIN_H2 = 400.715;
236 const double HEZMID_H2 = 436.285;
237 const double HEZMAX_H2 = 541.885;
238 const int nEtas = 10;
239 const int nDepth[nEtas] = {1,2,2,2,2,2,2,2,3,3};
240 const int dStart[nEtas] = {3,1,1,1,1,1,1,1,1,1};
241 const int nPhis[nEtas] = {8,8,8,8,8,8,4,4,4,4};
242 const double etas[nEtas+1] = {1.305,1.373,1.444,1.521,1.603,1.693,1.790,
243 1.880,1.980,2.090,2.210};
244 const double zval[4*nEtas] = {409.885,462.685,0.,0.,
245 HEZMIN_H2,427.485,506.685,0.0,
246 HEZMIN_H2,HEZMID_H2,524.285,0.,
247 HEZMIN_H2,HEZMID_H2,HEZMAX_H2,0.,
248 HEZMIN_H2,HEZMID_H2,HEZMAX_H2,0.,
249 HEZMIN_H2,HEZMID_H2,HEZMAX_H2,0.,
250 HEZMIN_H2,HEZMID_H2,HEZMAX_H2,0.,
251 HEZMIN_H2,HEZMID_H2,HEZMAX_H2,0.,
252 HEZMIN_H2,418.685,HEZMID_H2,HEZMAX_H2,
253 HEZMIN_H2,418.685,HEZMID_H2,HEZMAX_H2};
254 std::vector<HcalFlexiHardcodeGeometryLoader::HECellParameters>
result;
256 for (
int i = 0;
i < nEtas; ++
i) {
258 for (
int k=0;
k<nDepth[
i]; ++
k) {
260 for (
int j=0; j < nPhis[
i]; ++j) {
261 int iphi = (nPhis[
i] == 8) ? (j+1) : (2*j+1);
263 double phi0 = (j+0.5)*dphi;
275 const float HFZMIN1 = 1115.;
276 const float HFZMIN2 = 1137.;
277 const float HFZMAX = 1280.1;
279 unsigned int nCells = cells.size();
280 std::vector <HcalFlexiHardcodeGeometryLoader::HFCellParameters>
result;
281 result.reserve (nCells);
282 for (
unsigned int i = 0;
i < nCells; ++
i) {
284 result.emplace_back (cell1);
286 result.emplace_back (cell2);
294 for (
const auto & param : fCells) {
296 float phiCenter = param.phi;
297 float etaCenter = 0.5 * (param.etaMin + param.etaMax);
298 int iside = (param.ieta >= 0) ? 1 : -1;
299 float perp = param.zMin / sinh (etaCenter);
300 float x = perp *
cos (phiCenter);
301 float y = perp *
sin (phiCenter);
302 float z = (
isBH_) ? (iside*0.5*(param.zMin+param.zMax)) : (iside*param.zMin);
305 std::vector<CCGFloat> cellParams;
306 cellParams.reserve (5);
307 cellParams.emplace_back (0.5 * (param.etaMax - param.etaMin));
308 cellParams.emplace_back (0.5 * param.dphi);
309 cellParams.emplace_back (-0.5 * (param.zMax - param.zMin) / tanh (etaCenter));
310 cellParams.emplace_back ( fabs( refPoint.
eta() ) ) ;
311 cellParams.emplace_back ( fabs( refPoint.
z() ) ) ;
313 std::cout <<
"HcalFlexiHardcodeGeometryLoader::fillHE-> " << hid <<
" " 315 <<
" " << hid << refPoint <<
'/' << cellParams [0] <<
'/' 316 << cellParams [1] <<
'/' << cellParams [2] << std::endl;
318 fGeometry->
newCellFast(refPoint, refPoint, refPoint,
329 for (
const auto & param : fCells) {
331 int iPhi = param.phiFirst +
kPhi*param.phiStep;
337 float iEta = inner.
eta();
338 float oEta = outer.
eta();
339 float etaCenter = 0.5 * ( iEta + oEta );
341 float perp = param.zMin / sinh (etaCenter);
342 float x = perp *
cos (phiCenter);
343 float y = perp *
sin (phiCenter);
344 float z = (param.eta > 0) ? param.zMin : -param.zMin;
347 std::vector<CCGFloat> cellParams;
348 cellParams.reserve (5);
349 cellParams.emplace_back (0.5 * ( iEta - oEta ));
350 cellParams.emplace_back (0.5 * param.dphi *
DEGREE2RAD);
351 cellParams.emplace_back (0.5 * (param.zMax - param.zMin));
352 cellParams.emplace_back ( fabs( refPoint.eta()));
353 cellParams.emplace_back ( fabs( refPoint.z() ) ) ;
355 std::cout <<
"HcalFlexiHardcodeGeometryLoader::fillHF-> " << hid <<
" " 357 <<
" " << hid <<
" " << refPoint <<
'/' << cellParams [0]
358 <<
'/' << cellParams [1] <<
'/' << cellParams [2] << std::endl;
360 fGeometry->
newCellFast(refPoint, refPoint, refPoint,
CaloCellGeometry::CCGFloat CCGFloat
unsigned int getHFSize() const
std::vector< std::pair< double, double > > getConstHBHE(const int &type) const
std::vector< HFCellParameters > makeHFCells(const HcalDDDRecConstants &hcons)
Sin< T >::type sin(const T &t)
unsigned int numberOfShapes() const override
std::vector< HECellParameters > makeHECells_H2()
HcalFlexiHardcodeGeometryLoader(const edm::ParameterSet &)
void allocatePar(ParVec::size_type n, unsigned int m)
std::vector< HBHOCellParameters > makeHBCells(const HcalDDDRecConstants &hcons)
HcalTopologyMode::Mode mode() const
uint32_t rawId() const
get the raw id
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< HcalEtaBin > getEtaBins(const int &itype) const
std::vector< HBHOCellParameters > makeHOCells()
Cos< T >::type cos(const T &t)
std::vector< HFCellParameters > getHFCellParameters() 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)
CaloCellGeometry::CornersMgr * cornersMgr()
void increaseReserve(unsigned int extra)
TString units(TString variable, Char_t axis)
T perp() const
Magnitude of transverse component.
void fillHBHO(HcalGeometry *fGeometry, const std::vector< HBHOCellParameters > &fCells, bool fHB)
CaloSubdetectorGeometry * load(const HcalTopology &fTopology, const HcalDDDRecConstants &hcons)
unsigned int ncells() const override
return a count of valid cells (for dense indexing use)
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
void fillHF(HcalGeometry *fGeometry, const std::vector< HFCellParameters > &fCells)