CMS 3D CMS Logo

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 19 of file DDTECAxialCableAlgo.cc.

References LogDebug.

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

Definition at line 23 of file DDTECAxialCableAlgo.cc.

23 {}

Member Function Documentation

void DDTECAxialCableAlgo::execute ( DDCompactView cpv)

Definition at line 78 of file DDTECAxialCableAlgo.cc.

References childName, DDrot(), DDSplit(), delta, dZ, plotBeamSpotDB::first, mps_fire::i, idNameSpace, cuy::ii, createfilelist::int, gen::k, LogDebug, matName, n, dataset::name, class-composition::parent, phi, DDSolidFactory::polycone(), DDCompactView::position(), rMax, rMin, idealTransformation::rotation, edm::second(), startAngle, AlCaHLTBitMon_QueryRunRegistry::string, theta(), thickR, thickZ, width, zEnd, zPos, and zStart.

78  {
79 
80  DDName mother = parent().name();
81  double theta = 90.*CLHEP::deg;
82 
83  for (int k=0; k<(int)(startAngle.size()); k++) {
84 
85  int i;
86  double zv = zPos[k]-dZ-0.5*(zStart+zEnd);
87  std::vector<double> pconZ, pconRmin, pconRmax;
88  pconZ.push_back(zv);
89  pconRmin.push_back(rMin);
90  pconRmax.push_back(rMax);
91  pconZ.push_back(zv+thickZ);
92  pconRmin.push_back(rMin);
93  pconRmax.push_back(rMax);
94  pconZ.push_back(zv+thickZ);
95  pconRmin.push_back(rMax-thickR);
96  pconRmax.push_back(rMax);
97  zv = zPos[k]+dZ-0.5*(zStart+zEnd);
98  pconZ.push_back(zv-thickZ);
99  pconRmin.push_back(rMax-thickR);
100  pconRmax.push_back(rMax);
101  pconZ.push_back(zv-thickZ);
102  pconRmin.push_back(rMin);
103  pconRmax.push_back(rMax);
104  pconZ.push_back(zv);
105  pconRmin.push_back(rMin);
106  pconRmax.push_back(rMax);
107  pconZ.push_back(zv);
108  pconRmin.push_back(rMax-thickR);
109  pconRmax.push_back(rMax);
110  pconZ.push_back(0.5*(zEnd-zStart));
111  pconRmin.push_back(rMax-thickR);
112  pconRmax.push_back(rMax);
113 
114  std::string name = childName + std::to_string(k);
116  -0.5*width, width, pconZ,
117  pconRmin, pconRmax);
118 
119  LogDebug("TECGeom") << "DDTECAxialCableAlgo test: "
120  << DDName(name, idNameSpace) <<" Polycone made of "
121  << matName << " from " <<-0.5*width/CLHEP::deg <<" to "
122  << 0.5*width/CLHEP::deg << " and with " << pconZ.size()
123  << " sections ";
124  for (int ii = 0; ii <(int)(pconZ.size()); ii++)
125  LogDebug("TECGeom") << "\t" << "\tZ[" << ii << "] = " << pconZ[ii]
126  << "\tRmin[" << ii << "] = "<< pconRmin[ii]
127  << "\tRmax[" << ii << "] = " << pconRmax[ii];
129  DDMaterial matter(mat);
130  DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
131 
132  double phi = startAngle[k];
133  for (i=0; i<n; i++) {
134  double phix = phi;
135  double phiy = phix + 90.*CLHEP::deg;
136  double phideg = phix/CLHEP::deg;
137 
139  if (phideg != 0) {
140  std::string rotstr = childName + std::to_string(phideg*10.);
141  rotation = DDRotation(DDName(rotstr, idNameSpace));
142  if (!rotation) {
143  LogDebug("TECGeom") << "DDTECAxialCableAlgo test: Creating a new"
144  << " rotation: " << rotstr << "\t90., "
145  << phix/CLHEP::deg << ", 90.,"
146  << phiy/CLHEP::deg << ", 0, 0";
147  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta,
148  phiy, 0., 0.);
149  }
150  }
151 
152  DDTranslation tran(0,0,0);
153  cpv.position(DDName(name, idNameSpace), mother, i+1, tran, rotation);
154  LogDebug("TECGeom") << "DDTECAxialCableAlgo test "
155  << DDName(name, idNameSpace) << " number " << i+1
156  << " positioned in " << mother << " at " << tran
157  << " with " << rotation;
158 
159  phi += delta;
160  }
161  }
162 }
#define LogDebug(id)
std::vector< double > zPos
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:825
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:15
std::vector< double > startAngle
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
U second(std::pair< T, U > const &p)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
ii
Definition: cuy.py:588
int k[5][pyjets_maxn]
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 25 of file DDTECAxialCableAlgo.cc.

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

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