CMS 3D CMS Logo

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

#include <DDTIDAxialCableAlgo.h>

Inheritance diagram for DDTIDAxialCableAlgo:

Public Member Functions

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

Private Attributes

std::vector< double > angles
 
std::string childName
 
std::string idNameSpace
 
std::string matIn
 
std::string matOut
 
double rMax
 
double rMin
 
double rTop
 
double thick
 
double width
 
double zBend
 
double zEnd
 
std::vector< double > zposRing
 
std::vector< double > zposWheel
 

Detailed Description

Definition at line 10 of file DDTIDAxialCableAlgo.h.

Constructor & Destructor Documentation

DDTIDAxialCableAlgo::DDTIDAxialCableAlgo ( )

Definition at line 20 of file DDTIDAxialCableAlgo.cc.

References LogDebug.

20  {
21  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo info: Creating an instance";
22 }
#define LogDebug(id)
DDTIDAxialCableAlgo::~DDTIDAxialCableAlgo ( )
override

Definition at line 24 of file DDTIDAxialCableAlgo.cc.

24 {}

Member Function Documentation

void DDTIDAxialCableAlgo::execute ( DDCompactView cpv)
override

Definition at line 73 of file DDTIDAxialCableAlgo.cc.

References angles, childName, DDrot(), DDSplit(), plotBeamSpotDB::first, mps_fire::i, idNameSpace, createfilelist::int, gen::k, LogDebug, matIn, matOut, dataset::name, class-composition::parent, DDSolidFactory::polycone(), DDCompactView::position(), alignCSCRings::r, rMax, rMin, idealTransformation::rotation, rTop, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, theta(), thick, DDSolidFactory::tubs(), width, z, zBend, zEnd, zposRing, and zposWheel.

73  {
74 
75  DDName mother = parent().name();
76  std::vector<DDName> logs;
77  double thk = thick/zposRing.size();
78  double r = rMin;
79  double thktot = 0;
80  double z;
81 
82  //Cables between the wheels
83  for (int k=0; k<(int)(zposWheel.size()); k++) {
84 
85  std::vector<double> pconZ, pconRmin, pconRmax;
86  for (int i=0; i<(int)(zposRing.size()); i++) {
87  thktot += thk;
88  z = zposWheel[k] + zposRing[i] - 0.5*thk;
89  if (i != 0) {
90  pconZ.emplace_back(z);
91  pconRmin.emplace_back(r);
92  pconRmax.emplace_back(rMax);
93  }
94  r = rMin;
95  pconZ.emplace_back(z);
96  pconRmin.emplace_back(r);
97  pconRmax.emplace_back(rMax);
98  z += thk;
99  pconZ.emplace_back(z);
100  pconRmin.emplace_back(r);
101  pconRmax.emplace_back(rMax);
102  r = rMax - thktot;
103  pconZ.emplace_back(z);
104  pconRmin.emplace_back(r);
105  pconRmax.emplace_back(rMax);
106  }
107  if (k >= ((int)(zposWheel.size())-1)) z = zBend;
108  else z = zposWheel[k+1] + zposRing[0] - 0.5*thk;
109  pconZ.emplace_back(z);
110  pconRmin.emplace_back(r);
111  pconRmax.emplace_back(rMax);
112 
113  std::string name = childName + std::to_string(k);
115  -0.5*width, width, pconZ,
116  pconRmin, pconRmax);
117 
118  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: "
119  << DDName(name,idNameSpace) << " Polycone made of "
120  << matIn << " from " << -0.5*width/CLHEP::deg << " to "
121  << 0.5*width/CLHEP::deg << " and with " << pconZ.size()
122  << " sections ";
123  for (int i = 0; i <(int)(pconZ.size()); i++)
124  LogDebug("TIDGeom") << "\t[" << i << "]\tZ = " << pconZ[i]
125  << "\tRmin = "<< pconRmin[i] << "\tRmax = "
126  << pconRmax[i];
127 
129  DDMaterial matter(mat);
130  DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
131  logs.emplace_back(DDName(name, idNameSpace));
132  }
133 
134  //Cable in the vertical part
135  std::vector<double> pconZ, pconRmin, pconRmax;
136  r = thktot*rMax/rTop;
137  z = zBend - thktot;
138  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: Thk " << thk
139  << " Total " << thktot << " rMax " << rMax
140  << " rTop " << rTop << " dR " << r << " z " << z;
141  pconZ.emplace_back(z);
142  pconRmin.emplace_back(rMax);
143  pconRmax.emplace_back(rMax);
144  z = zBend - r;
145  pconZ.emplace_back(z);
146  pconRmin.emplace_back(rMax);
147  pconRmax.emplace_back(rTop);
148  pconZ.emplace_back(zBend);
149  pconRmin.emplace_back(rMax);
150  pconRmax.emplace_back(rTop);
151 
152  std::string name = childName + std::to_string(zposWheel.size());
154  -0.5*width, width, pconZ,
155  pconRmin, pconRmax);
156 
157  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: "
158  << DDName(name, idNameSpace) << " Polycone made of "
159  << matIn << " from " << -0.5*width/CLHEP::deg << " to "
160  << 0.5*width/CLHEP::deg << " and with " << pconZ.size()
161  << " sections ";
162  for (int i = 0; i < (int)(pconZ.size()); i++)
163  LogDebug("TIDGeom") << "\t[" << i << "]\tZ = " << pconZ[i]
164  << "\tRmin = "<< pconRmin[i] << "\tRmax = "
165  << pconRmax[i];
166 
167  DDMaterial matter(DDName(DDSplit(matIn).first, DDSplit(matIn).second));
168  DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
169  logs.emplace_back(DDName(name, idNameSpace));
170 
171  //Cable in the outer part
172  name = childName + std::to_string(zposWheel.size()+1);
173  r = rTop-r;
174  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.5*(zEnd-zBend),
175  r, rTop, -0.5*width, width);
176  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: "
177  << DDName(name, idNameSpace) << " Tubs made of "
178  << matOut << " from " << -0.5*width/CLHEP::deg << " to "
179  << 0.5*width/CLHEP::deg << " with Rin " << r << " Rout "
180  << rTop << " ZHalf " << 0.5*(zEnd-zBend);
181  matter = DDMaterial(DDName(DDSplit(matOut).first, DDSplit(matOut).second));
182  genlogic = DDLogicalPart(DDName(name, idNameSpace), matter, solid);
183  logs.emplace_back(DDName(name, idNameSpace));
184 
185  //Position the cables
186  double theta = 90.*CLHEP::deg;
187  for (int i=0; i<(int)(angles.size()); i++) {
188  double phix = angles[i];
189  double phiy = phix + 90.*CLHEP::deg;
190  double phideg = phix/CLHEP::deg;
191 
193  if (phideg != 0) {
194  std::string rotstr = childName + std::to_string(phideg*10.);
195  rotation = DDRotation(DDName(rotstr, idNameSpace));
196  if (!rotation) {
197  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: Creating a new "
198  << "rotation: " << rotstr << " "
199  << theta/CLHEP::deg << ", " << phix/CLHEP::deg
200  << ", " << theta/CLHEP::deg << ", "
201  << phiy/CLHEP::deg << ", 0, 0";
202  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta,
203  phiy, 0., 0.);
204  }
205  }
206 
207  for (int k=0; k<(int)(logs.size()); k++) {
208  DDTranslation tran(0,0,0);
209  if (k == ((int)(logs.size())-1))
210  tran = DDTranslation(0,0,0.5*(zEnd+zBend));
211  cpv.position(logs[k], mother, i+1, tran, rotation);
212  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test " << logs[k]
213  << " number " << i+1 << " positioned in "
214  << mother << " at " << tran << " with "
215  << rotation;
216  }
217  }
218 }
#define LogDebug(id)
std::vector< double > zposWheel
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
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:713
Geom::Theta< T > theta() const
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
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
std::vector< double > angles
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
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:865
int k[5][pyjets_maxn]
std::vector< double > zposRing
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
void DDTIDAxialCableAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 26 of file DDTIDAxialCableAlgo.cc.

References angles, childName, mps_fire::i, idNameSpace, createfilelist::int, LogDebug, matIn, matOut, DDCurrentNamespace::ns(), class-composition::parent, rMax, rMin, rTop, thick, width, zBend, zEnd, zposRing, and zposWheel.

30  {
31 
32  zBend = nArgs["ZBend"];
33  zEnd = nArgs["ZEnd"];
34  rMin = nArgs["RMin"];
35  rMax = nArgs["RMax"];
36  rTop = nArgs["RTop"];
37  width = nArgs["Width"];
38  thick = nArgs["Thick"];
39  angles = vArgs["Angles"];
40  zposWheel = vArgs["ZPosWheel"];
41  zposRing = vArgs["ZPosRing"];
42 
43  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo debug: Parameters for creating "
44  << (zposWheel.size()+2) << " axial cables and position"
45  << "ing " << angles.size() << " copies in Service volume"
46  << "\n zBend " << zBend
47  << " zEnd " << zEnd << " rMin " << rMin << " rMax "
48  << rMax << " Cable width " << width/CLHEP::deg
49  << " thickness " << thick << " with Angles";
50  for (int i=0; i<(int)(angles.size()); i++)
51  LogDebug("TIDGeom") << "\tangles[" << i << "] = " << angles[i]/CLHEP::deg;
52  LogDebug("TIDGeom") << " Wheels "
53  << zposWheel.size() << " at Z";
54  for (int i=0; i<(int)(zposWheel.size()); i++)
55  LogDebug("TIDGeom") << "\tzposWheel[" << i <<"] = " << zposWheel[i];
56  LogDebug("TIDGeom") << " each with "
57  << zposRing.size() << " Rings at Z";
58  for (int i=0; i<(int)(zposRing.size()); i++)
59  LogDebug("TIDGeom") << "\tzposRing[" << i <<"] = " << zposRing[i];
60 
62  childName = sArgs["ChildName"];
63  matIn = sArgs["MaterialIn"];
64  matOut = sArgs["MaterialOut"];
65 
66  DDName parentName = parent().name();
67  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo debug: Parent " << parentName
68  << "\tChild " << childName << " NameSpace "
69  << idNameSpace << "\tMaterial " << matIn << " and "
70  << matOut;
71 }
#define LogDebug(id)
std::vector< double > zposWheel
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
std::vector< double > angles
std::vector< double > zposRing

Member Data Documentation

std::vector<double> DDTIDAxialCableAlgo::angles
private

Definition at line 34 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTIDAxialCableAlgo::childName
private

Definition at line 39 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTIDAxialCableAlgo::idNameSpace
private

Definition at line 38 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTIDAxialCableAlgo::matIn
private

Definition at line 40 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTIDAxialCableAlgo::matOut
private

Definition at line 41 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::rMax
private

Definition at line 30 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::rMin
private

Definition at line 29 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::rTop
private

Definition at line 31 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::thick
private

Definition at line 33 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::width
private
double DDTIDAxialCableAlgo::zBend
private

Definition at line 27 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::zEnd
private

Definition at line 28 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIDAxialCableAlgo::zposRing
private

Definition at line 36 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIDAxialCableAlgo::zposWheel
private

Definition at line 35 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().