CMS 3D CMS Logo

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

Public Member Functions

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

Private Attributes

std::vector< double > angles_
 
double cellSize_
 
int cellType_
 
std::vector< std::string > childNames_
 
std::vector< int > detectorType_
 
std::string idNameSpace_
 
DDName parentName_
 
std::vector< int > positionX_
 
std::vector< int > positionY_
 
std::string rotns_
 

Detailed Description

Definition at line 26 of file DDHGCalWaferAlgo.cc.

Constructor & Destructor Documentation

◆ DDHGCalWaferAlgo()

DDHGCalWaferAlgo::DDHGCalWaferAlgo ( )

Definition at line 51 of file DDHGCalWaferAlgo.cc.

51  {
52 #ifdef EDM_ML_DEBUG
53  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: Creating an instance";
54 #endif
55 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

◆ execute()

void DDHGCalWaferAlgo::execute ( DDCompactView cpv)
override

Definition at line 85 of file DDHGCalWaferAlgo.cc.

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

85  {
86 #ifdef EDM_ML_DEBUG
87  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalWaferAlgo...";
88 #endif
89  double dx = 0.5 * cellSize_;
90  double dy = 0.5 * dx * tan(30._deg);
91 
92  for (unsigned int k = 0; k < positionX_.size(); ++k) {
95  std::string rotstr("NULL");
96  if (angles_[k] != 0) {
97  double phi = convertDegToRad(angles_[k]);
98  rotstr = "R" + formatAsDegrees(phi);
99  rotation = DDRotation(DDName(rotstr, rotns_));
100  if (!rotation) {
101 #ifdef EDM_ML_DEBUG
102  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: Creating new rotation " << DDName(rotstr, rotns_)
103  << "\t90, " << angles_[k] << ", 90, " << (angles_[k] + 90) << ", 0, 0";
104 #endif
105  rotation = DDrot(DDName(rotstr, rotns_), 90._deg, phi, 90._deg, (90._deg + phi), 0, 0);
106  }
107  }
108  double xpos = dx * positionX_[k];
109  double ypos = dy * positionY_[k];
110  DDTranslation tran(xpos, ypos, 0);
113 #ifdef EDM_ML_DEBUG
114  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: " << DDName(name, idNameSpace_) << " number " << copy
115  << " positioned in " << parentName_ << " at " << tran << " with " << rotation;
116 #endif
117  }
118 }
Log< level::Info, true > LogVerbatim
std::vector< int > positionY_
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)
std::string idNameSpace_
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
std::vector< int > positionX_
std::vector< int > detectorType_
std::vector< double > angles_
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< std::string > childNames_
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7

◆ initialize()

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

Definition at line 57 of file DDHGCalWaferAlgo.cc.

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

61  {
62  cellSize_ = nArgs["CellSize"];
63  cellType_ = (int)(nArgs["CellType"]);
64  childNames_ = vsArgs["ChildNames"];
65  positionX_ = dbl_to_int(vArgs["PositionX"]);
66  positionY_ = dbl_to_int(vArgs["PositionY"]);
67  angles_ = vArgs["Angles"];
68  detectorType_ = dbl_to_int(vArgs["DetectorType"]);
69 #ifdef EDM_ML_DEBUG
70  edm::LogVerbatim("HGCalGeom") << childNames_.size() << " children: " << childNames_[0] << "; " << childNames_[1]
71  << " positioned " << positionX_.size() << " times with cell size " << cellSize_;
72  for (unsigned int k = 0; k < positionX_.size(); ++k)
73  edm::LogVerbatim("HGCalGeom") << "[" << k << "] x " << positionX_[k] << " y " << positionY_[k] << " angle "
74  << angles_[k] << " detector " << detectorType_[k];
75 #endif
76  rotns_ = sArgs["RotNameSpace"];
78  parentName_ = parent().name();
79 #ifdef EDM_ML_DEBUG
80  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo debug: Parent " << parentName_ << " NameSpace " << idNameSpace_
81  << " for Rotation " << rotns_;
82 #endif
83 }
Log< level::Info, true > LogVerbatim
std::vector< int > positionY_
std::string idNameSpace_
static std::string & ns()
std::vector< int > positionX_
std::vector< int > detectorType_
std::vector< double > angles_
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_

Member Data Documentation

◆ angles_

std::vector<double> DDHGCalWaferAlgo::angles_
private

Definition at line 44 of file DDHGCalWaferAlgo.cc.

◆ cellSize_

double DDHGCalWaferAlgo::cellSize_
private

Definition at line 39 of file DDHGCalWaferAlgo.cc.

◆ cellType_

int DDHGCalWaferAlgo::cellType_
private

Definition at line 40 of file DDHGCalWaferAlgo.cc.

◆ childNames_

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

Definition at line 41 of file DDHGCalWaferAlgo.cc.

◆ detectorType_

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

Definition at line 45 of file DDHGCalWaferAlgo.cc.

◆ idNameSpace_

std::string DDHGCalWaferAlgo::idNameSpace_
private

Definition at line 47 of file DDHGCalWaferAlgo.cc.

◆ parentName_

DDName DDHGCalWaferAlgo::parentName_
private

Definition at line 48 of file DDHGCalWaferAlgo.cc.

◆ positionX_

std::vector<int> DDHGCalWaferAlgo::positionX_
private

Definition at line 42 of file DDHGCalWaferAlgo.cc.

◆ positionY_

std::vector<int> DDHGCalWaferAlgo::positionY_
private

Definition at line 43 of file DDHGCalWaferAlgo.cc.

◆ rotns_

std::string DDHGCalWaferAlgo::rotns_
private

Definition at line 46 of file DDHGCalWaferAlgo.cc.