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
DDTECAxialCableAlgo Class Reference

#include <DDTECAxialCableAlgo.h>

Inheritance diagram for DDTECAxialCableAlgo:

Public Member Functions

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

Private Attributes

std::string childName
 
double delta
 
double dZ
 
std::string idNameSpace
 
std::string matName
 
int n
 
double rangeAngle
 
double rMax
 
double rMin
 
std::vector< double > startAngle
 
double thickR
 
double thickZ
 
double width
 
double zEnd
 
std::vector< double > zPos
 
double zStart
 

Detailed Description

Definition at line 10 of file DDTECAxialCableAlgo.h.

Constructor & Destructor Documentation

DDTECAxialCableAlgo::DDTECAxialCableAlgo ( )

Definition at line 20 of file DDTECAxialCableAlgo.cc.

References LogDebug.

20  {
21  LogDebug("TECGeom") << "DDTECAxialCableAlgo info: Creating an instance";
22 }
#define LogDebug(id)
DDTECAxialCableAlgo::~DDTECAxialCableAlgo ( )
virtual

Definition at line 24 of file DDTECAxialCableAlgo.cc.

24 {}

Member Function Documentation

void DDTECAxialCableAlgo::execute ( DDCompactView cpv)

Definition at line 79 of file DDTECAxialCableAlgo.cc.

References childName, dbl_to_string(), DDrot(), DDSplit(), delta, dZ, plotBeamSpotDB::first, i, idNameSpace, cuy::ii, relval_steps::k, LogDebug, matName, n, mergeVDriftHistosByStation::name, dbtoconf::parent, phi, DDSolidFactory::polycone(), DDCompactView::position(), rMax, rMin, idealTransformation::rotation, edm::second(), startAngle, AlCaHLTBitMon_QueryRunRegistry::string, theta(), thickR, thickZ, width, zEnd, zPos, and zStart.

79  {
80 
81  DDName mother = parent().name();
82  double theta = 90.*CLHEP::deg;
83 
84  for (int k=0; k<(int)(startAngle.size()); k++) {
85 
86  int i;
87  double zv = zPos[k]-dZ-0.5*(zStart+zEnd);
88  std::vector<double> pconZ, pconRmin, pconRmax;
89  pconZ.push_back(zv);
90  pconRmin.push_back(rMin);
91  pconRmax.push_back(rMax);
92  pconZ.push_back(zv+thickZ);
93  pconRmin.push_back(rMin);
94  pconRmax.push_back(rMax);
95  pconZ.push_back(zv+thickZ);
96  pconRmin.push_back(rMax-thickR);
97  pconRmax.push_back(rMax);
98  zv = zPos[k]+dZ-0.5*(zStart+zEnd);
99  pconZ.push_back(zv-thickZ);
100  pconRmin.push_back(rMax-thickR);
101  pconRmax.push_back(rMax);
102  pconZ.push_back(zv-thickZ);
103  pconRmin.push_back(rMin);
104  pconRmax.push_back(rMax);
105  pconZ.push_back(zv);
106  pconRmin.push_back(rMin);
107  pconRmax.push_back(rMax);
108  pconZ.push_back(zv);
109  pconRmin.push_back(rMax-thickR);
110  pconRmax.push_back(rMax);
111  pconZ.push_back(0.5*(zEnd-zStart));
112  pconRmin.push_back(rMax-thickR);
113  pconRmax.push_back(rMax);
114 
117  -0.5*width, width, pconZ,
118  pconRmin, pconRmax);
119 
120  LogDebug("TECGeom") << "DDTECAxialCableAlgo test: "
121  << DDName(name, idNameSpace) <<" Polycone made of "
122  << matName << " from " <<-0.5*width/CLHEP::deg <<" to "
123  << 0.5*width/CLHEP::deg << " and with " << pconZ.size()
124  << " sections ";
125  for (int ii = 0; ii <(int)(pconZ.size()); ii++)
126  LogDebug("TECGeom") << "\t" << "\tZ[" << ii << "] = " << pconZ[ii]
127  << "\tRmin[" << ii << "] = "<< pconRmin[ii]
128  << "\tRmax[" << ii << "] = " << pconRmax[ii];
130  DDMaterial matter(mat);
131  DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
132 
133  double phi = startAngle[k];
134  for (i=0; i<n; i++) {
135  double phix = phi;
136  double phiy = phix + 90.*CLHEP::deg;
137  double phideg = phix/CLHEP::deg;
138 
140  if (phideg != 0) {
141  std::string rotstr = childName + dbl_to_string(phideg*10.);
142  rotation = DDRotation(DDName(rotstr, idNameSpace));
143  if (!rotation) {
144  LogDebug("TECGeom") << "DDTECAxialCableAlgo test: Creating a new"
145  << " rotation: " << rotstr << "\t90., "
146  << phix/CLHEP::deg << ", 90.,"
147  << phiy/CLHEP::deg << ", 0, 0";
148  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta,
149  phiy, 0., 0.);
150  }
151  }
152 
153  DDTranslation tran(0,0,0);
154  cpv.position(DDName(name, idNameSpace), mother, i+1, tran, rotation);
155  LogDebug("TECGeom") << "DDTECAxialCableAlgo test "
156  << DDName(name, idNameSpace) << " number " << i+1
157  << " positioned in " << mother << " at " << tran
158  << " with " << rotation;
159 
160  phi += delta;
161  }
162  }
163 }
#define LogDebug(id)
std::vector< double > zPos
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
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:18
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
std::vector< double > startAngle
int ii
Definition: cuy.py:588
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)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
void DDTECAxialCableAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 26 of file DDTECAxialCableAlgo.cc.

References childName, delta, dZ, i, idNameSpace, LogDebug, matName, n, DDCurrentNamespace::ns(), dbtoconf::parent, rangeAngle, rMax, rMin, startAngle, thickR, thickZ, width, zEnd, zPos, and zStart.

30  {
31 
32  n = int(nArgs["N"]);
33  rangeAngle = nArgs["RangeAngle"];
34  zStart = nArgs["ZStart"];
35  zEnd = nArgs["ZEnd"];
36  rMin = nArgs["RMin"];
37  rMax = nArgs["RMax"];
38  width = nArgs["Width"];
39  thickR = nArgs["ThickR"];
40  thickZ = nArgs["ThickZ"];
41  dZ = nArgs["DZ"];
42  startAngle = vArgs["StartAngle"];
43  zPos = vArgs["ZPos"];
44 
45  if (fabs(rangeAngle-360.0*CLHEP::deg)<0.001*CLHEP::deg) {
46  delta = rangeAngle/double(n);
47  } else {
48  if (n > 1) {
49  delta = rangeAngle/double(n-1);
50  } else {
51  delta = 0.;
52  }
53  }
54 
55  LogDebug("TECGeom") << "DDTECAxialCableAlgo debug: Parameters for creating "
56  << startAngle.size() << " axial cables and positioning "
57  << n << " copies in Service volume\n"
58  << " zStart " << zStart
59  << " zEnd " << zEnd << " rMin " << rMin << " rMax "
60  << rMax << " Cable width " << width/CLHEP::deg
61  << " thickness " << thickR << ", " << thickZ << " dZ "
62  << dZ << "\n Range, Delta "
63  << rangeAngle/CLHEP::deg << ", " << delta/CLHEP::deg;
64  for (int i=0; i<(int)(startAngle.size()); i++)
65  LogDebug("TECGeom") << " Cable " << i
66  << " from Z " << zPos[i] << " startAngle "
67  << startAngle[i]/CLHEP::deg;
69  childName = sArgs["ChildName"];
70  matName = sArgs["Material"];
71 
72  DDName parentName = parent().name();
73 
74  LogDebug("TECGeom") << "DDTECAxialCableAlgo debug: Parent " << parentName
75  << "\tChild " << childName << " NameSpace "
76  << idNameSpace << "\tMaterial " << matName;
77 }
#define LogDebug(id)
std::vector< double > zPos
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
static std::string & ns()
std::vector< double > startAngle

Member Data Documentation

std::string DDTECAxialCableAlgo::childName
private

Definition at line 42 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::delta
private

Definition at line 39 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::dZ
private

Definition at line 36 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECAxialCableAlgo::idNameSpace
private

Definition at line 41 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECAxialCableAlgo::matName
private

Definition at line 43 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

int DDTECAxialCableAlgo::n
private

Definition at line 27 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::rangeAngle
private

Definition at line 28 of file DDTECAxialCableAlgo.h.

Referenced by initialize().

double DDTECAxialCableAlgo::rMax
private

Definition at line 32 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::rMin
private

Definition at line 31 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTECAxialCableAlgo::startAngle
private

Definition at line 37 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::thickR
private

Definition at line 34 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::thickZ
private

Definition at line 35 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::width
private
double DDTECAxialCableAlgo::zEnd
private

Definition at line 30 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTECAxialCableAlgo::zPos
private

Definition at line 38 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::zStart
private

Definition at line 29 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().