15 #include "CLHEP/Units/GlobalPhysicalConstants.h" 16 #include "CLHEP/Units/GlobalSystemOfUnits.h" 42 names_ = vsArgs[
"VolumeNames"];
43 thick_ = vArgs[
"Thickness"];
49 <<
" types of volumes";
50 for (
unsigned int i=0;
i<
names_.size(); ++
i)
52 <<
" of thickness " <<
thick_[
i]
63 <<
" with " <<
layers_[
i] <<
" layers";
75 <<
i <<
":" << ii <<
" with " 103 <<
" radius for wafer type separation uses " 114 slopeB_ = vArgs[
"SlopeBottom"];
154 <<
" different wafer copy numbers";
156 for (std::unordered_set<int>::const_iterator itr=
copies_.begin();
161 edm::LogVerbatim(
"HGCalGeom") <<
"<<== End of DDHGCalEEAlgo construction...";
173 const double tol(0.01);
174 for (
unsigned int i=0;
i<
layers_.size();
i++) {
180 std::vector<double> pgonZ(2), pgonRin(2), pgonRout(2);
181 for (
int ly=laymin; ly<laymax; ++ly) {
192 << ii <<
" Front " << zi <<
", " << routF
193 <<
" Back " << zo <<
", " << rinB
194 <<
" superlayer thickness " 203 double rmax = routF*
cos(alpha) - tol;
204 pgonZ[0] =-hthick; pgonZ[1] = hthick;
205 pgonRin[0] = rinB; pgonRin[1] = rinB;
206 pgonRout[0] = rmax; pgonRout[1] = rmax;
209 pgonZ, pgonRin, pgonRout);
214 <<
" sectors covering " 215 << -alpha/CLHEP::deg <<
":" 216 << (-alpha+CLHEP::twopi)/CLHEP::deg
217 <<
" with " << pgonZ.size()
218 <<
" sections and filled with " 219 << matName <<
":" << &matter;
220 for (
unsigned int k=0;
k<pgonZ.size(); ++
k)
222 <<
" R " << pgonRin[
k] <<
":" 227 hthick, rinB, routF, 0.0,
232 <<
" Tubs made of " << matName <<
":" 233 << &matter <<
" of dimensions " << rinB
234 <<
", " << routF <<
", " << hthick
235 <<
", 0.0, " << CLHEP::twopi/CLHEP::deg
236 <<
" and position " << glog.
name()
237 <<
" number " <<
copy;
243 cpv.
position(glog, module, copy, r1, rot);
247 <<
" number " << copy <<
" positioned in " 248 << module.
name() <<
" at " << r1
255 if (
std::abs(thickTot-layerThick_[
i]) < 0.00001) {
256 }
else if (thickTot > layerThick_[i]) {
258 << layerThick_[
i] <<
" is smaller than " 259 << thickTot <<
": thickness of all its " 260 <<
"components **** ERROR ****";
261 }
else if (thickTot < layerThick_[i]) {
263 << layerThick_[
i] <<
" does not match with " 264 << thickTot <<
" of the components";
270 double rout,
double zpos,
int layertype,
272 static const double sqrt3 =
std::sqrt(3.0);
274 double R = 2.0*r/sqrt3;
276 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 " << N
282 <<
" for maximum u, v; r " << r <<
" R " 283 << R <<
" dy " <<
dy;
285 for (
int u = -N; u <=
N; ++u) {
287 for (
int v = -N;
v <=
N; ++
v) {
293 std::pair<int,int>
corner =
300 <<
" R " << rin <<
":" << rout
301 <<
"\n Z " << zpos <<
" LayerType " 302 << layertype <<
" u " << u <<
" v " << v
303 <<
" with " << corner.first <<
" corners";
306 if (corner.first > 0) {
308 int copy = type*1000000 + iv*100 + iu;
309 if (u < 0) copy += 10000;
310 if (v < 0) copy += 100000;
312 if (iu > ium) ium = iu;
313 if (iv > ivm) ivm = iv;
319 if (iu > iumAll) iumAll = iu;
320 if (iv > ivmAll) ivmAll = iv;
325 if (layertype > 1) type += 3;
332 <<
" number " << copy
333 <<
" positioned in " << glog.
ddname()
343 <<
":" << iumAll <<
" # of v " << ivm <<
":" 344 << ivmAll <<
" and " << nin <<
":" << kount
345 <<
":" << ntot <<
" wafers (" << ntype[0]
346 <<
":" << ntype[1] <<
":" << ntype[2] <<
":" 347 << ntype[3] <<
":" << ntype[4] <<
":" 348 << ntype[5] <<
") for " << glog.
ddname()
349 <<
" 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_
static uint32_t k_CornerSize
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)