CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDHGCalPassiveFull Class Reference
Inheritance diagram for DDHGCalPassiveFull:

Public Member Functions

 DDHGCalPassiveFull ()
 
void execute (DDCompactView &cpv) override
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 
 ~DDHGCalPassiveFull () override=default
 

Private Attributes

std::vector< int > copyNumber_
 
std::vector< std::string > layerNames_
 
std::vector< double > layerThick_
 
std::vector< int > layerType_
 
std::string material_
 
std::vector< std::string > materials_
 
double thick_
 
double waferSepar_
 
double waferSize_
 

Detailed Description

Definition at line 24 of file DDHGCalPassiveFull.cc.

Constructor & Destructor Documentation

◆ DDHGCalPassiveFull()

DDHGCalPassiveFull::DDHGCalPassiveFull ( )

Definition at line 49 of file DDHGCalPassiveFull.cc.

49  {
50 #ifdef EDM_ML_DEBUG
51  edm::LogVerbatim("HGCalGeom") << "DDHGCalPassiveFull: Creating an instance";
52 #endif
53 }
Log< level::Info, true > LogVerbatim

◆ ~DDHGCalPassiveFull()

DDHGCalPassiveFull::~DDHGCalPassiveFull ( )
overridedefault

Member Function Documentation

◆ execute()

void DDHGCalPassiveFull::execute ( DDCompactView cpv)
override

Definition at line 87 of file DDHGCalPassiveFull.cc.

References funct::abs(), copyNumber_, DDBase< N, C >::ddname(), DDSplit(), DDSolidFactory::extrudedpolygon(), dqmdumpme::first, mps_fire::i, GetRecoTauVFromDQM_MC_cff::kk, MainPageGenerator::l, layerNames_, layerThick_, layerType_, material_, materials_, DDBase< N, C >::name(), class-composition::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, pfClustersFromCombinedCaloHF_cfi::scale, edm::second(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, thick_, waferSize_, and zw().

87  {
88 #ifdef EDM_ML_DEBUG
89  edm::LogVerbatim("HGCalGeom") << "==>> Executing DDHGCalPassiveFull...";
90 #endif
91 
92  static constexpr double tol = 0.00001;
93  static const double sqrt3 = std::sqrt(3.0);
94  double rM = 0.5 * waferSize_;
95  double RM2 = rM / sqrt3;
96 
97  // First the mother
98  std::vector<double> xM = {rM, 0, -rM, -rM, 0, rM};
99  std::vector<double> yM = {RM2, 2 * RM2, RM2, -RM2, -2 * RM2, -RM2};
100  std::vector<double> zw = {-0.5 * thick_, 0.5 * thick_};
101  std::vector<double> zx(2, 0), zy(2, 0), scale(2, 1.0);
102  std::string parentName = parent().name().name();
103  DDSolid solid = DDSolidFactory::extrudedpolygon(parentName, xM, yM, zw, zx, zy, scale);
105  DDMaterial matter(matName);
106  DDLogicalPart glogM = DDLogicalPart(solid.ddname(), matter, solid);
107 #ifdef EDM_ML_DEBUG
108  edm::LogVerbatim("HGCalGeom") << "DDHGCalPassiveFull: " << solid.name() << " extruded polygon made of " << matName
109  << " z|x|y|s (0) " << zw[0] << ":" << zx[0] << ":" << zy[0] << ":" << scale[0]
110  << " z|x|y|s (1) " << zw[1] << ":" << zx[1] << ":" << zy[1] << ":" << scale[1]
111  << " and " << xM.size() << " edges";
112  for (unsigned int kk = 0; kk < xM.size(); ++kk)
113  edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << xM[kk] << ":" << yM[kk];
114 #endif
115 
116  // Then the layers
117  std::vector<DDLogicalPart> glogs(materials_.size());
118  double zi(-0.5 * thick_), thickTot(0.0);
119  for (unsigned int l = 0; l < layerType_.size(); l++) {
120  unsigned int i = layerType_[l];
121  if (copyNumber_[i] == 1) {
122  zw[0] = -0.5 * layerThick_[i];
123  zw[1] = 0.5 * layerThick_[i];
124  std::string layerName = parentName + layerNames_[i];
125  solid = DDSolidFactory::extrudedpolygon(layerName, xM, yM, zw, zx, zy, scale);
127  DDMaterial matter(matN);
128  glogs[i] = DDLogicalPart(solid.ddname(), matter, solid);
129 #ifdef EDM_ML_DEBUG
130  edm::LogVerbatim("HGCalGeom") << "DDHGCalPassiveFull: Layer " << i << ":" << l << ":" << solid.name()
131  << " extruded polygon made of " << matN << " z|x|y|s (0) " << zw[0] << ":" << zx[0]
132  << ":" << zy[0] << ":" << scale[0] << " z|x|y|s (1) " << zw[1] << ":" << zx[1]
133  << ":" << zy[1] << ":" << scale[1] << " and " << xM.size() << " edges";
134  for (unsigned int kk = 0; kk < xM.size(); ++kk)
135  edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << xM[kk] << ":" << yM[kk];
136 #endif
137  }
138  DDTranslation tran0(0, 0, (zi + 0.5 * layerThick_[i]));
139  DDRotation rot;
140  cpv.position(glogs[i], glogM, copyNumber_[i], tran0, rot);
141 #ifdef EDM_ML_DEBUG
142  edm::LogVerbatim("HGCalGeom") << "DDHGCalPassiveFull: " << glogs[i].name() << " number " << copyNumber_[i]
143  << " positioned in " << glogM.name() << " at " << tran0 << " with no rotation";
144 #endif
145  ++copyNumber_[i];
146  zi += layerThick_[i];
147  thickTot += layerThick_[i];
148  }
149  if ((std::abs(thickTot - thick_) >= tol) && (!layerType_.empty())) {
150  if (thickTot > thick_) {
151  edm::LogError("HGCalGeom") << "Thickness of the partition " << thick_ << " is smaller than " << thickTot
152  << ": thickness of all its components **** ERROR ****";
153  } else {
154  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << thick_ << " does not match with " << thickTot
155  << " of the components";
156  }
157  }
158 }
Log< level::Info, true > LogVerbatim
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::vector< double > layerThick_
Log< level::Error, false > LogError
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
std::vector< int > layerType_
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< std::string > materials_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
const N & name() const
Definition: DDBase.h:59
static DDSolid extrudedpolygon(const DDName &name, const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, const std::vector< double > &zx, const std::vector< double > &zy, const std::vector< double > &zscale)
Definition: DDSolid.cc:584
const N & ddname() const
Definition: DDBase.h:61
std::vector< int > copyNumber_
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
Definition: ExtVec.h:71
Log< level::Warning, false > LogWarning
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::vector< std::string > layerNames_

◆ initialize()

void DDHGCalPassiveFull::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 55 of file DDHGCalPassiveFull.cc.

References copyNumber_, dbl_to_int(), mps_fire::i, layerNames_, layerThick_, layerType_, material_, materials_, class-composition::parent, thick_, waferSepar_, and waferSize_.

59  {
60  material_ = sArgs["ModuleMaterial"];
61  thick_ = nArgs["ModuleThickness"];
62  waferSize_ = nArgs["WaferSize"];
63 #ifdef EDM_ML_DEBUG
64  waferSepar_ = nArgs["SensorSeparation"];
65  edm::LogVerbatim("HGCalGeom") << "DDHGCalPassiveFull: Module " << parent().name() << " made of " << material_ << " T "
66  << thick_ << " Wafer 2r " << waferSize_ << " Half Separation " << waferSepar_;
67 #endif
68  layerNames_ = vsArgs["LayerNames"];
69  materials_ = vsArgs["LayerMaterials"];
70  layerThick_ = vArgs["LayerThickness"];
71  copyNumber_.resize(materials_.size(), 1);
72 #ifdef EDM_ML_DEBUG
73  edm::LogVerbatim("HGCalGeom") << "DDHGCalPassiveFull: " << layerNames_.size() << " types of volumes";
74  for (unsigned int i = 0; i < layerNames_.size(); ++i)
75  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames_[i] << " of thickness " << layerThick_[i]
76  << " filled with " << materials_[i];
77 #endif
78  layerType_ = dbl_to_int(vArgs["LayerType"]);
79 #ifdef EDM_ML_DEBUG
80  std::ostringstream st1;
81  for (unsigned int i = 0; i < layerType_.size(); ++i)
82  st1 << " [" << i << "] " << layerType_[i];
83  edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " blocks" << st1.str();
84 #endif
85 }
Log< level::Info, true > LogVerbatim
std::vector< double > layerThick_
std::vector< int > layerType_
std::vector< std::string > materials_
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
std::vector< int > copyNumber_
std::vector< std::string > layerNames_

Member Data Documentation

◆ copyNumber_

std::vector<int> DDHGCalPassiveFull::copyNumber_
private

Definition at line 45 of file DDHGCalPassiveFull.cc.

Referenced by execute(), and initialize().

◆ layerNames_

std::vector<std::string> DDHGCalPassiveFull::layerNames_
private

Definition at line 42 of file DDHGCalPassiveFull.cc.

Referenced by execute(), and initialize().

◆ layerThick_

std::vector<double> DDHGCalPassiveFull::layerThick_
private

Definition at line 44 of file DDHGCalPassiveFull.cc.

Referenced by execute(), and initialize().

◆ layerType_

std::vector<int> DDHGCalPassiveFull::layerType_
private

Definition at line 46 of file DDHGCalPassiveFull.cc.

Referenced by execute(), and initialize().

◆ material_

std::string DDHGCalPassiveFull::material_
private

Definition at line 38 of file DDHGCalPassiveFull.cc.

Referenced by execute(), and initialize().

◆ materials_

std::vector<std::string> DDHGCalPassiveFull::materials_
private

Definition at line 43 of file DDHGCalPassiveFull.cc.

Referenced by execute(), and initialize().

◆ thick_

double DDHGCalPassiveFull::thick_
private

Definition at line 39 of file DDHGCalPassiveFull.cc.

Referenced by execute(), and initialize().

◆ waferSepar_

double DDHGCalPassiveFull::waferSepar_
private

Definition at line 41 of file DDHGCalPassiveFull.cc.

Referenced by initialize().

◆ waferSize_

double DDHGCalPassiveFull::waferSize_
private

Definition at line 40 of file DDHGCalPassiveFull.cc.

Referenced by execute(), and initialize().