15 #include "CLHEP/Units/GlobalPhysicalConstants.h" 16 #include "CLHEP/Units/GlobalSystemOfUnits.h" 22 std::cout <<
"HcalGeomParameters::HcalGeomParameters ( const DDCompactView& cpv ) constructor" << std::endl;
28 std::cout <<
"HcalGeomParameters::destructed!!!" << std::endl;
35 for (
int i=0;
i<4; ++
i) rHO.push_back(
etaHO[
i]);
40 std::vector<int> modHalf;
42 modHalf.push_back(
nmodHB); modHalf.push_back(
nzHB);
44 modHalf.push_back(
nmodHE); modHalf.push_back(
nzHE);
50 std::vector<int>&
array)
const {
51 unsigned int id = array.size();
52 for (
unsigned int i = 0;
i < array.size();
i++) {
53 if (element == array[
i]) {
64 if (z != 0) tmp = -
log(
tan(0.5*atan(r/z)));
66 std::cout <<
"HcalGeomParameters::getEta " << r <<
" " << z <<
" ==> " 76 bool dodet=
true,
hf=
false;
77 std::vector<double> rb(20,0.0), ze(20,0.0), thkb(20,-1.0), thke(20,-1.0);
78 std::vector<int>
ib(20,0), ie(20,0);
79 std::vector<int> izb, phib, ize, phie;
80 std::vector<double> rxb;
82 std::vector<double> rminHE(20,0.0), rmaxHE(20,0.0);
93 int idet = 0, lay = -1;
94 int nsiz = (
int)(copy.size());
95 if (nsiz>0) lay = copy[nsiz-1]/10;
96 if (nsiz>1) idet = copy[nsiz-2]/1000;
97 double dx=0, dy=0,
dz=0, dx1=0, dx2=0;
101 if (sol.
shape() == 1) {
106 }
else if (sol.
shape() == 3) {
110 dx = 0.25*(trp.
x1()+trp.
x2()+trp.
x3()+trp.
x4());
111 dy = 0.5*(trp.
y1()+trp.
y2());
116 }
else if (sol.
shape() == 2) {
126 <<
" Layer " << lay <<
" R " << t.Rho() << std::endl;
128 if (lay >=0 && lay < 20) {
131 if (thkb[lay] <= 0) {
132 if (lay < 17) thkb[lay] = dx;
137 for (
unsigned int k=0;
k<rxb.size();
k++) {
144 rxb.push_back(t.Rho());
147 php.
dyHB.push_back(2.*dy);
148 php.
dxHB.push_back(2.*
dz);
149 php.
layHB.push_back(lay);
154 int iz = copy[nsiz-5];
155 int fi = copy[nsiz-4];
156 unsigned int it1 =
find(iz, izb);
157 if (it1 == izb.size()) izb.push_back(iz);
158 unsigned int it2 =
find(fi, phib);
159 if (it2 == phib.size()) phib.push_back(fi);
163 if (nsiz>2) ifi = copy[nsiz-3];
164 if (nsiz>3) ich = copy[nsiz-4];
168 if (ifi == 1 && ich == 4) {
175 for (
unsigned int kk=0;
kk<php.
zHO.size();
kk++) {
179 }
else if (z2 < php.
zHO[
kk]) {
180 php.
zHO.resize(php.
zHO.size()+2);
181 for (
unsigned int kz=php.
zHO.size()-1; kz>
kk+1; kz=kz-2) {
182 php.
zHO[kz] = php.
zHO[kz-2];
183 php.
zHO[kz-1] = php.
zHO[kz-3];
192 php.
zHO.push_back(z1);
193 php.
zHO.push_back(z2);
196 std::cout <<
"Detector " << idet <<
" Lay " << lay <<
" fi " << ifi
197 <<
" " << ich <<
" z " << z1 <<
" " << z2 << std::endl;
201 }
else if (idet == 4) {
205 <<
" Layer " << lay <<
" Z " << t.z() << std::endl;
207 if (lay >=0 && lay < 20) {
210 if (thke[lay] <= 0) thke[lay] =
dz;
212 double rinHE = t.Rho()*
cos(alp) - dy;
213 double routHE = t.Rho()*
cos(alp) + dy;
214 rminHE[lay] += rinHE;
215 rmaxHE[lay] += routHE;
218 for (
unsigned int k=0;
k<php.
zxHE.size();
k++) {
230 php.
dx1HE.push_back(-dx1);
231 php.
dx2HE.push_back(-dx2);
232 php.
layHE.push_back(lay);
235 if (copy[nsiz-1] == 21 || copy[nsiz-1] == 71) {
236 int iz = copy[nsiz-7];
237 int fi = copy[nsiz-5];
238 unsigned int it1 =
find(iz, ize);
239 if (it1 == ize.size()) ize.push_back(iz);
240 unsigned int it2 =
find(fi, phie);
241 if (it2 == phie.size()) phie.push_back(fi);
243 }
else if (idet == 5) {
246 const std::vector<double> & paras = sol.
parameters();
249 <<
" Z " << t.z() <<
" with " << paras.size()
250 <<
" Parameters" << std::endl;
251 for (
unsigned j=0; j<paras.size(); j++)
252 std::cout <<
"HF Parameter[" << j <<
"] = " << paras[j] << std::endl;
255 int nz = (
int)(paras.size())-3;
256 dzVcal = 0.5*(paras[nz]-paras[3]);
265 std::cout <<
"Unknown Detector " << idet <<
" for " << sol.
name()
266 <<
" Shape " << sol.
shape() <<
" R " << t.Rho() <<
" Z " 267 << t.z() << std::endl;
273 int ibmx = 0, iemx = 0;
274 for (
int i = 0;
i < 20;
i++) {
276 rb[
i] /= (double)(
ib[
i]);
280 ze[
i] /= (double)(ie[
i]);
285 rminHE[
i] /= (double)(ie[
i]);
286 rmaxHE[
i] /= (double)(ie[i]);
289 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i] <<
":" 290 << rminHE[
i] <<
":" << rmaxHE[
i] << std::endl;
293 for (
int i = 4;
i >= 0;
i--) {
294 if (
ib[
i] == 0) {rb[
i] = rb[
i+1]; thkb[
i] = thkb[
i+1];}
295 if (ie[
i] == 0) {ze[
i] = ze[
i+1]; thke[
i] = thke[
i+1];}
297 if (
ib[
i] == 0 || ie[
i] == 0)
299 << rb[
i] <<
" Endcap " << ie[
i] <<
" " << ze[
i] << std::endl;
304 for (
unsigned int k=0;
k<php.
layHB.size(); ++
k)
306 for (
unsigned int k=0;
k<php.
layHE.size(); ++
k)
308 std::cout <<
"HcalGeomParameters: Maximum Layer for HB " << ibmx <<
" for HE " 309 << iemx <<
" extent " <<
dzVcal << std::endl;
313 php.
rHB.resize(ibmx);
314 php.
drHB.resize(ibmx);
315 for (
int i=0;
i<ibmx;
i++) {
319 std::cout <<
"HcalGeomParameters: php.rHB[" <<
i <<
"] = " << php.
rHB[
i]
320 <<
" php.drHB[" <<
i <<
"] = " << php.
drHB[
i] << std::endl;
325 php.
zHE.resize(iemx);
326 php.
dzHE.resize(iemx);
327 for (
int i=0;
i<iemx;
i++) {
331 std::cout <<
"HcalGeomParameters: php.zHE[" <<
i <<
"] = " << php.
zHE[
i]
332 <<
" php.dzHE[" <<
i <<
"] = " << php.
dzHE[
i] << std::endl;
341 <<
" barrel half-sectors" << std::endl;
343 std::cout <<
"Section " <<
i <<
" Copy number " << izb[
i] << std::endl;
345 <<
" barrel modules" << std::endl;
347 std::cout <<
"Module " <<
i <<
" Copy number " << phib[
i] << std::endl;
354 <<
" endcap half-sectors" << std::endl;
356 std::cout <<
"Section " <<
i <<
" Copy number " << ize[
i] << std::endl;
358 <<
" endcap modules" << std::endl;
360 std::cout <<
"Module " <<
i <<
" Copy number " << phie[
i] << std::endl;
364 std::cout <<
"HO has Z of size " << php.
zHO.size() << std::endl;
365 for (
unsigned int kk=0;
kk<php.
zHO.size();
kk++)
368 if (ibmx > 17 && php.
zHO.size() > 4) {
380 <<
" " <<
etaHO[2] <<
" " <<
etaHO[3] << std::endl;
383 for (
unsigned int i=0;
i<php.
zHO.size(); ++
i)
std::cout <<
" zho[" <<
i <<
"] = " << php.
zHO[
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< std::vector< double > > tmp
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.