CMS 3D CMS Logo

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

#include <DDHGCalWafer.h>

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

Constructor & Destructor Documentation

DDHGCalWafer::DDHGCalWafer ( )

Definition at line 15 of file DDHGCalWafer.cc.

15  {
16 #ifdef EDM_ML_DEBUG
17  edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer: Creating an instance";
18 #endif
19 }
DDHGCalWafer::~DDHGCalWafer ( )
override

Definition at line 21 of file DDHGCalWafer.cc.

21 {}

Member Function Documentation

void DDHGCalWafer::execute ( DDCompactView cpv)
override

Definition at line 54 of file DDHGCalWafer.cc.

References geant_units::operators::convertDegToRad(), popcon2dropbox::copy(), DDrot(), PVValHelper::dx, PVValHelper::dy, formatAsDegrees(), dataset::name, DDCompactView::position(), makeMuonMisalignmentScenario::rot, AlCaHLTBitMon_QueryRunRegistry::string, and funct::tan().

54  {
55 #ifdef EDM_ML_DEBUG
56  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalWafer...";
57 #endif
58  double dx = 0.5 * waferSize_ / nColumns_;
59  double dy = 0.5 * dx * tan(30._deg);
60  int ny = nBottomY_;
61  int kount(0);
62 
63  for (unsigned int ir = 0; ir < nCellsRow_.size(); ++ir) {
64  int nx = 1 - nCellsRow_[ir];
65  double ypos = dy * ny;
66  for (int ic = 0; ic < nCellsRow_[ir]; ++ic) {
67  std::string name(childNames_[0]), rotstr("NULL");
68  int irot(0);
69  if (ic == 0) {
70  name = childNames_[detectorType_[2 * ir]];
71  irot = angleEdges_[2 * ir];
72  } else if (ic + 1 == nCellsRow_[ir]) {
73  name = childNames_[detectorType_[2 * ir + 1]];
74  irot = angleEdges_[2 * ir + 1];
75  }
77  if (irot != 0) {
78  double phi = convertDegToRad(irot);
79  rotstr = "R" + formatAsDegrees(phi);
80  rot = DDRotation(DDName(rotstr, idNameSpace_));
81  if (!rot) {
82 #ifdef EDM_ML_DEBUG
83  edm::LogVerbatim("HGCalGeom")
84  << "DDHGCalWaferAlgo: Creating new rotation "
85  << DDName(rotstr, idNameSpace_) << "\t90, " << irot
86  << ", 90, " << (irot + 90) << ", 0, 0";
87 #endif
88  rot = DDrot(DDName(rotstr, idNameSpace_), 90._deg, phi, 90._deg,
89  (90._deg+phi), 0, 0);
90  }
91  }
92  double xpos = dx * nx;
93  nx += 2;
94  DDTranslation tran(xpos, ypos, 0);
95  int copy = cellType_ * 1000 + kount;
96  cpv.position(DDName(name, idNameSpace_), parentName_, copy, tran, rot);
97  ++kount;
98 #ifdef EDM_ML_DEBUG
99  edm::LogVerbatim("HGCalGeom")
100  << "DDHGCalWafer: " << DDName(name, idNameSpace_) << " number "
101  << copy << " positioned in " << parentName_ << " at " << tran
102  << " with " << rot;
103 #endif
104  }
105  ny += 6;
106  }
107 }
def copy(args, dbName)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
std::vector< int > detectorType_
Definition: DDHGCalWafer.h:30
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
double waferSize_
Definition: DDHGCalWafer.h:23
std::vector< std::string > childNames_
Definition: DDHGCalWafer.h:27
std::vector< int > nCellsRow_
Definition: DDHGCalWafer.h:28
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:80
constexpr long double convertDegToRad(NumType degrees)
Definition: GeantUnits.h:104
std::string formatAsDegrees(double radianVal)
Definition: DDTypes.cc:75
std::vector< int > angleEdges_
Definition: DDHGCalWafer.h:29
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::string idNameSpace_
Definition: DDHGCalWafer.h:31
DDName parentName_
Definition: DDHGCalWafer.h:32
void DDHGCalWafer::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 23 of file DDHGCalWafer.cc.

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

27  {
28  waferSize_ = nArgs["WaferSize"];
29  cellType_ = (int)(nArgs["CellType"]);
30  nColumns_ = (int)(nArgs["NColumns"]);
31  nBottomY_ = (int)(nArgs["NBottomY"]);
32  childNames_ = vsArgs["ChildNames"];
33  nCellsRow_ = dbl_to_int(vArgs["NCellsRow"]);
34  angleEdges_ = dbl_to_int(vArgs["AngleEdges"]);
35  detectorType_ = dbl_to_int(vArgs["DetectorType"]);
37  parentName_ = parent().name();
38 #ifdef EDM_ML_DEBUG
39  edm::LogVerbatim("HGCalGeom")
40  << childNames_.size() << " children: " << childNames_[0] << "; "
41  << childNames_[1] << " in namespace " << idNameSpace_
42  << " positioned in " << nCellsRow_.size() << " rows and "
43  << nColumns_ << " columns with lowest column at " << nBottomY_
44  << " in mother " << parentName_ << " of size " << waferSize_;
45  for (unsigned int k = 0; k < nCellsRow_.size(); ++k)
46  edm::LogVerbatim("HGCalGeom")
47  << "[" << k << "] Ncells " << nCellsRow_[k] << " Edge rotations "
48  << angleEdges_[2 * k] << ":" << angleEdges_[2 * k + 1]
49  << " Type of edge cells " << detectorType_[2 * k] << ":"
50  << detectorType_[2 * k + 1];
51 #endif
52 }
static std::string & ns()
std::vector< int > detectorType_
Definition: DDHGCalWafer.h:30
double waferSize_
Definition: DDHGCalWafer.h:23
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_
Definition: DDHGCalWafer.h:27
std::vector< int > nCellsRow_
Definition: DDHGCalWafer.h:28
int k[5][pyjets_maxn]
std::vector< int > angleEdges_
Definition: DDHGCalWafer.h:29
std::string idNameSpace_
Definition: DDHGCalWafer.h:31
DDName parentName_
Definition: DDHGCalWafer.h:32

Member Data Documentation

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

Definition at line 29 of file DDHGCalWafer.h.

int DDHGCalWafer::cellType_
private

Definition at line 24 of file DDHGCalWafer.h.

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

Definition at line 27 of file DDHGCalWafer.h.

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

Definition at line 30 of file DDHGCalWafer.h.

std::string DDHGCalWafer::idNameSpace_
private

Definition at line 31 of file DDHGCalWafer.h.

int DDHGCalWafer::nBottomY_
private

Definition at line 26 of file DDHGCalWafer.h.

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

Definition at line 28 of file DDHGCalWafer.h.

int DDHGCalWafer::nColumns_
private

Definition at line 25 of file DDHGCalWafer.h.

DDName DDHGCalWafer::parentName_
private

Definition at line 32 of file DDHGCalWafer.h.

double DDHGCalWafer::waferSize_
private

Definition at line 23 of file DDHGCalWafer.h.