10 #include "CLHEP/Units/GlobalSystemOfUnits.h"
17 switch( solid.
shape())
26 xos <<
"<UnionSolid ";
30 xos <<
"<SubtractionSolid ";
34 xos <<
"<IntersectionSolid ";
36 xos <<
"name=\"" << rs.
toString() <<
"\">" << std::endl;
39 xos <<
"<rSolid name=\"" << rs.
solidA().
toString() <<
"\"/>" << std::endl;
40 xos <<
"<rSolid name=\"" << rs.
solidB().
toString() <<
"\"/>" << std::endl;
41 xos <<
"<Translation x=\"" << rs.
translation().X() <<
"*mm\"";
44 xos <<
"/>" << std::endl;
50 xos <<
"<rRotation name=\"" << rs.
rotation().
toString() <<
"\"/>" << std::endl;
53 xos <<
"</UnionSolid>" << std::endl;
57 xos <<
"</SubtractionSolid>" << std::endl;
61 xos <<
"</IntersectionSolid>" << std::endl;
73 xos <<
"<ReflectionSolid name=\"" << rs.
toString() <<
"\">" << std::endl;
75 xos <<
"</ReflectionSolid>" << std::endl;
82 xos <<
"<Box name=\"" << rs.
toString() <<
"\""
83 <<
" dx=\"" << rs.
halfX() <<
"*mm\""
84 <<
" dy=\"" << rs.
halfY() <<
"*mm\""
85 <<
" dz=\"" << rs.
halfZ() <<
"*mm\"/>"
95 xos <<
"<Tubs name=\"" << rs.
toString() <<
"\""
96 <<
" rMin=\"" << rs.
rIn() <<
"*mm\""
97 <<
" rMax=\"" << rs.
rOut() <<
"*mm\""
98 <<
" dz=\"" << rs.
zhalf() <<
"*mm\""
99 <<
" startPhi=\"" << rs.
startPhi()/deg <<
"*deg\""
100 <<
" deltaPhi=\"" << rs.
deltaPhi()/deg <<
"*deg\"/>"
110 xos <<
"<Trapezoid name=\"" << rs.
toString() <<
"\""
111 <<
" dz=\"" << rs.
halfZ() <<
"*mm\""
112 <<
" theta=\"" << rs.
theta()/deg <<
"*deg\""
113 <<
" phi=\"" << rs.
phi()/deg <<
"*deg\""
114 <<
" h1=\"" << rs.
y1() <<
"*mm\""
115 <<
" bl1=\"" << rs.
x1() <<
"*mm\""
116 <<
" tl1=\"" << rs.
x2() <<
"*mm\""
117 <<
" alp1=\"" << rs.
alpha1()/deg <<
"*deg\""
118 <<
" h2=\"" << rs.
y2() <<
"*mm\""
119 <<
" bl2=\"" << rs.
x3() <<
"*mm\""
120 <<
" tl2=\"" << rs.
x4() <<
"*mm\""
121 <<
" alp2=\"" << rs.
alpha2()/deg <<
"*deg\"/>"
128 xos <<
"<Cone name=\"" << rs.
toString() <<
"\""
129 <<
" dz=\"" << rs.
zhalf() <<
"*mm\""
130 <<
" rMin1=\"" << rs.
rInMinusZ() <<
"*mm\""
132 <<
" rMin2=\"" << rs.
rInPlusZ() <<
"*mm\""
133 <<
" rMax2=\"" << rs.
rOutPlusZ() <<
"*mm\""
134 <<
" startPhi=\"" << rs.
phiFrom()/deg <<
"*deg\""
135 <<
" deltaPhi=\"" << rs.
deltaPhi()/deg <<
"*deg\"/>"
142 xos <<
"<Polycone name=\"" << rs.
toString() <<
"\""
143 <<
" startPhi=\"" << rs.
startPhi()/deg <<
"*deg\""
144 <<
" deltaPhi=\"" << rs.
deltaPhi()/deg <<
"*deg\">"
146 const std::vector<double> & zV(rs.
zVec());
147 const std::vector<double> & rV(rs.
rVec());
148 for (
size_t i = 0;
i < zV.size(); ++
i ) {
149 xos <<
"<RZPoint r=\"" << rV[
i] <<
"*mm\""
150 <<
" z=\"" << zV[
i] <<
"*mm\"/>"
153 xos <<
"</Polycone>" << std::endl;
159 xos <<
"<Polyhedra name=\"" << rs.
toString() <<
"\""
160 <<
" numSide=\"" << rs.
sides() <<
"\""
161 <<
" startPhi=\"" << rs.
startPhi()/deg <<
"*deg\""
162 <<
" deltaPhi=\"" << rs.
deltaPhi()/deg <<
"*deg\">"
164 const std::vector<double> & zV(rs.
zVec());
165 const std::vector<double> & rV(rs.
rVec());
166 for (
size_t i = 0;
i < zV.size(); ++
i ) {
167 xos <<
"<RZPoint r=\"" << rV[
i] <<
"*mm\""
168 <<
" z=\"" << zV[
i] <<
"*mm\"/>"
171 xos <<
"</Polyhedra>" << std::endl;
184 xos <<
"<Polycone name=\"" << rs.
toString() <<
"\""
185 <<
" startPhi=\"" << rs.
startPhi()/deg <<
"*deg\""
186 <<
" deltaPhi=\"" << rs.
deltaPhi()/deg <<
"*deg\">"
188 const std::vector<double> & zV(rs.
zVec());
189 const std::vector<double> & rMinV(rs.
rMinVec());
190 const std::vector<double> & rMaxV(rs.
rMaxVec());
191 for (
size_t i = 0;
i < zV.size(); ++
i ) {
192 xos <<
"<ZSection z=\"" << zV[
i] <<
"*mm\""
193 <<
" rMin=\"" << rMinV[
i] <<
"*mm\""
194 <<
" rMax=\"" << rMaxV[
i] <<
"*mm\"/>"
197 xos <<
"</Polycone>" << std::endl;
203 xos <<
"<Polyhedra name=\"" << rs.
toString() <<
"\""
204 <<
" numSide=\"" << rs.
sides() <<
"\""
205 <<
" startPhi=\"" << rs.
startPhi()/deg <<
"*deg\""
206 <<
" deltaPhi=\"" << rs.
deltaPhi()/deg <<
"*deg\">"
208 const std::vector<double> & zV(rs.
zVec());
209 const std::vector<double> & rMinV(rs.
rMinVec());
210 const std::vector<double> & rMaxV(rs.
rMaxVec());
211 for (
size_t i = 0;
i < zV.size(); ++
i ) {
212 xos <<
"<ZSection z=\"" << zV[
i] <<
"*mm\""
213 <<
" rMin=\"" << rMinV[
i] <<
"*mm\""
214 <<
" rMax=\"" << rMaxV[
i] <<
"*mm\"/>"
217 xos <<
"</Polyhedra>" << std::endl;
224 xos <<
"<PseudoTrap name=\"" << rs.
toString() <<
"\""
225 <<
" dx1=\"" << rs.
x1() <<
"*mm\""
226 <<
" dx2=\"" << rs.
x2() <<
"*mm\""
227 <<
" dy1=\"" << rs.
y1() <<
"*mm\""
228 <<
" dy2=\"" << rs.
y2() <<
"*mm\""
229 <<
" dz=\"" << rs.
halfZ() <<
"*mm\""
230 <<
" radius=\"" << rs.
radius() <<
"*mm\""
231 <<
" atMinusZ=\"" << ( rs.
atMinusZ() ?
"true" :
"false" ) <<
"\"/>"
239 xos <<
"<TruncTubs name=\"" << rs.
toString() <<
"\""
240 <<
" zHalf=\"" << rs.
zHalf() <<
"*mm\""
241 <<
" rMin=\"" << rs.
rIn() <<
"*mm\""
242 <<
" rMax=\"" << rs.
rOut() <<
"*mm\""
243 <<
" startPhi=\"" << rs.
startPhi()/deg <<
"*deg\""
244 <<
" deltaPhi=\"" << rs.
deltaPhi()/deg <<
"*deg\""
245 <<
" cutAtStart=\"" << rs.
cutAtStart() <<
"*mm\""
246 <<
" cutAtDelta=\"" << rs.
cutAtDelta() <<
"*mm\""
247 <<
" cutInside=\"" << ( rs.
cutInside() ?
"true" :
"false" ) <<
"\"/>"
254 xos <<
"<ShapelessSolid name=\"" << rs.
toString() <<
"\"/>"
262 xos <<
"<Torus name=\"" << rs.
toString() <<
"\""
263 <<
" innerRadius=\"" << rs.
rMin() <<
"*mm\""
264 <<
" outerRadius=\"" << rs.
rMax() <<
"*mm\""
265 <<
" torusRadius=\"" << rs.
rTorus() <<
"*mm\""
266 <<
" startPhi=\"" << rs.
startPhi()/deg <<
"*deg\""
267 <<
" deltaPhi=\"" << rs.
deltaPhi()/deg <<
"*deg\"/>"
275 throw cms::Exception(
"DDException") <<
"DDCoreToDDXMLOutput::solid(...) either not inited or no such solid.";
285 xos <<
"<ElementaryMaterial name=\"" << material.
toString() <<
"\""
287 << std::scientific << std::setprecision(5)
288 << material.
density() / mg * cm3 <<
"*mg/cm3\""
289 <<
" atomicWeight=\""
291 << material.
a() /
g * mole <<
"*g/mole\""
292 << std::setprecision(0) << std::fixed <<
" atomicNumber=\"" << material.
z() <<
"\"/>"
297 xos <<
"<CompositeMaterial name=\"" << material.
toString() <<
"\""
299 << std::scientific << std::setprecision(5)
300 << material.
density() / mg * cm3 <<
"*mg/cm3\""
301 <<
" method=\"mixture by weight\">" << std::endl;
306 xos <<
"<MaterialFraction fraction=\""
307 << std::fixed << std::setprecision(9)
308 << material.
constituent(j).second <<
"\">" << std::endl;
309 xos <<
"<rMaterial name=\"" << material.
constituent(j).first.name() <<
"\"/>" << std::endl;
310 xos <<
"</MaterialFraction>" << std::endl;
312 xos <<
"</CompositeMaterial>" << std::endl;
321 rotation.
matrix()->GetComponents(x,y,z);
322 double check = (x.Cross(y)).Dot(z);
324 bool reflection((1.-check)>tol);
325 std::string rotName=rotation.
toString();
331 std::cout <<
"about to try to make a new DDRotation... should fail!" << std::endl;
337 std::cout <<
"WARNING: MAKING AN UNNAMED ROTATION" << std::endl;
346 xos <<
"<ReflectionRotation ";
349 xos <<
"name=\"" << rotName <<
"\""
350 <<
" phiX=\"" << x.phi()/deg <<
"*deg\""
351 <<
" thetaX=\"" << x.theta()/deg <<
"*deg\""
352 <<
" phiY=\"" << y.phi()/deg <<
"*deg\""
353 <<
" thetaY=\"" << y.theta()/deg <<
"*deg\""
354 <<
" phiZ=\"" << z.phi()/deg <<
"*deg\""
355 <<
" thetaZ=\"" << z.theta()/deg <<
"*deg\"/>"
362 xos <<
"<LogicalPart name=\"" << lp.
toString() <<
"\">" << std::endl;
363 xos <<
"<rSolid name=\"" << lp.
solid().
toString() <<
"\"/>" << std::endl;
364 xos <<
"<rMaterial name=\"" << lp.
material().
toString() <<
"\"/>" << std::endl;
365 xos <<
"</LogicalPart>" << std::endl;
378 xos <<
"<PosPart copyNumber=\"" << edgeToChild->
copyno_ <<
"\">" << std::endl;
379 xos <<
"<rParent name=\"" << parent.
toString() <<
"\"/>" << std::endl;
380 xos <<
"<rChild name=\"" << child.
toString() <<
"\"/>" << std::endl;
381 if( *(edgeToChild->
rot_.
matrix()) != myIDENT )
389 xos <<
"<rRotation name=\"" << rotName <<
"\"/>" << std::endl;
393 xos <<
"<Translation x=\"" << edgeToChild->
translation().x() <<
"*mm\""
394 <<
" y=\"" << edgeToChild->
translation().y() <<
"*mm\""
395 <<
" z=\"" << edgeToChild->
translation().z() <<
"*mm\"/>" << std::endl;
397 xos <<
"</PosPart>" << std::endl;
403 xos <<
"<SpecPar name=\"" << sp.
toString() <<
"\" eval=\"false\">" << std::endl;
406 const std::vector<DDPartSelection> sels = sp.
selection();
407 std::vector<DDPartSelection>::const_iterator psit = sels.begin();
408 std::vector<DDPartSelection>::const_iterator psendit = sels.end();
409 for(; psit != psendit ; ++psit)
411 xos <<
"<PartSelector path=\"" << *psit <<
"\"/>" << std::endl;
415 DDsvalues_type::const_iterator vit(sp.
specifics().begin()), ved(sp.
specifics().end());
416 for(; vit != ved; ++vit)
422 const std::vector<std::string>& strvec = v.
strings();
427 xos <<
"<Parameter name=\"" << v.
name() <<
"\""
428 <<
" value=\"" << v[
i] <<
"\""
429 <<
" eval=\"true\"/>" << std::endl;
436 xos <<
"<Parameter name=\"" << v.
name() <<
"\""
437 <<
" value=\"" << strvec[
i] <<
"\""
438 <<
" eval=\"false\"/>" << std::endl;
443 xos <<
"</SpecPar>" << std::endl;
448 static std::string madeName(
"specparname");
449 static int numspecpars(0);
450 std::ostringstream ostr;
451 ostr << numspecpars++;
452 std::string spname = madeName + ostr.str();
453 xos <<
"<SpecPar name=\"" << spname <<
"\" eval=\"false\">" << std::endl;
454 std::set<DDPartSelection*>::const_iterator psit = pssv.second.begin();
455 std::set<DDPartSelection*>::const_iterator psendit = pssv.second.end();
456 for (; psit != psendit; ++psit) {
457 xos <<
"<PartSelector path=\"" << *(*psit) <<
"\"/>" << std::endl;
462 DDsvalues_type::const_iterator vit(pssv.first.begin()), ved(pssv.first.end());
463 for(; vit != ved; ++vit)
469 const std::vector<std::string>& strvec = v.
strings();
474 xos <<
"<Parameter name=\"" << v.
name() <<
"\""
475 <<
" value=\"" << v[
i] <<
"\""
476 <<
" eval=\"true\"/>" << std::endl;
483 xos <<
"<Parameter name=\"" << v.
name() <<
"\""
484 <<
" value=\"" << strvec[
i] <<
"\""
485 <<
" eval=\"false\"/>" << std::endl;
490 xos <<
"</SpecPar>" << std::endl;
const std::string & name(void) const
the name of the DDValue
double a() const
returns the atomic mass
double startPhi(void) const
double cutAtStart(void) const
truncation at begin of the tube-section
double halfZ(void) const
half of the z-Axis
Relative position of a child-volume inside a parent-volume.
bool cutInside(void) const
true, if truncation is on the inner side of the tube-section
std::vector< double > rVec(void) const
A truncated tube section.
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
double zHalf(void) const
half of the z-Axis
void rotation(DDRotation &rotation, std::ostream &xos, const std::string &rotn="")
double y2(void) const
half length along y on +z
std::vector< double > rMaxVec(void) const
double deltaPhi(void) const
angular span of the tube-section
DDMaterial is used to define and access material information.
std::vector< double > rMaxVec(void) const
double phi(void) const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
This is simply a handle on the solid.
double rTorus(void) const
std::vector< double > rVec(void) const
double cutAtDelta(void) const
truncation at end of the tube-section
double phiFrom(void) const
DDName is used to identify DDD entities uniquely.
double rIn(void) const
inner radius
void specpar(const DDSpecifics &sp, std::ostream &xos)
double rOutMinusZ(void) const
double rOutPlusZ(void) const
DDTranslation translation(void) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
A DDSolid represents the shape of a part.
double y1(void) const
half length along y on -z
DDSolid solidB(void) const
Represents a uniquely identifyable rotation matrix.
bool isEvaluated(void) const
true, if values are numerical evaluated; else false.
double z() const
retruns the atomic number
DDSolid unreflected(void) const
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
DDRotation rotation(void) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
bool atMinusZ(void) const
true, if cut-out or rounding is on the -z side
double halfZ(void) const
half of the z-Axis
std::vector< double > rMinVec(void) const
double startPhi(void) const
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
double startPhi(void) const
void position(const DDLogicalPart &parent, const DDLogicalPart &child, DDPosData *edgeToChild, int &rotNameSeed, std::ostream &xos)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
double deltaPhi(void) const
FractionV::value_type constituent(int i) const
returns the i-th compound material and its fraction-mass
Interface to a Trapezoid.
double y1(void) const
Half-length along y of the face at -pDz.
double rInMinusZ(void) const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
DDSolidShape shape(void) const
The type of the solid.
void logicalPart(const DDLogicalPart &lp, std::ostream &xos)
std::vector< double > rMinVec(void) const
const std::vector< std::string > & strings() const
a reference to the std::string-valued values stored in the given instance of DDValue ...
DDSolid solidA(void) const
double deltaPhi(void) const
double deltaPhi(void) const
double startPhi(void) const
std::string toString() const
double density() const
returns the density
std::vector< double > zVec(void) const
double deltaPhi(void) const
int noOfConstituents() const
returns the number of compound materials or 0 for elementary materials
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
double alpha2(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of t...
double startPhi(void) const
angular start of the tube-section
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
const DDsvalues_type & specifics() const
Reference to the user-data attached to all nodes selected by the selections-strings given through sel...
const DDTranslation & translation() const
double deltaPhi(void) const
double y2(void) const
Half-length along y of the face at +pDz.
void material(const DDMaterial &material, std::ostream &xos)
double rInPlusZ(void) const
unsigned int size() const
the size of the stored value-pairs (std::string,double)
DDRotationMatrix * matrix()
double x2(void) const
half length along x on +z
void solid(const DDSolid &solid, std::ostream &xos)
double rOut(void) const
outer radius
double theta(void) const
Polar angle of the line joining the centres of the faces at -/+pDz.
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
std::vector< double > zVec(void) const
Interface to attach user specific data to nodes in the expanded-view.
double x1(void) const
half length along x on -z
double radius(void) const
radius of the cut-out (neg.) or rounding (pos.)
const std::vector< DDPartSelection > & selection() const
Gives a reference to the collection of part-selections.