13 #include "CLHEP/Units/GlobalPhysicalConstants.h" 14 #include "CLHEP/Units/GlobalSystemOfUnits.h" 40 names_ = vsArgs[
"VolumeNames"];
41 thick_ = vArgs[
"Thickness"];
47 <<
" types of volumes";
48 for (
unsigned int i=0;
i<
names_.size(); ++
i)
50 <<
" of thickness " <<
thick_[
i]
61 <<
" with " <<
layers_[
i] <<
" layers";
73 <<
i <<
":" << ii <<
" with " 101 <<
" radius for wafer type separation uses " 112 slopeB_ = vArgs[
"SlopeBottom"];
119 <<
" slopes for top" ;
149 <<
" different wafer copy numbers";
151 for (std::unordered_set<int>::const_iterator itr=
copies_.begin();
156 edm::LogVerbatim(
"HGCalGeom") <<
"<<== End of DDHGCalEEAlgo construction...";
168 const double tol(0.01);
169 for (
unsigned int i=0;
i<
layers_.size();
i++) {
171 double routF =
rMax(zi);
175 std::vector<double> pgonZ(2), pgonRin(2), pgonRout(2);
176 for (
int ly=laymin; ly<laymax; ++ly) {
188 << ii <<
" Front " << zi <<
", " << routF
189 <<
" Back " << zo <<
", " << rinB
190 <<
" superlayer thickness " 199 double rmax = routF*
cos(alpha) - tol;
200 pgonZ[0] =-hthick; pgonZ[1] = hthick;
201 pgonRin[0] = rinB; pgonRin[1] = rinB;
202 pgonRout[0] = rmax; pgonRout[1] = rmax;
205 pgonZ, pgonRin, pgonRout);
210 <<
" sectors covering " 211 << -alpha/CLHEP::deg <<
":" 212 << (-alpha+CLHEP::twopi)/CLHEP::deg
213 <<
" with " << pgonZ.size()
214 <<
" sections and filled with " 215 << matName <<
":" << &matter;
216 for (
unsigned int k=0;
k<pgonZ.size(); ++
k)
218 <<
" R " << pgonRin[
k] <<
":" 223 hthick, rinB, routF, 0.0,
228 <<
" Tubs made of " << matName <<
":" 229 << &matter <<
" of dimensions " << rinB
230 <<
", " << routF <<
", " << hthick
231 <<
", 0.0, " << CLHEP::twopi/CLHEP::deg
232 <<
" and position " << glog.
name()
233 <<
" number " <<
copy;
239 cpv.
position(glog, module, copy, r1, rot);
243 <<
" number " << copy <<
" positioned in " 244 << module.
name() <<
" at " << r1
251 if (
std::abs(thickTot-layerThick_[
i]) < 0.00001) {
252 }
else if (thickTot > layerThick_[i]) {
254 << layerThick_[
i] <<
" is smaller than " 255 << thickTot <<
": thickness of all its " 256 <<
"components **** ERROR ****";
257 }
else if (thickTot < layerThick_[i]) {
259 << layerThick_[
i] <<
" does not match with " 260 << thickTot <<
" of the components";
270 for (
unsigned int k=0;
k<
slopeT_.size(); ++
k) {
285 double rout,
double zpos,
int layertype,
287 static const double sqrt3 =
std::sqrt(3.0);
289 double R = 2.0*r/sqrt3;
291 int N = (
int)(0.5*rout/r) + 2;
294 int ium(0), ivm(0), iumAll(0), ivmAll(0), kount(0), ntot(0),
nin(0);
295 std::vector<int> ntype(6,0);
297 <<
" rout " << rout <<
" N " 298 << N <<
" for maximum u, v";
300 for (
int u = -N; u <=
N; ++u) {
302 for (
int v = -N;
v <=
N; ++
v) {
308 xc[0] = xpos+
r; yc[0] = ypos+0.5*
R;
309 xc[1] = xpos; yc[1] = ypos+
R;
310 xc[2] = xpos-
r; yc[2] = ypos+0.5*
R;
311 xc[3] = xpos-
r; yc[3] = ypos-0.5*
R;
312 xc[4] = xpos; yc[4] = ypos-
R;
313 xc[5] = xpos+
r; yc[5] = ypos-0.5*
R;
314 bool cornerOne(
false), cornerAll(
true);
315 for (
int k=0;
k<6; ++
k) {
317 if (rpos >= rin && rpos <= rout) cornerOne =
true;
318 else cornerAll =
false;
325 int copy = type*1000000 + iv*100 + iu;
326 if (u < 0) copy += 10000;
327 if (v < 0) copy += 100000;
329 if (iu > ium) ium = iu;
330 if (iv > ivm) ivm = iv;
336 if (iu > iumAll) iumAll = iu;
337 if (iv > ivmAll) ivmAll = iv;
342 if (layertype > 1) type += 3;
349 <<
" number " << copy
350 <<
" positioned in " << glog.
ddname()
360 <<
":" << iumAll <<
" # of v " << ivm <<
":" 361 << ivmAll <<
" and " << nin <<
":" << kount
362 <<
":" << ntot <<
" wafers (" << ntype[0]
363 <<
":" << ntype[1] <<
":" << ntype[2] <<
":" 364 << ntype[3] <<
":" << ntype[4] <<
":" 365 << ntype[5] <<
") for " << glog.
ddname()
366 <<
" R " << rin <<
":" << rout;
std::vector< double > slopeB_
void execute(DDCompactView &cpv) override
~DDHGCalEEAlgo() override
std::unordered_set< int > copies_
std::vector< double > thick_
std::vector< double > layerThick_
DDMaterial is used to define and access material information.
std::vector< int > copyNumber_
std::vector< std::string > wafers_
DDName is used to identify DDD entities uniquely.
static std::string & ns()
Compact representation of the geometrical detector hierarchy.
std::vector< double > slopeT_
std::vector< int > layerSense_
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)
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
std::vector< double > zFront_
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
std::vector< int > layerType_
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
std::vector< double > rad100to200_
std::unique_ptr< HGCalWaferType > waferType_
std::vector< int > layers_
std::vector< std::string > names_
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void positionSensitive(const DDLogicalPart &glog, double rin, double rout, double zpos, int layertype, DDCompactView &cpv)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::vector< std::string > materials_
std::vector< double > rMaxFront_
std::vector< double > rad200to300_
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 constructLayers(const DDLogicalPart &, DDCompactView &cpv)