12 #include "CLHEP/Units/GlobalPhysicalConstants.h" 13 #include "CLHEP/Units/GlobalSystemOfUnits.h" 19 std::cout <<
"DDHGCalTBModule info: Creating an instance" << std::endl;
31 wafer_ = vsArgs[
"WaferName"];
34 std::cout <<
"DDHGCalTBModule: " <<
wafer_.size() <<
" wafers" << std::endl;
36 for (
auto wafer :
wafer_) {
37 std::cout <<
"Wafer[" << i <<
"] " << wafer << std::endl; ++
i;}
38 std::cout <<
"DDHGCalTBModule: " <<
covers_.size() <<
" covers" << std::endl;
41 std::cout <<
"Cover[" << i <<
"] " << cover << std::endl; ++
i;}
44 names_ = vsArgs[
"VolumeNames"];
45 thick_ = vArgs[
"Thickness"];
51 <<
" types of volumes" << std::endl;
52 for (
unsigned int i=0; i<
names_.size(); ++
i)
55 <<
" first copy number " <<
copyNumber_[i] << std::endl;
61 for (
unsigned int i=0; i<
layers_.size(); ++
i)
63 <<
" with " <<
layers_[i] <<
" layers" << std::endl;
72 <<
" sensitive class " <<
layerSense_[i] << std::endl;
95 for (
unsigned int i=0; i<
slopeT_.size(); ++
i)
112 std::cout <<
"==>> Constructing DDHGCalTBModule..." << std::endl;
117 std::cout <<
copies_.size() <<
" different wafer copy numbers" << std::endl;
121 std::cout <<
"<<== End of DDHGCalTBModule construction ..." << std::endl;
129 std::cout <<
"DDHGCalTBModule test: \t\tInside Layers" << std::endl;
133 for (
unsigned int i=0;
i<
layers_.size();
i++) {
135 double routF =
rMax(zi);
139 for (
int ly=laymin; ly<laymax; ++ly) {
148 std::cout <<
"DDHGCalTBModule test: Layer " << ly <<
":" << ii
149 <<
" Front " << zi <<
", " << routF <<
" Back " << zo <<
", " 150 << rinB <<
" superlayer thickness " << layerThick_[
i]
164 <<
":" << 0.5*
thick_[
ii] << std::endl;
168 0.5*
thick_[ii], rinB, routF, 0.0,
173 <<
" Tubs made of " << matName <<
" of dimensions " << rinB
174 <<
", " << routF <<
", " << 0.5*
thick_[
ii] <<
", 0.0, " 175 << CLHEP::twopi/CLHEP::deg << std::endl;
181 cpv.
position(glog, module, copy, r1, rot);
184 std::cout <<
"DDHGCalTBModule test: " << glog.
name() <<
" number " 185 << copy <<
" positioned in " << module.
name() <<
" at " << r1
186 <<
" with " << rot << std::endl;
192 if (fabs(thickTot-layerThick_[
i]) < 0.00001) {
193 }
else if (thickTot > layerThick_[i]) {
194 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " << layerThick_[
i]
195 <<
" is smaller than thickness " << thickTot
196 <<
" of all its components **** ERROR ****\n";
197 }
else if (thickTot < layerThick_[i]) {
199 << layerThick_[
i] <<
" does not match with " 200 << thickTot <<
" of the components\n";
210 for (
unsigned int k=0;
k<
slopeT_.size(); ++
k) {
218 std::cout <<
"rMax : " << z <<
":" << ik <<
":" << r << std::endl;
224 double rin,
double rout,
228 double dy = 3.0*dx*
tan(30.0*CLHEP::deg);
229 double rr = 2.0*dx*
tan(30.0*CLHEP::deg);
230 int ncol = (
int)(2.0*rout/ww) + 1;
231 int nrow = (
int)(rout/(ww*
tan(30.0*CLHEP::deg))) + 1;
232 int incm(0), inrm(0), kount(0);
236 <<
" Column " << ncol << std::endl;
238 for (
int nr=-nrow; nr <= nrow; ++nr) {
239 int inr = (nr >= 0) ? nr : -nr;
240 for (
int nc=-ncol; nc <=
ncol; ++nc) {
241 int inc = (nc >= 0) ? nc : -nc;
242 if (inr%2 == inc%2) {
245 xc[0] = xpos+
dx; yc[0] = ypos-0.5*
rr;
246 xc[1] = xpos+
dx; yc[1] = ypos+0.5*
rr;
247 xc[2] = xpos; yc[2] = ypos+
rr;
248 xc[3] = xpos-
dx; yc[3] = ypos+0.5*
rr;
249 xc[4] = xpos+
dx; yc[4] = ypos-0.5*
rr;
250 xc[5] = xpos; yc[5] = ypos-
rr;
251 bool cornerAll(
true);
252 for (
int k=0;
k<6; ++
k) {
254 if (rpos < rin || rpos > rout) cornerAll =
false;
257 double rpos =
std::sqrt(xpos*xpos+ypos*ypos);
260 int copy = inr*100 + inc;
261 if (nc < 0) copy += 10000;
262 if (nr < 0) copy += 100000;
273 if (inc > incm) incm = inc;
274 if (inr > inrm) inrm = inr;
276 if (
copies_.count(copy) == 0 && type == 1)
279 std::cout <<
"DDHGCalTBModule: " << name <<
" number " << copy
280 <<
" positioned in " << glog.
ddname() <<
" at " << tran
281 <<
" with " << rotation << std::endl;
288 std::cout <<
"DDHGCalTBModule: # of columns " << incm <<
" # of rows " 289 << inrm <<
" and " << kount <<
" wafers for " << glog.
ddname()
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
std::vector< std::string > names_
std::vector< std::string > wafer_
std::vector< double > layerThick_
DDMaterial is used to define and access material information.
~DDHGCalTBModule() override
void positionSensitive(DDLogicalPart &glog, int type, double rin, double rout, DDCompactView &cpv)
DDName is used to identify DDD entities uniquely.
static std::string & ns()
Compact representation of the geometrical detector hierarchy.
std::vector< double > rMaxFront_
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_
std::vector< int > layerType_
Tan< T >::type tan(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
std::vector< int > copyNumber_
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
std::vector< double > slopeT_
void constructLayers(const DDLogicalPart &, DDCompactView &cpv)
std::vector< int > layers_
void execute(DDCompactView &cpv) override
std::vector< std::string > covers_
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 > slopeB_
std::vector< double > thick_
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::vector< std::string > materials_
std::unordered_set< int > copies_