CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDHGCalWaferAlgo Class Reference

#include <DDHGCalWaferAlgo.h>

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 10 of file DDHGCalWaferAlgo.h.

Constructor & Destructor Documentation

DDHGCalWaferAlgo::DDHGCalWaferAlgo ( )

Definition at line 19 of file DDHGCalWaferAlgo.cc.

19  {
20 #ifdef EDM_ML_DEBUG
21  edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: Creating an instance";
22 #endif
23 }
DDHGCalWaferAlgo::~DDHGCalWaferAlgo ( )
override

Definition at line 25 of file DDHGCalWaferAlgo.cc.

25 {}

Member Function Documentation

void DDHGCalWaferAlgo::execute ( DDCompactView cpv)
override

Definition at line 59 of file DDHGCalWaferAlgo.cc.

References particleFlowDisplacedVertex_cfi::angles, geant_units::operators::convertDegToRad(), popcon2dropbox::copy(), DDrot(), PVValHelper::dx, PVValHelper::dy, formatAsDegrees(), gen::k, dataset::name, DDCompactView::position(), idealTransformation::rotation, AlCaHLTBitMon_QueryRunRegistry::string, and funct::tan().

59  {
60 #ifdef EDM_ML_DEBUG
61  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalWaferAlgo...";
62 #endif
63  double dx = 0.5 * cellSize;
64  double dy = 0.5 * dx * tan(30._deg);
65 
66  for (unsigned int k = 0; k < positionX.size(); ++k) {
69  std::string rotstr("NULL");
70  if (angles[k] != 0) {
71  double phi = convertDegToRad(angles[k]);
72  rotstr = "R" + formatAsDegrees(phi);
73  rotation = DDRotation(DDName(rotstr, rotns));
74  if (!rotation) {
75 #ifdef EDM_ML_DEBUG
76  edm::LogVerbatim("HGCalGeom")
77  << "DDHGCalWaferAlgo: Creating new rotation "
78  << DDName(rotstr, rotns) << "\t90, " << angles[k] << ", 90, "
79  << (angles[k] + 90) << ", 0, 0";
80 #endif
81  rotation = DDrot(DDName(rotstr, rotns), 90._deg, phi,
82  90._deg, (90._deg + phi), 0, 0);
83  }
84  }
85  double xpos = dx * positionX[k];
86  double ypos = dy * positionY[k];
87  DDTranslation tran(xpos, ypos, 0);
88  int copy = cellType * 1000 + k;
89  cpv.position(DDName(name, idNameSpace), parentName, copy, tran, rotation);
90 #ifdef EDM_ML_DEBUG
91  edm::LogVerbatim("HGCalGeom")
92  << "DDHGCalWaferAlgo: " << DDName(name, idNameSpace) << " number "
93  << copy << " positioned in " << parentName << " at " << tran
94  << " with " << rotation;
95 #endif
96  }
97 }
def copy(args, dbName)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
std::string idNameSpace
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< int > positionX
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:80
constexpr long double convertDegToRad(NumType degrees)
Definition: GeantUnits.h:104
std::string formatAsDegrees(double radianVal)
Definition: DDTypes.cc:75
std::vector< int > detectorType
int k[5][pyjets_maxn]
std::vector< std::string > childNames
std::vector< int > positionY
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::vector< double > angles
void DDHGCalWaferAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 27 of file DDHGCalWaferAlgo.cc.

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

31  {
32  cellSize = nArgs["CellSize"];
33  cellType = (int)(nArgs["CellType"]);
34  childNames = vsArgs["ChildNames"];
35  positionX = dbl_to_int(vArgs["PositionX"]);
36  positionY = dbl_to_int(vArgs["PositionY"]);
37  angles = vArgs["Angles"];
38  detectorType = dbl_to_int(vArgs["DetectorType"]);
39 #ifdef EDM_ML_DEBUG
40  edm::LogVerbatim("HGCalGeom")
41  << childNames.size() << " children: " << childNames[0] << "; "
42  << childNames[1] << " positioned " << positionX.size()
43  << " times with cell size " << cellSize;
44  for (unsigned int k = 0; k < positionX.size(); ++k)
45  edm::LogVerbatim("HGCalGeom")
46  << "[" << k << "] x " << positionX[k] << " y " << positionY[k]
47  << " angle " << angles[k] << " detector " << detectorType[k];
48 #endif
49  rotns = sArgs["RotNameSpace"];
51  parentName = parent().name();
52 #ifdef EDM_ML_DEBUG
53  edm::LogVerbatim("HGCalGeom")
54  << "DDHGCalWaferAlgo debug: Parent " << parentName << " NameSpace "
55  << idNameSpace << " for Rotation " << rotns;
56 #endif
57 }
static std::string & ns()
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::string idNameSpace
std::vector< int > positionX
std::vector< int > detectorType
int k[5][pyjets_maxn]
std::vector< std::string > childNames
std::vector< int > positionY
std::vector< double > angles

Member Data Documentation

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

Definition at line 28 of file DDHGCalWaferAlgo.h.

double DDHGCalWaferAlgo::cellSize
private

Definition at line 23 of file DDHGCalWaferAlgo.h.

int DDHGCalWaferAlgo::cellType
private

Definition at line 24 of file DDHGCalWaferAlgo.h.

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

Definition at line 25 of file DDHGCalWaferAlgo.h.

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

Definition at line 29 of file DDHGCalWaferAlgo.h.

std::string DDHGCalWaferAlgo::idName
private

Definition at line 30 of file DDHGCalWaferAlgo.h.

std::string DDHGCalWaferAlgo::idNameSpace
private

Definition at line 32 of file DDHGCalWaferAlgo.h.

DDName DDHGCalWaferAlgo::parentName
private

Definition at line 33 of file DDHGCalWaferAlgo.h.

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

Definition at line 26 of file DDHGCalWaferAlgo.h.

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

Definition at line 27 of file DDHGCalWaferAlgo.h.

std::string DDHGCalWaferAlgo::rotns
private

Definition at line 31 of file DDHGCalWaferAlgo.h.