9 namespace std{}
using namespace std;
18 #include "CLHEP/Units/GlobalPhysicalConstants.h"
19 #include "CLHEP/Units/GlobalSystemOfUnits.h"
22 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo info: Creating an instance";
34 genMat = sArgs[
"MaterialName"];
37 nhalf = int (nArgs[
"NHalf"]);
39 theta = vArgs[
"Theta"];
43 absMat = sArgs[
"AbsMatName"];
44 thick = nArgs[
"Thickness"];
51 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo debug: General material "
54 for (
unsigned int i = 0;
i <
theta.size();
i++)
57 LogDebug(
"HCalGeom") <<
"\tCable mockup made of " <<
absMat <<
"\tThick "
62 idName = sArgs[
"MotherName"];
64 rotns = sArgs[
"RotNameSpace"];
66 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo debug: Parent " << parentName
68 <<
" for solids etc. and " <<
rotns <<
" for rotations";
73 LogDebug(
"HCalGeom") <<
"==>> Constructing DDHCalTBCableAlgo...";
81 double zstep2 =
zoff[3];
83 double rstep0 =
rin + (zstep2-zstep1)/
tan(
theta[2]);
84 double rstep1 =
rin + (zstep1-zstep0)/
tan(
theta[2]);
87 pgonZ.push_back(zstep0);
88 pgonZ.push_back(zstep1);
89 pgonZ.push_back(zstep2);
92 vector<double> pgonRmin;
93 pgonRmin.push_back(
rin);
94 pgonRmin.push_back(
rin);
95 pgonRmin.push_back(rstep0);
96 pgonRmin.push_back(
rmax[2]);
98 vector<double> pgonRmax;
99 pgonRmax.push_back(
rin);
100 pgonRmax.push_back(rstep1);
101 pgonRmax.push_back(
rmax[2]);
102 pgonRmax.push_back(
rmax[2]);
109 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: "
112 << -alpha/CLHEP::deg <<
" to "
113 << (-alpha+dphi)/CLHEP::deg <<
" and with "
114 << pgonZ.size() <<
" sections";
115 for (i = 0; i <pgonZ.size(); i++)
116 LogDebug(
"HCalGeom") <<
"\t\tZ = " << pgonZ[
i] <<
"\tRmin = "
117 << pgonRmin[
i] <<
"\tRmax = " << pgonRmax[
i];
127 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: "
129 <<
"in " << parentName <<
" at " << r0 <<
" with "<<
rot;
134 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: "
136 <<
"in " << parentName <<
" at " << r0 <<
" with "
142 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: "
144 <<
genMat <<
" with 1 sector from " <<-alpha/CLHEP::deg
145 <<
" to " << alpha/CLHEP::deg <<
" and with "
146 << pgonZ.size() <<
" sections";
147 for (i = 0; i < pgonZ.size(); i++)
148 LogDebug(
"HCalGeom") <<
"\t\tZ = " << pgonZ[
i] <<
"\tRmin = "
149 << pgonRmin[
i] <<
"\tRmax = " << pgonRmax[
i];
151 1, -alpha, 2*alpha, pgonZ,
157 double phideg = phi/CLHEP::deg;
160 string rotstr(
"NULL");
163 if (phideg < 100) rotstr =
"R0";
164 rotstr = rotstr + std::to_string(phideg);
167 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: Creating a new "
168 <<
"rotation " << rotstr <<
"\t90," << phideg
169 <<
", 90, " << (phideg+90) <<
", 0, 0";
171 phideg*CLHEP::deg, 90*CLHEP::deg,
172 (90+phideg)*CLHEP::deg, 0*CLHEP::deg, 0*CLHEP::deg);
177 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: " << seclogic.name()
178 <<
" number " <<
ii+1 <<
" positioned in "
179 << genlogic.name() <<
" at (0,0,0) with " <<
rotation;
185 double dx1 = rinl *
tan(alpha);
186 double dx2 = 0.90 * routl *
tan(alpha);
187 double dy = 0.50 *
thick;
188 double dz = 0.50 * (routl -rinl);
191 dx1, 0, dy, dx2, dx2, 0);
192 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: " << solid.
name()
193 <<
" Trap made of " <<
genMat <<
" of dimensions " << dz
194 <<
", 0, 0, " << dy <<
", " << dx1 <<
", " << dx1
195 <<
", 0, " << dy <<
", " << dx2 <<
", " << dx2 <<
", 0";
198 string rotstr =
name;
199 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: Creating a new rotation: "
200 << rotstr <<
"\t90, 270, " << (180-
theta[2]/CLHEP::deg)
201 <<
", 0, " << (90-
theta[2]/CLHEP::deg) <<
", 0";
203 180*CLHEP::deg-
theta[2], 0, 90*CLHEP::deg-
theta[2], 0);
205 cpv.
position(glog, seclogic, 1, r1, rot);
206 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: " << glog.name()
207 <<
" number 1 positioned in " << seclogic.name()
208 <<
" at " << r1 <<
" with " <<
rot;
212 double phi = atan((dx2-dx1)/(2*dz));
213 double xmid = 0.5*(dx1+dx2)-1.0;
216 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: " << solid.
name()
217 <<
" Box made of " <<
absMat <<
" of dimension "
225 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: Creating a new rotation "
226 << rotstr <<
"\t" << (90+phi/CLHEP::deg) <<
"," << 0
227 <<
"," << 90 <<
"," << 90 <<
"," << phi/CLHEP::deg
230 90*CLHEP::deg, 90*CLHEP::deg, phi, 0.0);
232 cpv.
position(cablog1, glog, 1, r2, rot2);
233 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: " << cablog1.name()
234 <<
" number 1 positioned in " << glog.name() <<
" at "
235 << r2 <<
" with " << rot2;
237 rotstr =
idName +
"Right";
238 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: Creating a new rotation "
239 << rotstr <<
"\t" << (90-phi/CLHEP::deg)
240 <<
", 0, 90, 90, " << -phi/CLHEP::deg <<
", 0";
242 0*CLHEP::deg, 90*CLHEP::deg, 90*CLHEP::deg,
245 cpv.
position(cablog1, glog, 2, r3, rot3);
246 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: " << cablog1.name()
247 <<
" number 2 positioned in " << glog.name() <<
" at "
248 << r3 <<
" with " << rot3;
254 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: " << solid.
name()
255 <<
" Box made of " <<
absMat <<
" of dimension "
261 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: " << cablog2.name()
262 <<
" number 1 positioned in " << glog.name() <<
" at ("
263 << xpos <<
", 0, 0) with no rotation";
265 LogDebug(
"HCalGeom") <<
"DDHCalTBCableAlgo test: " << cablog2.name()
266 <<
" number 2 positioned in " << glog.name() <<
" at ("
267 <<-xpos <<
", 0, 0) with no rotation";
269 LogDebug(
"HCalGeom") <<
"<<== End of DDHCalTBCableAlgo construction ...";
std::vector< double > theta
std::vector< double > rmax
DDMaterial is used to define and access material information.
Sin< T >::type sin(const T &t)
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.
static std::string & ns()
type of data representation of DDCompactView
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
void execute(DDCompactView &cpv)
virtual ~DDHCalTBCableAlgo()
std::vector< double > zoff
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
static DDSolid polyhedra(const DDName &name, int sides, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polyhedra (refere to Geant3 or Geant4 documentation)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)