CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
 
virtual ~DDTIDAxialCableAlgo ()
 

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 21 of file DDTIDAxialCableAlgo.cc.

References LogDebug.

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

Definition at line 25 of file DDTIDAxialCableAlgo.cc.

25 {}

Member Function Documentation

void DDTIDAxialCableAlgo::execute ( DDCompactView cpv)

Definition at line 74 of file DDTIDAxialCableAlgo.cc.

References angles, childName, dbl_to_string(), DDrot(), DDSplit(), plotBeamSpotDB::first, i, idNameSpace, relval_steps::k, LogDebug, matIn, matOut, mergeVDriftHistosByStation::name, dbtoconf::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.

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

Definition at line 27 of file DDTIDAxialCableAlgo.cc.

References angles, childName, i, idNameSpace, LogDebug, matIn, matOut, DDCurrentNamespace::ns(), dbtoconf::parent, rMax, rMin, rTop, thick, width, zBend, zEnd, zposRing, and zposWheel.

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