CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTIDAxialCableAlgo Class Reference
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

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

Detailed Description

Definition at line 23 of file DDTIDAxialCableAlgo.cc.

Constructor & Destructor Documentation

◆ DDTIDAxialCableAlgo()

DDTIDAxialCableAlgo::DDTIDAxialCableAlgo ( )

Definition at line 55 of file DDTIDAxialCableAlgo.cc.

References LogDebug.

55 { LogDebug("TIDGeom") << "DDTIDAxialCableAlgo info: Creating an instance"; }
#define LogDebug(id)

◆ ~DDTIDAxialCableAlgo()

DDTIDAxialCableAlgo::~DDTIDAxialCableAlgo ( )
override

Definition at line 57 of file DDTIDAxialCableAlgo.cc.

57 {}

Member Function Documentation

◆ execute()

void DDTIDAxialCableAlgo::execute ( DDCompactView cpv)
override

Definition at line 100 of file DDTIDAxialCableAlgo.cc.

References DDrot(), DDSplit(), dqmdumpme::first, mps_fire::i, createfilelist::int, dqmdumpme::k, LogDebug, Skims_PA_cff::name, class-composition::parent, DDSolidFactory::polycone(), DDCompactView::position(), photonAnalyzer_cfi::rMax, photonAnalyzer_cfi::rMin, idealTransformation::rotation, edm::second(), theta(), to_string(), DDSolidFactory::tubs(), and ApeEstimator_cff::width.

100  {
101  DDName mother = parent().name();
102  vector<DDName> logs;
103  double thk = thick / zposRing.size();
104  double r = rMin;
105  double thktot = 0;
106  double z;
107 
108  //Cables between the wheels
109  for (int k = 0; k < (int)(zposWheel.size()); k++) {
110  vector<double> pconZ, pconRmin, pconRmax;
111  for (int i = 0; i < (int)(zposRing.size()); i++) {
112  thktot += thk;
113  z = zposWheel[k] + zposRing[i] - 0.5 * thk;
114  if (i != 0) {
115  pconZ.emplace_back(z);
116  pconRmin.emplace_back(r);
117  pconRmax.emplace_back(rMax);
118  }
119  r = rMin;
120  pconZ.emplace_back(z);
121  pconRmin.emplace_back(r);
122  pconRmax.emplace_back(rMax);
123  z += thk;
124  pconZ.emplace_back(z);
125  pconRmin.emplace_back(r);
126  pconRmax.emplace_back(rMax);
127  r = rMax - thktot;
128  pconZ.emplace_back(z);
129  pconRmin.emplace_back(r);
130  pconRmax.emplace_back(rMax);
131  }
132  if (k >= ((int)(zposWheel.size()) - 1))
133  z = zBend;
134  else
135  z = zposWheel[k + 1] + zposRing[0] - 0.5 * thk;
136  pconZ.emplace_back(z);
137  pconRmin.emplace_back(r);
138  pconRmax.emplace_back(rMax);
139 
140  string name = childName + to_string(k);
141  DDSolid solid = DDSolidFactory::polycone(DDName(name, idNameSpace), -0.5 * width, width, pconZ, pconRmin, pconRmax);
142 
143  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: " << DDName(name, idNameSpace) << " Polycone made of " << matIn
144  << " from " << -0.5 * width / CLHEP::deg << " to " << 0.5 * width / CLHEP::deg << " and with "
145  << pconZ.size() << " sections ";
146  for (int i = 0; i < (int)(pconZ.size()); i++)
147  LogDebug("TIDGeom") << "\t[" << i << "]\tZ = " << pconZ[i] << "\tRmin = " << pconRmin[i]
148  << "\tRmax = " << pconRmax[i];
149 
151  DDMaterial matter(mat);
152  DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
153  logs.emplace_back(DDName(name, idNameSpace));
154  }
155 
156  //Cable in the vertical part
157  vector<double> pconZ, pconRmin, pconRmax;
158  r = thktot * rMax / rTop;
159  z = zBend - thktot;
160  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: Thk " << thk << " Total " << thktot << " rMax " << rMax << " rTop "
161  << rTop << " dR " << r << " z " << z;
162  pconZ.emplace_back(z);
163  pconRmin.emplace_back(rMax);
164  pconRmax.emplace_back(rMax);
165  z = zBend - r;
166  pconZ.emplace_back(z);
167  pconRmin.emplace_back(rMax);
168  pconRmax.emplace_back(rTop);
169  pconZ.emplace_back(zBend);
170  pconRmin.emplace_back(rMax);
171  pconRmax.emplace_back(rTop);
172 
173  string name = childName + to_string(zposWheel.size());
174  DDSolid solid = DDSolidFactory::polycone(DDName(name, idNameSpace), -0.5 * width, width, pconZ, pconRmin, pconRmax);
175 
176  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: " << DDName(name, idNameSpace) << " Polycone made of " << matIn
177  << " from " << -0.5 * width / CLHEP::deg << " to " << 0.5 * width / CLHEP::deg << " and with "
178  << pconZ.size() << " sections ";
179  for (int i = 0; i < (int)(pconZ.size()); i++)
180  LogDebug("TIDGeom") << "\t[" << i << "]\tZ = " << pconZ[i] << "\tRmin = " << pconRmin[i]
181  << "\tRmax = " << pconRmax[i];
182 
184  DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
185  logs.emplace_back(DDName(name, idNameSpace));
186 
187  //Cable in the outer part
188  name = childName + to_string(zposWheel.size() + 1);
189  r = rTop - r;
190  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.5 * (zEnd - zBend), r, rTop, -0.5 * width, width);
191  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: " << DDName(name, idNameSpace) << " Tubs made of " << matOut
192  << " from " << -0.5 * width / CLHEP::deg << " to " << 0.5 * width / CLHEP::deg << " with Rin "
193  << r << " Rout " << rTop << " ZHalf " << 0.5 * (zEnd - zBend);
195  genlogic = DDLogicalPart(DDName(name, idNameSpace), matter, solid);
196  logs.emplace_back(DDName(name, idNameSpace));
197 
198  //Position the cables
199  double theta = 90. * CLHEP::deg;
200  for (int i = 0; i < (int)(angles.size()); i++) {
201  double phix = angles[i];
202  double phiy = phix + 90. * CLHEP::deg;
203  double phideg = phix / CLHEP::deg;
204 
206  if (phideg != 0) {
207  string rotstr = childName + to_string(phideg * 10.);
209  if (!rotation) {
210  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: Creating a new "
211  << "rotation: " << rotstr << " " << theta / CLHEP::deg << ", " << phix / CLHEP::deg << ", "
212  << theta / CLHEP::deg << ", " << phiy / CLHEP::deg << ", 0, 0";
213  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.);
214  }
215  }
216 
217  for (int k = 0; k < (int)(logs.size()); k++) {
218  DDTranslation tran(0, 0, 0);
219  if (k == ((int)(logs.size()) - 1))
220  tran = DDTranslation(0, 0, 0.5 * (zEnd + zBend));
221  cpv.position(logs[k], mother, i + 1, tran, rotation);
222  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test " << logs[k] << " number " << i + 1 << " positioned in "
223  << mother << " at " << tran << " with " << rotation;
224  }
225  }
226 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
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:551
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
static std::string to_string(const XMLCh *ch)
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
vector< double > zposRing
U second(std::pair< T, U > const &p)
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:67
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:667
vector< double > zposWheel
vector< double > angles
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
Geom::Theta< T > theta() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)

◆ initialize()

void DDTIDAxialCableAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 59 of file DDTIDAxialCableAlgo.cc.

References mps_fire::i, createfilelist::int, LogDebug, DDCurrentNamespace::ns(), class-composition::parent, photonAnalyzer_cfi::rMax, photonAnalyzer_cfi::rMin, and ApeEstimator_cff::width.

63  {
64  zBend = nArgs["ZBend"];
65  zEnd = nArgs["ZEnd"];
66  rMin = nArgs["RMin"];
67  rMax = nArgs["RMax"];
68  rTop = nArgs["RTop"];
69  width = nArgs["Width"];
70  thick = nArgs["Thick"];
71  angles = vArgs["Angles"];
72  zposWheel = vArgs["ZPosWheel"];
73  zposRing = vArgs["ZPosRing"];
74 
75  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo debug: Parameters for creating " << (zposWheel.size() + 2)
76  << " axial cables and position"
77  << "ing " << angles.size() << " copies in Service volume"
78  << "\n zBend " << zBend << " zEnd " << zEnd << " rMin " << rMin
79  << " rMax " << rMax << " Cable width " << width / CLHEP::deg << " thickness " << thick
80  << " with Angles";
81  for (int i = 0; i < (int)(angles.size()); i++)
82  LogDebug("TIDGeom") << "\tangles[" << i << "] = " << angles[i] / CLHEP::deg;
83  LogDebug("TIDGeom") << " Wheels " << zposWheel.size() << " at Z";
84  for (int i = 0; i < (int)(zposWheel.size()); i++)
85  LogDebug("TIDGeom") << "\tzposWheel[" << i << "] = " << zposWheel[i];
86  LogDebug("TIDGeom") << " each with " << zposRing.size() << " Rings at Z";
87  for (int i = 0; i < (int)(zposRing.size()); i++)
88  LogDebug("TIDGeom") << "\tzposRing[" << i << "] = " << zposRing[i];
89 
91  childName = sArgs["ChildName"];
92  matIn = sArgs["MaterialIn"];
93  matOut = sArgs["MaterialOut"];
94 
95  DDName parentName = parent().name();
96  LogDebug("TIDGeom") << "DDTIDAxialCableAlgo debug: Parent " << parentName << "\tChild " << childName << " NameSpace "
97  << idNameSpace << "\tMaterial " << matIn << " and " << matOut;
98 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string & ns()
vector< double > zposRing
vector< double > zposWheel
vector< double > angles
#define LogDebug(id)

Member Data Documentation

◆ angles

vector<double> DDTIDAxialCableAlgo::angles
private

Definition at line 45 of file DDTIDAxialCableAlgo.cc.

◆ childName

string DDTIDAxialCableAlgo::childName
private

Definition at line 50 of file DDTIDAxialCableAlgo.cc.

◆ idNameSpace

string DDTIDAxialCableAlgo::idNameSpace
private

Definition at line 49 of file DDTIDAxialCableAlgo.cc.

◆ matIn

string DDTIDAxialCableAlgo::matIn
private

Definition at line 51 of file DDTIDAxialCableAlgo.cc.

◆ matOut

string DDTIDAxialCableAlgo::matOut
private

Definition at line 52 of file DDTIDAxialCableAlgo.cc.

◆ rMax

double DDTIDAxialCableAlgo::rMax
private

Definition at line 41 of file DDTIDAxialCableAlgo.cc.

◆ rMin

double DDTIDAxialCableAlgo::rMin
private

Definition at line 40 of file DDTIDAxialCableAlgo.cc.

◆ rTop

double DDTIDAxialCableAlgo::rTop
private

Definition at line 42 of file DDTIDAxialCableAlgo.cc.

◆ thick

double DDTIDAxialCableAlgo::thick
private

Definition at line 44 of file DDTIDAxialCableAlgo.cc.

◆ width

double DDTIDAxialCableAlgo::width
private

◆ zBend

double DDTIDAxialCableAlgo::zBend
private

Definition at line 38 of file DDTIDAxialCableAlgo.cc.

◆ zEnd

double DDTIDAxialCableAlgo::zEnd
private

Definition at line 39 of file DDTIDAxialCableAlgo.cc.

◆ zposRing

vector<double> DDTIDAxialCableAlgo::zposRing
private

Definition at line 47 of file DDTIDAxialCableAlgo.cc.

◆ zposWheel

vector<double> DDTIDAxialCableAlgo::zposWheel
private

Definition at line 46 of file DDTIDAxialCableAlgo.cc.