CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDHGCalWafer8 Class Reference

#include <DDHGCalWafer8.h>

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 9 of file DDHGCalWafer8.h.

Constructor & Destructor Documentation

DDHGCalWafer8::DDHGCalWafer8 ( )

Definition at line 13 of file DDHGCalWafer8.cc.

13  {
14 #ifdef EDM_ML_DEBUG
15  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Creating an instance";
16 #endif
17 }
DDHGCalWafer8::~DDHGCalWafer8 ( )
override

Definition at line 19 of file DDHGCalWafer8.cc.

19 {}

Member Function Documentation

void DDHGCalWafer8::execute ( DDCompactView cpv)
override

Definition at line 52 of file DDHGCalWafer8.cc.

References cellNames_, cellType_, popcon2dropbox::copy(), DDBase< N, C >::ddname(), DDSplit(), DDSolidFactory::extrudedpolygon(), plotBeamSpotDB::first, gen::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().

52  {
53 
54 #ifdef EDM_ML_DEBUG
55  edm::LogVerbatim("HGCalGeom") << "==>> Executing DDHGCalWafer8...";
56 #endif
57 
58  static const double sqrt3 = std::sqrt(3.0);
59  double rM = 0.5*(waferSize_ + waferSepar_);
60  double RM2 = rM/sqrt3;
61  double R = waferSize_/(3.0*nCells_);
62  double r = 0.5*R*sqrt3;
63 
64  // First the full cell
65  std::vector<double> xM = {rM,0,-rM,-rM,0,rM};
66  std::vector<double> yM = {RM2,2*RM2,RM2,-RM2,-2*RM2,-RM2};
67  std::vector<double> zw = {-0.5*waferT_,0.5*waferT_};
68  std::vector<double> zx(2,0), zy(2,0), scale(2,1.0);
69  DDName parentName = parent().name();
70  DDSolid solid = DDSolidFactory::extrudedpolygon(parentName,
71  xM, yM, zw, zx, zy, scale);
73  DDMaterial matter(matName);
74  DDLogicalPart glog = DDLogicalPart(solid.ddname(), matter, solid);
75 #ifdef EDM_ML_DEBUG
76  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: " << solid.name()
77  << " extruded polygon made of " << matName
78  << " z|x|y|s (0) " << zw[0] << ":" << zx[0]
79  << ":" << zy[0] << ":" << scale[0]
80  << " z|x|y|s (1) " << zw[1] << ":" << zx[1]
81  << ":" << zy[1] << ":" << scale[1] << " and "
82  << xM.size() << " edges";
83  for (unsigned int k=0; k<xM.size(); ++k)
84  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << xM[k] << ":" << yM[k];
85 #endif
86 
88  for (int u=0; u<2*nCells_; ++u) {
89  for (int v=0; v<2*nCells_; ++v) {
90  if (((v-u) < nCells_) && (u-v) <= nCells_) {
91  int n2 = nCells_/2;
92  double yp = (u-0.5*v-n2)*2*r;
93  double xp = (1.5*(v-nCells_)+1.0)*R;
94  int cell(0);
95  if ((u == 0) && (v == 0)) cell = 7;
96  else if ((u == 0) && (v == nCells_-1)) cell = 8;
97  else if ((u == nCells_) && (v == 2*nCells_-1)) cell = 9;
98  else if ((u == 2*nCells_-1) && (v == 2*nCells_-1)) cell = 10;
99  else if ((u == 2*nCells_-1) && (v == nCells_-1)) cell = 11;
100  else if ((u == nCells_) && (v == 0)) cell = 12;
101  else if (u == 0) cell = 1;
102  else if ((v-u) == (nCells_-1)) cell = 4;
103  else if (v == (2*nCells_-1)) cell = 2;
104  else if (u == (2*nCells_-1)) cell = 5;
105  else if ((u-v) == nCells_) cell = 3;
106  else if (v == 0) cell = 6;
107  DDTranslation tran(xp,yp,0);
108  int copy = (cellType_*100 + v)*100 + u;
109  cpv.position(DDName(cellNames_[cell]), glog, copy, tran, rot);
110 #ifdef EDM_ML_DEBUG
111  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: " << cellNames_[cell]
112  << " number " << copy << " position in "
113  << glog.name() << " at " << tran
114  << " with " <<rot;
115 #endif
116  }
117  }
118  }
119 
120 }
const N & name() const
Definition: DDBase.h:74
double waferSepar_
Definition: DDHGCalWafer8.h:26
def copy(args, dbName)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
double waferSize_
Definition: DDHGCalWafer8.h:24
std::string material_
Definition: DDHGCalWafer8.h:30
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:68
U second(std::pair< T, U > const &p)
std::vector< std::string > cellNames_
Definition: DDHGCalWafer8.h:31
T sqrt(T t)
Definition: SSEVec.h:18
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
int k[5][pyjets_maxn]
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:753
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:76
void DDHGCalWafer8::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 21 of file DDHGCalWafer8.cc.

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

25  {
26 
27  waferSize_ = nArgs["WaferSize"];
28  waferT_ = nArgs["WaferThick"];
29  waferSepar_ = nArgs["SensorSeparation"];
30  mouseBite_ = nArgs["MouseBite"];
31  nCells_ = (int)(nArgs["NCells"]);
32  cellType_ = (int)(nArgs["CellType"]);
33  material_ = sArgs["Material"];
34  cellNames_ = vsArgs["CellNames"];
36 #ifdef EDM_ML_DEBUG
37  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Wafer 2r " << waferSize_
38  << " T " << waferT_ << " Half Separation "
39  << waferSepar_ << " Mouse bite radius "
40  << mouseBite_ << " Cells/Wafer " << nCells_
41  << " Cell Type " << cellType_
42  << " Material " << material_ << " Names "
43  << parent().name() << " NameSpace "
44  << nameSpace_ << " # of cells "
45  << cellNames_.size();
46  for (unsigned int k=0; k<cellNames_.size(); ++k)
47  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Cell[" << k << "] "
48  << cellNames_[k];
49 #endif
50 }
double waferSepar_
Definition: DDHGCalWafer8.h:26
double waferSize_
Definition: DDHGCalWafer8.h:24
static std::string & ns()
std::string material_
Definition: DDHGCalWafer8.h:30
double mouseBite_
Definition: DDHGCalWafer8.h:27
std::vector< std::string > cellNames_
Definition: DDHGCalWafer8.h:31
int k[5][pyjets_maxn]
std::string nameSpace_
Definition: DDHGCalWafer8.h:32

Member Data Documentation

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

Definition at line 31 of file DDHGCalWafer8.h.

Referenced by execute(), and initialize().

int DDHGCalWafer8::cellType_
private

Definition at line 29 of file DDHGCalWafer8.h.

Referenced by execute(), and initialize().

std::string DDHGCalWafer8::material_
private

Definition at line 30 of file DDHGCalWafer8.h.

Referenced by execute(), and initialize().

double DDHGCalWafer8::mouseBite_
private

Definition at line 27 of file DDHGCalWafer8.h.

Referenced by initialize().

std::string DDHGCalWafer8::nameSpace_
private

Definition at line 32 of file DDHGCalWafer8.h.

Referenced by initialize().

int DDHGCalWafer8::nCells_
private

Definition at line 28 of file DDHGCalWafer8.h.

Referenced by execute(), and initialize().

double DDHGCalWafer8::waferSepar_
private

Definition at line 26 of file DDHGCalWafer8.h.

Referenced by execute(), and initialize().

double DDHGCalWafer8::waferSize_
private

Definition at line 24 of file DDHGCalWafer8.h.

Referenced by execute(), and initialize().

double DDHGCalWafer8::waferT_
private

Definition at line 25 of file DDHGCalWafer8.h.

Referenced by execute(), and initialize().