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

Private Attributes

std::vector< double > angles
 
double cellSize
 
int cellType
 
std::vector< std::string > childNames
 
std::vector< int > detectorType
 
std::string idName
 
std::string idNameSpace
 
DDName parentName
 
std::vector< int > positionX
 
std::vector< int > positionY
 
std::string rotns
 

Detailed Description

Definition at line 25 of file DDHGCalWaferAlgo.cc.

Constructor & Destructor Documentation

◆ DDHGCalWaferAlgo()

DDHGCalWaferAlgo::DDHGCalWaferAlgo ( )

Definition at line 52 of file DDHGCalWaferAlgo.cc.

52  {
53 #ifdef EDM_ML_DEBUG
54  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: Creating an instance";
55 #endif
56 }

◆ ~DDHGCalWaferAlgo()

DDHGCalWaferAlgo::~DDHGCalWaferAlgo ( )
override

Definition at line 58 of file DDHGCalWaferAlgo.cc.

58 {}

Member Function Documentation

◆ execute()

void DDHGCalWaferAlgo::execute ( DDCompactView cpv)
override

Definition at line 88 of file DDHGCalWaferAlgo.cc.

88  {
89 #ifdef EDM_ML_DEBUG
90  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalWaferAlgo...";
91 #endif
92  double dx = 0.5 * cellSize;
93  double dy = 0.5 * dx * tan(30._deg);
94 
95  for (unsigned int k = 0; k < positionX.size(); ++k) {
98  std::string rotstr("NULL");
99  if (angles[k] != 0) {
100  double phi = convertDegToRad(angles[k]);
101  rotstr = "R" + formatAsDegrees(phi);
102  rotation = DDRotation(DDName(rotstr, rotns));
103  if (!rotation) {
104 #ifdef EDM_ML_DEBUG
105  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: Creating new rotation " << DDName(rotstr, rotns) << "\t90, "
106  << angles[k] << ", 90, " << (angles[k] + 90) << ", 0, 0";
107 #endif
108  rotation = DDrot(DDName(rotstr, rotns), 90._deg, phi, 90._deg, (90._deg + phi), 0, 0);
109  }
110  }
111  double xpos = dx * positionX[k];
112  double ypos = dy * positionY[k];
113  DDTranslation tran(xpos, ypos, 0);
114  int copy = cellType * 1000 + k;
116 #ifdef EDM_ML_DEBUG
117  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: " << DDName(name, idNameSpace) << " number " << copy
118  << " positioned in " << parentName << " at " << tran << " with " << rotation;
119 #endif
120  }
121 }

References particleFlowDisplacedVertex_cfi::angles, angle_units::operators::convertDegToRad(), filterCSVwithJSON::copy, DDrot(), PVValHelper::dx, PVValHelper::dy, formatAsDegrees(), dqmdumpme::k, Skims_PA_cff::name, 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 60 of file DDHGCalWaferAlgo.cc.

64  {
65  cellSize = nArgs["CellSize"];
66  cellType = (int)(nArgs["CellType"]);
67  childNames = vsArgs["ChildNames"];
68  positionX = dbl_to_int(vArgs["PositionX"]);
69  positionY = dbl_to_int(vArgs["PositionY"]);
70  angles = vArgs["Angles"];
71  detectorType = dbl_to_int(vArgs["DetectorType"]);
72 #ifdef EDM_ML_DEBUG
73  edm::LogVerbatim("HGCalGeom") << childNames.size() << " children: " << childNames[0] << "; " << childNames[1]
74  << " positioned " << positionX.size() << " times with cell size " << cellSize;
75  for (unsigned int k = 0; k < positionX.size(); ++k)
76  edm::LogVerbatim("HGCalGeom") << "[" << k << "] x " << positionX[k] << " y " << positionY[k] << " angle "
77  << angles[k] << " detector " << detectorType[k];
78 #endif
79  rotns = sArgs["RotNameSpace"];
81  parentName = parent().name();
82 #ifdef EDM_ML_DEBUG
83  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo debug: Parent " << parentName << " NameSpace " << idNameSpace
84  << " for Rotation " << rotns;
85 #endif
86 }

References particleFlowDisplacedVertex_cfi::angles, 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.

◆ idName

std::string DDHGCalWaferAlgo::idName
private

Definition at line 46 of file DDHGCalWaferAlgo.cc.

◆ idNameSpace

std::string DDHGCalWaferAlgo::idNameSpace
private

Definition at line 48 of file DDHGCalWaferAlgo.cc.

◆ parentName

DDName DDHGCalWaferAlgo::parentName
private

Definition at line 49 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 47 of file DDHGCalWaferAlgo.cc.

DDHGCalWaferAlgo::cellType
int cellType
Definition: DDHGCalWaferAlgo.cc:40
DDHGCalWaferAlgo::rotns
std::string rotns
Definition: DDHGCalWaferAlgo.cc:47
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
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::childNames
std::vector< std::string > childNames
Definition: DDHGCalWaferAlgo.cc:41
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::angles
std::vector< double > angles
Definition: DDHGCalWaferAlgo.cc:44
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
DDHGCalWaferAlgo::parentName
DDName parentName
Definition: DDHGCalWaferAlgo.cc:49
DDAxes::phi
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDHGCalWaferAlgo::idNameSpace
std::string idNameSpace
Definition: DDHGCalWaferAlgo.cc:48
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDHGCalWaferAlgo::detectorType
std::vector< int > detectorType
Definition: DDHGCalWaferAlgo.cc:45
DDHGCalWaferAlgo::cellSize
double cellSize
Definition: DDHGCalWaferAlgo.cc:39
DDHGCalWaferAlgo::positionY
std::vector< int > positionY
Definition: DDHGCalWaferAlgo.cc:43
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