CMS 3D CMS Logo

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

Public Member Functions

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

Private Attributes

std::vector< int > angleEdges_
 
int cellType_
 
std::vector< std::string > childNames_
 
std::vector< int > detectorType_
 
std::string idNameSpace_
 
int nBottomY_
 
std::vector< int > nCellsRow_
 
int nColumns_
 
DDName parentName_
 
double waferSize_
 

Detailed Description

Definition at line 21 of file DDHGCalWafer.cc.

Constructor & Destructor Documentation

◆ DDHGCalWafer()

DDHGCalWafer::DDHGCalWafer ( )

Definition at line 47 of file DDHGCalWafer.cc.

47  {
48 #ifdef EDM_ML_DEBUG
49  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer: Creating an instance";
50 #endif
51 }

◆ ~DDHGCalWafer()

DDHGCalWafer::~DDHGCalWafer ( )
override

Definition at line 53 of file DDHGCalWafer.cc.

53 {}

Member Function Documentation

◆ execute()

void DDHGCalWafer::execute ( DDCompactView cpv)
override

Definition at line 82 of file DDHGCalWafer.cc.

82  {
83 #ifdef EDM_ML_DEBUG
84  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalWafer...";
85 #endif
86  double dx = 0.5 * waferSize_ / nColumns_;
87  double dy = 0.5 * dx * tan(30._deg);
88  int ny = nBottomY_;
89  int kount(0);
90 
91  for (unsigned int ir = 0; ir < nCellsRow_.size(); ++ir) {
92  int nx = 1 - nCellsRow_[ir];
93  double ypos = dy * ny;
94  for (int ic = 0; ic < nCellsRow_[ir]; ++ic) {
95  std::string name(childNames_[0]), rotstr("NULL");
96  int irot(0);
97  if (ic == 0) {
98  name = childNames_[detectorType_[2 * ir]];
99  irot = angleEdges_[2 * ir];
100  } else if (ic + 1 == nCellsRow_[ir]) {
101  name = childNames_[detectorType_[2 * ir + 1]];
102  irot = angleEdges_[2 * ir + 1];
103  }
104  DDRotation rot;
105  if (irot != 0) {
106  double phi = convertDegToRad(irot);
107  rotstr = "R" + formatAsDegrees(phi);
108  rot = DDRotation(DDName(rotstr, idNameSpace_));
109  if (!rot) {
110 #ifdef EDM_ML_DEBUG
111  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: Creating new rotation " << DDName(rotstr, idNameSpace_)
112  << "\t90, " << irot << ", 90, " << (irot + 90) << ", 0, 0";
113 #endif
114  rot = DDrot(DDName(rotstr, idNameSpace_), 90._deg, phi, 90._deg, (90._deg + phi), 0, 0);
115  }
116  }
117  double xpos = dx * nx;
118  nx += 2;
119  DDTranslation tran(xpos, ypos, 0);
120  int copy = cellType_ * 1000 + kount;
122  ++kount;
123 #ifdef EDM_ML_DEBUG
124  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer: " << DDName(name, idNameSpace_) << " number " << copy
125  << " positioned in " << parentName_ << " at " << tran << " with " << rot;
126 #endif
127  }
128  ny += 6;
129  }
130 }

References angle_units::operators::convertDegToRad(), filterCSVwithJSON::copy, DDrot(), PVValHelper::dx, PVValHelper::dy, formatAsDegrees(), Skims_PA_cff::name, DDCompactView::position(), makeMuonMisalignmentScenario::rot, AlCaHLTBitMon_QueryRunRegistry::string, and funct::tan().

◆ initialize()

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

Definition at line 55 of file DDHGCalWafer.cc.

59  {
60  waferSize_ = nArgs["WaferSize"];
61  cellType_ = (int)(nArgs["CellType"]);
62  nColumns_ = (int)(nArgs["NColumns"]);
63  nBottomY_ = (int)(nArgs["NBottomY"]);
64  childNames_ = vsArgs["ChildNames"];
65  nCellsRow_ = dbl_to_int(vArgs["NCellsRow"]);
66  angleEdges_ = dbl_to_int(vArgs["AngleEdges"]);
67  detectorType_ = dbl_to_int(vArgs["DetectorType"]);
69  parentName_ = parent().name();
70 #ifdef EDM_ML_DEBUG
71  edm::LogVerbatim("HGCalGeom") << childNames_.size() << " children: " << childNames_[0] << "; " << childNames_[1]
72  << " in namespace " << idNameSpace_ << " positioned in " << nCellsRow_.size()
73  << " rows and " << nColumns_ << " columns with lowest column at " << nBottomY_
74  << " in mother " << parentName_ << " of size " << waferSize_;
75  for (unsigned int k = 0; k < nCellsRow_.size(); ++k)
76  edm::LogVerbatim("HGCalGeom") << "[" << k << "] Ncells " << nCellsRow_[k] << " Edge rotations "
77  << angleEdges_[2 * k] << ":" << angleEdges_[2 * k + 1] << " Type of edge cells "
78  << detectorType_[2 * k] << ":" << detectorType_[2 * k + 1];
79 #endif
80 }

References dbl_to_int(), createfilelist::int, dqmdumpme::k, DDCurrentNamespace::ns(), and class-composition::parent.

Member Data Documentation

◆ angleEdges_

std::vector<int> DDHGCalWafer::angleEdges_
private

Definition at line 41 of file DDHGCalWafer.cc.

◆ cellType_

int DDHGCalWafer::cellType_
private

Definition at line 36 of file DDHGCalWafer.cc.

◆ childNames_

std::vector<std::string> DDHGCalWafer::childNames_
private

Definition at line 39 of file DDHGCalWafer.cc.

◆ detectorType_

std::vector<int> DDHGCalWafer::detectorType_
private

Definition at line 42 of file DDHGCalWafer.cc.

◆ idNameSpace_

std::string DDHGCalWafer::idNameSpace_
private

Definition at line 43 of file DDHGCalWafer.cc.

◆ nBottomY_

int DDHGCalWafer::nBottomY_
private

Definition at line 38 of file DDHGCalWafer.cc.

◆ nCellsRow_

std::vector<int> DDHGCalWafer::nCellsRow_
private

Definition at line 40 of file DDHGCalWafer.cc.

◆ nColumns_

int DDHGCalWafer::nColumns_
private

Definition at line 37 of file DDHGCalWafer.cc.

◆ parentName_

DDName DDHGCalWafer::parentName_
private

Definition at line 44 of file DDHGCalWafer.cc.

◆ waferSize_

double DDHGCalWafer::waferSize_
private

Definition at line 35 of file DDHGCalWafer.cc.

DDHGCalWafer::nCellsRow_
std::vector< int > nCellsRow_
Definition: DDHGCalWafer.cc:40
DDrot
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDHGCalWafer::waferSize_
double waferSize_
Definition: DDHGCalWafer.cc:35
angle_units::operators::convertDegToRad
constexpr long double convertDegToRad(NumType degrees)
Definition: angle_units.h:27
DDHGCalWafer::nBottomY_
int nBottomY_
Definition: DDHGCalWafer.cc:38
dbl_to_int
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
DDHGCalWafer::childNames_
std::vector< std::string > childNames_
Definition: DDHGCalWafer.cc:39
DDHGCalWafer::parentName_
DDName parentName_
Definition: DDHGCalWafer.cc:44
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDHGCalWafer::cellType_
int cellType_
Definition: DDHGCalWafer.cc:36
formatAsDegrees
std::string formatAsDegrees(double radianVal)
Definition: DDTypes.cc:68
dqmdumpme.k
k
Definition: dqmdumpme.py:60
DDHGCalWafer::nColumns_
int nColumns_
Definition: DDHGCalWafer.cc:37
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDHGCalWafer::angleEdges_
std::vector< int > angleEdges_
Definition: DDHGCalWafer.cc:41
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogVerbatim
Definition: MessageLogger.h:297
PVValHelper::dy
Definition: PVValidationHelpers.h:49
DDHGCalWafer::idNameSpace_
std::string idNameSpace_
Definition: DDHGCalWafer.cc:43
DDAxes::phi
DDHGCalWafer::detectorType_
std::vector< int > detectorType_
Definition: DDHGCalWafer.cc:42
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
class-composition.parent
parent
Definition: class-composition.py:88
PVValHelper::dx
Definition: PVValidationHelpers.h:48
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:66
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18