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 14 of file DDHGCalWafer.cc.

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

Definition at line 20 of file DDHGCalWafer.cc.

20 {}

Member Function Documentation

void DDHGCalWafer::execute ( DDCompactView cpv)
override

Definition at line 53 of file DDHGCalWafer.cc.

References angleEdges_, cellType_, childNames_, popcon2dropbox::copy(), gather_cfg::cout, DDrot(), detectorType_, PVValHelper::dx, PVValHelper::dy, idNameSpace_, dataset::name, nBottomY_, nCellsRow_, nColumns_, parentName_, DDCompactView::position(), makeMuonMisalignmentScenario::rot, AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), and waferSize_.

53  {
54 
55 #ifdef EDM_ML_DEBUG
56  edm::LogInfo("HGCalGeom") << "==>> Constructing DDHGCalWafer...";
57 #endif
58  double dx = 0.5*waferSize_/nColumns_;
59  double dy = 0.5*dx*tan(30.0*CLHEP::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) {
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  if (irot >=0 && irot < 100) rotstr = "R0";
79  else rotstr = "R";
80  rotstr = rotstr + std::to_string(irot);
81  rot = DDRotation(DDName(rotstr, idNameSpace_));
82  if (!rot) {
83 #ifdef EDM_ML_DEBUG
84  std::cout << "DDHGCalWaferAlgo: Creating new rotation "
85  << DDName(rotstr, idNameSpace_) << "\t90, " << irot
86  << ", 90, " << (irot+90) << ", 0, 0" << std::endl;
87 #endif
88  rot = DDrot(DDName(rotstr, idNameSpace_), 90*CLHEP::deg,
89  irot*CLHEP::deg, 90*CLHEP::deg, (90+irot)*CLHEP::deg,
90  0*CLHEP::deg,0*CLHEP::deg);
91  }
92  }
93  double xpos = dx*nx;
94  nx += 2;
95  DDTranslation tran(xpos, ypos, 0);
96  int copy = cellType_*1000+kount;
97  cpv.position(DDName(name,idNameSpace_), parentName_, copy, tran, rot);
98  ++kount;
99 #ifdef EDM_ML_DEBUG
100  std::cout << "DDHGCalWafer: " << DDName(name,idNameSpace_) << " number "
101  << copy << " positioned in " << parentName_ << " at " << tran
102  << " with " << rot << std::endl;
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:33
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
double waferSize_
Definition: DDHGCalWafer.h:26
std::vector< std::string > childNames_
Definition: DDHGCalWafer.h:30
std::vector< int > nCellsRow_
Definition: DDHGCalWafer.h:31
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::vector< int > angleEdges_
Definition: DDHGCalWafer.h:32
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:34
DDName parentName_
Definition: DDHGCalWafer.h:35
void DDHGCalWafer::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 22 of file DDHGCalWafer.cc.

References angleEdges_, cellType_, childNames_, gather_cfg::cout, dbl_to_int(), detectorType_, idNameSpace_, createfilelist::int, gen::k, nBottomY_, nCellsRow_, nColumns_, DDCurrentNamespace::ns(), class-composition::parent, parentName_, and waferSize_.

26  {
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  std::cout << childNames_.size() << " children: " << childNames_[0] << "; "
40  << childNames_[1] << " in namespace " << idNameSpace_
41  << " positioned in " << nCellsRow_.size() << " rows and "
42  << nColumns_ << " columns with lowest column at " << nBottomY_
43  << " in mother " << parentName_ << " of size " << waferSize_
44  << std::endl;
45  for (unsigned int k=0; k<nCellsRow_.size(); ++k)
46  std::cout << "[" << k << "] Ncells " << nCellsRow_[k] << " Edge rotations "
47  << angleEdges_[2*k] << ":" << angleEdges_[2*k+1]
48  << " Type of edge cells " << detectorType_[2*k] << ":"
49  << detectorType_[2*k+1] << std::endl;
50 #endif
51 }
static std::string & ns()
std::vector< int > detectorType_
Definition: DDHGCalWafer.h:33
double waferSize_
Definition: DDHGCalWafer.h:26
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:30
std::vector< int > nCellsRow_
Definition: DDHGCalWafer.h:31
int k[5][pyjets_maxn]
std::vector< int > angleEdges_
Definition: DDHGCalWafer.h:32
std::string idNameSpace_
Definition: DDHGCalWafer.h:34
DDName parentName_
Definition: DDHGCalWafer.h:35

Member Data Documentation

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

Definition at line 32 of file DDHGCalWafer.h.

Referenced by execute(), and initialize().

int DDHGCalWafer::cellType_
private

Definition at line 27 of file DDHGCalWafer.h.

Referenced by execute(), and initialize().

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

Definition at line 30 of file DDHGCalWafer.h.

Referenced by execute(), and initialize().

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

Definition at line 33 of file DDHGCalWafer.h.

Referenced by execute(), and initialize().

std::string DDHGCalWafer::idNameSpace_
private

Definition at line 34 of file DDHGCalWafer.h.

Referenced by execute(), and initialize().

int DDHGCalWafer::nBottomY_
private

Definition at line 29 of file DDHGCalWafer.h.

Referenced by execute(), and initialize().

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

Definition at line 31 of file DDHGCalWafer.h.

Referenced by execute(), and initialize().

int DDHGCalWafer::nColumns_
private

Definition at line 28 of file DDHGCalWafer.h.

Referenced by execute(), and initialize().

DDName DDHGCalWafer::parentName_
private

Definition at line 35 of file DDHGCalWafer.h.

Referenced by execute(), and initialize().

double DDHGCalWafer::waferSize_
private

Definition at line 26 of file DDHGCalWafer.h.

Referenced by execute(), and initialize().