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 22 of file DDHGCalWafer.cc.

Constructor & Destructor Documentation

◆ DDHGCalWafer()

DDHGCalWafer::DDHGCalWafer ( )

Definition at line 48 of file DDHGCalWafer.cc.

48  {
49 #ifdef EDM_ML_DEBUG
50  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer: Creating an instance";
51 #endif
52 }
Log< level::Info, true > LogVerbatim

◆ ~DDHGCalWafer()

DDHGCalWafer::~DDHGCalWafer ( )
override

Definition at line 54 of file DDHGCalWafer.cc.

54 {}

Member Function Documentation

◆ execute()

void DDHGCalWafer::execute ( DDCompactView cpv)
override

Definition at line 83 of file DDHGCalWafer.cc.

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

83  {
84 #ifdef EDM_ML_DEBUG
85  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalWafer...";
86 #endif
87  double dx = 0.5 * waferSize_ / nColumns_;
88  double dy = 0.5 * dx * tan(30._deg);
89  int ny = nBottomY_;
90  int kount(0);
91 
92  for (unsigned int ir = 0; ir < nCellsRow_.size(); ++ir) {
93  int nx = 1 - nCellsRow_[ir];
94  double ypos = dy * ny;
95  for (int ic = 0; ic < nCellsRow_[ir]; ++ic) {
96  std::string name(childNames_[0]), rotstr("NULL");
97  int irot(0);
98  if (ic == 0) {
99  name = childNames_[detectorType_[2 * ir]];
100  irot = angleEdges_[2 * ir];
101  } else if (ic + 1 == nCellsRow_[ir]) {
102  name = childNames_[detectorType_[2 * ir + 1]];
103  irot = angleEdges_[2 * ir + 1];
104  }
105  DDRotation rot;
106  if (irot != 0) {
107  double phi = convertDegToRad(irot);
108  rotstr = "R" + formatAsDegrees(phi);
109  rot = DDRotation(DDName(rotstr, idNameSpace_));
110  if (!rot) {
111 #ifdef EDM_ML_DEBUG
112  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: Creating new rotation " << DDName(rotstr, idNameSpace_)
113  << "\t90, " << irot << ", 90, " << (irot + 90) << ", 0, 0";
114 #endif
115  rot = DDrot(DDName(rotstr, idNameSpace_), 90._deg, phi, 90._deg, (90._deg + phi), 0, 0);
116  }
117  }
118  double xpos = dx * nx;
119  nx += 2;
120  DDTranslation tran(xpos, ypos, 0);
123  ++kount;
124 #ifdef EDM_ML_DEBUG
125  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer: " << DDName(name, idNameSpace_) << " number " << copy
126  << " positioned in " << parentName_ << " at " << tran << " with " << rot;
127 #endif
128  }
129  ny += 6;
130  }
131 }
Log< level::Info, true > LogVerbatim
constexpr double convertDegToRad(NumType degrees)
Definition: angle_units.h:27
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::vector< int > detectorType_
Definition: DDHGCalWafer.cc:43
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
double waferSize_
Definition: DDHGCalWafer.cc:36
std::vector< std::string > childNames_
Definition: DDHGCalWafer.cc:40
std::vector< int > nCellsRow_
Definition: DDHGCalWafer.cc:41
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
static int32_t packCellType6(int type, int cell)
Definition: HGCalTypes.cc:36
std::vector< int > angleEdges_
Definition: DDHGCalWafer.cc:42
std::string idNameSpace_
Definition: DDHGCalWafer.cc:44
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDName parentName_
Definition: DDHGCalWafer.cc:45

◆ initialize()

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

Definition at line 56 of file DDHGCalWafer.cc.

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

60  {
61  waferSize_ = nArgs["WaferSize"];
62  cellType_ = (int)(nArgs["CellType"]);
63  nColumns_ = (int)(nArgs["NColumns"]);
64  nBottomY_ = (int)(nArgs["NBottomY"]);
65  childNames_ = vsArgs["ChildNames"];
66  nCellsRow_ = dbl_to_int(vArgs["NCellsRow"]);
67  angleEdges_ = dbl_to_int(vArgs["AngleEdges"]);
68  detectorType_ = dbl_to_int(vArgs["DetectorType"]);
70  parentName_ = parent().name();
71 #ifdef EDM_ML_DEBUG
72  edm::LogVerbatim("HGCalGeom") << childNames_.size() << " children: " << childNames_[0] << "; " << childNames_[1]
73  << " in namespace " << idNameSpace_ << " positioned in " << nCellsRow_.size()
74  << " rows and " << nColumns_ << " columns with lowest column at " << nBottomY_
75  << " in mother " << parentName_ << " of size " << waferSize_;
76  for (unsigned int k = 0; k < nCellsRow_.size(); ++k)
77  edm::LogVerbatim("HGCalGeom") << "[" << k << "] Ncells " << nCellsRow_[k] << " Edge rotations "
78  << angleEdges_[2 * k] << ":" << angleEdges_[2 * k + 1] << " Type of edge cells "
79  << detectorType_[2 * k] << ":" << detectorType_[2 * k + 1];
80 #endif
81 }
Log< level::Info, true > LogVerbatim
static std::string & ns()
std::vector< int > detectorType_
Definition: DDHGCalWafer.cc:43
double waferSize_
Definition: DDHGCalWafer.cc:36
std::vector< std::string > childNames_
Definition: DDHGCalWafer.cc:40
std::vector< int > nCellsRow_
Definition: DDHGCalWafer.cc:41
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< int > angleEdges_
Definition: DDHGCalWafer.cc:42
std::string idNameSpace_
Definition: DDHGCalWafer.cc:44
DDName parentName_
Definition: DDHGCalWafer.cc:45

Member Data Documentation

◆ angleEdges_

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

Definition at line 42 of file DDHGCalWafer.cc.

◆ cellType_

int DDHGCalWafer::cellType_
private

Definition at line 37 of file DDHGCalWafer.cc.

◆ childNames_

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

Definition at line 40 of file DDHGCalWafer.cc.

◆ detectorType_

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

Definition at line 43 of file DDHGCalWafer.cc.

◆ idNameSpace_

std::string DDHGCalWafer::idNameSpace_
private

Definition at line 44 of file DDHGCalWafer.cc.

◆ nBottomY_

int DDHGCalWafer::nBottomY_
private

Definition at line 39 of file DDHGCalWafer.cc.

◆ nCellsRow_

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

Definition at line 41 of file DDHGCalWafer.cc.

◆ nColumns_

int DDHGCalWafer::nColumns_
private

Definition at line 38 of file DDHGCalWafer.cc.

◆ parentName_

DDName DDHGCalWafer::parentName_
private

Definition at line 45 of file DDHGCalWafer.cc.

◆ waferSize_

double DDHGCalWafer::waferSize_
private

Definition at line 36 of file DDHGCalWafer.cc.