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
 
 ~DDHGCalWafer8 () override
 

Private Attributes

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

Detailed Description

Definition at line 18 of file DDHGCalWafer8.cc.

Constructor & Destructor Documentation

DDHGCalWafer8::DDHGCalWafer8 ( )

Definition at line 43 of file DDHGCalWafer8.cc.

43  {
44 #ifdef EDM_ML_DEBUG
45  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Creating an instance";
46 #endif
47 }
DDHGCalWafer8::~DDHGCalWafer8 ( )
override

Definition at line 49 of file DDHGCalWafer8.cc.

49 {}

Member Function Documentation

void DDHGCalWafer8::execute ( DDCompactView cpv)
override

Definition at line 76 of file DDHGCalWafer8.cc.

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

76  {
77 #ifdef EDM_ML_DEBUG
78  edm::LogVerbatim("HGCalGeom") << "==>> Executing DDHGCalWafer8...";
79 #endif
80 
81  static const double sqrt3 = std::sqrt(3.0);
82  double rM = 0.5 * (waferSize_ + waferSepar_);
83  double RM2 = rM / sqrt3;
84  double R = waferSize_ / (3.0 * nCells_);
85  double r = 0.5 * R * sqrt3;
86 
87  // First the full cell
88  std::vector<double> xM = {rM, 0, -rM, -rM, 0, rM};
89  std::vector<double> yM = {RM2, 2 * RM2, RM2, -RM2, -2 * RM2, -RM2};
90  std::vector<double> zw = {-0.5 * waferT_, 0.5 * waferT_};
91  std::vector<double> zx(2, 0), zy(2, 0), scale(2, 1.0);
92  DDName parentName = parent().name();
93  DDSolid solid = DDSolidFactory::extrudedpolygon(parentName, xM, yM, zw, zx, zy, scale);
95  DDMaterial matter(matName);
96  DDLogicalPart glog = DDLogicalPart(solid.ddname(), matter, solid);
97 #ifdef EDM_ML_DEBUG
98  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: " << solid.name() << " extruded polygon made of " << matName
99  << " z|x|y|s (0) " << zw[0] << ":" << zx[0] << ":" << zy[0] << ":" << scale[0]
100  << " z|x|y|s (1) " << zw[1] << ":" << zx[1] << ":" << zy[1] << ":" << scale[1]
101  << " and " << xM.size() << " edges";
102  for (unsigned int k = 0; k < xM.size(); ++k)
103  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << xM[k] << ":" << yM[k];
104 #endif
105 
106  DDRotation rot;
107  for (int u = 0; u < 2 * nCells_; ++u) {
108  for (int v = 0; v < 2 * nCells_; ++v) {
109  if (((v - u) < nCells_) && (u - v) <= nCells_) {
110  int n2 = nCells_ / 2;
111  double yp = (u - 0.5 * v - n2) * 2 * r;
112  double xp = (1.5 * (v - nCells_) + 1.0) * R;
113  int cell(0);
114  if ((u == 0) && (v == 0))
115  cell = 7;
116  else if ((u == 0) && (v == nCells_ - 1))
117  cell = 8;
118  else if ((u == nCells_) && (v == 2 * nCells_ - 1))
119  cell = 9;
120  else if ((u == 2 * nCells_ - 1) && (v == 2 * nCells_ - 1))
121  cell = 10;
122  else if ((u == 2 * nCells_ - 1) && (v == nCells_ - 1))
123  cell = 11;
124  else if ((u == nCells_) && (v == 0))
125  cell = 12;
126  else if (u == 0)
127  cell = 1;
128  else if ((v - u) == (nCells_ - 1))
129  cell = 4;
130  else if (v == (2 * nCells_ - 1))
131  cell = 2;
132  else if (u == (2 * nCells_ - 1))
133  cell = 5;
134  else if ((u - v) == nCells_)
135  cell = 3;
136  else if (v == 0)
137  cell = 6;
138  DDTranslation tran(xp, yp, 0);
139  int copy = (cellType_ * 100 + v) * 100 + u;
140  cpv.position(DDName(cellNames_[cell]), glog, copy, tran, rot);
141 #ifdef EDM_ML_DEBUG
142  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: " << cellNames_[cell] << " number " << copy << " position in "
143  << glog.name() << " at " << tran << " with " << rot;
144 #endif
145  }
146  }
147  }
148 }
const N & name() const
Definition: DDBase.h:59
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:15
std::string material_
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
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
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:570
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
Definition: ExtVec.h:75
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
const N & ddname() const
Definition: DDBase.h:61
void DDHGCalWafer8::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 51 of file DDHGCalWafer8.cc.

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

55  {
56  waferSize_ = nArgs["WaferSize"];
57  waferT_ = nArgs["WaferThick"];
58  waferSepar_ = nArgs["SensorSeparation"];
59  mouseBite_ = nArgs["MouseBite"];
60  nCells_ = (int)(nArgs["NCells"]);
61  cellType_ = (int)(nArgs["CellType"]);
62  material_ = sArgs["Material"];
63  cellNames_ = vsArgs["CellNames"];
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Wafer 2r " << waferSize_ << " T " << waferT_ << " Half Separation "
67  << waferSepar_ << " Mouse bite radius " << mouseBite_ << " Cells/Wafer " << nCells_
68  << " Cell Type " << cellType_ << " Material " << material_ << " Names "
69  << parent().name() << " NameSpace " << nameSpace_ << " # of cells "
70  << cellNames_.size();
71  for (unsigned int k = 0; k < cellNames_.size(); ++k)
72  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Cell[" << k << "] " << cellNames_[k];
73 #endif
74 }
double waferSepar_
static std::string & ns()
std::string material_
std::vector< std::string > cellNames_
std::string nameSpace_

Member Data Documentation

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

Definition at line 39 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

int DDHGCalWafer8::cellType_
private

Definition at line 37 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

std::string DDHGCalWafer8::material_
private

Definition at line 38 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

double DDHGCalWafer8::mouseBite_
private

Definition at line 35 of file DDHGCalWafer8.cc.

Referenced by initialize().

std::string DDHGCalWafer8::nameSpace_
private

Definition at line 40 of file DDHGCalWafer8.cc.

Referenced by initialize().

int DDHGCalWafer8::nCells_
private

Definition at line 36 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

double DDHGCalWafer8::waferSepar_
private

Definition at line 34 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

double DDHGCalWafer8::waferSize_
private

Definition at line 32 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

double DDHGCalWafer8::waferT_
private

Definition at line 33 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().