CMS 3D CMS Logo

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

Public Member Functions

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

Private Attributes

std::vector< std::string > cellNames_
 
int cellType_
 
std::string material_
 
std::string nameSpace_
 
int nCells_
 
double waferSepar_
 
double waferSize_
 
double waferT_
 

Detailed Description

Definition at line 19 of file DDHGCalWafer8.cc.

Constructor & Destructor Documentation

◆ DDHGCalWafer8()

DDHGCalWafer8::DDHGCalWafer8 ( )
inline

Definition at line 22 of file DDHGCalWafer8.cc.

22 {}

Member Function Documentation

◆ execute()

void DDHGCalWafer8::execute ( DDCompactView cpv)
override

Definition at line 65 of file DDHGCalWafer8.cc.

References cellNames_, cellType_, filterCSVwithJSON::copy, counter, DDBase< N, C >::ddname(), DDSplit(), DDSolidFactory::extrudedpolygon(), dqmdumpme::first, dqmdumpme::k, material_, DDBase< N, C >::name(), nCells_, HGCalTypes::packCellTypeUV(), class-composition::parent, DDCompactView::position(), dttmaxenums::R, alignCSCRings::r, makeMuonMisalignmentScenario::rot, l1tEGammaCrystalsEmulatorProducer_cfi::scale, edm::second(), mathSSE::sqrt(), findQualityFiles::v, waferSepar_, waferSize_, waferT_, and zw().

65  {
66  static const double sqrt3 = std::sqrt(3.0);
67  double rM = 0.5 * (waferSize_ + waferSepar_);
68  double RM2 = rM / sqrt3;
69  double R = waferSize_ / (3.0 * nCells_);
70  double r = 0.5 * R * sqrt3;
71 
72  // First the full cell
73  std::vector<double> xM = {rM, 0, -rM, -rM, 0, rM};
74  std::vector<double> yM = {RM2, 2 * RM2, RM2, -RM2, -2 * RM2, -RM2};
75  std::vector<double> zw = {-0.5 * waferT_, 0.5 * waferT_};
76  std::vector<double> zx(2, 0), zy(2, 0), scale(2, 1.0);
77  DDName parentName = parent().name();
78  DDSolid solid = DDSolidFactory::extrudedpolygon(parentName, xM, yM, zw, zx, zy, scale);
80  DDMaterial matter(matName);
81  DDLogicalPart glog = DDLogicalPart(solid.ddname(), matter, solid);
82 #ifdef EDM_ML_DEBUG
83  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: " << solid.name() << " extruded polygon made of " << matName
84  << " z|x|y|s (0) " << zw[0] << ":" << zx[0] << ":" << zy[0] << ":" << scale[0]
85  << " z|x|y|s (1) " << zw[1] << ":" << zx[1] << ":" << zy[1] << ":" << scale[1]
86  << " and " << xM.size() << " edges";
87  for (unsigned int k = 0; k < xM.size(); ++k)
88  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << xM[k] << ":" << yM[k];
89  int counter(0);
90 #endif
91 
93  for (int u = 0; u < 2 * nCells_; ++u) {
94  for (int v = 0; v < 2 * nCells_; ++v) {
95  if (((v - u) < nCells_) && (u - v) <= nCells_) {
96 #ifdef EDM_ML_DEBUG
97  counter++;
98 #endif
99  int n2 = nCells_ / 2;
100  double yp = (u - 0.5 * v - n2) * 2 * r;
101  double xp = (1.5 * (v - nCells_) + 1.0) * R;
102  int cell(0);
103  if ((u == 0) && (v == 0))
104  cell = 7;
105  else if ((u == 0) && (v == nCells_ - 1))
106  cell = 8;
107  else if ((u == nCells_) && (v == 2 * nCells_ - 1))
108  cell = 9;
109  else if ((u == 2 * nCells_ - 1) && (v == 2 * nCells_ - 1))
110  cell = 10;
111  else if ((u == 2 * nCells_ - 1) && (v == nCells_ - 1))
112  cell = 11;
113  else if ((u == nCells_) && (v == 0))
114  cell = 12;
115  else if (u == 0)
116  cell = 1;
117  else if ((v - u) == (nCells_ - 1))
118  cell = 4;
119  else if (v == (2 * nCells_ - 1))
120  cell = 2;
121  else if (u == (2 * nCells_ - 1))
122  cell = 5;
123  else if ((u - v) == nCells_)
124  cell = 3;
125  else if (v == 0)
126  cell = 6;
127  DDTranslation tran(xp, yp, 0);
129  cpv.position(DDName(cellNames_[cell]), glog, copy, tran, rot);
130 #ifdef EDM_ML_DEBUG
131  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: " << cellNames_[cell] << " number " << copy << " position in "
132  << glog.name() << " at " << tran << " with no rotation";
133 #endif
134  }
135  }
136  }
137 #ifdef EDM_ML_DEBUG
138  edm::LogVerbatim("HGCalGeom") << "\nDDHGCalWafer8::Counter : " << counter << "\n===============================\n";
139 #endif
140 }
Log< level::Info, true > LogVerbatim
static int32_t packCellTypeUV(int type, int u, int v)
Definition: HGCalTypes.cc:28
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
double waferSepar_
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::string material_
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< std::string > cellNames_
T sqrt(T t)
Definition: SSEVec.h:19
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
static std::atomic< unsigned int > counter
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
Definition: ExtVec.h:71
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

◆ initialize()

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

Definition at line 42 of file DDHGCalWafer8.cc.

References cellNames_, cellType_, createfilelist::int, dqmdumpme::k, material_, nameSpace_, nCells_, DDCurrentNamespace::ns(), class-composition::parent, waferSepar_, waferSize_, and waferT_.

46  {
47  waferSize_ = nArgs["WaferSize"];
48  waferT_ = nArgs["WaferThick"];
49  waferSepar_ = nArgs["SensorSeparation"];
50  nCells_ = (int)(nArgs["NCells"]);
51  cellType_ = (int)(nArgs["CellType"]);
52  material_ = sArgs["Material"];
53  cellNames_ = vsArgs["CellNames"];
55 #ifdef EDM_ML_DEBUG
56  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Wafer 2r " << waferSize_ << " T " << waferT_ << " Half Separation "
57  << waferSepar_ << " Cells/Wafer " << nCells_ << " Cell Type " << cellType_
58  << " Material " << material_ << " Names " << parent().name() << " NameSpace "
59  << nameSpace_ << ": # of cells " << cellNames_.size();
60  for (unsigned int k = 0; k < cellNames_.size(); ++k)
61  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Cell[" << k << "] " << cellNames_[k];
62 #endif
63 }
Log< level::Info, true > LogVerbatim
double waferSepar_
static std::string & ns()
std::string material_
std::vector< std::string > cellNames_
std::string nameSpace_

Member Data Documentation

◆ cellNames_

std::vector<std::string> DDHGCalWafer8::cellNames_
private

Definition at line 38 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ cellType_

int DDHGCalWafer8::cellType_
private

Definition at line 36 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ material_

std::string DDHGCalWafer8::material_
private

Definition at line 37 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ nameSpace_

std::string DDHGCalWafer8::nameSpace_
private

Definition at line 39 of file DDHGCalWafer8.cc.

Referenced by initialize().

◆ nCells_

int DDHGCalWafer8::nCells_
private

Definition at line 35 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ waferSepar_

double DDHGCalWafer8::waferSepar_
private

Definition at line 34 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ waferSize_

double DDHGCalWafer8::waferSize_
private

Definition at line 32 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ waferT_

double DDHGCalWafer8::waferT_
private

Definition at line 33 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().