17 : hcalConstants(hcons) {
45 fill (hsub, gDDD, geom );
79 LogDebug(
"HCalGeom") <<
"HcalDDDGeometryLoader::fill gets "
80 << hcalCells.size() <<
" cells for subdetector "
85 double deg =
M_PI/180.;
86 std::vector<HcalDetId> hcalIds;
87 for (
unsigned int i=0;
i<hcalCells.size();
i++) {
88 int etaRing = hcalCells[
i].etaBin();
89 int depthBin = hcalCells[
i].depthSegment();
90 int phiInc = 4/hcalCells[
i].nPhiModule();
91 unsigned int iphi = 1;
92 if (hcalCells[
i].unitPhi() == 4) iphi = 3;
93 double dphi = (hcalCells[
i].phiBinWidth())*deg;
94 double phi =-(hcalCells[
i].phiOffset())*deg + 0.5*dphi;
95 std::vector<int>missPlus = hcalCells[
i].missingPhiPlus();
96 std::vector<int>missMinus = hcalCells[
i].missingPhiMinus();
98 LogDebug(
"HCalGeom") <<
"HcalDDDGeometryLoader: Subdet " << subdet
99 <<
" eta " << etaRing <<
" depth " << depthBin
100 <<
" modules " << hcalCells[
i].nPhiModule() <<
" "
101 << phiInc <<
" phi " << phi/deg <<
" " << dphi/deg
102 <<
" Missing " << missPlus.size() <<
"/"
105 for (
int k = 0;
k < hcalCells[
i].nPhiBins();
k++) {
107 for (
unsigned int kk = 0;
kk < missPlus.size();
kk++)
108 if (iphi == (
unsigned int)(missPlus[
kk])) ok =
false;
111 LogDebug(
"HCalGeom") <<
"HcalDDDGeometryLoader::fill Cell " <<
i
112 <<
" eta " << etaRing <<
" phi " << iphi <<
"("
113 << phi/deg <<
", " << dphi/deg <<
") depth "
116 HcalDetId id(subdet, etaRing, iphi, depthBin);
117 hcalIds.push_back(
id);
118 makeCell(
id,hcalCells[
i],phi,dphi,geom) ;
120 if (hcalCells[
i].nHalves() > 1) {
122 for (
unsigned int kk = 0;
kk < missMinus.size();
kk++)
123 if (iphi == (
unsigned int)(missMinus[
kk])) ok =
false;
126 LogDebug(
"HCalGeom") <<
"HcalDDDGeometryLoader::fill Cell " <<
i
127 <<
" eta " << -etaRing <<
" phi " << iphi <<
" ("
128 << phi/deg <<
", " << dphi/deg <<
") depth "
131 HcalDetId id(subdet, -etaRing, iphi, depthBin);
132 hcalIds.push_back(
id);
133 makeCell(
id,hcalCells[
i],phi,dphi,geom) ;
141 edm::LogInfo(
"HCalGeom") <<
"Number of HCAL DetIds made for " << subdet
142 <<
" is " << hcalIds.size();
153 double eta1 = hcalCell.
etaMin();
154 double eta2 = hcalCell.
etaMax();
156 double eta = 0.5*(eta1+eta2) * detId.
zside();
157 double deta = (eta2-eta1);
164 double z,
r, thickness;
172 thickness = (hcalCell.
depthMax() -
r) * cosh(eta);
180 thickness = 2. * hcalCell.
halfSize();
184 r1 = z/sinh(
std::abs(eta)+0.5*deta);
185 r2 = z/sinh(
std::abs(eta)-0.5*deta);
189 LogDebug(
"HCalGeom") <<
"HcalDDDGeometryLoader::makeCell SubDet " << subdet
190 <<
" eta = " << eta <<
" theta = " << theta
191 <<
" r = " << r <<
" thickness = " << thickness
192 <<
" r0-r2 (" << r0 <<
":" << r1 <<
":" << r2 <<
")";
197 if (
isBH_) z += (0.5*thickness);
203 r1 = z/sinh(
std::abs(eta)+0.5*deta);
204 r2 = z/sinh(
std::abs(eta)-0.5*deta);
205 LogDebug(
"HCalGeom") <<
"HcalDDDGeometryLoader::makeCell SubDet " << subdet
206 <<
" eta = " << eta <<
" theta = " << theta
207 <<
" z = " << z <<
" r = " << r <<
" thickness = "
208 << thickness <<
" r0-r2 (" << r0 <<
":" << r1 <<
":"
213 double x = r *
cos(phi);
214 double y = r *
sin(phi);
218 LogDebug(
"HCalGeom") <<
"HcalDDDGeometryLoader::makeCell for " << detId
219 <<
" Point " << point <<
" deta = " << deta
220 <<
" dphi = " << dphi <<
" thickness = " << thickness
221 <<
" isBarrel = " << isBarrel <<
" " << rzType;
224 std::vector<CCGFloat>
hp ;
228 hp.push_back(deta/2.) ;
229 hp.push_back(dphi/2.) ;
230 hp.push_back(thickness/2.) ;
232 const double sign ( isBarrel ? 1 : -1 ) ;
233 hp.push_back(deta/2.) ;
234 hp.push_back(dphi/2.) ;
235 hp.push_back(sign*thickness/2.) ;
237 geom->
newCell( point, point, point,
HcalSubdetector subdet() const
get the subdetector
int zside() const
get the z-side of the cell (1/-1)
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
bool isBarrel(GeomDetEnumerators::SubDetector m)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
void allocatePar(ParVec::size_type n, unsigned int m)
void fill(HcalSubdetector, HcalDDDGeometry *, CaloSubdetectorGeometry *)
unsigned int numberOfCells(HcalSubdetector) const
int insertCell(std::vector< HcalCellType > const &)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
CaloCellGeometry::CCGFloat CCGFloat
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
ReturnType load(const HcalTopology &topo, DetId::Detector, int)
std::vector< HcalCellType > HcalCellTypes(HcalSubdetector) const
void makeCell(const HcalDetId &, const HcalCellType &, double, double, CaloSubdetectorGeometry *geom) const
double etaMax() const
cell edge, always positive & greater than etaMin
CaloCellGeometry::CornersMgr * cornersMgr()
double etaMin() const
lower cell edge. Always positive
Geom::Phi< T > phi() const
virtual ~HcalDDDGeometryLoader()
const HcalDDDRecConstants * hcalConstants
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
*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