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 ( )

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

Definition at line 53 of file DDHGCalWafer.cc.

53 {}

Member Function Documentation

void DDHGCalWafer::execute ( DDCompactView cpv)
override

Definition at line 82 of file DDHGCalWafer.cc.

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

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;
121  cpv.position(DDName(name, idNameSpace_), parentName_, copy, tran, rot);
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 }
constexpr long double convertDegToRad(NumType degrees)
Definition: angle_units.h:27
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
std::vector< int > detectorType_
Definition: DDHGCalWafer.cc:42
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
double waferSize_
Definition: DDHGCalWafer.cc:35
std::vector< std::string > childNames_
Definition: DDHGCalWafer.cc:39
std::vector< int > nCellsRow_
Definition: DDHGCalWafer.cc:40
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
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
std::string formatAsDegrees(double radianVal)
Definition: DDTypes.cc:68
std::vector< int > angleEdges_
Definition: DDHGCalWafer.cc:41
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::string idNameSpace_
Definition: DDHGCalWafer.cc:43
ROOT::Math::Rotation3D DDRotation
DDName parentName_
Definition: DDHGCalWafer.cc:44
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.

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

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 }
static std::string & ns()
std::vector< int > detectorType_
Definition: DDHGCalWafer.cc:42
double waferSize_
Definition: DDHGCalWafer.cc:35
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
std::vector< std::string > childNames_
Definition: DDHGCalWafer.cc:39
std::vector< int > nCellsRow_
Definition: DDHGCalWafer.cc:40
std::vector< int > angleEdges_
Definition: DDHGCalWafer.cc:41
std::string idNameSpace_
Definition: DDHGCalWafer.cc:43
DDName parentName_
Definition: DDHGCalWafer.cc:44

Member Data Documentation

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

Definition at line 41 of file DDHGCalWafer.cc.

int DDHGCalWafer::cellType_
private

Definition at line 36 of file DDHGCalWafer.cc.

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

Definition at line 39 of file DDHGCalWafer.cc.

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

Definition at line 42 of file DDHGCalWafer.cc.

std::string DDHGCalWafer::idNameSpace_
private

Definition at line 43 of file DDHGCalWafer.cc.

int DDHGCalWafer::nBottomY_
private

Definition at line 38 of file DDHGCalWafer.cc.

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

Definition at line 40 of file DDHGCalWafer.cc.

int DDHGCalWafer::nColumns_
private

Definition at line 37 of file DDHGCalWafer.cc.

DDName DDHGCalWafer::parentName_
private

Definition at line 44 of file DDHGCalWafer.cc.

double DDHGCalWafer::waferSize_
private

Definition at line 35 of file DDHGCalWafer.cc.