14 #include "CLHEP/Units/GlobalPhysicalConstants.h" 15 #include "CLHEP/Units/GlobalSystemOfUnits.h" 41 names_ = vsArgs[
"VolumeNames"];
42 thick_ = vArgs[
"Thickness"];
48 <<
" types of volumes";
49 for (
unsigned int i=0;
i<
names_.size(); ++
i)
51 <<
" of thickness " <<
thick_[
i]
63 <<
" with " <<
layers_[
i] <<
" layers";
75 <<
i <<
":" << ii <<
" with " 100 <<
" types of volumes in the top part";
107 <<
" layers in the top part" ;
122 <<
" types of volumes in the bottom part";
129 <<
" layers in the top part" ;
147 <<
" radius for wafer type separation uses " 158 slopeB_ = vArgs[
"SlopeBottom"];
198 <<
" different wafer copy numbers";
200 for (std::unordered_set<int>::const_iterator itr=
copies_.begin();
205 edm::LogVerbatim(
"HGCalGeom") <<
"<<== End of DDHGCalHEAlgo construction...";
217 const double tol(0.01);
218 for (
unsigned int i=0;
i<
layers_.size();
i++) {
224 std::vector<double> pgonZ(2), pgonRin(2), pgonRout(2);
225 for (
int ly=laymin; ly<laymax; ++ly) {
236 << ii <<
" Front " << zi <<
", " << routF
237 <<
" Back " << zo <<
", " << rinB
238 <<
" superlayer thickness " 247 double rmax = routF*
cos(alpha) - tol;
248 pgonZ[0] =-hthick; pgonZ[1] = hthick;
249 pgonRin[0] = rinB; pgonRin[1] = rinB;
250 pgonRout[0] = rmax; pgonRout[1] = rmax;
253 pgonZ, pgonRin, pgonRout);
258 <<
" sectors covering " 259 << -alpha/CLHEP::deg <<
":" 260 << (-alpha+CLHEP::twopi)/CLHEP::deg
261 <<
" with " << pgonZ.size()<<
" sections";
262 for (
unsigned int k=0;
k<pgonZ.size(); ++
k)
264 <<
" R " << pgonRin[
k] <<
":" 269 hthick, rinB, routF, 0.0,
274 <<
" Tubs made of " << matName
275 <<
" of dimensions " << rinB
276 <<
", " << routF <<
", " << hthick
277 <<
", 0.0, " << CLHEP::twopi/CLHEP::deg;
279 <<
" number " <<
copy;
286 cpv.
position(glog, module, copy, r1, rot);
290 <<
" number " << copy
291 <<
" positioned in " << module.
name()
292 <<
" at " << r1 <<
" with " <<
rot;
298 if (
std::abs(thickTot-layerThick_[
i]) < 0.00001) {
299 }
else if (thickTot > layerThick_[i]) {
301 << layerThick_[
i] <<
" is smaller than " 302 << thickTot <<
": thickness of all its " 303 <<
"components **** ERROR ****";
304 }
else if (thickTot < layerThick_[i]) {
306 << layerThick_[
i] <<
" does not match with " 307 << thickTot <<
" of the components";
315 double rin,
double rmid,
double rout,
329 double hthick = 0.5*thick;
333 hthick, rmid, rout, 0.0,
338 <<
" Tubs made of " << matter.
name()
339 <<
" of dimensions " << rmid <<
", " << rout
340 <<
", " << hthick <<
", 0.0, " 341 << CLHEP::twopi/CLHEP::deg;
343 cpv.
position(glog1, glog, 1, tran, rot);
346 <<
" number 1 positioned in " << glog.
name()
347 <<
" at " << tran <<
" with " <<
rot;
349 double thickTot(0), zpos(-hthick);
358 <<
" R " << rmid <<
":" << rout <<
" Thick " 368 double eta1 = -
log(
tan(0.5*atan(rmid/zz)));
369 double eta2 = -
log(
tan(0.5*atan(rout/zz)));
371 << rmid <<
":" << rout <<
" eta " << eta1
374 <<
" Tubs made of " << matName
375 <<
" of dimensions " << rmid <<
", " << rout
376 <<
", " << hthickl <<
", 0.0, " 377 << CLHEP::twopi/CLHEP::deg;
381 cpv.
position(glog2, glog1, copy, r1, rot);
384 <<
" number " << copy <<
" in " 385 << glog1.
name() <<
" at " << r1
391 if (
std::abs(thickTot-thick) < 0.00001) {
392 }
else if (thickTot > thick) {
393 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " << thick
394 <<
" is smaller than " << thickTot
395 <<
": thickness of all its components in " 396 <<
"the top part **** ERROR ****";
397 }
else if (thickTot < thick) {
399 <<
" does not match with " << thickTot
400 <<
" of the components in top part";
404 name = nameM+
"Bottom";
406 hthick, rin, rmid, 0.0, CLHEP::twopi);
410 <<
" Tubs made of " << matter.
name()
411 <<
" of dimensions " << rin <<
", " << rmid
412 <<
", " << hthick <<
", 0.0, " 413 << CLHEP::twopi/CLHEP::deg;
415 cpv.
position(glog1, glog, 1, tran, rot);
418 <<
" number 1 positioned in " << glog.
name()
419 <<
" at " << tran <<
" with " <<
rot;
431 <<
" R " << rin <<
":" << rmid <<
" Thick " 441 double eta1 = -
log(
tan(0.5*atan(rin/zz)));
442 double eta2 = -
log(
tan(0.5*atan(rmid/zz)));
444 << rin <<
":" << rmid <<
" eta " << eta1
447 <<
" Tubs made of " << matName
448 <<
" of dimensions " << rin <<
", " << rmid
449 <<
", " << hthickl <<
", 0.0, " 450 << CLHEP::twopi/CLHEP::deg;
454 cpv.
position(glog2, glog1, copy, r1, rot);
457 <<
" number " << copy <<
" in " 458 << glog1.
name() <<
" at " << r1
466 if (
std::abs(thickTot-thick) < 0.00001) {
467 }
else if (thickTot > thick) {
468 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " << thick
469 <<
" is smaller than " << thickTot
470 <<
": thickness of all its components in " 471 <<
"the top part **** ERROR ****";
472 }
else if (thickTot < thick) {
474 <<
" does not match with " << thickTot
475 <<
" of the components in top part";
480 double rout,
double zpos,
int layertype,
482 static const double sqrt3 =
std::sqrt(3.0);
484 double R = 2.0*r/sqrt3;
486 int N = (
int)(0.5*rout/r) + 2;
488 int ium(0), ivm(0), iumAll(0), ivmAll(0), kount(0), ntot(0),
nin(0);
489 std::vector<int> ntype(6,0);
491 <<
" rout " << rout <<
" N " << N
492 <<
" for maximum u, v";
494 for (
int u = -N; u <=
N; ++u) {
496 for (
int v = -N;
v <=
N; ++
v) {
502 std::pair<int,int>
corner =
507 if (corner.first > 0) {
509 int copy = type*1000000 + iv*100 + iu;
510 if (u < 0) copy += 10000;
511 if (v < 0) copy += 100000;
513 if (iu > ium) ium = iu;
514 if (iv > ivm) ivm = iv;
520 if (iu > iumAll) iumAll = iu;
521 if (iv > ivmAll) ivmAll = iv;
526 if (layertype > 1) type += 3;
533 <<
" number " << copy
534 <<
" positioned in " << glog.
ddname()
544 <<
":" << iumAll <<
" # of v " << ivm <<
":" 545 << ivmAll <<
" and " << nin <<
":" << kount
546 <<
":" << ntot <<
" wafers (" << ntype[0]
547 <<
":" << ntype[1] <<
":" << ntype[2] <<
":" 548 << ntype[3] <<
":" << ntype[4] <<
":" 549 << ntype[5] <<
") for " << glog.
ddname()
550 <<
" R " << rin <<
":" << rout;
std::vector< double > rMixLayer_
std::vector< int > layerTypeTop_
std::vector< double > layerThickBot_
void positionMix(const DDLogicalPart &glog, const std::string &name, int copy, double thick, const DDMaterial &matter, double rin, double rmid, double routF, double zz, DDCompactView &cpv)
std::vector< double > slopeB_
std::vector< std::string > materials_
DDMaterial is used to define and access material information.
std::vector< double > zFrontB_
void execute(DDCompactView &cpv) override
DDName is used to identify DDD entities uniquely.
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
static std::string & ns()
std::vector< double > thick_
std::vector< std::string > namesTop_
Compact representation of the geometrical detector hierarchy.
~DDHGCalHEAlgo() override
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
std::unique_ptr< HGCalWaferType > waferType_
std::vector< int > layerSense_
std::vector< int > copyNumberBot_
std::vector< std::string > materialsBot_
std::vector< double > slopeT_
void constructLayers(const DDLogicalPart &, DDCompactView &cpv)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
std::vector< int > layers_
std::vector< double > rMinFront_
std::vector< double > rad100to200_
static uint32_t k_CornerSize
std::vector< double > zFrontT_
std::vector< double > layerThickTop_
std::unordered_set< int > copies_
std::vector< int > copyNumber_
std::vector< int > layerType_
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::vector< std::string > materialsTop_
std::vector< int > copyNumberTop_
void positionSensitive(const DDLogicalPart &glog, double rin, double rout, double zpos, int layertype, DDCompactView &cpv)
std::vector< int > layerSenseBot_
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::vector< std::string > wafers_
std::vector< std::string > namesBot_
std::vector< double > layerThick_
static DDSolid polyhedra(const DDName &name, int sides, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polyhedra (refere to Geant3 or Geant4 documentation)
std::vector< std::string > names_
std::vector< int > layerTypeBot_
std::vector< double > rMaxFront_
std::vector< double > rad200to300_