CMS 3D CMS Logo

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

#include <DDTIBRadCableAlgo_MTCC.h>

Inheritance diagram for DDTIBRadCableAlgo_MTCC:

Public Member Functions

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

Private Attributes

std::vector< std::string > cableMat
 
double cableT
 
double cylinderT
 
double deltaR
 
std::string idNameSpace
 
std::vector< double > layers
 
std::vector< double > layRin
 
double rMax
 
double rMin
 
std::vector< std::string > strucMat
 
double supportDR
 
std::string supportMat
 
double supportT
 

Detailed Description

Definition at line 10 of file DDTIBRadCableAlgo_MTCC.h.

Constructor & Destructor Documentation

DDTIBRadCableAlgo_MTCC::DDTIBRadCableAlgo_MTCC ( )

Definition at line 19 of file DDTIBRadCableAlgo_MTCC.cc.

References LogDebug.

19  : layRin(0), cableMat(0), strucMat(0), layers(0) {
20  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC info: Creating an instance";
21 }
#define LogDebug(id)
std::vector< double > layers
std::vector< std::string > strucMat
std::vector< std::string > cableMat
std::vector< double > layRin
DDTIBRadCableAlgo_MTCC::~DDTIBRadCableAlgo_MTCC ( )
override

Definition at line 23 of file DDTIBRadCableAlgo_MTCC.cc.

23 {}

Member Function Documentation

void DDTIBRadCableAlgo_MTCC::execute ( DDCompactView cpv)
override

Definition at line 70 of file DDTIBRadCableAlgo_MTCC.cc.

References cableMat, cableT, cylinderT, DDSplit(), deltaR, PVValHelper::dz, relativeConstraints::empty, dqmdumpme::first, mps_fire::i, idNameSpace, cuy::ii, layers, layRin, LogDebug, Skims_PA_cff::name, class-composition::parent, DDSolidFactory::polycone(), DDCompactView::position(), diffTwoXMLs::r1, diffTwoXMLs::r2, rMax, rMin, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, strucMat, supportDR, supportMat, supportT, and DDSolidFactory::tubs().

70  {
71  LogDebug("TIBGeom") << "==>> Constructing DDTIBRadCableAlgo_MTCC...";
72  DDName diskName = parent().name();
73 
74  DDSolid solid;
76  double rin, rout;
77 
78  // Loop over sub disks
80  DDMaterial suppMatter(suppName);
81  double diskDz = 0.5 * (supportT + cableT * layRin.size());
82  double dz = 0.5 * supportT;
83 
84  for (unsigned int i = 0; i < layRin.size(); i++) {
85  // fill only layers in layers list
86  bool empty = true;
87  for (double layer : layers) {
88  if (i + 1 == (unsigned int)layer) {
89  empty = false;
90  }
91  }
92 
93  if (!empty) {
94  //Support disks
95  name = "TIBSupportSideDisk" + std::to_string(i);
96  rin = layRin[i] + 0.5 * (deltaR - cylinderT) - supportDR;
97  rout = layRin[i] + 0.5 * (deltaR + cylinderT) + supportDR;
98  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin, rout, 0, CLHEP::twopi);
99  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of "
100  << supportMat << " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rin " << rin << " Rout "
101  << rout << " ZHalf " << dz;
102  DDLogicalPart suppLogic(DDName(name, idNameSpace), suppMatter, solid);
103 
104  DDTranslation r1(0, 0, (dz - diskDz));
105  cpv.position(DDName(name, idNameSpace), diskName, i + 1, r1, DDRotation());
106  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " << DDName(name, idNameSpace) << " number " << i + 1
107  << " positioned in " << diskName << " at " << r1 << " with no rotation";
108 
109  //Open Structure
110  name = "TIBOpenZone" + std::to_string(i);
111  rout = rin;
112  if (i == 0)
113  rin = rMin;
114  else
115  rin = layRin[i - 1] + 0.5 * (deltaR + cylinderT) + supportDR;
116  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin, rout, 0, CLHEP::twopi);
117  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of "
118  << strucMat[i] << " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rin " << rin
119  << " Rout " << rout << " ZHalf " << dz;
120  DDName strucName(DDSplit(strucMat[i]).first, DDSplit(strucMat[i]).second);
121  DDMaterial strucMatter(strucName);
122  DDLogicalPart strucLogic(DDName(name, idNameSpace), strucMatter, solid);
123 
124  DDTranslation r2(0, 0, (dz - diskDz));
125  cpv.position(DDName(name, idNameSpace), diskName, i + 1, r2, DDRotation());
126  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " << DDName(name, idNameSpace) << " number " << i + 1
127  << " positioned in " << diskName << " at " << r2 << " with no rotation";
128 
129  //Now the radial cable
130  name = "TIBRadCable" + std::to_string(i);
131  double rv = layRin[i] + 0.5 * deltaR;
132  std::vector<double> pgonZ;
133  pgonZ.emplace_back(-0.5 * cableT);
134  pgonZ.emplace_back(cableT * (rv / rMax - 0.5));
135  pgonZ.emplace_back(0.5 * cableT);
136  std::vector<double> pgonRmin;
137  pgonRmin.emplace_back(rv);
138  pgonRmin.emplace_back(rv);
139  pgonRmin.emplace_back(rv);
140  std::vector<double> pgonRmax;
141  pgonRmax.emplace_back(rMax);
142  pgonRmax.emplace_back(rMax);
143  pgonRmax.emplace_back(rv);
144  solid = DDSolidFactory::polycone(DDName(name, idNameSpace), 0, CLHEP::twopi, pgonZ, pgonRmin, pgonRmax);
145  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " << DDName(name, idNameSpace) << " Polycone made of "
146  << cableMat[i] << " from 0 to " << CLHEP::twopi / CLHEP::deg << " and with " << pgonZ.size()
147  << " sections";
148  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
149  LogDebug("TIBGeom") << "\t"
150  << "\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii] << "\tRmax = " << pgonRmax[ii];
151  DDName cableName(DDSplit(cableMat[i]).first, DDSplit(cableMat[i]).second);
152  LogDebug("TIBGeom") << " material cableName " << i << " " << cableName;
153  DDMaterial cableMatter(cableName);
154  DDLogicalPart cableLogic(DDName(name, idNameSpace), cableMatter, solid);
155 
156  DDTranslation r3(0, 0, (diskDz - (i + 0.5) * cableT));
157  cpv.position(DDName(name, idNameSpace), diskName, i + 1, r3, DDRotation());
158  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " << DDName(name, idNameSpace) << " number " << i + 1
159  << " positioned in " << diskName << " at " << r3 << " with no rotation";
160  }
161  //
162 
163  // fill only layers in layers list
164  empty = true;
165  for (double layer : layers) {
166  if (i + 1 == (unsigned int)layer) {
167  empty = false;
168  }
169  }
170 
171  if (!empty) {
172  //Now the last open zone
173  unsigned int i = layRin.size();
174  rin = layRin[i - 1] + 0.5 * (deltaR + cylinderT) + supportDR;
175  rout = rMax;
176  name = "TIBOpenZone" + std::to_string(i);
177  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin, rout, 0, CLHEP::twopi);
178  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of "
179  << strucMat[i] << " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rin " << rin
180  << " Rout " << rout << " ZHalf " << dz;
181  DDName strucName(DDSplit(strucMat[i]).first, DDSplit(strucMat[i]).second);
182  DDMaterial strucMatter(strucName);
183  DDLogicalPart strucLogic(DDName(name, idNameSpace), strucMatter, solid);
184 
185  DDTranslation r2(0, 0, (dz - diskDz));
186  cpv.position(DDName(name, idNameSpace), diskName, i + 1, r2, DDRotation());
187  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " << DDName(name, idNameSpace) << " number " << i + 1
188  << " positioned in " << diskName << " at " << r2 << " with no rotation";
189  }
190  }
191  LogDebug("TIBGeom") << "<<== End of DDTIBRadCableAlgo_MTCC construction ...";
192 }
#define LogDebug(id)
std::vector< double > layers
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
static DDSolid polycone(const DDName &name, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polycone (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:537
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::vector< std::string > strucMat
U second(std::pair< T, U > const &p)
std::vector< std::string > cableMat
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
std::vector< double > layRin
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:653
ii
Definition: cuy.py:590
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::Rotation3D DDRotation
void DDTIBRadCableAlgo_MTCC::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 25 of file DDTIBRadCableAlgo_MTCC.cc.

References cableMat, cableT, cylinderT, deltaR, mps_fire::i, idNameSpace, layers, layRin, LogDebug, DDCurrentNamespace::ns(), class-composition::parent, rMax, rMin, strucMat, supportDR, supportMat, and supportT.

29  {
31  unsigned int i;
32  DDName parentName = parent().name();
33  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: Parent " << parentName << " NameSpace " << idNameSpace;
34 
35  rMin = nArgs["RMin"];
36  rMax = nArgs["RMax"];
37  layRin = vArgs["RadiusLo"];
38  deltaR = nArgs["DeltaR"];
39  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: Disk Rmin " << rMin << "\tRMax " << rMax
40  << "\tSeparation of layers " << deltaR << " with " << layRin.size() << " layers at R =";
41  for (i = 0; i < layRin.size(); i++)
42  LogDebug("TIBGeom") << " " << i << " : " << layRin[i];
43 
44  cylinderT = nArgs["CylinderThick"];
45  supportT = nArgs["SupportThick"];
46  supportDR = nArgs["SupportDR"];
47  supportMat = sArgs["SupportMaterial"];
48  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: SupportCylinder "
49  << "Thickness " << cylinderT << "\tSupportDisk "
50  << "Thickness " << supportT << "\tExtra width along R " << supportDR
51  << "\tMaterial: " << supportMat;
52 
53  cableT = nArgs["CableThick"];
54  cableMat = vsArgs["CableMaterial"];
55  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: Cable Thickness " << cableT << " with materials: ";
56  for (i = 0; i < cableMat.size(); i++)
57  LogDebug("TIBGeom") << " " << i << " : " << cableMat[i];
58 
59  strucMat = vsArgs["StructureMaterial"];
60  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: " << strucMat.size() << " materials for open structure:";
61  for (i = 0; i < strucMat.size(); i++)
62  LogDebug("TIBGeom") << " " << i << " : " << strucMat[i];
63 
64  layers = vArgs["Layers"];
65  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: " << layers.size() << " layers:";
66  for (i = 0; i < layers.size(); i++)
67  LogDebug("TIBGeom") << " " << i << " : " << layers[i];
68 }
#define LogDebug(id)
std::vector< double > layers
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
std::vector< std::string > strucMat
std::vector< std::string > cableMat
std::vector< double > layRin

Member Data Documentation

std::vector<std::string> DDTIBRadCableAlgo_MTCC::cableMat
private

Definition at line 36 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::cableT
private

Definition at line 35 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::cylinderT
private

Definition at line 31 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::deltaR
private

Definition at line 30 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::string DDTIBRadCableAlgo_MTCC::idNameSpace
private

Definition at line 25 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIBRadCableAlgo_MTCC::layers
private

Definition at line 38 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIBRadCableAlgo_MTCC::layRin
private

Definition at line 29 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::rMax
private

Definition at line 28 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::rMin
private

Definition at line 27 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDTIBRadCableAlgo_MTCC::strucMat
private

Definition at line 37 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::supportDR
private

Definition at line 33 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::string DDTIBRadCableAlgo_MTCC::supportMat
private

Definition at line 34 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::supportT
private

Definition at line 32 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().