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 19 of file DDHGCalWafer8.cc.

Constructor & Destructor Documentation

◆ DDHGCalWafer8()

DDHGCalWafer8::DDHGCalWafer8 ( )

Definition at line 44 of file DDHGCalWafer8.cc.

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

◆ ~DDHGCalWafer8()

DDHGCalWafer8::~DDHGCalWafer8 ( )
override

Definition at line 50 of file DDHGCalWafer8.cc.

50 {}

Member Function Documentation

◆ execute()

void DDHGCalWafer8::execute ( DDCompactView cpv)
override

Definition at line 77 of file DDHGCalWafer8.cc.

77  {
78 #ifdef EDM_ML_DEBUG
79  edm::LogVerbatim("HGCalGeom") << "==>> Executing DDHGCalWafer8...";
80 #endif
81 
82  static const double sqrt3 = std::sqrt(3.0);
83  double rM = 0.5 * (waferSize_ + waferSepar_);
84  double RM2 = rM / sqrt3;
85  double R = waferSize_ / (3.0 * nCells_);
86  double r = 0.5 * R * sqrt3;
87 
88  // First the full cell
89  std::vector<double> xM = {rM, 0, -rM, -rM, 0, rM};
90  std::vector<double> yM = {RM2, 2 * RM2, RM2, -RM2, -2 * RM2, -RM2};
91  std::vector<double> zw = {-0.5 * waferT_, 0.5 * waferT_};
92  std::vector<double> zx(2, 0), zy(2, 0), scale(2, 1.0);
93  DDName parentName = parent().name();
94  DDSolid solid = DDSolidFactory::extrudedpolygon(parentName, xM, yM, zw, zx, zy, scale);
96  DDMaterial matter(matName);
97  DDLogicalPart glog = DDLogicalPart(solid.ddname(), matter, solid);
98 #ifdef EDM_ML_DEBUG
99  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: " << solid.name() << " extruded polygon made of " << matName
100  << " z|x|y|s (0) " << zw[0] << ":" << zx[0] << ":" << zy[0] << ":" << scale[0]
101  << " z|x|y|s (1) " << zw[1] << ":" << zx[1] << ":" << zy[1] << ":" << scale[1]
102  << " and " << xM.size() << " edges";
103  for (unsigned int k = 0; k < xM.size(); ++k)
104  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << xM[k] << ":" << yM[k];
105 #endif
106 
107  DDRotation rot;
108  for (int u = 0; u < 2 * nCells_; ++u) {
109  for (int v = 0; v < 2 * nCells_; ++v) {
110  if (((v - u) < nCells_) && (u - v) <= nCells_) {
111  int n2 = nCells_ / 2;
112  double yp = (u - 0.5 * v - n2) * 2 * r;
113  double xp = (1.5 * (v - nCells_) + 1.0) * R;
114  int cell(0);
115  if ((u == 0) && (v == 0))
116  cell = 7;
117  else if ((u == 0) && (v == nCells_ - 1))
118  cell = 8;
119  else if ((u == nCells_) && (v == 2 * nCells_ - 1))
120  cell = 9;
121  else if ((u == 2 * nCells_ - 1) && (v == 2 * nCells_ - 1))
122  cell = 10;
123  else if ((u == 2 * nCells_ - 1) && (v == nCells_ - 1))
124  cell = 11;
125  else if ((u == nCells_) && (v == 0))
126  cell = 12;
127  else if (u == 0)
128  cell = 1;
129  else if ((v - u) == (nCells_ - 1))
130  cell = 4;
131  else if (v == (2 * nCells_ - 1))
132  cell = 2;
133  else if (u == (2 * nCells_ - 1))
134  cell = 5;
135  else if ((u - v) == nCells_)
136  cell = 3;
137  else if (v == 0)
138  cell = 6;
139  DDTranslation tran(xp, yp, 0);
141  cpv.position(DDName(cellNames_[cell]), glog, copy, tran, rot);
142 #ifdef EDM_ML_DEBUG
143  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: " << cellNames_[cell] << " number " << copy << " position in "
144  << glog.name() << " at " << tran << " with " << rot;
145 #endif
146  }
147  }
148  }
149 }

References cellNames_, cellType_, filterCSVwithJSON::copy, 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, L1EGammaCrystalsEmulatorProducer_cfi::scale, edm::second(), mathSSE::sqrt(), findQualityFiles::v, waferSepar_, waferSize_, waferT_, and zw().

◆ initialize()

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

Definition at line 52 of file DDHGCalWafer8.cc.

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

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

Member Data Documentation

◆ cellNames_

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

Definition at line 40 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ cellType_

int DDHGCalWafer8::cellType_
private

Definition at line 38 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ material_

std::string DDHGCalWafer8::material_
private

Definition at line 39 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ mouseBite_

double DDHGCalWafer8::mouseBite_
private

Definition at line 36 of file DDHGCalWafer8.cc.

Referenced by initialize().

◆ nameSpace_

std::string DDHGCalWafer8::nameSpace_
private

Definition at line 41 of file DDHGCalWafer8.cc.

Referenced by initialize().

◆ nCells_

int DDHGCalWafer8::nCells_
private

Definition at line 37 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ waferSepar_

double DDHGCalWafer8::waferSepar_
private

Definition at line 35 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ waferSize_

double DDHGCalWafer8::waferSize_
private

Definition at line 33 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

◆ waferT_

double DDHGCalWafer8::waferT_
private

Definition at line 34 of file DDHGCalWafer8.cc.

Referenced by execute(), and initialize().

DDHGCalWafer8::nameSpace_
std::string nameSpace_
Definition: DDHGCalWafer8.cc:41
DDHGCalWafer8::waferT_
double waferT_
Definition: DDHGCalWafer8.cc:34
DDHGCalWafer8::mouseBite_
double mouseBite_
Definition: DDHGCalWafer8.cc:36
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDHGCalWafer8::waferSepar_
double waferSepar_
Definition: DDHGCalWafer8.cc:35
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
DDHGCalWafer8::material_
std::string material_
Definition: DDHGCalWafer8.cc:39
findQualityFiles.v
v
Definition: findQualityFiles.py:179
dqmdumpme.first
first
Definition: dqmdumpme.py:55
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDBase::name
const N & name() const
Definition: DDBase.h:59
HGCalTypes::packCellTypeUV
static int32_t packCellTypeUV(int type, int u, int v)
Definition: HGCalTypes.cc:28
dqmdumpme.k
k
Definition: dqmdumpme.py:60
DDSolidFactory::extrudedpolygon
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
DDBase::ddname
const N & ddname() const
Definition: DDBase.h:61
DDHGCalWafer8::cellType_
int cellType_
Definition: DDHGCalWafer8.cc:38
DDHGCalWafer8::waferSize_
double waferSize_
Definition: DDHGCalWafer8.cc:33
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
createfilelist.int
int
Definition: createfilelist.py:10
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DDHGCalWafer8::nCells_
int nCells_
Definition: DDHGCalWafer8.cc:37
DDHGCalWafer8::cellNames_
std::vector< std::string > cellNames_
Definition: DDHGCalWafer8.cc:40
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
zw
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
Definition: ExtVec.h:75
edm::Log
Definition: MessageLogger.h:70
dttmaxenums::R
Definition: DTTMax.h:29
class-composition.parent
parent
Definition: class-composition.py:88
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:76