CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
DDHGCalEEAlgo Class Reference
Inheritance diagram for DDHGCalEEAlgo:

Public Member Functions

 DDHGCalEEAlgo ()
 
void execute (DDCompactView &cpv) override
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 
 ~DDHGCalEEAlgo () override
 

Protected Member Functions

void constructLayers (const DDLogicalPart &, DDCompactView &cpv)
 
void positionSensitive (const DDLogicalPart &glog, double rin, double rout, double zpos, int layertype, int layercenter, DDCompactView &cpv)
 

Private Attributes

int absorbMode_
 
double alpha_
 
int choiceType_
 
std::unordered_set< int > copies_
 
std::vector< int > copyNumber_
 
double cosAlpha_
 
int firstLayer_
 
double fracAreaMin_
 
HGCalGeomTools geomTools_
 
std::vector< int > layerCenter_
 
std::vector< int > layers_
 
std::vector< int > layerSense_
 
std::vector< double > layerThick_
 
std::vector< int > layerType_
 
std::vector< std::string > materials_
 
std::vector< std::string > names_
 
std::string nameSpace_
 
int nCutRadPar_
 
std::vector< double > rad100to200_
 
std::vector< double > rad200to300_
 
std::vector< double > rMaxFront_
 
std::vector< double > rMinFront_
 
int sectors_
 
int sensitiveMode_
 
std::vector< double > slopeB_
 
std::vector< double > slopeT_
 
std::vector< double > thick_
 
std::vector< std::string > wafers_
 
double waferSepar_
 
double waferSize_
 
std::unique_ptr< HGCalWaferTypewaferType_
 
std::vector< double > zFrontB_
 
std::vector< double > zFrontT_
 
double zMinBlock_
 
double zMinRadPar_
 

Static Private Attributes

static constexpr double tol1_ = 0.01
 
static constexpr double tol2_ = 0.00001
 

Detailed Description

Definition at line 32 of file DDHGCalEEAlgo.cc.

Constructor & Destructor Documentation

◆ DDHGCalEEAlgo()

DDHGCalEEAlgo::DDHGCalEEAlgo ( )

Definition at line 96 of file DDHGCalEEAlgo.cc.

96  {
97 #ifdef EDM_ML_DEBUG
98  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: Creating an instance";
99 #endif
100 }
Log< level::Info, true > LogVerbatim

◆ ~DDHGCalEEAlgo()

DDHGCalEEAlgo::~DDHGCalEEAlgo ( )
override

Definition at line 102 of file DDHGCalEEAlgo.cc.

102 {}

Member Function Documentation

◆ constructLayers()

void DDHGCalEEAlgo::constructLayers ( const DDLogicalPart module,
DDCompactView cpv 
)
protected

Definition at line 233 of file DDHGCalEEAlgo.cc.

References funct::abs(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, DDBase< N, C >::ddname(), DDSplit(), dqmdumpme::first, mps_fire::i, cuy::ii, l1ctLayer1_patternWriters_cff::isec, dqmdumpme::k, Skims_PA_cff::name, DDBase< N, C >::name(), DDSolidFactory::polyhedra(), DDCompactView::position(), HGCalGeomTools::radius(), makeMuonMisalignmentScenario::rot, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, to_string(), DDSolidFactory::tubs(), and geometryCSVtoXML::zz.

233  {
234 #ifdef EDM_ML_DEBUG
235  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: \t\tInside Layers";
236 #endif
237  double zi(zMinBlock_);
238  int laymin(0);
239  for (unsigned int i = 0; i < layers_.size(); i++) {
240  double zo = zi + layerThick_[i];
241  double routF = HGCalGeomTools::radius(zi, zFrontT_, rMaxFront_, slopeT_);
242  int laymax = laymin + layers_[i];
243  double zz = zi;
244  double thickTot(0);
245  for (int ly = laymin; ly < laymax; ++ly) {
246  int ii = layerType_[ly];
247  int copy = copyNumber_[ii];
248  double hthick = 0.5 * thick_[ii];
249  double rinB = HGCalGeomTools::radius(zo - tol1_, zFrontB_, rMinFront_, slopeB_);
250  zz += hthick;
251  thickTot += thick_[ii];
252 
254 #ifdef EDM_ML_DEBUG
255  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: Layer " << ly << ":" << ii << " Front " << zi << ", " << routF
256  << " Back " << zo << ", " << rinB << " superlayer thickness " << layerThick_[i];
257 #endif
259  DDMaterial matter(matName);
260  DDLogicalPart glog;
261  if (layerSense_[ly] < 1) {
262  std::vector<double> pgonZ, pgonRin, pgonRout;
263  if (layerSense_[ly] == 0 || absorbMode_ == 0) {
264  double rmax = routF * cosAlpha_ - tol1_;
265  pgonZ.emplace_back(-hthick);
266  pgonZ.emplace_back(hthick);
267  pgonRin.emplace_back(rinB);
268  pgonRin.emplace_back(rinB);
269  pgonRout.emplace_back(rmax);
270  pgonRout.emplace_back(rmax);
271  } else {
272  HGCalGeomTools::radius(zz - hthick,
273  zz + hthick,
274  zFrontB_,
275  rMinFront_,
276  slopeB_,
277  zFrontT_,
278  rMaxFront_,
279  slopeT_,
280  -layerSense_[ly],
281  pgonZ,
282  pgonRin,
283  pgonRout);
284 #ifdef EDM_ML_DEBUG
285  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: z " << (zz - hthick) << ":" << (zz + hthick) << " with "
286  << pgonZ.size() << " palnes";
287  for (unsigned int isec = 0; isec < pgonZ.size(); ++isec)
288  edm::LogVerbatim("HGCalGeom")
289  << "[" << isec << "] z " << pgonZ[isec] << " R " << pgonRin[isec] << ":" << pgonRout[isec];
290 #endif
291  for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
292  pgonZ[isec] -= zz;
293  pgonRout[isec] = pgonRout[isec] * cosAlpha_ - tol1_;
294  }
295  }
296  DDSolid solid =
297  DDSolidFactory::polyhedra(DDName(name, nameSpace_), sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
298  glog = DDLogicalPart(solid.ddname(), matter, solid);
299 #ifdef EDM_ML_DEBUG
300  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << solid.name() << " polyhedra of " << sectors_
301  << " sectors covering " << convertRadToDeg(-alpha_) << ":"
302  << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size()
303  << " sections and filled with " << matName << ":" << &matter;
304  for (unsigned int k = 0; k < pgonZ.size(); ++k)
305  edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k];
306 #endif
307  } else {
308  double rins =
310  double routs =
311  (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
312  DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rins, routs, 0.0, 2._pi);
313  glog = DDLogicalPart(solid.ddname(), matter, solid);
314 #ifdef EDM_ML_DEBUG
315  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matName << ":"
316  << &matter << " of dimensions " << rinB << ":" << rins << ", " << routF << ":"
317  << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name()
318  << " number " << copy << ":" << layerCenter_[copy - firstLayer_];
319 #endif
320  positionSensitive(glog, rins, routs, zz, layerSense_[ly], layerCenter_[copy - firstLayer_], cpv);
321  }
322  DDTranslation r1(0, 0, zz);
323  DDRotation rot;
324  cpv.position(glog, module, copy, r1, rot);
325  ++copyNumber_[ii];
326 #ifdef EDM_ML_DEBUG
327  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << glog.name() << " number " << copy << " positioned in "
328  << module.name() << " at " << r1 << " with no rotation";
329 #endif
330  zz += hthick;
331  } // End of loop over layers in a block
332  zi = zo;
333  laymin = laymax;
334  if (std::abs(thickTot - layerThick_[i]) >= tol2_) {
335  if (thickTot > layerThick_[i]) {
336  edm::LogError("HGCalGeom") << "Thickness of the partition " << layerThick_[i] << " is smaller than " << thickTot
337  << ": thickness of all its components **** ERROR ****";
338  } else {
339  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << layerThick_[i] << " does not match with "
340  << thickTot << " of the components";
341  }
342  }
343  } // End of loop over blocks
344 }
Log< level::Info, true > LogVerbatim
std::vector< double > slopeB_
static void radius(double zf, double zb, std::vector< double > const &zFront1, std::vector< double > const &rFront1, std::vector< double > const &slope1, std::vector< double > const &zFront2, std::vector< double > const &rFront2, std::vector< double > const &slope2, int flag, std::vector< double > &zz, std::vector< double > &rin, std::vector< double > &rout)
std::vector< double > zFrontT_
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
std::vector< double > thick_
std::vector< double > layerThick_
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
std::vector< int > copyNumber_
std::vector< double > zFrontB_
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
std::string nameSpace_
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::vector< int > layerCenter_
Log< level::Error, false > LogError
std::vector< double > slopeT_
std::vector< int > layerSense_
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
static std::string to_string(const XMLCh *ch)
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
static constexpr double tol1_
U second(std::pair< T, U > const &p)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
std::vector< int > layerType_
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:667
ii
Definition: cuy.py:589
static constexpr double tol2_
const N & name() const
Definition: DDBase.h:59
std::vector< int > layers_
std::vector< std::string > names_
const N & ddname() const
Definition: DDBase.h:61
std::vector< double > rMinFront_
void positionSensitive(const DDLogicalPart &glog, double rin, double rout, double zpos, int layertype, int layercenter, DDCompactView &cpv)
std::vector< std::string > materials_
Log< level::Warning, false > LogWarning
std::vector< double > rMaxFront_
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
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)
Definition: DDSolid.cc:565

◆ execute()

void DDHGCalEEAlgo::execute ( DDCompactView cpv)
override

Definition at line 216 of file DDHGCalEEAlgo.cc.

References DDHGCalGeom::constructLayers(), dqmdumpme::k, and class-composition::parent.

216  {
217 #ifdef EDM_ML_DEBUG
218  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalEEAlgo...";
219  copies_.clear();
220 #endif
221  constructLayers(parent(), cpv);
222 #ifdef EDM_ML_DEBUG
223  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << copies_.size() << " different wafer copy numbers";
224  int k(0);
225  for (std::unordered_set<int>::const_iterator itr = copies_.begin(); itr != copies_.end(); ++itr, ++k) {
226  edm::LogVerbatim("HGCalGeom") << "Copy [" << k << "] : " << (*itr);
227  }
228  copies_.clear();
229  edm::LogVerbatim("HGCalGeom") << "<<== End of DDHGCalEEAlgo construction...";
230 #endif
231 }
Log< level::Info, true > LogVerbatim
std::unordered_set< int > copies_
void constructLayers(const DDLogicalPart &, DDCompactView &cpv)

◆ initialize()

void DDHGCalEEAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 104 of file DDHGCalEEAlgo.cc.

References angle_units::operators::convertRadToDeg(), funct::cos(), dbl_to_int(), mps_fire::i, cuy::ii, createfilelist::int, dqmdumpme::k, and DDCurrentNamespace::ns().

108  {
109  wafers_ = vsArgs["WaferNames"];
110 #ifdef EDM_ML_DEBUG
111  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << wafers_.size() << " wafers";
112  for (unsigned int i = 0; i < wafers_.size(); ++i)
113  edm::LogVerbatim("HGCalGeom") << "Wafer[" << i << "] " << wafers_[i];
114 #endif
115  materials_ = vsArgs["MaterialNames"];
116  names_ = vsArgs["VolumeNames"];
117  thick_ = vArgs["Thickness"];
118  copyNumber_.resize(materials_.size(), 1);
119 #ifdef EDM_ML_DEBUG
120  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << materials_.size() << " types of volumes";
121  for (unsigned int i = 0; i < names_.size(); ++i)
122  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness " << thick_[i]
123  << " filled with " << materials_[i] << " first copy number " << copyNumber_[i];
124 #endif
125  layers_ = dbl_to_int(vArgs["Layers"]);
126  layerThick_ = vArgs["LayerThick"];
127 #ifdef EDM_ML_DEBUG
128  edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks";
129  for (unsigned int i = 0; i < layers_.size(); ++i)
130  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << layerThick_[i] << " with " << layers_[i]
131  << " layers";
132 #endif
133  layerType_ = dbl_to_int(vArgs["LayerType"]);
134  layerSense_ = dbl_to_int(vArgs["LayerSense"]);
135  firstLayer_ = (int)(nArgs["FirstLayer"]);
136  absorbMode_ = (int)(nArgs["AbsorberMode"]);
137  sensitiveMode_ = (int)(nArgs["SensitiveMode"]);
138 #ifdef EDM_ML_DEBUG
139  edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and "
140  << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_;
141 #endif
142  layerCenter_ = dbl_to_int(vArgs["LayerCenter"]);
143 #ifdef EDM_ML_DEBUG
144  for (unsigned int i = 0; i < layerCenter_.size(); ++i)
145  edm::LogVerbatim("HGCalGeom") << "LayerCenter [" << i << "] " << layerCenter_[i];
146 #endif
147  if (firstLayer_ > 0) {
148  for (unsigned int i = 0; i < layerType_.size(); ++i) {
149  if (layerSense_[i] > 0) {
150  int ii = layerType_[i];
152 #ifdef EDM_ML_DEBUG
153  edm::LogVerbatim("HGCalGeom") << "First copy number for layer type " << i << ":" << ii << " with "
154  << materials_[ii] << " changed to " << copyNumber_[ii];
155 #endif
156  break;
157  }
158  }
159  } else {
160  firstLayer_ = 1;
161  }
162 #ifdef EDM_ML_DEBUG
163  edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " layers";
164  for (unsigned int i = 0; i < layerType_.size(); ++i)
165  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type " << layerType_[i] << " sensitive class "
166  << layerSense_[i];
167 #endif
168  zMinBlock_ = nArgs["zMinBlock"];
169  rad100to200_ = vArgs["rad100to200"];
170  rad200to300_ = vArgs["rad200to300"];
171  zMinRadPar_ = nArgs["zMinForRadPar"];
172  choiceType_ = (int)(nArgs["choiceType"]);
173  nCutRadPar_ = (int)(nArgs["nCornerCut"]);
174  fracAreaMin_ = nArgs["fracAreaMin"];
175  waferSize_ = nArgs["waferSize"];
176  waferSepar_ = nArgs["SensorSeparation"];
177  sectors_ = (int)(nArgs["Sectors"]);
178  alpha_ = (1._pi) / sectors_;
179  cosAlpha_ = cos(alpha_);
180 #ifdef EDM_ML_DEBUG
181  edm::LogVerbatim("HGCalGeom") << "zStart " << zMinBlock_ << " radius for wafer type separation uses "
182  << rad100to200_.size() << " parameters; zmin " << zMinRadPar_ << " cutoff "
183  << choiceType_ << ":" << nCutRadPar_ << ":" << fracAreaMin_ << " wafer width "
184  << waferSize_ << " separations " << waferSepar_ << " sectors " << sectors_ << ":"
185  << convertRadToDeg(alpha_) << ":" << cosAlpha_;
186  for (unsigned int k = 0; k < rad100to200_.size(); ++k)
187  edm::LogVerbatim("HGCalGeom") << "[" << k << "] 100-200 " << rad100to200_[k] << " 200-300 " << rad200to300_[k];
188 #endif
189  slopeB_ = vArgs["SlopeBottom"];
190  zFrontB_ = vArgs["ZFrontBottom"];
191  rMinFront_ = vArgs["RMinFront"];
192  slopeT_ = vArgs["SlopeTop"];
193  zFrontT_ = vArgs["ZFrontTop"];
194  rMaxFront_ = vArgs["RMaxFront"];
195 #ifdef EDM_ML_DEBUG
196  for (unsigned int i = 0; i < slopeB_.size(); ++i)
197  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << zFrontB_[i] << " Rmin " << rMinFront_[i]
198  << " Slope " << slopeB_[i];
199  for (unsigned int i = 0; i < slopeT_.size(); ++i)
200  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << zFrontT_[i] << " Rmax " << rMaxFront_[i]
201  << " Slope " << slopeT_[i];
202 #endif
204 #ifdef EDM_ML_DEBUG
205  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: NameSpace " << nameSpace_;
206 #endif
207 
208  waferType_ = std::make_unique<HGCalWaferType>(
210 }
Log< level::Info, true > LogVerbatim
std::vector< double > slopeB_
std::vector< double > zFrontT_
std::vector< double > thick_
std::vector< double > layerThick_
double fracAreaMin_
std::vector< int > copyNumber_
std::vector< double > zFrontB_
std::vector< std::string > wafers_
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
std::string nameSpace_
std::vector< int > layerCenter_
double waferSepar_
static std::string & ns()
std::vector< double > slopeT_
std::vector< int > layerSense_
double zMinRadPar_
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< int > layerType_
std::vector< double > rad100to200_
ii
Definition: cuy.py:589
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
std::unique_ptr< HGCalWaferType > waferType_
std::vector< int > layers_
std::vector< std::string > names_
std::vector< double > rMinFront_
std::vector< std::string > materials_
std::vector< double > rMaxFront_
std::vector< double > rad200to300_

◆ positionSensitive()

void DDHGCalEEAlgo::positionSensitive ( const DDLogicalPart glog,
double  rin,
double  rout,
double  zpos,
int  layertype,
int  layercenter,
DDCompactView cpv 
)
protected

Definition at line 346 of file DDHGCalEEAlgo.cc.

References funct::abs(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, TCMET_cfi::corner, DDBase< N, C >::ddname(), DDSplit(), PVValHelper::dy, dqmdumpme::first, createfilelist::int, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, HGCalParameters::k_CornerSize, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, N, Skims_PA_cff::name, EgHLTOffHistBins_cfi::nr, ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::ntot, HGCalTypes::packTypeUV(), DDCompactView::position(), dttmaxenums::R, idealTransformation::rotation, edm::second(), mathSSE::sqrt(), findQualityFiles::v, HGCalGeomTools::waferCorner(), HGCalTypes::WaferFull, and HGCalTypes::WaferOrient0.

352  {
353  static const double sqrt3 = std::sqrt(3.0);
354 #ifdef EDM_ML_DEBUG
355  std::vector<double> zl = {10000., 10494., 10536., 10578., 10619., 10661., 10702., 10791., 10879.};
356  auto il = std::lower_bound(zl.begin(), zl.end(), zpos);
357  int layer = static_cast<int>(il - zl.begin());
358 #endif
359  double r = 0.5 * (waferSize_ + waferSepar_);
360  double R = 2.0 * r / sqrt3;
361  double dy = 0.75 * R;
362  int N = (int)(0.5 * rout / r) + 2;
363  const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_));
364 #ifdef EDM_ML_DEBUG
365  int ium(0), ivm(0), iumAll(0), ivmAll(0), kount(0), ntot(0), nin(0);
366  std::vector<int> ntype(6, 0);
367  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << glog.ddname() << " rin:rout " << rin << ":" << rout << " zpos "
368  << zpos << " N " << N << " for maximum u, v; r " << r << " R " << R << " dy " << dy
369  << " Shift " << xyoff.first << ":" << xyoff.second << " WaferSize "
370  << (waferSize_ + waferSepar_);
371 #endif
372  for (int u = -N; u <= N; ++u) {
373  for (int v = -N; v <= N; ++v) {
374  int nr = 2 * v;
375  int nc = -2 * u + v;
376  double xpos = xyoff.first + nc * r;
377  double ypos = xyoff.second + nr * dy;
378  const auto& corner = HGCalGeomTools::waferCorner(xpos, ypos, r, R, rin, rout, false);
379 #ifdef EDM_ML_DEBUG
380  int iu = std::abs(u);
381  int iv = std::abs(v);
382  ++ntot;
383  if (((corner.first <= 0) && std::abs(u) < 5 && std::abs(v) < 5) || (std::abs(u) < 2 && std::abs(v) < 2)) {
384  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << glog.ddname() << " R " << rin << ":" << rout << "\n Z "
385  << zpos << " LayerType " << layertype << " u " << u << " v " << v << " with "
386  << corner.first << " corners";
387  }
388 #endif
389  if (corner.first > 0) {
390  int type = waferType_->getType(xpos, ypos, zpos);
391  int copy = HGCalTypes::packTypeUV(type, u, v);
392  if (layertype > 1)
393  type += 3;
394 #ifdef EDM_ML_DEBUG
395  if (iu > ium)
396  ium = iu;
397  if (iv > ivm)
398  ivm = iv;
399  kount++;
400  if (copies_.count(copy) == 0)
401  copies_.insert(copy);
402 #endif
403  if (corner.first == (int)(HGCalParameters::k_CornerSize)) {
404 #ifdef EDM_ML_DEBUG
405  if (iu > iumAll)
406  iumAll = iu;
407  if (iv > ivmAll)
408  ivmAll = iv;
409  ++nin;
410 #endif
411  DDTranslation tran(xpos, ypos, 0.0);
414  cpv.position(name, glog.ddname(), copy, tran, rotation);
415 #ifdef EDM_ML_DEBUG
416  static const std::vector<std::string> thickstr = {"h120", "l200", "l300", "h200"};
417  char posit[20];
418  sprintf(posit, "%8.3f %8.3f", xpos, ypos);
419  double phi = convertRadToDeg(std::atan2(ypos, -xpos));
420  if (phi < 0)
421  phi += 360.0;
422  int cass = (layer < 7) ? static_cast<int>(phi / 60.0) : static_cast<int>(phi / 30.0);
423  edm::LogVerbatim("HGCalGeomX") << std::setw(2) << layer << " " << std::setw(2) << HGCalTypes::WaferFull << " "
424  << thickstr[type] << " " << posit << " " << std::setw(2)
425  << HGCalTypes::WaferOrient0 << " " << std::setw(2) << u << " " << std::setw(2)
426  << v << std::setw(2) << cass;
427  edm::LogVerbatim("HGCalGeom") << " DDEHGCalEEAlgo " << name << " Number " << copy << " u|v " << u << ":" << v
428  << " Poaition " << xpos << ":" << ypos << ":" << zpos << " Angle "
429  << convertRadToDeg(std::atan2(ypos, -xpos));
430  ++ntype[type];
431  edm::LogVerbatim("HGCalGeom") << " DDHGCalEEAlgo: " << name << " number " << copy << " positioned in "
432  << glog.ddname() << " at " << tran << " with no rotation";
433 #endif
434  }
435  }
436  }
437  }
438 #ifdef EDM_ML_DEBUG
439  edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: Maximum # of u " << ium << ":" << iumAll << " # of v " << ivm << ":"
440  << ivmAll << " and " << nin << ":" << kount << ":" << ntot << " wafers (" << ntype[0]
441  << ":" << ntype[1] << ":" << ntype[2] << ":" << ntype[3] << ":" << ntype[4] << ":"
442  << ntype[5] << ") for " << glog.ddname() << " R " << rin << ":" << rout;
443 #endif
444 }
Log< level::Info, true > LogVerbatim
std::unordered_set< int > copies_
HGCalGeomTools geomTools_
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
std::vector< std::string > wafers_
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
double waferSepar_
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
static constexpr uint32_t k_CornerSize
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
static std::pair< int32_t, int32_t > waferCorner(double xpos, double ypos, double r, double R, double rMin, double rMax, bool oldBug=false)
T sqrt(T t)
Definition: SSEVec.h:23
static constexpr int32_t WaferOrient0
Definition: HGCalTypes.h:63
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::unique_ptr< HGCalWaferType > waferType_
#define N
Definition: blowfish.cc:9
const N & ddname() const
Definition: DDBase.h:61
static int32_t packTypeUV(int type, int u, int v)
Definition: HGCalTypes.cc:3
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7

Member Data Documentation

◆ absorbMode_

int DDHGCalEEAlgo::absorbMode_
private

Definition at line 73 of file DDHGCalEEAlgo.cc.

◆ alpha_

double DDHGCalEEAlgo::alpha_
private

Definition at line 93 of file DDHGCalEEAlgo.cc.

◆ choiceType_

int DDHGCalEEAlgo::choiceType_
private

Definition at line 79 of file DDHGCalEEAlgo.cc.

◆ copies_

std::unordered_set<int> DDHGCalEEAlgo::copies_
private

Definition at line 92 of file DDHGCalEEAlgo.cc.

◆ copyNumber_

std::vector<int> DDHGCalEEAlgo::copyNumber_
private

Definition at line 66 of file DDHGCalEEAlgo.cc.

◆ cosAlpha_

double DDHGCalEEAlgo::cosAlpha_
private

Definition at line 93 of file DDHGCalEEAlgo.cc.

◆ firstLayer_

int DDHGCalEEAlgo::firstLayer_
private

Definition at line 72 of file DDHGCalEEAlgo.cc.

◆ fracAreaMin_

double DDHGCalEEAlgo::fracAreaMin_
private

Definition at line 81 of file DDHGCalEEAlgo.cc.

◆ geomTools_

HGCalGeomTools DDHGCalEEAlgo::geomTools_
private

Definition at line 56 of file DDHGCalEEAlgo.cc.

◆ layerCenter_

std::vector<int> DDHGCalEEAlgo::layerCenter_
private

Definition at line 71 of file DDHGCalEEAlgo.cc.

◆ layers_

std::vector<int> DDHGCalEEAlgo::layers_
private

Definition at line 67 of file DDHGCalEEAlgo.cc.

◆ layerSense_

std::vector<int> DDHGCalEEAlgo::layerSense_
private

Definition at line 70 of file DDHGCalEEAlgo.cc.

◆ layerThick_

std::vector<double> DDHGCalEEAlgo::layerThick_
private

Definition at line 68 of file DDHGCalEEAlgo.cc.

◆ layerType_

std::vector<int> DDHGCalEEAlgo::layerType_
private

Definition at line 69 of file DDHGCalEEAlgo.cc.

◆ materials_

std::vector<std::string> DDHGCalEEAlgo::materials_
private

Definition at line 63 of file DDHGCalEEAlgo.cc.

◆ names_

std::vector<std::string> DDHGCalEEAlgo::names_
private

Definition at line 64 of file DDHGCalEEAlgo.cc.

◆ nameSpace_

std::string DDHGCalEEAlgo::nameSpace_
private

Definition at line 91 of file DDHGCalEEAlgo.cc.

◆ nCutRadPar_

int DDHGCalEEAlgo::nCutRadPar_
private

Definition at line 80 of file DDHGCalEEAlgo.cc.

◆ rad100to200_

std::vector<double> DDHGCalEEAlgo::rad100to200_
private

Definition at line 76 of file DDHGCalEEAlgo.cc.

◆ rad200to300_

std::vector<double> DDHGCalEEAlgo::rad200to300_
private

Definition at line 77 of file DDHGCalEEAlgo.cc.

◆ rMaxFront_

std::vector<double> DDHGCalEEAlgo::rMaxFront_
private

Definition at line 90 of file DDHGCalEEAlgo.cc.

◆ rMinFront_

std::vector<double> DDHGCalEEAlgo::rMinFront_
private

Definition at line 87 of file DDHGCalEEAlgo.cc.

◆ sectors_

int DDHGCalEEAlgo::sectors_
private

Definition at line 84 of file DDHGCalEEAlgo.cc.

◆ sensitiveMode_

int DDHGCalEEAlgo::sensitiveMode_
private

Definition at line 74 of file DDHGCalEEAlgo.cc.

◆ slopeB_

std::vector<double> DDHGCalEEAlgo::slopeB_
private

Definition at line 85 of file DDHGCalEEAlgo.cc.

◆ slopeT_

std::vector<double> DDHGCalEEAlgo::slopeT_
private

Definition at line 88 of file DDHGCalEEAlgo.cc.

◆ thick_

std::vector<double> DDHGCalEEAlgo::thick_
private

Definition at line 65 of file DDHGCalEEAlgo.cc.

◆ tol1_

constexpr double DDHGCalEEAlgo::tol1_ = 0.01
staticprivate

Definition at line 59 of file DDHGCalEEAlgo.cc.

◆ tol2_

constexpr double DDHGCalEEAlgo::tol2_ = 0.00001
staticprivate

Definition at line 60 of file DDHGCalEEAlgo.cc.

◆ wafers_

std::vector<std::string> DDHGCalEEAlgo::wafers_
private

Definition at line 62 of file DDHGCalEEAlgo.cc.

◆ waferSepar_

double DDHGCalEEAlgo::waferSepar_
private

Definition at line 83 of file DDHGCalEEAlgo.cc.

◆ waferSize_

double DDHGCalEEAlgo::waferSize_
private

Definition at line 82 of file DDHGCalEEAlgo.cc.

◆ waferType_

std::unique_ptr<HGCalWaferType> DDHGCalEEAlgo::waferType_
private

Definition at line 57 of file DDHGCalEEAlgo.cc.

◆ zFrontB_

std::vector<double> DDHGCalEEAlgo::zFrontB_
private

Definition at line 86 of file DDHGCalEEAlgo.cc.

◆ zFrontT_

std::vector<double> DDHGCalEEAlgo::zFrontT_
private

Definition at line 89 of file DDHGCalEEAlgo.cc.

◆ zMinBlock_

double DDHGCalEEAlgo::zMinBlock_
private

Definition at line 75 of file DDHGCalEEAlgo.cc.

◆ zMinRadPar_

double DDHGCalEEAlgo::zMinRadPar_
private

Definition at line 78 of file DDHGCalEEAlgo.cc.