CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDHCalFibreBundle Class Reference
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 28 of file DDHCalFibreBundle.cc.

Constructor & Destructor Documentation

◆ DDHCalFibreBundle()

DDHCalFibreBundle::DDHCalFibreBundle ( )

Definition at line 56 of file DDHCalFibreBundle.cc.

56  {
57 #ifdef EDM_ML_DEBUG
58  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Creating an instance";
59 #endif
60 }

◆ ~DDHCalFibreBundle()

DDHCalFibreBundle::~DDHCalFibreBundle ( )
override

Definition at line 62 of file DDHCalFibreBundle.cc.

62 {}

Member Function Documentation

◆ execute()

void DDHCalFibreBundle::execute ( DDCompactView cpv)
override

Definition at line 99 of file DDHCalFibreBundle.cc.

99  {
100  DDName mother = parent().name();
102  DDMaterial matter(matname);
103 
104  // Create the rotation matrices
105  double dPhi = deltaPhi / numberPhi;
106  std::vector<DDRotation> rotation;
107  for (int i = 0; i < numberPhi; ++i) {
108  double phi = -0.5 * deltaPhi + (i + 0.5) * dPhi;
109  double phideg = convertRadToDeg(phi);
110  std::string rotstr = "R0" + std::to_string(phideg);
112  if (!rot) {
113 #ifdef EDM_ML_DEBUG
114  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Creating a new "
115  << "rotation " << rotstr << "\t" << 90 << "," << phideg << "," << 90 << ","
116  << (phideg + 90) << ", 0, 0";
117 #endif
118  rot = DDrot(DDName(rotstr, idNameSpace), 90._deg, phi, 90._deg, (90._deg + phi), 0, 0);
119  }
120  rotation.emplace_back(rot);
121  }
122 
123  // Create the solids and logical parts
124  std::vector<DDLogicalPart> logs;
125  for (unsigned int i = 0; i < areaSection.size(); ++i) {
126  double r0 = rEnd[i] / std::cos(tilt);
127  double dStart = areaSection[i] / (2 * dPhi * rStart[i]);
128  double dEnd = areaSection[i] / (2 * dPhi * r0);
129  std::string name = childPrefix + std::to_string(i);
131  0.5 * deltaZ,
132  rStart[i] - dStart,
133  rStart[i] + dStart,
134  r0 - dEnd,
135  r0 + dEnd,
136  -0.5 * dPhi,
137  dPhi);
138 #ifdef EDM_ML_DEBUG
139  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Creating a new solid " << name << " a cons with dZ " << deltaZ
140  << " rStart " << rStart[i] - dStart << ":" << rStart[i] + dStart << " rEnd "
141  << r0 - dEnd << ":" << r0 + dEnd << " Phi " << convertRadToDeg(-0.5 * dPhi) << ":"
142  << convertRadToDeg(0.5 * dPhi);
143 #endif
144  DDLogicalPart log(DDName(name, idNameSpace), matter, solid);
145  logs.emplace_back(log);
146  }
147 
148  // Now posiiton them
149  int copy = 0;
150  int nY = (int)(bundle.size()) / numberPhi;
151  for (unsigned int i = 0; i < bundle.size(); i++) {
152  DDTranslation tran(0, 0, 0);
153  int ir = (int)(i) / nY;
154  if (ir >= numberPhi)
155  ir = numberPhi - 1;
156  int ib = bundle[i];
157  copy++;
158  if (ib >= 0 && ib < (int)(logs.size())) {
159  cpv.position(logs[ib], mother, copy, tran, rotation[ir]);
160 #ifdef EDM_ML_DEBUG
161  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: " << logs[ib].name() << " number " << copy
162  << " positioned in " << mother << " at " << tran << " with " << rotation[ir];
163 #endif
164  }
165  }
166 }

References DDSolidFactory::cons(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, funct::cos(), DDrot(), DDSplit(), SiPixelRawToDigiRegional_cfi::deltaPhi, HLT_2018_cff::dPhi, dqmdumpme::first, mps_fire::i, cuy::ib, createfilelist::int, dqm-mbProfile::log, Skims_PA_cff::name, class-composition::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, idealTransformation::rotation, edm::second(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ initialize()

void DDHCalFibreBundle::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 64 of file DDHCalFibreBundle.cc.

68  {
69  deltaPhi = nArgs["DeltaPhi"];
70  deltaZ = nArgs["DeltaZ"];
71  numberPhi = int(nArgs["NumberPhi"]);
72  material = sArgs["Material"];
73  areaSection = vArgs["AreaSection"];
74  rStart = vArgs["RadiusStart"];
75  rEnd = vArgs["RadiusEnd"];
76  bundle = dbl_to_int(vArgs["Bundles"]);
77  tilt = nArgs["TiltAngle"];
78 
80  childPrefix = sArgs["Child"];
81 #ifdef EDM_ML_DEBUG
82  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Parent " << parent().name() << " with " << bundle.size()
83  << " children with prefix " << childPrefix << ", material " << material << " with "
84  << numberPhi << " bundles along phi; width of"
85  << " mother " << deltaZ << " along Z, " << convertRadToDeg(deltaPhi)
86  << " along phi and with " << rStart.size() << " different bundle types";
87  for (unsigned int i = 0; i < areaSection.size(); ++i)
88  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Child[" << i << "] Area " << areaSection[i] << " R at Start "
89  << rStart[i] << " R at End " << rEnd[i];
90  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: NameSpace " << idNameSpace << " Tilt Angle "
91  << convertRadToDeg(tilt) << " Bundle type at different positions";
92  for (unsigned int i = 0; i < bundle.size(); ++i) {
93  edm::LogVerbatim("HCalGeom") << "DDHCalFibreBundle: Position[" << i << "] "
94  << " with Type " << bundle[i];
95  }
96 #endif
97 }

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

Member Data Documentation

◆ areaSection

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

Definition at line 50 of file DDHCalFibreBundle.cc.

◆ bundle

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

Definition at line 53 of file DDHCalFibreBundle.cc.

◆ childPrefix

std::string DDHCalFibreBundle::childPrefix
private

Definition at line 44 of file DDHCalFibreBundle.cc.

◆ deltaPhi

double DDHCalFibreBundle::deltaPhi
private

Definition at line 47 of file DDHCalFibreBundle.cc.

◆ deltaZ

double DDHCalFibreBundle::deltaZ
private

Definition at line 46 of file DDHCalFibreBundle.cc.

◆ idNameSpace

std::string DDHCalFibreBundle::idNameSpace
private

Definition at line 43 of file DDHCalFibreBundle.cc.

◆ material

std::string DDHCalFibreBundle::material
private

Definition at line 45 of file DDHCalFibreBundle.cc.

◆ numberPhi

int DDHCalFibreBundle::numberPhi
private

Definition at line 48 of file DDHCalFibreBundle.cc.

◆ rEnd

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

Definition at line 52 of file DDHCalFibreBundle.cc.

◆ rStart

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

Definition at line 51 of file DDHCalFibreBundle.cc.

◆ tilt

double DDHCalFibreBundle::tilt
private

Definition at line 49 of file DDHCalFibreBundle.cc.

DDHCalFibreBundle::bundle
std::vector< int > bundle
Definition: DDHCalFibreBundle.cc:53
mps_fire.i
i
Definition: mps_fire.py:355
DDrot
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
DDHCalFibreBundle::deltaZ
double deltaZ
Definition: DDHCalFibreBundle.cc:46
DDSolidFactory::cons
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:636
dbl_to_int
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
dqmdumpme.first
first
Definition: dqmdumpme.py:55
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
DDHCalFibreBundle::areaSection
std::vector< double > areaSection
Definition: DDHCalFibreBundle.cc:50
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogVerbatim
Definition: MessageLogger.h:297
DDHCalFibreBundle::idNameSpace
std::string idNameSpace
Definition: DDHCalFibreBundle.cc:43
DDHCalFibreBundle::material
std::string material
Definition: DDHCalFibreBundle.cc:45
cuy.ib
ib
Definition: cuy.py:662
DDHCalFibreBundle::deltaPhi
double deltaPhi
Definition: DDHCalFibreBundle.cc:47
DDAxes::phi
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDHCalFibreBundle::rEnd
std::vector< double > rEnd
Definition: DDHCalFibreBundle.cc:52
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
DDHCalFibreBundle::rStart
std::vector< double > rStart
Definition: DDHCalFibreBundle.cc:51
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDHCalFibreBundle::numberPhi
int numberPhi
Definition: DDHCalFibreBundle.cc:48
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
DDHCalFibreBundle::tilt
double tilt
Definition: DDHCalFibreBundle.cc:49
DDHCalFibreBundle::childPrefix
std::string childPrefix
Definition: DDHCalFibreBundle.cc:44
class-composition.parent
parent
Definition: class-composition.py:88
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:66
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18