|
|
Go to the documentation of this file.
4 #include <unordered_set>
46 void positionSensitive(
double zpos,
58 static constexpr
double tolerance_ = 0.00001;
103 wafer_ = vsArgs[
"WaferName"];
105 genMat_ = sArgs[
"GeneralMaterial"];
109 for (
auto wafer :
wafer_) {
121 names_ = vsArgs[
"VolumeNames"];
127 for (
unsigned int i = 0;
i <
names_.size(); ++
i)
166 rMax_ = nArgs[
"rMax"];
170 <<
" wafer width " <<
waferW_ <<
" gap among wafers " <<
waferGap_ <<
" absorber width "
176 <<
parent().name().name();
195 edm::LogVerbatim(
"HGCalGeom") <<
"<<== End of DDHGCalTBModuleX construction";
208 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: Block " <<
i <<
":" <<
name <<
" z " << zi <<
":" << zo <<
" R "
220 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: " << glog.
name() <<
" number " <<
i <<
" positioned in "
221 <<
parent.name() <<
" at " <<
r1 <<
" with " <<
rot;
243 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: \t\tInside Block " <<
block <<
" Layers " << firstLayer <<
":"
244 << lastLayer <<
" zFront " << zFront <<
" thickness " << totalWidth <<
" ignore Center "
247 double zi(zFront), thickTot(0);
248 for (
int ly = firstLayer; ly <= lastLayer; ++ly) {
257 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: " <<
name <<
" Layer " << ly <<
":" <<
ii <<
" Z " << zi <<
":"
275 <<
module.name() <<
" at " <<
r1 <<
" with " <<
rot;
284 if (fabs(thickTot - totalWidth) <
tolerance_) {
285 }
else if (thickTot > totalWidth) {
286 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " << totalWidth <<
" is smaller than " << thickTot
287 <<
": total thickness of all its components in " <<
module.name() <<
" Layers "
288 << firstLayer <<
":" << lastLayer <<
":" << ignoreCenter <<
"**** ERROR ****";
289 }
else if (thickTot < totalWidth) {
290 edm::LogWarning(
"HGCalGeom") <<
"Thickness of the partition " << totalWidth <<
" does not match with " << thickTot
291 <<
" of the components in " <<
module.name() <<
" Layers " << firstLayer <<
":"
292 << lastLayer <<
":" << ignoreCenter;
307 double dx = 0.5 * ww;
310 int ncol = (
int)(2.0 * rout / ww) + 1;
313 int incm(0), inrm(0);
315 <<
" Row " << nrow <<
" column " << ncol <<
" ncrMax " << ncrMax <<
" Z " << zpos
316 <<
" Center " << ignoreCenter <<
" name " << nameIn <<
" matter " << matter.
name();
323 for (
int nr = -nrow;
nr <= nrow; ++
nr) {
325 for (
int nc = -ncol; nc <= ncol; ++nc) {
327 if ((inr % 2 == inc % 2) && (!ignoreCenter || nc != 0 ||
nr != 0)) {
328 double xpos = nc *
dx;
329 double ypos =
nr *
dy;
332 yc[0] = ypos - 0.5 *
rr;
334 yc[1] = ypos + 0.5 *
rr;
338 yc[3] = ypos + 0.5 *
rr;
340 yc[4] = ypos - 0.5 *
rr;
343 bool cornerAll(
true);
344 for (
int k = 0;
k < 6; ++
k) {
350 double rpos =
std::sqrt(xpos * xpos + ypos * ypos);
353 int copy = inr * 100 + inc;
366 <<
"DDHGCalTBModuleX: " << glog1.
ddname() <<
" number " << copyIn <<
" positioned in " << glog.
ddname()
367 <<
" at " << tran <<
" with " <<
rotation;
381 copy += copyIn * 1000000;
400 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: # of columns " << incm <<
" # of rows " << inrm <<
" and "
401 << kount <<
" wafers for " << glog.
ddname();
std::vector< int > layerFrontOut_
DDName is used to identify DDD entities uniquely.
std::vector< int > layerFrontIn_
U second(std::pair< T, U > const &p)
std::vector< std::string > wafer_
static constexpr double tolerance_
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
void execute(DDCompactView &cpv) override
DDMaterial is used to define and access material information.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
std::unordered_set< int > copies_
void constructBlocks(const DDLogicalPart &, DDCompactView &cpv)
Compact representation of the geometrical detector hierarchy.
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
std::vector< int > layerType_
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::string > covers_
std::vector< std::string > materials_
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Tan< T >::type tan(const T &t)
std::vector< int > layerSense_
void constructLayers(int block, int layerFront, int layerBack, double zFront, double thick, bool ignore, const DDLogicalPart &, DDCompactView &)
std::vector< int > layerBackIn_
std::vector< double > blockThick_
void positionSensitive(double zpos, int copyIn, int type, double rmax, int ncrMax, bool ignoreCenter, const std::string &, const DDMaterial &, const DDLogicalPart &, DDCompactView &cpv)
void constructLayers(const cms::DDNamespace &ns, const std::vector< std::string > &wafers, const std::vector< std::string > &covers, const std::vector< int > &layerType, const std::vector< int > &layerSense, const std::vector< int > &maxModule, const std::vector< std::string > &names, const std::vector< std::string > &materials, std::vector< int > ©Number, const std::vector< double > &layerThick, const double &absorbW, const double &absorbH, const double &waferTot, const double &rMax, const double &rMaxFine, std::unordered_set< int > &copies, int firstLayer, int lastLayer, double zFront, double totalWidth, bool ignoreCenter, dd4hep::Volume &module)
std::vector< int > layerBackOut_
static std::string & ns()
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
A DDSolid represents the shape of a part.
Represents a uniquely identifyable rotation matrix.
std::vector< std::string > names_
static AlgebraicMatrix initialize()
std::vector< int > maxModule_
Abs< T >::type abs(const T &t)
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
std::vector< int > copyNumber_
~DDHGCalTBModuleX() override
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::vector< double > layerThick_
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)