10 #include "CLHEP/Units/GlobalSystemOfUnits.h" 13 LogDebug(
"EcalGeom") <<
"DDEcalPreshowerAlgo info: Creating an instance" ;
22 LogDebug(
"EcalGeom") <<
"DDEcalPreshowerAlgo info: Initialize" ;
82 LogDebug(
"EcalGeom") <<
"******** DDEcalPreshowerAlgo execute!";
95 double zpos = -
thickness_/2., sdx(0), sdy(0), bdx(0),bdy(0);;
101 double rIn(0), rOut(0), zHalf(0);
121 if (I==2 || I==28 || I==13 || I==23) {
133 if (I==10 || I==20) {
136 double outalbx, outalby, shiftR, outalbx2, outalby2, shiftR2;
140 int cutabsx=-1, cutabsy=-1;
149 std::ostringstream tmp_Alname_fin;
150 tmp_Alname_fin <<
getLayName(
i) <<
"LtmpAl" << absz-1;
151 DDName dd_Alname_fin(tmp_Alname_fin.str(),
"esalgo");
192 for (
int L=0;
L<absz; ++
L) {
194 std::ostringstream tmp_name_b, tmp_name_b2, tmp_FAl_name_c, tmp_FAl_name_d1, tmp_FAl_name_d2, tmp_FAl_name_d3, tmp_FAl_name_d;
199 if(
L>0) tmp_FAl_name_c <<
getLayName(
i) <<
"LtmpAl" << K-1;
201 tmp_FAl_name_d1 <<
getLayName(
i) <<
"LtmpAl" << K <<
"_1";
202 tmp_FAl_name_d2 <<
getLayName(
i) <<
"LtmpAl" << K <<
"_2";
203 tmp_FAl_name_d3 <<
getLayName(
i) <<
"LtmpAl" << K <<
"_3";
206 DDName dd_tmp_name_b(tmp_name_b.str(),
"esalgo");
207 DDName dd_tmp_name_b2(tmp_name_b2.str(),
"esalgo");
208 DDName dd_FAl_name_c(tmp_FAl_name_c.str(),
"esalgo");
209 DDName dd_FAl_name_d1(tmp_FAl_name_d1.str(),
"esalgo");
210 DDName dd_FAl_name_d2(tmp_FAl_name_d2.str(),
"esalgo");
211 DDName dd_FAl_name_d3(tmp_FAl_name_d3.str(),
"esalgo");
212 DDName dd_FAl_name_d(tmp_FAl_name_d.str(),
"esalgo");
217 if(
abs1stx[K] < rIn+30*cm) { bdy=
abs1sty[K]/2 - 30*cm; cutabsx = K;}
223 if((
abs2ndx[K] < rIn+30*cm) && I==20) { bdy=
abs2ndy[K]/2 - 30*cm; cutabsy = K;}
228 sdx =
abs1stx[K]-bdx ; sdy = 0;
231 if(I==20) {sdx =
abs2ndx[K]-bdx ; sdy = 0;}
242 if(((
abs1stx[K] < rIn+30*cm) && I==10) || ((
abs2ndx[K] < rIn+30*cm) && I==20) ) {
254 if(I==20) bdx =
abs2ndx[cutabsy];
284 double xpos(0), ypos(0), zpos(0), sdx(0), sdy(0), sdz(0);
285 double prev_length_(0), ladder_new_length_(0), ladd_shift_(0),
ladder_length (0);
286 int enb(0), swed_scopy_glob(0);
double sdxe[50] = {0}, sdye[50] = {0}, sdze[50] = {0};
287 double sdxe2[50] = {0}, sdye2[50] = {0}, sdze2[50] = {0}, sdxe3[50] = {0}, sdye3[50] = {0}, sdze3[50] = {0};
290 int scopy(0);
double boxax(0), boxay(0), boxaz(0);
291 int ladd_not_plain(0), ladd_subtr_no(0), ladd_upper(0), ladd_side(0);
362 for (
int i=0;
i<=1;
i++) {
363 for (
int j=0; j<=3; j++) {
365 ladd_not_plain=1; ladd_subtr_no++;
if(j>1) ladd_upper=1; ladd_side=
i;
376 std::ostringstream tmp_name_5b, tmp_name_5c, tmp_name_5d;
383 std::ostringstream tmp_name_5b, tmp_name_5c, tmp_name_5d;
386 DDName dd_tmp_name_5b(tmp_name_5b.str(),
"esalgo");
388 DDName dd_tmp_name_5c(tmp_name_5c.str(),
"esalgo");
390 DDName dd_tmp_name_5d(tmp_name_5d.str(),
"esalgo");
449 for (
int i=0;
i<=1;
i++) {
450 for (
int j=0; j<=3; j++) {
452 ladd_not_plain=1; ladd_subtr_no++;
if(j>1) ladd_upper=1; ladd_side=
i;
461 std::ostringstream tmp_name_b, tmp_name_c, tmp_name_d;
467 DDName dd_tmp_name_b(tmp_name_b.str(),
"esalgo");
469 DDName dd_tmp_name_c(tmp_name_c.str(),
"esalgo");
471 DDName dd_tmp_name_d(tmp_name_d.str(),
"esalgo");
481 sdye2[enb] = boxay/2 + LdrBck_Length/2;
492 if(ladd_subtr_no>1) {
497 DDName dd_tmp_name_b(tmp_name_b.str(),
"esalgo");
499 DDName dd_tmp_name_c(tmp_name_c.str(),
"esalgo");
501 DDName dd_tmp_name_d(tmp_name_d.str(),
"esalgo");
525 DDName dd_tmp_name_b(tmp_name_b.str(),
"esalgo");
527 DDName dd_tmp_name_c(tmp_name_c.str(),
"esalgo");
529 DDName dd_tmp_name_d(tmp_name_d.str(),
"esalgo");
583 for (
int i=0;
i<=1;
i++) {
584 for (
int j=0; j<=4; j++) {
604 for (
int i=0;
i<=1;
i++) {
605 for (
int j=0; j<=3; j++) {
625 int icopy[100] = {0};
627 for(
int I=-9;
I<=9;++
I) {
646 for(
int t=0;
t<
int(types_l5_.size());
t++)
if(type == types_l5_[
t]) {j =
t;
if(
I<0 &&
asym_ladd_[t] == 1 ) {j = j + 1; type = types_l5_[j];}}
656 prev_length_ += ladd_shift_;
671 for(
int t=0;t<
int(types_l5_.size());t++)
if(type == types_l5_[t]) {j =
t;
if(
asym_ladd_[t] == 2 && !changed) { j = j - 1; changed = 1;}
if(
asym_ladd_[t] == 1 && !changed) { j = j + 1; changed = 1;} type = types_l5_[j];}
672 for(
int t=0;t<
int(
types_l4_.size());t++)
if(type ==
types_l4_[t]) {j = t+types_l5_.size();
if(
asym_ladd_[(t+types_l5_.size())] == 2 && !changed) { j = j - 1; changed = 1;}
if(
asym_ladd_[(t+types_l5_.size())] == 1 && !changed) { j = j + 1; changed = 1;} type =
types_l4_[j-types_l5_.size()]; }
694 double xpos(0), ypos(0);
695 for(
size_t i = 0;
i<32; ++
i)
std::vector< double > startOfFirstLadd_
std::vector< std::string > types_l4_
std::vector< std::string > typeOfLaddRow2
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
std::string getLayName(unsigned int i) const
double micromodule_length
std::vector< double > abs1stx
Sin< T >::type sin(const T &t)
DDName is used to identify DDD entities uniquely.
std::vector< double > rmaxVec
double zwedge_ceramic_diff
std::vector< double > ladd_l4_map_
void doLayers(DDCompactView &pos)
Compact representation of the geometrical detector hierarchy.
double absAlX_subtr1_Yshift_
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
std::vector< double > asym_ladd_
std::vector< std::string > typeOfLaddRow1
Cos< T >::type cos(const T &t)
double ywedge_ceramic_diff
Abs< T >::type abs(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
const std::complex< double > I
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
void doLadders(DDCompactView &pos)
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
void doSens(DDCompactView &pos)
std::string LaddMaterial_
DDMaterial getMaterial(unsigned int i) const
std::vector< double > abs1sty
std::vector< std::string > typeOfLaddRow3
static DDSolid subtraction(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
std::vector< double > thickLayers_
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 > rminVec
void execute(DDCompactView &pos) override
std::vector< std::string > materials_
std::string getLadPrefix(unsigned int i) const
std::vector< double > ladd_l5_map_
double absAlX_subtr1_Xshift_
DDMaterial getLaddMaterial() const
std::vector< std::string > typeOfLaddRow0
static DDSolid unionSolid(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
std::vector< double > abs2ndx
std::vector< double > noLaddInCol_
std::vector< std::string > ladPfx_
std::vector< double > abs2ndy
std::vector< std::string > types_l5_
std::vector< std::string > layName_
double absAlY_subtr1_Yshift_
double absAlY_subtr1_Xshift_