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 }
Log< level::Info, true > LogVerbatim

◆ ~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.

References DDSolidFactory::cons(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, funct::cos(), DDrot(), DDSplit(), SiPixelRawToDigiRegional_cfi::deltaPhi, l1tTrackerHTMiss_cfi::deltaZ, HLT_2022v14_cff::dPhi, 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(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::impl::to_string().

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);
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 }
Log< level::Info, true > LogVerbatim
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:650
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::string to_string(const V &value)
Definition: OMSAccess.h:71
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
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:67
std::vector< double > rEnd
std::vector< double > rStart
std::vector< int > bundle
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
ib
Definition: cuy.py:661

◆ 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.

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

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 }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
static std::string & ns()
std::vector< double > areaSection
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 > rEnd
std::vector< double > rStart
std::vector< int > bundle

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.