CMS 3D CMS Logo

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

#include <DDHCalFibreBundle.h>

Inheritance diagram for DDHCalFibreBundle:

Public Member Functions

 DDHCalFibreBundle ()
 
void execute (DDCompactView &cpv) override
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 
 ~DDHCalFibreBundle () override
 

Private Attributes

std::vector< double > areaSection
 
std::vector< int > bundle
 
std::string childPrefix
 
double deltaPhi
 
double deltaZ
 
std::string idNameSpace
 
std::string material
 
int numberPhi
 
std::vector< double > rEnd
 
std::vector< double > rStart
 
double tilt
 

Detailed Description

Definition at line 10 of file DDHCalFibreBundle.h.

Constructor & Destructor Documentation

DDHCalFibreBundle::DDHCalFibreBundle ( )

Definition at line 22 of file DDHCalFibreBundle.cc.

22  {
23 #ifdef EDM_ML_DEBUG
24  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Creating an instance";
25 #endif
26 }
DDHCalFibreBundle::~DDHCalFibreBundle ( )
override

Definition at line 28 of file DDHCalFibreBundle.cc.

28 {}

Member Function Documentation

void DDHCalFibreBundle::execute ( DDCompactView cpv)
override

Definition at line 74 of file DDHCalFibreBundle.cc.

References DDSolidFactory::cons(), geant_units::operators::convertRadToDeg(), popcon2dropbox::copy(), funct::cos(), DDrot(), DDSplit(), hiPixelPairStep_cff::deltaPhi, particleFlow_cfi::dPhi, plotBeamSpotDB::first, mps_fire::i, cuy::ib, createfilelist::int, cmsBatch::log, dataset::name, class-composition::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, idealTransformation::rotation, edm::second(), and AlCaHLTBitMon_QueryRunRegistry::string.

74  {
75 
76  DDName mother = parent().name();
78  DDMaterial matter(matname);
79 
80  // Create the rotation matrices
81  double dPhi = deltaPhi/numberPhi;
82  std::vector<DDRotation> rotation;
83  for (int i=0; i<numberPhi; ++i) {
84  double phi = -0.5*deltaPhi+(i+0.5)*dPhi;
85  double phideg = convertRadToDeg(phi);
86  std::string rotstr = "R0"+ std::to_string(phideg);
88  if (!rot) {
89 #ifdef EDM_ML_DEBUG
90  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Creating a new "
91  << "rotation " << rotstr << "\t" << 90
92  << "," << phideg << "," << 90 << ","
93  << (phideg+90) << ", 0, 0";
94 #endif
95  rot = DDrot(DDName(rotstr, idNameSpace), 90._deg, phi,
96  90._deg, (90._deg+phi), 0, 0);
97  }
98  rotation.emplace_back(rot);
99  }
100 
101  // Create the solids and logical parts
102  std::vector<DDLogicalPart> logs;
103  for (unsigned int i=0; i<areaSection.size(); ++i) {
104  double r0 = rEnd[i]/std::cos(tilt);
105  double dStart = areaSection[i]/(2*dPhi*rStart[i]);
106  double dEnd = areaSection[i]/(2*dPhi*r0);
107  std::string name = childPrefix + std::to_string(i);
109  rStart[i]-dStart, rStart[i]+dStart,
110  r0-dEnd, r0+dEnd, -0.5*dPhi, dPhi);
111 #ifdef EDM_ML_DEBUG
112  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Creating a new solid "
113  << name << " a cons with dZ " << deltaZ
114  << " rStart " << rStart[i]-dStart << ":"
115  << rStart[i]+dStart << " rEnd " << r0-dEnd
116  << ":" << r0+dEnd << " Phi "
117  << convertRadToDeg(-0.5*dPhi) << ":"
118  << convertRadToDeg(0.5*dPhi);
119 #endif
120  DDLogicalPart log(DDName(name, idNameSpace), matter, solid);
121  logs.emplace_back(log);
122  }
123 
124  // Now posiiton them
125  int copy = 0;
126  int nY = (int)(bundle.size())/numberPhi;
127  for (unsigned int i=0; i<bundle.size(); i++) {
128  DDTranslation tran(0,0,0);
129  int ir = (int)(i)/nY;
130  if (ir >= numberPhi) ir = numberPhi-1;
131  int ib = bundle[i];
132  copy++;
133  if (ib>=0 && ib<(int)(logs.size())) {
134  cpv.position(logs[ib], mother, copy, tran, rotation[ir]);
135 #ifdef EDM_ML_DEBUG
136  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: " << logs[ib].name()
137  << " number " << copy << " positioned in "
138  << mother << " at " << tran << " with "
139  << rotation[ir];
140 #endif
141  }
142  }
143 }
def copy(args, dbName)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:838
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< double > areaSection
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
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
std::string idNameSpace
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 > rEnd
std::vector< double > rStart
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::vector< int > bundle
std::string childPrefix
ib
Definition: cuy.py:662
void DDHCalFibreBundle::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 30 of file DDHCalFibreBundle.cc.

References geant_units::operators::convertRadToDeg(), dbl_to_int(), hiPixelPairStep_cff::deltaPhi, mps_fire::i, createfilelist::int, DDCurrentNamespace::ns(), and class-composition::parent.

34  {
35 
36  deltaPhi = nArgs["DeltaPhi"];
37  deltaZ = nArgs["DeltaZ"];
38  numberPhi = int(nArgs["NumberPhi"]);
39  material = sArgs["Material"];
40  areaSection = vArgs["AreaSection"];
41  rStart = vArgs["RadiusStart"];
42  rEnd = vArgs["RadiusEnd"];
43  bundle = dbl_to_int(vArgs["Bundles"]);
44  tilt = nArgs["TiltAngle"];
45 
47  childPrefix = sArgs["Child"];
48 #ifdef EDM_ML_DEBUG
49  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Parent "
50  << parent().name() << " with " << bundle.size()
51  << " children with prefix " << childPrefix
52  << ", material " << material << " with "
53  << numberPhi << " bundles along phi; width of"
54  << " mother " << deltaZ << " along Z, "
56  << " along phi and with " << rStart.size()
57  << " different bundle types";
58  for (unsigned int i=0; i<areaSection.size(); ++i)
59  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Child[" << i
60  << "] Area " << areaSection[i]
61  << " R at Start " << rStart[i]
62  << " R at End " << rEnd[i];
63  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: NameSpace "
64  << idNameSpace << " Tilt Angle "
66  << " Bundle type at different positions";
67  for (unsigned int i=0; i<bundle.size(); ++i) {
68  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Position[" << i << "] "
69  << " with Type " << bundle[i];
70  }
71 #endif
72 }
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
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::vector< double > areaSection
std::string idNameSpace
std::vector< double > rEnd
std::vector< double > rStart
std::vector< int > bundle
std::string childPrefix

Member Data Documentation

std::vector<double> DDHCalFibreBundle::areaSection
private

Definition at line 34 of file DDHCalFibreBundle.h.

std::vector<int> DDHCalFibreBundle::bundle
private

Definition at line 37 of file DDHCalFibreBundle.h.

std::string DDHCalFibreBundle::childPrefix
private

Definition at line 28 of file DDHCalFibreBundle.h.

double DDHCalFibreBundle::deltaPhi
private

Definition at line 31 of file DDHCalFibreBundle.h.

double DDHCalFibreBundle::deltaZ
private

Definition at line 30 of file DDHCalFibreBundle.h.

std::string DDHCalFibreBundle::idNameSpace
private

Definition at line 27 of file DDHCalFibreBundle.h.

std::string DDHCalFibreBundle::material
private

Definition at line 29 of file DDHCalFibreBundle.h.

int DDHCalFibreBundle::numberPhi
private

Definition at line 32 of file DDHCalFibreBundle.h.

std::vector<double> DDHCalFibreBundle::rEnd
private

Definition at line 36 of file DDHCalFibreBundle.h.

std::vector<double> DDHCalFibreBundle::rStart
private

Definition at line 35 of file DDHCalFibreBundle.h.

double DDHCalFibreBundle::tilt
private

Definition at line 33 of file DDHCalFibreBundle.h.