15 #include "CLHEP/Units/GlobalPhysicalConstants.h" 16 #include "CLHEP/Units/GlobalSystemOfUnits.h" 22 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::HcalGeomParameters ( const DDCompactView& cpv ) constructor";
39 std::vector<int> modHalf;
41 modHalf.emplace_back(
nmodHB);
42 modHalf.emplace_back(
nzHB);
44 modHalf.emplace_back(
nmodHE);
45 modHalf.emplace_back(
nzHE);
51 unsigned int id = array.size();
52 for (
unsigned int i = 0;
i < array.size();
i++) {
53 if (element == array[
i]) {
64 tmp = -
log(
tan(0.5 * atan(r / z)));
66 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::getEta " << r <<
" " << z <<
" ==> " <<
tmp;
73 bool dodet =
true,
hf =
false;
74 std::vector<double> rb(20, 0.0), ze(20, 0.0), thkb(20, -1.0), thke(20, -1.0);
75 std::vector<int>
ib(20, 0), ie(20, 0);
76 std::vector<int> izb, phib, ize, phie;
77 std::vector<double> rxb;
79 std::vector<double> rminHE(20, 0.0), rmaxHE(20, 0.0);
98 int idet = 0, lay = -1;
99 int nsiz = (
int)(copy.size());
101 lay = copy[nsiz - 1] / 10;
103 idet = copy[nsiz - 2] / 1000;
104 double dx = 0,
dy = 0,
dz = 0, dx1 = 0, dx2 = 0;
117 dx = 0.25 * (trp.
x1() + trp.
x2() + trp.
x3() + trp.
x4());
118 dy = 0.5 * (trp.
y1() + trp.
y2());
135 if (lay >= 0 && lay < 20) {
138 if (thkb[lay] <= 0) {
146 for (
double k : rxb) {
153 rxb.emplace_back(t.Rho());
156 php.
dyHB.emplace_back(2. *
dy);
157 php.
dxHB.emplace_back(2. *
dz);
158 php.
layHB.emplace_back(lay);
163 int iz = copy[nsiz - 5];
164 int fi = copy[nsiz - 4];
165 unsigned int it1 =
find(iz, izb);
166 if (it1 == izb.size())
167 izb.emplace_back(iz);
168 unsigned int it2 =
find(fi, phib);
169 if (it2 == phib.size())
170 phib.emplace_back(fi);
173 int ifi = -1, ich = -1;
175 ifi = copy[nsiz - 3];
177 ich = copy[nsiz - 4];
182 if (ifi == 1 && ich == 4) {
189 for (
unsigned int kk = 0;
kk < php.
zHO.size();
kk++) {
193 }
else if (z2 < php.
zHO[
kk]) {
194 php.
zHO.resize(php.
zHO.size() + 2);
195 for (
unsigned int kz = php.
zHO.size() - 1; kz >
kk + 1; kz = kz - 2) {
196 php.
zHO[kz] = php.
zHO[kz - 2];
197 php.
zHO[kz - 1] = php.
zHO[kz - 3];
199 php.
zHO[kk + 1] =
z2;
206 php.
zHO.emplace_back(z1);
207 php.
zHO.emplace_back(z2);
210 edm::LogVerbatim(
"HCalGeom") <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi <<
" " << ich <<
" z " 215 }
else if (idet == 4) {
221 if (lay >= 0 && lay < 20) {
227 double rinHE = t.Rho() *
cos(alp) -
dy;
228 double routHE = t.Rho() *
cos(alp) +
dy;
229 rminHE[lay] += rinHE;
230 rmaxHE[lay] += routHE;
233 for (
double k : php.
zxHE) {
245 php.
dx1HE.emplace_back(-dx1);
246 php.
dx2HE.emplace_back(-dx2);
247 php.
layHE.emplace_back(lay);
250 if (copy[nsiz - 1] == 21 || copy[nsiz - 1] == 71) {
251 int iz = copy[nsiz - 7];
252 int fi = copy[nsiz - 5];
253 unsigned int it1 =
find(iz, ize);
254 if (it1 == ize.size())
255 ize.emplace_back(iz);
256 unsigned int it2 =
find(fi, phie);
257 if (it2 == phie.size())
258 phie.emplace_back(fi);
260 }
else if (idet == 5) {
263 const std::vector<double>& paras = sol.
parameters();
266 << paras.size() <<
" Parameters";
267 for (
unsigned j = 0;
j < paras.size();
j++)
271 int nz = (
int)(paras.size()) - 3;
272 dzVcal = 0.5 * (paras[nz] - paras[3]);
282 <<
" R " << t.Rho() <<
" Z " << t.z();
288 int ibmx = 0, iemx = 0;
289 for (
int i = 0;
i < 20;
i++) {
291 rb[
i] /= (double)(
ib[
i]);
295 ze[
i] /= (double)(ie[
i]);
300 rminHE[
i] /= (double)(ie[
i]);
301 rmaxHE[
i] /= (double)(ie[i]);
303 edm::LogVerbatim(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " <<
ib[
i] <<
" " << rb[
i] <<
" Endcap " << ie[
i] <<
" " 304 << ze[
i] <<
":" << rminHE[
i] <<
":" << rmaxHE[
i];
307 for (
int i = 4;
i >= 0;
i--) {
310 thkb[
i] = thkb[
i + 1];
314 thke[
i] = thke[
i + 1];
317 if (
ib[
i] == 0 || ie[
i] == 0)
318 edm::LogVerbatim(
"HCalGeom") <<
"Index " <<
i <<
" Barrel " <<
ib[
i] <<
" " << rb[
i] <<
" Endcap " << ie[
i] <<
" " 324 for (
unsigned int k = 0;
k < php.
layHB.size(); ++
k)
327 for (
unsigned int k = 0;
k < php.
layHE.size(); ++
k)
330 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters: Maximum Layer for HB " << ibmx <<
" for HE " << iemx
335 php.
rHB.resize(ibmx);
336 php.
drHB.resize(ibmx);
337 for (
int i = 0;
i < ibmx;
i++) {
341 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters: php.rHB[" <<
i <<
"] = " << php.
rHB[
i] <<
" php.drHB[" <<
i 342 <<
"] = " << php.
drHB[
i];
347 php.
zHE.resize(iemx);
348 php.
dzHE.resize(iemx);
349 for (
int i = 0;
i < iemx;
i++) {
353 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters: php.zHE[" <<
i <<
"] = " << php.
zHE[
i] <<
" php.dzHE[" <<
i 354 <<
"] = " << php.
dzHE[
i];
362 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::loadGeometry: " <<
nzHB <<
" barrel half-sectors";
373 edm::LogVerbatim(
"HCalGeom") <<
"HcalGeomParameters::loadGeometry: " <<
nzHE <<
" endcap half-sectors";
383 for (
unsigned int kk = 0;
kk < php.
zHO.size();
kk++)
386 if (ibmx > 17 && php.
zHO.size() > 4) {
400 for (
unsigned int i = 0;
i < php.
zHO.size(); ++
i)
std::vector< double > zHO
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
double halfZ(void) const
half of the z-Axis
void loadGeometry(const DDFilteredView &_fv, HcalParameters &php)
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
std::vector< double > rHB
nav_type copyNumbers() const
return the stack of copy numbers
unsigned find(int element, std::vector< int > &array) const
std::vector< double > rhoxHB
std::vector< int > getModHalfHBHE(const int type) const
std::vector< double > dx2HE
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
void getConstRHO(std::vector< double > &) const
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
std::vector< double > rhoxHE
std::vector< double > zxHE
std::vector< double > zHE
std::vector< double > dyHE
std::vector< double > zxHB
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
bool next()
set current node to the next node in the filtered tree
std::vector< double > dx1HE
std::vector< double > dzHE
Cos< T >::type cos(const T &t)
Interface to a Trapezoid.
Tan< T >::type tan(const T &t)
double y1(void) const
Half-length along y of the face at -pDz.
Abs< T >::type abs(const T &t)
DDSolidShape shape(void) const
The type of the solid.
std::vector< double > dyHB
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
double alpha2(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of t...
std::vector< double > dxHB
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
double getEta(double r, double z) const
std::vector< double > drHB
double y2(void) const
Half-length along y of the face at +pDz.
const DDTranslation & translation() const
The absolute translation of the current node.
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.