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 " 102 slopeB_ = vArgs[
"SlopeBottom"];
109 <<
" slopes for top" ;
134 <<
" different wafer copy numbers";
136 for (std::unordered_set<int>::const_iterator itr=
copies_.begin();
141 edm::LogVerbatim(
"HGCalGeom") <<
"<<== End of DDHGCalEEAlgo construction...";
153 const double tol(0.01);
154 for (
unsigned int i=0;
i<
layers_.size();
i++) {
156 double routF =
rMax(zi);
160 std::vector<double> pgonZ(2), pgonRin(2), pgonRout(2);
161 for (
int ly=laymin; ly<laymax; ++ly) {
173 << ii <<
" Front " << zi <<
", " << routF
174 <<
" Back " << zo <<
", " << rinB
175 <<
" superlayer thickness " 184 double rmax = routF*
cos(alpha) - tol;
185 pgonZ[0] =-hthick; pgonZ[1] = hthick;
186 pgonRin[0] = rinB; pgonRin[1] = rinB;
187 pgonRout[0] = rmax; pgonRout[1] = rmax;
190 pgonZ, pgonRin, pgonRout);
195 <<
" sectors covering " 196 << -alpha/CLHEP::deg <<
":" 197 << (-alpha+CLHEP::twopi)/CLHEP::deg
198 <<
" with " << pgonZ.size()
199 <<
" sections and filled with " 200 << matName <<
":" << &matter;
201 for (
unsigned int k=0;
k<pgonZ.size(); ++
k)
203 <<
" R " << pgonRin[
k] <<
":" 208 hthick, rinB, routF, 0.0,
213 <<
" Tubs made of " << matName <<
":" 214 << &matter <<
" of dimensions " << rinB
215 <<
", " << routF <<
", " << hthick
216 <<
", 0.0, " << CLHEP::twopi/CLHEP::deg
217 <<
" and position " << glog.
name()
218 <<
" number " <<
copy;
224 cpv.
position(glog, module, copy, r1, rot);
228 <<
" number " << copy <<
" positioned in " 229 << module.
name() <<
" at " << r1
236 if (fabs(thickTot-layerThick_[
i]) < 0.00001) {
237 }
else if (thickTot > layerThick_[i]) {
239 << layerThick_[
i] <<
" is smaller than " 240 << thickTot <<
": thickness of all its " 241 <<
"components **** ERROR ****";
242 }
else if (thickTot < layerThick_[i]) {
244 << layerThick_[
i] <<
" does not match with " 245 << thickTot <<
" of the components";
255 for (
unsigned int k=0;
k<
slopeT_.size(); ++
k) {
270 double rout,
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;
279 int ium(0), ivm(0), iumAll(0), ivmAll(0), kount(0), ntot(0),
nin(0);
280 std::vector<int> ntype(6,0);
282 <<
" rout " << rout <<
" N " 283 << N <<
" for maximum u, v";
285 for (
int u = -N; u <=
N; ++u) {
287 for (
int v = -N;
v <=
N; ++
v) {
293 xc[0] = xpos+
r; yc[0] = ypos+0.5*
R;
294 xc[1] = xpos; yc[1] = ypos+
R;
295 xc[2] = xpos-
r; yc[2] = ypos+0.5*
R;
296 xc[3] = xpos-
r; yc[3] = ypos-0.5*
R;
297 xc[4] = xpos; yc[4] = ypos-
R;
298 xc[5] = xpos+
r; yc[5] = ypos-0.5*
R;
299 bool cornerOne(
false), cornerAll(
true);
300 for (
int k=0;
k<6; ++
k) {
302 if (rpos >= rin && rpos <= rout) cornerOne =
true;
303 else cornerAll =
false;
309 int copy = 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;
324 double rpos =
std::sqrt(xpos*xpos+ypos*ypos);
328 if (layertype > 1) type += 3;
335 <<
" number " << copy
336 <<
" positioned in " << glog.
ddname()
346 <<
":" << iumAll <<
" # of v " << ivm <<
":" 347 << ivmAll <<
" and " << nin <<
":" << kount
348 <<
":" << ntot <<
" wafers (" << ntype[0]
349 <<
":" << ntype[1] <<
":" << ntype[2] <<
":" 350 << ntype[3] <<
":" << ntype[4] <<
":" 351 << ntype[5] <<
") for " << glog.
ddname()
352 <<
" 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()
type of data representation of DDCompactView
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 ...
void positionSensitive(const DDLogicalPart &glog, double rin, double rout, int layertype, DDCompactView &cpv)
std::vector< int > layerType_
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
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 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_
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)