14 #include "CLHEP/Units/GlobalPhysicalConstants.h" 15 #include "CLHEP/Units/GlobalSystemOfUnits.h" 41 names_ = vsArgs[
"VolumeNames"];
42 thick_ = vArgs[
"Thickness"];
48 <<
" types of volumes";
49 for (
unsigned int i=0;
i<
names_.size(); ++
i)
51 <<
" of thickness " <<
thick_[
i]
62 <<
" with " <<
layers_[
i] <<
" layers";
74 <<
i <<
":" << ii <<
" with " 102 <<
" radius for wafer type separation uses " 113 slopeB_ = vArgs[
"SlopeBottom"];
153 <<
" different wafer copy numbers";
155 for (std::unordered_set<int>::const_iterator itr=
copies_.begin();
160 edm::LogVerbatim(
"HGCalGeom") <<
"<<== End of DDHGCalEEAlgo construction...";
172 const double tol(0.01);
173 for (
unsigned int i=0;
i<
layers_.size();
i++) {
179 std::vector<double> pgonZ(2), pgonRin(2), pgonRout(2);
180 for (
int ly=laymin; ly<laymax; ++ly) {
191 << ii <<
" Front " << zi <<
", " << routF
192 <<
" Back " << zo <<
", " << rinB
193 <<
" superlayer thickness " 202 double rmax = routF*
cos(alpha) - tol;
203 pgonZ[0] =-hthick; pgonZ[1] = hthick;
204 pgonRin[0] = rinB; pgonRin[1] = rinB;
205 pgonRout[0] = rmax; pgonRout[1] = rmax;
208 pgonZ, pgonRin, pgonRout);
213 <<
" sectors covering " 214 << -alpha/CLHEP::deg <<
":" 215 << (-alpha+CLHEP::twopi)/CLHEP::deg
216 <<
" with " << pgonZ.size()
217 <<
" sections and filled with " 218 << matName <<
":" << &matter;
219 for (
unsigned int k=0;
k<pgonZ.size(); ++
k)
221 <<
" R " << pgonRin[
k] <<
":" 226 hthick, rinB, routF, 0.0,
231 <<
" Tubs made of " << matName <<
":" 232 << &matter <<
" of dimensions " << rinB
233 <<
", " << routF <<
", " << hthick
234 <<
", 0.0, " << CLHEP::twopi/CLHEP::deg
235 <<
" and position " << glog.
name()
236 <<
" number " <<
copy;
242 cpv.
position(glog, module, copy, r1, rot);
246 <<
" number " << copy <<
" positioned in " 247 << module.
name() <<
" at " << r1
254 if (
std::abs(thickTot-layerThick_[
i]) < 0.00001) {
255 }
else if (thickTot > layerThick_[i]) {
257 << layerThick_[
i] <<
" is smaller than " 258 << thickTot <<
": thickness of all its " 259 <<
"components **** ERROR ****";
260 }
else if (thickTot < layerThick_[i]) {
262 << layerThick_[
i] <<
" does not match with " 263 << thickTot <<
" of the components";
269 double rout,
double zpos,
int layertype,
271 static const double sqrt3 =
std::sqrt(3.0);
273 double R = 2.0*r/sqrt3;
275 int N = (
int)(0.5*rout/r) + 2;
278 int ium(0), ivm(0), iumAll(0), ivmAll(0), kount(0), ntot(0),
nin(0);
279 std::vector<int> ntype(6,0);
281 <<
" rout " << rout <<
" N " 282 << N <<
" for maximum u, v";
284 for (
int u = -N; u <=
N; ++u) {
286 for (
int v = -N;
v <=
N; ++
v) {
292 xc[0] = xpos+
r; yc[0] = ypos+0.5*
R;
293 xc[1] = xpos; yc[1] = ypos+
R;
294 xc[2] = xpos-
r; yc[2] = ypos+0.5*
R;
295 xc[3] = xpos-
r; yc[3] = ypos-0.5*
R;
296 xc[4] = xpos; yc[4] = ypos-
R;
297 xc[5] = xpos+
r; yc[5] = ypos-0.5*
R;
298 bool cornerOne(
false), cornerAll(
true);
299 for (
int k=0;
k<6; ++
k) {
301 if (rpos >= rin && rpos <= rout) cornerOne =
true;
302 else cornerAll =
false;
309 int copy = type*1000000 + iv*100 + iu;
310 if (u < 0) copy += 10000;
311 if (v < 0) copy += 100000;
313 if (iu > ium) ium = iu;
314 if (iv > ivm) ivm = iv;
320 if (iu > iumAll) iumAll = iu;
321 if (iv > ivmAll) ivmAll = iv;
326 if (layertype > 1) type += 3;
333 <<
" number " << copy
334 <<
" positioned in " << glog.
ddname()
344 <<
":" << iumAll <<
" # of v " << ivm <<
":" 345 << ivmAll <<
" and " << nin <<
":" << kount
346 <<
":" << ntot <<
" wafers (" << ntype[0]
347 <<
":" << ntype[1] <<
":" << ntype[2] <<
":" 348 << ntype[3] <<
":" << ntype[4] <<
":" 349 << ntype[5] <<
") for " << glog.
ddname()
350 <<
" R " << rin <<
":" << rout;
std::vector< double > slopeB_
void execute(DDCompactView &cpv) override
~DDHGCalEEAlgo() override
std::unordered_set< int > copies_
std::vector< double > zFrontT_
std::vector< double > thick_
std::vector< double > layerThick_
DDMaterial is used to define and access material information.
std::vector< int > copyNumber_
std::vector< double > zFrontB_
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.
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)
std::vector< double > rMinFront_
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)