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 }

Member Function Documentation

◆ execute()

void DDHGCalWaferAlgo::execute ( DDCompactView cpv)
override

Definition at line 85 of file DDHGCalWaferAlgo.cc.

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 }

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

◆ 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.

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 }

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

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.

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
DDHGCalWaferAlgo::positionX_
std::vector< int > positionX_
Definition: DDHGCalWaferAlgo.cc:42
angle_units::operators::convertDegToRad
constexpr long double convertDegToRad(NumType degrees)
Definition: angle_units.h:27
HGCalTypes::packCellType6
static int32_t packCellType6(int type, int cell)
Definition: HGCalTypes.cc:36
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
DDHGCalWaferAlgo::parentName_
DDName parentName_
Definition: DDHGCalWaferAlgo.cc:48
DDHGCalWaferAlgo::positionY_
std::vector< int > positionY_
Definition: DDHGCalWaferAlgo.cc:43
DDHGCalWaferAlgo::rotns_
std::string rotns_
Definition: DDHGCalWaferAlgo.cc:46
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
formatAsDegrees
std::string formatAsDegrees(double radianVal)
Definition: DDTypes.cc:68
dqmdumpme.k
k
Definition: dqmdumpme.py:60
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
DDHGCalWaferAlgo::childNames_
std::vector< std::string > childNames_
Definition: DDHGCalWaferAlgo.cc:41
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
createfilelist.int
int
Definition: createfilelist.py:10
DDHGCalWaferAlgo::detectorType_
std::vector< int > detectorType_
Definition: DDHGCalWaferAlgo.cc:45
DDHGCalWaferAlgo::cellSize_
double cellSize_
Definition: DDHGCalWaferAlgo.cc:39
PVValHelper::dy
Definition: PVValidationHelpers.h:49
DDHGCalWaferAlgo::angles_
std::vector< double > angles_
Definition: DDHGCalWaferAlgo.cc:44
DDAxes::phi
DDHGCalWaferAlgo::cellType_
int cellType_
Definition: DDHGCalWaferAlgo.cc:40
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDHGCalWaferAlgo::idNameSpace_
std::string idNameSpace_
Definition: DDHGCalWaferAlgo.cc:47
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
edm::Log
Definition: MessageLogger.h:70
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:76
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18