|
|
Go to the documentation of this file.
4 #include <unordered_set>
47 void positionSensitive(
double zpos,
59 static constexpr
double tolerance_ = 0.00001;
104 wafer_ = vsArgs[
"WaferName"];
106 genMat_ = sArgs[
"GeneralMaterial"];
110 for (
auto wafer :
wafer_) {
122 names_ = vsArgs[
"VolumeNames"];
128 for (
unsigned int i = 0;
i <
names_.size(); ++
i)
167 rMax_ = nArgs[
"rMax"];
171 <<
" wafer width " <<
waferW_ <<
" gap among wafers " <<
waferGap_ <<
" absorber width "
177 <<
parent().name().name();
196 edm::LogVerbatim(
"HGCalGeom") <<
"<<== End of DDHGCalTBModuleX construction";
209 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: Block " <<
i <<
":" <<
name <<
" z " << zi <<
":" << zo <<
" R "
221 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: " << glog.
name() <<
" number " <<
i <<
" positioned in "
222 <<
parent.name() <<
" at " <<
r1 <<
" with " <<
rot;
244 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: \t\tInside Block " <<
block <<
" Layers " << firstLayer <<
":"
245 << lastLayer <<
" zFront " << zFront <<
" thickness " << totalWidth <<
" ignore Center "
248 double zi(zFront), thickTot(0);
249 for (
int ly = firstLayer; ly <= lastLayer; ++ly) {
258 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: " <<
name <<
" Layer " << ly <<
":" <<
ii <<
" Z " << zi <<
":"
276 << module.
name() <<
" at " <<
r1 <<
" with " <<
rot;
285 if (fabs(thickTot - totalWidth) <
tolerance_) {
286 }
else if (thickTot > totalWidth) {
287 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " << totalWidth <<
" is smaller than " << thickTot
288 <<
": total thickness of all its components in " << module.
name() <<
" Layers "
289 << firstLayer <<
":" << lastLayer <<
":" << ignoreCenter <<
"**** ERROR ****";
290 }
else if (thickTot < totalWidth) {
291 edm::LogWarning(
"HGCalGeom") <<
"Thickness of the partition " << totalWidth <<
" does not match with " << thickTot
292 <<
" of the components in " << module.
name() <<
" Layers " << firstLayer <<
":"
293 << lastLayer <<
":" << ignoreCenter;
308 double dx = 0.5 * ww;
311 int ncol = (
int)(2.0 * rout / ww) + 1;
314 int incm(0), inrm(0);
316 <<
" Row " << nrow <<
" column " << ncol <<
" ncrMax " << ncrMax <<
" Z " << zpos
317 <<
" Center " << ignoreCenter <<
" name " << nameIn <<
" matter " << matter.
name();
324 for (
int nr = -nrow;
nr <= nrow; ++
nr) {
326 for (
int nc = -ncol; nc <= ncol; ++nc) {
328 if ((inr % 2 == inc % 2) && (!ignoreCenter || nc != 0 ||
nr != 0)) {
329 double xpos = nc *
dx;
330 double ypos =
nr *
dy;
333 yc[0] = ypos - 0.5 *
rr;
335 yc[1] = ypos + 0.5 *
rr;
339 yc[3] = ypos + 0.5 *
rr;
341 yc[4] = ypos - 0.5 *
rr;
344 bool cornerAll(
true);
345 for (
int k = 0;
k < 6; ++
k) {
351 double rpos =
std::sqrt(xpos * xpos + ypos * ypos);
363 <<
"DDHGCalTBModuleX: " << glog1.
ddname() <<
" number " << copyIn <<
" positioned in " << glog.
ddname()
364 <<
" at " << tran <<
" with " <<
rotation;
378 copy += copyIn * 1000000;
397 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: # of columns " << incm <<
" # of rows " << inrm <<
" and "
398 << 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_
Log< level::Warning, false > LogWarning
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)
static int32_t packTypeUV(int type, int u, int v)
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_
Log< level::Error, false > LogError
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)
Log< level::Info, true > LogVerbatim
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)
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
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)