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 19 of file DDHCalFibreBundle.cc.

References LogDebug.

19  {
20  LogDebug("HCalGeom") <<"DDHCalFibreBundle info: Creating an instance";
21 }
#define LogDebug(id)
DDHCalFibreBundle::~DDHCalFibreBundle ( )
override

Definition at line 23 of file DDHCalFibreBundle.cc.

23 {}

Member Function Documentation

void DDHCalFibreBundle::execute ( DDCompactView cpv)
override

Definition at line 64 of file DDHCalFibreBundle.cc.

References areaSection, bundle, childPrefix, DDSolidFactory::cons(), popcon2dropbox::copy(), funct::cos(), DDrot(), DDSplit(), deltaPhi, deltaZ, plotBeamSpotDB::first, mps_fire::i, cuy::ib, idNameSpace, createfilelist::int, cmsBatch::log, LogDebug, material, dataset::name, numberPhi, class-composition::parent, phi, DDCompactView::position(), rEnd, makeMuonMisalignmentScenario::rot, idealTransformation::rotation, rStart, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, and tilt.

64  {
65 
66  DDName mother = parent().name();
68  DDMaterial matter(matname);
69 
70  // Create the rotation matrices
71  double dPhi = deltaPhi/numberPhi;
72  std::vector<DDRotation> rotation;
73  for (int i=0; i<numberPhi; ++i) {
74  double phi = -0.5*deltaPhi+(i+0.5)*dPhi;
75  double phideg = phi/CLHEP::deg;
76  std::string rotstr = "R0"+ std::to_string(phideg);
78  if (!rot) {
79  LogDebug("HCalGeom") << "DDHCalFibreBundle test: Creating a new "
80  << "rotation " << rotstr << "\t" << 90 << ","
81  << phideg << "," << 90 << "," << (phideg+90)
82  << ", 0, 0";
83  rot = DDrot(DDName(rotstr, idNameSpace), 90*CLHEP::deg, phi,
84  90*CLHEP::deg, (90*CLHEP::deg+phi), 0, 0);
85  }
86  rotation.emplace_back(rot);
87  }
88 
89  // Create the solids and logical parts
90  std::vector<DDLogicalPart> logs;
91  for (unsigned int i=0; i<areaSection.size(); ++i) {
92  double r0 = rEnd[i]/std::cos(tilt);
93  double dStart = areaSection[i]/(2*dPhi*rStart[i]);
94  double dEnd = areaSection[i]/(2*dPhi*r0);
95  std::string name = childPrefix + std::to_string(i);
97  rStart[i]-dStart, rStart[i]+dStart,
98  r0-dEnd, r0+dEnd, -0.5*dPhi, dPhi);
99  LogDebug("HCalGeom") << "DDHCalFibreBundle test: Creating a new solid "
100  << name << " a cons with dZ " << deltaZ << " rStart "
101  << rStart[i]-dStart << ":" << rStart[i]+dStart
102  << " rEnd " << r0-dEnd << ":" << r0+dEnd << " Phi "
103  << -0.5*dPhi/CLHEP::deg << ":" << 0.5*dPhi/CLHEP::deg;
104  DDLogicalPart log(DDName(name, idNameSpace), matter, solid);
105  logs.emplace_back(log);
106  }
107 
108  // Now posiiton them
109  int copy = 0;
110  int nY = (int)(bundle.size())/numberPhi;
111  for (unsigned int i=0; i<bundle.size(); i++) {
112  DDTranslation tran(0,0,0);
113  int ir = (int)(i)/nY;
114  if (ir >= numberPhi) ir = numberPhi-1;
115  int ib = bundle[i];
116  copy++;
117  if (ib>=0 && ib<(int)(logs.size())) {
118  cpv.position(logs[ib], mother, copy, tran, rotation[ir]);
119  LogDebug("HCalGeom") << "DDHCalFibreBundle test: " << logs[ib].name()
120  << " number " << copy << " positioned in "
121  << mother << " at " << tran << " with "
122  << rotation[ir];
123  }
124  }
125 }
#define LogDebug(id)
def copy(args, dbName)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:959
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
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:92
std::string idNameSpace
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
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:660
void DDHCalFibreBundle::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 25 of file DDHCalFibreBundle.cc.

References areaSection, bundle, childPrefix, dbl_to_int(), deltaPhi, deltaZ, mps_fire::i, idNameSpace, createfilelist::int, LogDebug, material, DDCurrentNamespace::ns(), numberPhi, class-composition::parent, rEnd, rStart, and tilt.

29  {
30 
31  deltaPhi = nArgs["DeltaPhi"];
32  deltaZ = nArgs["DeltaZ"];
33  numberPhi = int(nArgs["NumberPhi"]);
34  material = sArgs["Material"];
35  areaSection = vArgs["AreaSection"];
36  rStart = vArgs["RadiusStart"];
37  rEnd = vArgs["RadiusEnd"];
38  bundle = dbl_to_int(vArgs["Bundles"]);
39  tilt = nArgs["TiltAngle"];
40 
42  childPrefix = sArgs["Child"];
43  DDName parentName = parent().name();
44  LogDebug("HCalGeom") << "DDHCalFibreBundle debug: Parent " << parentName
45  << " with " << bundle.size() << " children with prefix "
46  << childPrefix << ", material " << material << " with "
47  << numberPhi << " bundles along phi; width of mother "
48  << deltaZ << " along Z, " << deltaPhi/CLHEP::deg
49  << " along phi and with " << rStart.size()
50  << " different bundle types";
51  for (unsigned int i=0; i<areaSection.size(); ++i)
52  LogDebug("HCalGeom") << "DDHCalFibreBundle debug: Child[" << i << "] Area "
53  << areaSection[i] << " R at Start " << rStart[i]
54  << " R at End " << rEnd[i];
55  LogDebug("HCalGeom") << "DDHCalFibreBundle debug: NameSpace "
56  << idNameSpace << " Tilt Angle " << tilt/CLHEP::deg
57  << " Bundle type at different positions";
58  for (unsigned int i=0; i<bundle.size(); ++i) {
59  LogDebug("HCalGeom") << "DDHCalFibreBundle debug: Position[" << i << "] "
60  << " with Type " << bundle[i];
61  }
62 }
#define LogDebug(id)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
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.

Referenced by execute(), and initialize().

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

Definition at line 37 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

std::string DDHCalFibreBundle::childPrefix
private

Definition at line 28 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

double DDHCalFibreBundle::deltaPhi
private

Definition at line 31 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

double DDHCalFibreBundle::deltaZ
private

Definition at line 30 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

std::string DDHCalFibreBundle::idNameSpace
private

Definition at line 27 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

std::string DDHCalFibreBundle::material
private

Definition at line 29 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

int DDHCalFibreBundle::numberPhi
private

Definition at line 32 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

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

Definition at line 36 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

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

Definition at line 35 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

double DDHCalFibreBundle::tilt
private

Definition at line 33 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().