CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DDHCalBarrelAlgo Class Reference

#include <DDHCalBarrelAlgo.h>

Inheritance diagram for DDHCalBarrelAlgo:

Public Member Functions

 DDHCalBarrelAlgo ()
 
void execute (DDCompactView &cpv)
 
double getAbsorbD (unsigned int i) const
 
int getAbsorberN () const
 
std::string getAbsorbMat (unsigned int i) const
 
std::string getAbsorbName (unsigned int i) const
 
double getAbsorbT (unsigned int i) const
 
double getDetdP1 (unsigned int i) const
 
double getDetdP2 (unsigned int i) const
 
std::string getDetMat () const
 
std::string getDetMatPl () const
 
std::string getDetMatSc () const
 
int getDetPosY (unsigned int i) const
 
double getDetT11 (unsigned int i) const
 
double getDetT12 (unsigned int i) const
 
double getDetT21 (unsigned int i) const
 
double getDetT22 (unsigned int i) const
 
double getDetTsc (unsigned int i) const
 
int getDetType (unsigned int i) const
 
double getDetWidth1 (unsigned int i) const
 
double getDetWidth2 (unsigned int i) const
 
std::string getGenMaterial () const
 
int getLayerAbsorb (unsigned int i) const
 
double getLayerAlpha (unsigned i) const
 
double getLayerD1 (unsigned i) const
 
double getLayerD2 (unsigned i) const
 
double getLayerGap (unsigned int i) const
 
int getLayerId (unsigned i) const
 
std::string getLayerLabel (unsigned i) const
 
std::string getLayerMaterial (unsigned i) const
 
double getLayerT1 (unsigned i) const
 
double getLayerT2 (unsigned i) const
 
double getLayerWidth (unsigned i) const
 
std::string getMidAbsMat (unsigned int i) const
 
std::string getMidAbsName (unsigned int i) const
 
int getMidAbsorber () const
 
double getMidAbsT (unsigned int i) const
 
double getMidAbsW (unsigned int i) const
 
double getMiddleD () const
 
std::string getMiddleMat () const
 
double getMiddleW () const
 
int getNhalf () const
 
int getNLayers () const
 
int getNsectors () const
 
int getNsectortot () const
 
double getRin () const
 
double getRmax (unsigned int i) const
 
double getRout () const
 
int getRzones () const
 
std::string getSideAbsMat (unsigned int i) const
 
std::string getSideAbsName (unsigned int i) const
 
int getSideAbsorber () const
 
double getSideAbsW (unsigned int i) const
 
double getSideD (unsigned int i) const
 
std::string getSideMat (unsigned int i) const
 
double getSideT (unsigned int i) const
 
double getTanTheta (unsigned int i) const
 
double getTheta (unsigned int i) const
 
double getZoff (unsigned int i) const
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
 
virtual ~DDHCalBarrelAlgo ()
 

Protected Member Functions

void constructGeneralVolume (DDCompactView &cpv)
 
void constructInsideDetectors (DDLogicalPart detector, std::string name, int id, double dx, double dy, double dz, int type, DDCompactView &cpv)
 
void constructInsideLayers (DDLogicalPart laylog, std::string name, int id, int nAbs, double rin, double d1, double alpha1, double d2, double alpha2, double t1, double t2, DDCompactView &cpv)
 
void constructInsideSector (DDLogicalPart sector, DDCompactView &cpv)
 
DDLogicalPart constructMidLayer (DDLogicalPart laylog, std::string nm, double rin, double alpha, DDCompactView &cpv)
 
DDLogicalPart constructSideLayer (DDLogicalPart laylog, std::string nm, int nAbs, double rin, double alpha, DDCompactView &cpv)
 

Private Attributes

std::vector< double > absorbD
 
std::vector< std::string > absorbMat
 
std::vector< std::string > absorbName
 
std::vector< double > absorbT
 
std::vector< double > detdP1
 
std::vector< double > detdP2
 
std::string detMat
 
std::string detMatPl
 
std::string detMatSc
 
std::vector< int > detPosY
 
std::string detRot
 
std::vector< double > detT11
 
std::vector< double > detT12
 
std::vector< double > detT21
 
std::vector< double > detT22
 
std::vector< double > detTsc
 
std::vector< int > detType
 
std::vector< double > detWidth1
 
std::vector< double > detWidth2
 
std::string genMaterial
 
std::string idName
 
std::string idNameSpace
 
int idOffset
 
std::vector< int > layerAbsorb
 
std::vector< double > layerAlpha
 
std::vector< double > layerD1
 
std::vector< double > layerD2
 
std::vector< double > layerGap
 
std::vector< int > layerId
 
std::vector< std::string > layerLabel
 
std::vector< std::string > layerMat
 
std::vector< double > layerT1
 
std::vector< double > layerT2
 
std::vector< double > layerWidth
 
double middleD
 
std::string middleMat
 
double middleW
 
std::vector< std::string > midMat
 
std::vector< std::string > midName
 
std::vector< double > midT
 
std::vector< double > midW
 
int nAbsorber
 
int nhalf
 
int nLayers
 
int nMidAbs
 
int nsectors
 
int nsectortot
 
int nSideAbs
 
double rin
 
std::vector< double > rmax
 
std::string rotHalf
 
std::string rotns
 
double rout
 
int rzones
 
std::vector< std::string > sideAbsMat
 
std::vector< std::string > sideAbsName
 
std::vector< double > sideAbsW
 
std::vector< double > sideD
 
std::vector< std::string > sideMat
 
std::vector< double > sideT
 
std::vector< double > theta
 
std::vector< double > ttheta
 
std::vector< double > zoff
 

Detailed Description

Definition at line 10 of file DDHCalBarrelAlgo.h.

Constructor & Destructor Documentation

DDHCalBarrelAlgo::DDHCalBarrelAlgo ( )

Definition at line 23 of file DDHCalBarrelAlgo.cc.

References LogDebug.

23  :
24  theta(0),rmax(0),zoff(0),ttheta(0),layerId(0),layerLabel(0),layerMat(0),
27  midName(0),midMat(0),midW(0),midT(0),sideMat(0),sideD(0),sideT(0),
29  detT11(0),detT12(0),detTsc(0),detT21(0),detT22(0),detWidth1(0),detWidth2(0),
30  detPosY(0) {
31  LogDebug("HCalGeom") << "DDHCalBarrelAlgo info: Creating an instance";
32 }
#define LogDebug(id)
std::vector< std::string > absorbMat
std::vector< std::string > midMat
std::vector< double > sideAbsW
std::vector< std::string > layerLabel
std::vector< double > layerD2
std::vector< std::string > layerMat
std::vector< int > layerId
std::vector< double > rmax
std::vector< double > layerT1
std::vector< double > detdP2
std::vector< double > detWidth2
std::vector< std::string > sideAbsName
std::vector< double > detdP1
std::vector< double > absorbT
std::vector< double > detWidth1
std::vector< double > layerGap
std::vector< double > layerAlpha
std::vector< double > detT22
std::vector< int > layerAbsorb
std::vector< std::string > sideAbsMat
std::vector< double > sideT
std::vector< double > detTsc
std::vector< std::string > midName
std::vector< std::string > sideMat
std::vector< double > detT21
std::vector< int > detPosY
std::vector< int > detType
std::vector< double > zoff
std::vector< double > sideD
std::vector< double > detT11
std::vector< double > absorbD
std::vector< double > ttheta
std::vector< double > theta
std::vector< double > layerWidth
std::vector< std::string > absorbName
std::vector< double > midW
std::vector< double > layerD1
std::vector< double > detT12
std::vector< double > midT
std::vector< double > layerT2
DDHCalBarrelAlgo::~DDHCalBarrelAlgo ( )
virtual

Definition at line 34 of file DDHCalBarrelAlgo.cc.

34 {}

Member Function Documentation

void DDHCalBarrelAlgo::constructGeneralVolume ( DDCompactView cpv)
protected

Definition at line 199 of file DDHCalBarrelAlgo.cc.

References alpha, constructInsideSector(), DDrot(), DDSplit(), plotBeamSpotDB::first, getGenMaterial(), getNhalf(), getNsectors(), getNsectortot(), getRin(), getRmax(), getRout(), getTanTheta(), getZoff(), i, idName, idNameSpace, cuy::ii, LogDebug, mergeVDriftHistosByStation::name, DDBase< N, C >::name(), SpecificationBuilder_cfi::parent(), phi, pi, DDSolidFactory::polyhedra(), DDCompactView::position(), rin, makeMuonMisalignmentScenario::rot, idealTransformation::rotation, rotHalf, rotns, rout, edm::second(), and SiStripMonitorClusterAlca_cfi::zmax.

Referenced by execute().

199  {
200 
201  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: General volume...";
202  unsigned int i=0;
203 
205 
206  double alpha = CLHEP::pi/getNsectors();
207  double dphi = getNsectortot()*CLHEP::twopi/getNsectors();
208  int nsec, ntot=15;
209  if (getNhalf() == 1)
210  nsec = 8;
211  else
212  nsec = 15;
213  int nf = ntot - nsec;
214 
215  //Calculate zmin... see HCalBarrel.hh picture. For polyhedra
216  //Rmin and Rmax are distances to vertex
217  double zmax = getZoff(3);
218  double zstep5 = getZoff(4);
219  double zstep4 =(getZoff(1) + getRmax(1)*getTanTheta(1));
220  if ((getZoff(2)+getRmax(1)*getTanTheta(2)) > zstep4)
221  zstep4 = (getZoff(2)+getRmax(1)*getTanTheta(2));
222  double zstep3 =(getZoff(1) + getRmax(0)*getTanTheta(1));
223  double zstep2 =(getZoff(0) + getRmax(0)*getTanTheta(0));
224  double zstep1 =(getZoff(0) + getRin() *getTanTheta(0));
225  double rout = getRout();
226  double rout1 = getRmax(3);
227  double rin = getRin();
228  double rmid1 = getRmax(0);
229  double rmid2 = getRmax(1);
230  double rmid3 =(getZoff(4) - getZoff(2))/getTanTheta(2);
231  double rmid4 = getRmax(2);
232 
233  vector<double> pgonZ;
234  pgonZ.push_back( -zmax);
235  pgonZ.push_back( -zstep5);
236  pgonZ.push_back( -zstep5);
237  pgonZ.push_back( -zstep4);
238  pgonZ.push_back( -zstep3);
239  pgonZ.push_back( -zstep2);
240  pgonZ.push_back( -zstep1);
241  pgonZ.push_back( 0);
242  pgonZ.push_back( zstep1);
243  pgonZ.push_back( zstep2);
244  pgonZ.push_back( zstep3);
245  pgonZ.push_back( zstep4);
246  pgonZ.push_back( zstep5);
247  pgonZ.push_back( zstep5);
248  pgonZ.push_back( zmax);
249 
250  vector<double> pgonRmin;
251  pgonRmin.push_back( rmid4);
252  pgonRmin.push_back( rmid3);
253  pgonRmin.push_back( rmid3);
254  pgonRmin.push_back( rmid2);
255  pgonRmin.push_back( rmid1);
256  pgonRmin.push_back( rmid1);
257  pgonRmin.push_back( rin);
258  pgonRmin.push_back( rin);
259  pgonRmin.push_back( rin);
260  pgonRmin.push_back( rmid1);
261  pgonRmin.push_back( rmid1);
262  pgonRmin.push_back( rmid2);
263  pgonRmin.push_back( rmid3);
264  pgonRmin.push_back( rmid3);
265  pgonRmin.push_back( rmid4);
266 
267  vector<double> pgonRmax;
268  pgonRmax.push_back( rout1);
269  pgonRmax.push_back( rout1);
270  pgonRmax.push_back( rout);
271  pgonRmax.push_back( rout);
272  pgonRmax.push_back( rout);
273  pgonRmax.push_back( rout);
274  pgonRmax.push_back( rout);
275  pgonRmax.push_back( rout);
276  pgonRmax.push_back( rout);
277  pgonRmax.push_back( rout);
278  pgonRmax.push_back( rout);
279  pgonRmax.push_back( rout);
280  pgonRmax.push_back( rout);
281  pgonRmax.push_back( rout1);
282  pgonRmax.push_back( rout1);
283 
284  vector<double> pgonZHalf;
285  pgonZHalf.push_back( 0);
286  pgonZHalf.push_back( zstep1);
287  pgonZHalf.push_back( zstep2);
288  pgonZHalf.push_back( zstep3);
289  pgonZHalf.push_back( zstep4);
290  pgonZHalf.push_back( zstep5);
291  pgonZHalf.push_back( zstep5);
292  pgonZHalf.push_back( zmax);
293 
294  vector<double> pgonRminHalf;
295  pgonRminHalf.push_back( rin);
296  pgonRminHalf.push_back( rin);
297  pgonRminHalf.push_back( rmid1);
298  pgonRminHalf.push_back( rmid1);
299  pgonRminHalf.push_back( rmid2);
300  pgonRminHalf.push_back( rmid3);
301  pgonRminHalf.push_back( rmid3);
302  pgonRminHalf.push_back( rmid4);
303 
304  vector<double> pgonRmaxHalf;
305  pgonRmaxHalf.push_back( rout);
306  pgonRmaxHalf.push_back( rout);
307  pgonRmaxHalf.push_back( rout);
308  pgonRmaxHalf.push_back( rout);
309  pgonRmaxHalf.push_back( rout);
310  pgonRmaxHalf.push_back( rout);
311  pgonRmaxHalf.push_back( rout1);
312  pgonRmaxHalf.push_back( rout1);
313 
314  string name("Null");
315  DDSolid solid;
316  if (nf == 0) {
318  getNsectortot(), -alpha, dphi, pgonZ,
319  pgonRmin, pgonRmax);
320  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: "
321  << DDName(idName, idNameSpace) <<" Polyhedra made of "
322  << getGenMaterial() << " with " << getNsectortot()
323  << " sectors from " << -alpha/CLHEP::deg <<" to "
324  << (-alpha+dphi)/CLHEP::deg << " and with " << nsec
325  << " sections ";
326  for (i = 0; i <pgonZ.size(); i++) {
327  LogDebug("HCalGeom") << "\t" << "\tZ = " << pgonZ[i] << "\tRmin = "
328  << pgonRmin[i] << "\tRmax = " << pgonRmax[i];
329  }
330  } else {
332  getNsectortot(), -alpha, dphi, pgonZHalf,
333  pgonRminHalf, pgonRmaxHalf);
334  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: "
335  << DDName(idName, idNameSpace) <<" Polyhedra made of "
336  << getGenMaterial() << " with " << getNsectortot()
337  << " sectors from " << -alpha/CLHEP::deg << " to "
338  << (-alpha+dphi)/CLHEP::deg << " and with " << nsec
339  << " sections ";
340  for (i = 0; i < pgonZHalf.size(); i++) {
341  LogDebug("HCalGeom") << "\t" << "\tZ = " << pgonZHalf[i] << "\tRmin = "
342  << pgonRminHalf[i] << "\tRmax = " <<pgonRmaxHalf[i];
343  }
344  }
345 
346 
348  DDMaterial matter(matname);
349  DDLogicalPart genlogic(DDName(idName, idNameSpace), matter, solid);
350 
351  DDName parentName = parent().name();
352  DDTranslation r0(0,0,0);
353  cpv.position(DDName(idName, idNameSpace), parentName, 1, r0, rot);
354  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: "
355  << DDName(idName, idNameSpace) << " number 1 positioned"
356  << " in " << parentName << " at " << r0 <<" with "<<rot;
357 
358  //Forward and backwards halfs
359  name = idName + "Half";
360  nf = (ntot+1)/2;
361  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << DDName(name,idNameSpace)
362  << " Polyhedra made of " << getGenMaterial() << " with "
363  << getNsectortot() << " sectors from "
364  << -alpha/CLHEP::deg << " to "
365  << (-alpha+dphi)/CLHEP::deg << " and with " << nf
366  << " sections ";
367  for (i = 0; i < pgonZHalf.size(); i++) {
368  LogDebug("HCalGeom") << "\t" << "\tZ = " << pgonZHalf[i] << "\tRmin = "
369  << pgonRminHalf[i] << "\tRmax = " << pgonRmaxHalf[i];
370  }
371 
373  getNsectortot(), -alpha, dphi, pgonZHalf,
374  pgonRminHalf, pgonRmaxHalf);
375  DDLogicalPart genlogich(DDName(name, idNameSpace), matter, solid);
376 
377  cpv.position(genlogich, genlogic, 1, r0, rot);
378  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << genlogich.name()
379  << " number 1 positioned in " << genlogic.name()
380  << " at " << r0 << " with " << rot;
381 
382  if (getNhalf() != 1) {
383  rot = DDRotation(DDName(rotHalf, rotns));
384  cpv.position(genlogich, genlogic, 2, r0, rot);
385  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << genlogich.name()
386  << " number 2 positioned in " << genlogic.name()
387  << " at " << r0 << " with " << rot;
388  } //end if (getNhalf...
389 
390  //Construct sector (from -alpha to +alpha)
391  name = idName + "Module";
392  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << DDName(name,idNameSpace)
393  << " Polyhedra made of " << getGenMaterial()
394  << " with 1 sector from " << -alpha/CLHEP::deg << " to "
395  << alpha/CLHEP::deg << " and with " << nf <<" sections";
396  for (i = 0; i < pgonZHalf.size(); i++) {
397  LogDebug("HCalGeom") << "\t" << "\tZ = " << pgonZHalf[i] << "\tRmin = "
398  << pgonRminHalf[i] << "\tRmax = " << pgonRmaxHalf[i];
399  }
400 
402  1, -alpha, 2*alpha, pgonZHalf,
403  pgonRminHalf, pgonRmaxHalf);
404  DDLogicalPart seclogic(DDName(name, idNameSpace), matter, solid);
405 
406  for (int ii=0; ii<getNsectortot(); ii++) {
407  double phi = ii*2*alpha;
408  double phideg = phi/CLHEP::deg;
409 
411  string rotstr("NULL");
412  if (phideg != 0) {
413  rotstr = "R";
414  if (phideg < 100) rotstr = "R0";
415  rotstr = rotstr + std::to_string(phideg);
416  rotation = DDRotation(DDName(rotstr, rotns));
417  if (!rotation) {
418  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: Creating a new rotat"
419  << "ion " << rotstr << "\t" << 90 << "," << phideg
420  << "," << 90 << "," << (phideg+90) << ", 0, 0";
421  rotation = DDrot(DDName(rotstr, rotns), 90*CLHEP::deg,
422  phideg*CLHEP::deg, 90*CLHEP::deg,
423  (90+phideg)*CLHEP::deg, 0*CLHEP::deg, 0*CLHEP::deg);
424  } //if !rotation
425  } //if phideg!=0
426 
427  cpv.position(seclogic, genlogich, ii+1, r0, rotation);
428  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << seclogic.name()
429  << " number " << ii+1 << " positioned in "
430  << genlogich.name() << " at " << r0 << " with "
431  << rotation;
432  }
433 
434  //Construct the things inside the sector
435  constructInsideSector(seclogic, cpv);
436 }
#define LogDebug(id)
int getNsectortot() const
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
double getRin() const
std::string getGenMaterial() const
int getNhalf() const
double getRmax(unsigned int i) const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
std::string idNameSpace
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
void constructInsideSector(DDLogicalPart sector, DDCompactView &cpv)
int ii
Definition: cuy.py:588
A DDSolid represents the shape of a part.
Definition: DDSolid.h:37
double getRout() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
const Double_t pi
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
double getZoff(unsigned int i) const
U second(std::pair< T, U > const &p)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
double getTanTheta(unsigned int i) const
int getNsectors() const
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
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:708
void DDHCalBarrelAlgo::constructInsideDetectors ( DDLogicalPart  detector,
std::string  name,
int  id,
double  dx,
double  dy,
double  dz,
int  type,
DDCompactView cpv 
)
protected

Definition at line 886 of file DDHCalBarrelAlgo.cc.

References DDSolidFactory::box(), DDBase< N, C >::ddname(), DDSplit(), plotBeamSpotDB::first, getDetdP1(), getDetdP2(), getDetMatPl(), getDetMatSc(), getDetPosY(), getDetT11(), getDetT12(), getDetT21(), getDetT22(), getDetTsc(), getDetType(), getDetWidth1(), getDetWidth2(), idName, idNameSpace, LogDebug, DDName::name(), mergeVDriftHistosByStation::name, DDBase< N, C >::name(), DDCompactView::position(), edm::second(), x, and y.

Referenced by constructInsideLayers().

889  {
890 
891  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: \t\tInside detector " << id
892  << "...";
893 
895  DDMaterial plmatter(plmatname);
897  DDMaterial scmatter(scmatname);
898 
899  string plname = detector.name().name()+"Plastic_";
900  string scname = idName+"Scintillator"+name;
901 
902  id--;
903  DDSolid solid;
904  DDLogicalPart glog;
905  double wid, y=0;
906  double dx1, dx2, shiftX;
907 
908  if (type == 1) {
909  wid = 0.5*getDetWidth1(id);
910  if (getDetPosY(id)>0) y =-dy+wid;
911  dx1 = 0.5*getDetT11(id);
912  dx2 = 0.5*getDetT21(id);
913  shiftX = getDetdP1(id);
914  } else {
915  wid = 0.5*getDetWidth2(id);
916  dx1 = 0.5*getDetT12(id);
917  dx2 = 0.5*getDetT22(id);
918  shiftX = getDetdP2(id);
919  }
920 
921  solid = DDSolidFactory::box(DDName(plname+"1", idNameSpace), dx1, wid, dz);
922  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
923  << " Box made of " << getDetMatPl() << " of dimensions "
924  << dx1 <<", " << wid << ", " << dz;
925  glog = DDLogicalPart(solid.ddname(), plmatter, solid);
926 
927  double x = shiftX + dx1 - dx;
928  cpv.position(glog, detector, 1, DDTranslation(x,y,0), DDRotation());
929  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << glog.name()
930  << " Number 1 positioned in " << detector.name()
931  << " at (" << x << "," << y << ",0) with no rotation";
932 
933  solid = DDSolidFactory::box(DDName(scname, idNameSpace),
934  0.5*getDetTsc(id), wid, dz);
935  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
936  << " Box made of " << getDetMatSc() << " of dimensions "
937  << 0.5*getDetTsc(id) << ", " << wid << ", " << dz;
938  glog = DDLogicalPart(solid.ddname(), scmatter, solid);
939 
940  x += dx1 + 0.5*getDetTsc(id);
941  int copyNo = id*10 + getDetType(id);
942  cpv.position(glog, detector, copyNo, DDTranslation(x, y, 0), DDRotation());
943  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << glog.name() <<" Number "
944  << copyNo << " positioned in " << detector.name()
945  << " at (" << x << "," << y << ",0) with no rotation";
946 
947  solid = DDSolidFactory::box(DDName(plname+"2", idNameSpace), dx2, wid, dz);
948  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
949  << " Box made of " << getDetMatPl() << " of dimensions "
950  << dx2 <<", " << wid << ", " << dz;
951  glog = DDLogicalPart(solid.ddname(), plmatter, solid);
952 
953  x+=0.5*getDetTsc(id) + dx2;
954  cpv.position(glog, detector, 1, DDTranslation(x, y, 0), DDRotation());
955  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << glog.name()
956  << " Number 1 positioned in " << detector.name()
957  << " at (" << x << "," << y << ",0) with no rotation";
958 
959 }
#define LogDebug(id)
type
Definition: HCALResponse.h:21
const N & name() const
Definition: DDBase.h:78
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
int getDetPosY(unsigned int i) const
std::string idNameSpace
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
std::string getDetMatPl() const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:37
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
std::string getDetMatSc() const
U second(std::pair< T, U > const &p)
double getDetT22(unsigned int i) const
double getDetT11(unsigned int i) const
int getDetType(unsigned int i) const
double getDetdP1(unsigned int i) const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
double getDetTsc(unsigned int i) const
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
Definition: DDSolid.cc:526
double getDetdP2(unsigned int i) const
double getDetT21(unsigned int i) const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
double getDetWidth2(unsigned int i) const
double getDetT12(unsigned int i) const
double getDetWidth1(unsigned int i) const
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
const N & ddname() const
Definition: DDBase.h:80
void DDHCalBarrelAlgo::constructInsideLayers ( DDLogicalPart  laylog,
std::string  name,
int  id,
int  nAbs,
double  rin,
double  d1,
double  alpha1,
double  d2,
double  alpha2,
double  t1,
double  t2,
DDCompactView cpv 
)
protected

Definition at line 555 of file DDHCalBarrelAlgo.cc.

References DDSolidFactory::box(), constructInsideDetectors(), constructMidLayer(), constructSideLayer(), DDBase< N, C >::ddname(), DDSplit(), detRot, plotBeamSpotDB::first, getDetMat(), getRmax(), getRzones(), getTanTheta(), getZoff(), i, idName, idNameSpace, idOffset, recoMuon::in, LogDebug, mergeVDriftHistosByStation::name, DDBase< N, C >::name(), DDCompactView::position(), makeMuonMisalignmentScenario::rot, rotns, edm::second(), reco::t2, funct::tan(), x, and y.

Referenced by constructInsideSector().

560  {
561 
562  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: \t\tInside layer " << id
563  << "...";
564 
566  //Pointers to the Rotation Matrices and to the Materials
568 
569  string nam0 = nm + "In";
570  string name = idName + nam0;
572  DDMaterial matter (matName);
573 
574  DDSolid solid;
575  DDLogicalPart glog, mother;
576  double rsi, dx, dy, dz, x, y;
577  int i, in;
578  //Two lower volumes
579  if (alpha1 > 0) {
580  rsi = rin + d1;
581  in = 0;
582  for (i = 0; i < getRzones()-1; i++) {
583  if (rsi >= getRmax(i)) in = i+1;
584  }
585  dx = 0.5*t1;
586  dy = 0.5*rsi*(tan(alpha1)-tan(alpha2));
587  dz = 0.5*(getZoff(in) + rsi*getTanTheta(in));
588  x = rsi + dx;
589  y = 0.5*rsi*(tan(alpha1)+tan(alpha2));
590  DDTranslation r11(x, y, dz);
591  DDTranslation r12(x, -y, dz);
592 
593  solid = DDSolidFactory::box(DDName(name+"1", idNameSpace), dx, dy, dz);
594  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
595  <<" Box made of " << getDetMat() << " of dimensions "
596  << dx << ", " << dy << ", " << dz;
597  glog = DDLogicalPart(solid.ddname(), matter, solid);
598 
599  if (nAbs != 0) {
600  mother = constructSideLayer(laylog, name, nAbs, rin, alpha1, cpv);
601  } else {
602  mother = laylog;
603  }
604  cpv.position(glog, mother, idOffset+1, r11, DDRotation());
605  cpv.position(glog, mother, idOffset+2, r12, rot);
606  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << glog.name()
607  << " Number " << idOffset+1 << " positioned in "
608  << mother.name() << " at " << r11
609  << " with no rotation\n"
610  << "DDHCalBarrelAlgo test: " << glog.name()
611  << " Number " << idOffset+2 << " positioned in "
612  << mother.name() << " at " << r12 << " with " << rot;
613 
614  //Constructin the plastics and scintillators inside
615  constructInsideDetectors(glog, nam0+"1", id, dx, dy, dz, 1, cpv);
616  }
617 
618  //Upper volume
619  rsi = rin + d2;
620  in = 0;
621  for (i = 0; i < getRzones()-1; i++) {
622  if (rsi >= getRmax(i)) in = i+1;
623  }
624  dx = 0.5*t2;
625  dy = 0.5*rsi*tan(alpha2);
626  dz = 0.5*(getZoff(in) + rsi*getTanTheta(in));
627  x = rsi + dx;
628  DDTranslation r21(x, dy, dz);
629  DDTranslation r22(x, -dy, dz);
630 
631  solid = DDSolidFactory::box(DDName(name+"2", idNameSpace), dx, dy, dz);
632  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
633  << " Box made of " << getDetMat() << " of dimensions "
634  << dx << ", " << dy << ", " << dz;
635  glog = DDLogicalPart(solid.ddname(), matter, solid);
636 
637  if (nAbs < 0) {
638  mother = constructMidLayer(laylog, name, rin, alpha1, cpv);
639  } else {
640  mother = laylog;
641  }
642  cpv.position(glog, mother, idOffset+3, r21, DDRotation());
643  cpv.position(glog, mother, idOffset+4, r22, rot);
644  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << glog.name() <<" Number "
645  << idOffset+3 << " positioned in " << mother.name()
646  << " at " << r21 << " with no rotation\n"
647  << "DDHCalBarrelAlgo test: " << glog.name() <<" Number "
648  << idOffset+4 << " positioned in " << mother.name()
649  << " at " << r22 << " with " << rot;
650 
651  //Constructin the plastics and scintillators inside
652  constructInsideDetectors(glog, nam0+"2", id, dx, dy, dz, 2, cpv);
653 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
void constructInsideDetectors(DDLogicalPart detector, std::string name, int id, double dx, double dy, double dz, int type, DDCompactView &cpv)
const N & name() const
Definition: DDBase.h:78
double getRmax(unsigned int i) const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
std::string idNameSpace
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
int getRzones() const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:37
std::string getDetMat() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
double getZoff(unsigned int i) const
U second(std::pair< T, U > const &p)
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
double getTanTheta(unsigned int i) const
DDLogicalPart constructSideLayer(DDLogicalPart laylog, std::string nm, int nAbs, double rin, double alpha, DDCompactView &cpv)
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
Definition: DDSolid.cc:526
DDLogicalPart constructMidLayer(DDLogicalPart laylog, std::string nm, double rin, double alpha, DDCompactView &cpv)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
const N & ddname() const
Definition: DDBase.h:80
void DDHCalBarrelAlgo::constructInsideSector ( DDLogicalPart  sector,
DDCompactView cpv 
)
protected

!!!!!!!!!!!!!!!!Should be zero. And removed as soon as

Definition at line 439 of file DDHCalBarrelAlgo.cc.

References alpha, constructInsideLayers(), DDSplit(), alignCSCRings::e, plotBeamSpotDB::first, getLayerAbsorb(), getLayerAlpha(), getLayerD1(), getLayerD2(), getLayerGap(), getLayerId(), getLayerLabel(), getLayerMaterial(), getLayerT1(), getLayerT2(), getLayerWidth(), getNLayers(), getNsectors(), getRin(), getRmax(), getRzones(), getTanTheta(), getZoff(), i, idName, idNameSpace, recoMuon::in, j, relval_2017::k, LogDebug, mergeVDriftHistosByStation::name, DDBase< N, C >::name(), fileinputsource_cfi::out, pi, DDSolidFactory::polyhedra(), DDCompactView::position(), rin, rout, edm::second(), funct::tan(), and create_public_lumi_plots::width.

Referenced by constructGeneralVolume().

439  {
440 
441  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: Layers (" << getNLayers()
442  << ") ...";
443 
444  double alpha = CLHEP::pi/getNsectors();
445  double rin = getRin();
446  for (int i = 0; i < getNLayers(); i++) {
447  string name = idName + getLayerLabel(i);
449  DDSplit(getLayerMaterial(i)).second); //idNameSpace);
450  DDMaterial matter(matname);
451 
452  double width = getLayerWidth(i);
453  double rout = rin + width;
454 
455  int in = 0, out = 0;
456  for (int j = 0; j < getRzones()-1; j++) {
457  if (rin >= getRmax(j)) in = j+1;
458  if (rout> getRmax(j)) out= j+1;
459  }
460  double zout = getZoff(in) + rin*getTanTheta(in);
461 
463  //vertical walls are allowed in SolidPolyhedra
464  double deltaz = 0;
465  int nsec=2;
466  vector<double> pgonZ, pgonRmin, pgonRmax;
467  // index 0
468  pgonZ.push_back(0);
469  pgonRmin.push_back(rin);
470  pgonRmax.push_back(rout);
471  // index 1
472  pgonZ.push_back(zout);
473  pgonRmin.push_back(rin);
474  pgonRmax.push_back(rout);
475  if (in == out) {
476  if (in <= 3) {
477  //index 2
478  pgonZ.push_back(getZoff(in) + rout*getTanTheta(in));
479  pgonRmin.push_back(pgonRmax[1]);
480  pgonRmax.push_back(pgonRmax[1]);
481  nsec++;
482  }
483  } else {
484  if (in == 3) {
485  //redo index 1, add index 2
486  pgonZ[1] =(getZoff(out) + getRmax(out)*getTanTheta(out));
487  pgonZ.push_back(pgonZ[1] + deltaz);
488  pgonRmin.push_back(pgonRmin[1]);
489  pgonRmax.push_back(getRmax(in));
490  //index 3
491  pgonZ.push_back(getZoff(in) + getRmax(in)*getTanTheta(in));
492  pgonRmin.push_back(pgonRmin[2]);
493  pgonRmax.push_back(pgonRmax[2]);
494  nsec += 2;
495  } else {
496  //index 2
497  pgonZ.push_back(getZoff(in) + getRmax(in)*getTanTheta(in));
498  pgonRmin.push_back(getRmax(in));
499  pgonRmax.push_back(pgonRmax[1]);
500  nsec++;
501  if (in == 0) {
502  pgonZ.push_back(getZoff(out) + getRmax(in)*getTanTheta(out));
503  pgonRmin.push_back(pgonRmin[2]);
504  pgonRmax.push_back(pgonRmax[2]);
505  nsec++;
506  }
507  if (in <= 1) {
508  pgonZ.push_back(getZoff(out) + rout*getTanTheta(out));
509  pgonRmin.push_back(rout);
510  pgonRmax.push_back(rout);
511  nsec++;
512  }
513  }
514  }
515  //Solid & volume
516  DDSolid solid;
517  double alpha1 = alpha;
518  if (getLayerGap(i)>1.e-6) {
519  double rmid = 0.5*(rin+rout);
520  double width = rmid*tan(alpha) - getLayerGap(i);
521  alpha1 = atan(width/rmid);
522  LogDebug("HCalGeom") << "\t" << "Alpha_1 modified from "
523  << alpha/CLHEP::deg << " to " << alpha1/CLHEP::deg
524  << " Rmid " << rmid << " Reduced width " << width;
525  }
526  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << name << " (Layer "
527  << i << ") Polyhedra made of " << getLayerMaterial(i)
528  << " with 1 sector from " << -alpha1/CLHEP::deg
529  << " to " << alpha1/CLHEP::deg << " and with "
530  << nsec << " sections";
531  for (unsigned int k=0; k<pgonZ.size(); k++) {
532  LogDebug("HCalGeom") << "\t" << "\t" << pgonZ[k] << "\t" << pgonRmin[k]
533  << "\t" << pgonRmax[k];
534  }
536  1, -alpha1, 2*alpha1,
537  pgonZ, pgonRmin, pgonRmax);
538  DDLogicalPart glog(DDName(name, idNameSpace), matter, solid);
539 
540  cpv.position(glog, sector, getLayerId(i), DDTranslation(0.0, 0.0, 0.0),
541  DDRotation());
542  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << glog.name()
543  << " number " << getLayerId(i) << " positioned in "
544  << sector.name() << " at (0,0,0) with no rotation";
545 
547  getLayerAbsorb(i), rin, getLayerD1(i), alpha1,
549  getLayerT2(i), cpv);
550  rin = rout;
551  }
552 
553 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
std::string getLayerLabel(unsigned i) const
double getRin() const
const N & name() const
Definition: DDBase.h:78
double getLayerD1(unsigned i) const
std::string getLayerMaterial(unsigned i) const
double getRmax(unsigned int i) const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
double getLayerD2(unsigned i) const
std::string idNameSpace
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
double getLayerAlpha(unsigned i) const
int getRzones() const
void constructInsideLayers(DDLogicalPart laylog, std::string name, int id, int nAbs, double rin, double d1, double alpha1, double d2, double alpha2, double t1, double t2, DDCompactView &cpv)
A DDSolid represents the shape of a part.
Definition: DDSolid.h:37
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
const Double_t pi
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
double getZoff(unsigned int i) const
U second(std::pair< T, U > const &p)
double getLayerGap(unsigned int i) const
int getNLayers() const
int getLayerAbsorb(unsigned int i) const
double getLayerT2(unsigned i) const
double getLayerT1(unsigned i) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
int j
Definition: DBlmapReader.cc:9
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
double getTanTheta(unsigned int i) const
int getNsectors() const
int getLayerId(unsigned i) const
double getLayerWidth(unsigned i) const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
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:708
DDLogicalPart DDHCalBarrelAlgo::constructMidLayer ( DDLogicalPart  laylog,
std::string  nm,
double  rin,
double  alpha,
DDCompactView cpv 
)
protected

Definition at line 739 of file DDHCalBarrelAlgo.cc.

References DDBase< N, C >::ddname(), DDSplit(), plotBeamSpotDB::first, getAbsorbD(), getAbsorberN(), getAbsorbMat(), getAbsorbName(), getAbsorbT(), getMidAbsMat(), getMidAbsName(), getMidAbsorber(), getMidAbsT(), getMidAbsW(), getMiddleD(), getMiddleMat(), getMiddleW(), getRmax(), getRzones(), getTanTheta(), getZoff(), i, idNameSpace, cuy::ii, recoMuon::in, relval_2017::k, dqm-mbProfile::log, LogDebug, mergeVDriftHistosByStation::name, DDBase< N, C >::name(), DDSolidFactory::polyhedra(), DDCompactView::position(), rmax, and edm::second().

Referenced by constructInsideLayers().

741  {
742 
743  DDSolid solid;
744  DDLogicalPart log, glog;
745  string name = nm + "Mid";
746  for (int k=0; k < getAbsorberN(); k++) {
747  string namek = name + getAbsorbName(k);
748  double rsi = rin + getAbsorbD(k);
749  int in = 0;
750  for (int i = 0; i < getRzones()-1; i++) {
751  if (rsi >= getRmax(i)) in = i+1;
752  }
753  vector<double> pgonZ, pgonRmin, pgonRmax;
754  // index 0
755  pgonZ.push_back(0.0);
756  pgonRmin.push_back(rsi);
757  pgonRmax.push_back(rsi+getAbsorbT(k));
758  // index 1
759  pgonZ.push_back(getZoff(in) + rsi*getTanTheta(in));
760  pgonRmin.push_back(rsi);
761  pgonRmax.push_back(pgonRmax[0]);
762  // index 2
763  pgonZ.push_back(getZoff(in) + pgonRmax[0]*getTanTheta(in));
764  pgonRmin.push_back(pgonRmax[1]);
765  pgonRmax.push_back(pgonRmax[1]);
766  solid = DDSolidFactory::polyhedra(DDName(namek, idNameSpace), 1, -alpha,
767  2*alpha, pgonZ, pgonRmin, pgonRmax);
768  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
769  << " Polyhedra made of " << getAbsorbMat(k)
770  << " with 1 sector from " << -alpha/CLHEP::deg
771  << " to " << alpha/CLHEP::deg << " and with "
772  << pgonZ.size() << " sections";
773  for (unsigned int ii=0; ii<pgonZ.size(); ii++) {
774  LogDebug("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = "
775  << pgonRmin[ii] << "\tRmax = " << pgonRmax[ii];
776  }
777 
779  DDMaterial matter(matName);
780  log = DDLogicalPart(solid.ddname(), matter, solid);
781 
782  cpv.position(log, laylog, 1, DDTranslation(), DDRotation());
783  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << log.name()
784  << " Number 1 positioned in " << laylog.name()
785  << " at (0,0,0) with no rotation";
786 
787  if (k==0) {
788  double rmin = pgonRmin[0];
789  double rmax = pgonRmax[0];
790  DDLogicalPart mother = log;
791  for (int i=0; i<1; i++) {
792  double alpha1 = atan(getMidAbsW(i)/rmin);
793  string namek = name + getMidAbsName(i);
794  solid = DDSolidFactory::polyhedra(DDName(namek, idNameSpace), 1,
795  -alpha1, 2*alpha1, pgonZ, pgonRmin,
796  pgonRmax);
797  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
798  << " Polyhedra made of " << getMidAbsMat(i)
799  << " with 1 sector from " << -alpha1/CLHEP::deg
800  << " to " << alpha1/CLHEP::deg << " and with "
801  << pgonZ.size() << " sections";
802  for (unsigned int ii=0; ii<pgonZ.size(); ii++) {
803  LogDebug("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = "
804  << pgonRmin[ii] << "\tRmax = " << pgonRmax[ii];
805  }
806 
807  DDName matNam1(DDSplit(getMidAbsMat(i)).first,
809  DDMaterial matter1(matNam1);
810  log = DDLogicalPart(solid.ddname(), matter1, solid);
811 
812  cpv.position(log, mother, 1, DDTranslation(), DDRotation());
813  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << log.name()
814  << " Number 1 positioned in " << mother.name()
815  << " at (0,0,0) with no rotation";
816  mother = log;
817  }
818 
819  // Now the layer with detectors
820  double rmid = rmin + getMiddleD();
821  pgonRmin[0] = rmid; pgonRmax[0] = rmax;
822  pgonRmin[1] = rmid; pgonRmax[1] = rmax; pgonZ[1] = getZoff(in) + rmid*getTanTheta(in);
823  pgonRmin[2] = rmax; pgonRmax[2] = rmax; pgonZ[2] = getZoff(in) + rmax*getTanTheta(in);
824  double alpha1 = atan(getMiddleW()/rmin);
825  solid = DDSolidFactory::polyhedra(DDName(name, idNameSpace), 1,
826  -alpha1, 2*alpha1, pgonZ, pgonRmin,
827  pgonRmax);
828  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
829  << " Polyhedra made of " << getMiddleMat()
830  << " with 1 sector from " << -alpha1/CLHEP::deg
831  << " to " << alpha1/CLHEP::deg << " and with "
832  << pgonZ.size() << " sections";
833  for (unsigned int ii=0; ii<pgonZ.size(); ii++) {
834  LogDebug("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = "
835  << pgonRmin[ii] << "\tRmax = " << pgonRmax[ii];
836  }
837 
838  DDName matNam1(DDSplit(getMiddleMat()).first,
840  DDMaterial matter1(matNam1);
841  glog = DDLogicalPart(solid.ddname(), matter1, solid);
842 
843  cpv.position(glog, mother, 1, DDTranslation(), DDRotation());
844  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << glog.name()
845  << " Number 1 positioned in " << mother.name()
846  << " at (0,0,0) with no rotation";
847 
848  // Now the remaining absorber layers
849  for (int i = 1; i < getMidAbsorber(); i++) {
850  namek = name + getMidAbsName(i);
851  rmid = rmin + getMidAbsT(i);
852  pgonRmin[0] = rmin; pgonRmax[0] = rmid;
853  pgonRmin[1] = rmin; pgonRmax[1] = rmid; pgonZ[1] = getZoff(in) + rmin*getTanTheta(in);
854  pgonRmin[2] = rmid; pgonRmax[2] = rmid; pgonZ[2] = getZoff(in) + rmid*getTanTheta(in);
855  alpha1 = atan(getMidAbsW(i)/rmin);
856  solid = DDSolidFactory::polyhedra(DDName(namek, idNameSpace), 1,
857  -alpha1, 2*alpha1, pgonZ, pgonRmin,
858  pgonRmax);
859  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
860  << " Polyhedra made of " << getMidAbsMat(i)
861  << " with 1 sector from " << -alpha1/CLHEP::deg
862  << " to " << alpha1/CLHEP::deg << " and with "
863  << pgonZ.size() << " sections";
864  for (unsigned int ii=0; ii<pgonZ.size(); ii++) {
865  LogDebug("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = "
866  << pgonRmin[ii] << "\tRmax = " << pgonRmax[ii];
867  }
868 
869  DDName matName2(DDSplit(getMidAbsMat(i)).first,
871  DDMaterial matter2(matName2);
872  log = DDLogicalPart(solid.ddname(), matter2, solid);
873 
874  cpv.position(log, mother, i, DDTranslation(), DDRotation());
875  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << log.name()
876  << " Number " << i << " positioned in "
877  << mother.name() << " at (0,0,0) with no "
878  << "rotation";
879  mother = log;
880  }
881  }
882  }
883  return glog;
884 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
const N & name() const
Definition: DDBase.h:78
double getAbsorbT(unsigned int i) const
std::string getMidAbsName(unsigned int i) const
double getRmax(unsigned int i) const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
std::string idNameSpace
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
std::string getAbsorbMat(unsigned int i) const
std::vector< double > rmax
int getRzones() const
int ii
Definition: cuy.py:588
double getMidAbsT(unsigned int i) const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:37
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
double getZoff(unsigned int i) const
U second(std::pair< T, U > const &p)
int getAbsorberN() const
double getMidAbsW(unsigned int i) const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
double getTanTheta(unsigned int i) const
std::string getAbsorbName(unsigned int i) const
double getMiddleW() const
double getAbsorbD(unsigned int i) const
double getMiddleD() const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
int getMidAbsorber() const
std::string getMiddleMat() const
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:708
std::string getMidAbsMat(unsigned int i) const
const N & ddname() const
Definition: DDBase.h:80
DDLogicalPart DDHCalBarrelAlgo::constructSideLayer ( DDLogicalPart  laylog,
std::string  nm,
int  nAbs,
double  rin,
double  alpha,
DDCompactView cpv 
)
protected

Definition at line 655 of file DDHCalBarrelAlgo.cc.

References funct::abs(), DDBase< N, C >::ddname(), DDSplit(), plotBeamSpotDB::first, getRmax(), getRzones(), getSideAbsMat(), getSideAbsName(), getSideAbsorber(), getSideAbsW(), getSideD(), getSideMat(), getSideT(), getTanTheta(), getZoff(), i, idNameSpace, cuy::ii, recoMuon::in, relval_2017::k, dqm-mbProfile::log, LogDebug, mergeVDriftHistosByStation::name, DDBase< N, C >::name(), DDSolidFactory::polyhedra(), DDCompactView::position(), and edm::second().

Referenced by constructInsideLayers().

658  {
659 
660  //Extra absorber layer
661  int k = abs(nAbs) - 1;
662  string namek = nm + "Side";
663  double rsi = rin + getSideD(k);
664  int in = 0;
665  for (int i = 0; i < getRzones()-1; i++) {
666  if (rsi >= getRmax(i)) in = i+1;
667  }
668  vector<double> pgonZ, pgonRmin, pgonRmax;
669  // index 0
670  pgonZ.push_back(0.0);
671  pgonRmin.push_back(rsi);
672  pgonRmax.push_back(rsi+getSideT(k));
673  // index 1
674  pgonZ.push_back(getZoff(in) + rsi*getTanTheta(in));
675  pgonRmin.push_back(rsi);
676  pgonRmax.push_back(pgonRmax[0]);
677  // index 2
678  pgonZ.push_back(getZoff(in) + pgonRmax[0]*getTanTheta(in));
679  pgonRmin.push_back(pgonRmax[1]);
680  pgonRmax.push_back(pgonRmax[1]);
682  -alpha, 2*alpha, pgonZ, pgonRmin,
683  pgonRmax);
684  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
685  << " Polyhedra made of " << getSideMat(k)
686  << " with 1 sector from " << -alpha/CLHEP::deg
687  << " to " << alpha/CLHEP::deg << " and with "
688  << pgonZ.size() << " sections";
689  for (unsigned int ii=0; ii<pgonZ.size(); ii++) {
690  LogDebug("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = "
691  << pgonRmin[ii] << "\tRmax = " << pgonRmax[ii];
692  }
693 
695  DDMaterial matter(matName);
696  DDLogicalPart glog = DDLogicalPart(solid.ddname(), matter, solid);
697 
698  cpv.position(glog, laylog, 1, DDTranslation(), DDRotation());
699  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << glog.name()
700  << " Number 1 positioned in " << laylog.name()
701  << " at (0,0,0) with no rotation";
702 
703  if (nAbs < 0) {
704  DDLogicalPart mother = glog;
705  double rmid = pgonRmax[0];
706  for (int i = 0; i < getSideAbsorber(); i++) {
707  double alpha1 = atan(getSideAbsW(i)/rmid);
708  if (alpha1 > 0) {
709  string name = namek + getSideAbsName(i);
710  solid = DDSolidFactory::polyhedra(DDName(name, idNameSpace), 1,
711  -alpha1, 2*alpha1, pgonZ, pgonRmin,
712  pgonRmax);
713  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << solid.name()
714  << " Polyhedra made of " << getSideAbsMat(i)
715  << " with 1 sector from " << -alpha1/CLHEP::deg
716  << " to " << alpha1/CLHEP::deg << " and with "
717  << pgonZ.size() << " sections";
718  for (unsigned int ii=0; ii<pgonZ.size(); ii++) {
719  LogDebug("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = "
720  << pgonRmin[ii] << "\tRmax = " << pgonRmax[ii];
721  }
722 
723  DDName matName(DDSplit(getSideAbsMat(i)).first,
725  DDMaterial matter(matName);
726  DDLogicalPart log = DDLogicalPart(solid.ddname(), matter, solid);
727 
728  cpv.position(log, mother, 1, DDTranslation(), DDRotation());
729  LogDebug("HCalGeom") << "DDHCalBarrelAlgo test: " << log.name()
730  << " Number 1 positioned in " << mother.name()
731  << " at (0,0,0) with no rotation";
732  mother = log;
733  }
734  }
735  }
736  return glog;
737 }
#define LogDebug(id)
std::string getSideAbsName(unsigned int i) const
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
const N & name() const
Definition: DDBase.h:78
double getRmax(unsigned int i) const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
double getSideAbsW(unsigned int i) const
std::string idNameSpace
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
int getRzones() const
int ii
Definition: cuy.py:588
A DDSolid represents the shape of a part.
Definition: DDSolid.h:37
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
double getZoff(unsigned int i) const
U second(std::pair< T, U > const &p)
int getSideAbsorber() const
double getSideD(unsigned int i) const
std::string getSideAbsMat(unsigned int i) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::string getSideMat(unsigned int i) const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
double getTanTheta(unsigned int i) const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
double getSideT(unsigned int i) const
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:708
const N & ddname() const
Definition: DDBase.h:80
void DDHCalBarrelAlgo::execute ( DDCompactView cpv)

Definition at line 190 of file DDHCalBarrelAlgo.cc.

References constructGeneralVolume(), and LogDebug.

190  {
191 
192  LogDebug("HCalGeom") << "==>> Constructing DDHCalBarrelAlgo...";
194  LogDebug("HCalGeom") << "<<== End of DDHCalBarrelAlgo construction ...";
195 }
#define LogDebug(id)
void constructGeneralVolume(DDCompactView &cpv)
double DDHCalBarrelAlgo::getAbsorbD ( unsigned int  i) const
inline

Definition at line 53 of file DDHCalBarrelAlgo.h.

References absorbD, and i.

Referenced by constructMidLayer().

53 {return absorbD[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > absorbD
int DDHCalBarrelAlgo::getAbsorberN ( ) const
inline

Definition at line 50 of file DDHCalBarrelAlgo.h.

References nAbsorber.

Referenced by constructMidLayer().

50 {return nAbsorber;}
std::string DDHCalBarrelAlgo::getAbsorbMat ( unsigned int  i) const
inline

Definition at line 52 of file DDHCalBarrelAlgo.h.

References absorbMat, and i.

Referenced by constructMidLayer().

52 {return absorbMat[i];}
std::vector< std::string > absorbMat
int i
Definition: DBlmapReader.cc:9
std::string DDHCalBarrelAlgo::getAbsorbName ( unsigned int  i) const
inline

Definition at line 51 of file DDHCalBarrelAlgo.h.

References absorbName, and i.

Referenced by constructMidLayer().

51 {return absorbName[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > absorbName
double DDHCalBarrelAlgo::getAbsorbT ( unsigned int  i) const
inline

Definition at line 54 of file DDHCalBarrelAlgo.h.

References absorbT, and i.

Referenced by constructMidLayer().

54 {return absorbT[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > absorbT
double DDHCalBarrelAlgo::getDetdP1 ( unsigned int  i) const
inline

Definition at line 68 of file DDHCalBarrelAlgo.h.

References detdP1, and i.

Referenced by constructInsideDetectors().

68 {return detdP1[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > detdP1
double DDHCalBarrelAlgo::getDetdP2 ( unsigned int  i) const
inline

Definition at line 69 of file DDHCalBarrelAlgo.h.

References detdP2, and i.

Referenced by constructInsideDetectors().

69 {return detdP2[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > detdP2
std::string DDHCalBarrelAlgo::getDetMat ( ) const
inline

Definition at line 64 of file DDHCalBarrelAlgo.h.

References detMat.

Referenced by constructInsideLayers().

64 {return detMat;}
std::string DDHCalBarrelAlgo::getDetMatPl ( ) const
inline

Definition at line 65 of file DDHCalBarrelAlgo.h.

References detMatPl.

Referenced by constructInsideDetectors().

65 {return detMatPl;}
std::string detMatPl
std::string DDHCalBarrelAlgo::getDetMatSc ( ) const
inline

Definition at line 66 of file DDHCalBarrelAlgo.h.

References detMatSc.

Referenced by constructInsideDetectors().

66 {return detMatSc;}
std::string detMatSc
int DDHCalBarrelAlgo::getDetPosY ( unsigned int  i) const
inline

Definition at line 77 of file DDHCalBarrelAlgo.h.

References detPosY, and i.

Referenced by constructInsideDetectors().

77 {return detPosY[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< int > detPosY
double DDHCalBarrelAlgo::getDetT11 ( unsigned int  i) const
inline

Definition at line 70 of file DDHCalBarrelAlgo.h.

References detT11, and i.

Referenced by constructInsideDetectors().

70 {return detT11[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > detT11
double DDHCalBarrelAlgo::getDetT12 ( unsigned int  i) const
inline

Definition at line 71 of file DDHCalBarrelAlgo.h.

References detT12, and i.

Referenced by constructInsideDetectors().

71 {return detT12[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > detT12
double DDHCalBarrelAlgo::getDetT21 ( unsigned int  i) const
inline

Definition at line 73 of file DDHCalBarrelAlgo.h.

References detT21, and i.

Referenced by constructInsideDetectors().

73 {return detT21[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > detT21
double DDHCalBarrelAlgo::getDetT22 ( unsigned int  i) const
inline

Definition at line 74 of file DDHCalBarrelAlgo.h.

References detT22, and i.

Referenced by constructInsideDetectors().

74 {return detT22[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > detT22
double DDHCalBarrelAlgo::getDetTsc ( unsigned int  i) const
inline

Definition at line 72 of file DDHCalBarrelAlgo.h.

References detTsc, and i.

Referenced by constructInsideDetectors().

72 {return detTsc[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > detTsc
int DDHCalBarrelAlgo::getDetType ( unsigned int  i) const
inline

Definition at line 67 of file DDHCalBarrelAlgo.h.

References detType, and i.

Referenced by constructInsideDetectors().

67 {return detType[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< int > detType
double DDHCalBarrelAlgo::getDetWidth1 ( unsigned int  i) const
inline

Definition at line 75 of file DDHCalBarrelAlgo.h.

References detWidth1, and i.

Referenced by constructInsideDetectors().

75 {return detWidth1[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > detWidth1
double DDHCalBarrelAlgo::getDetWidth2 ( unsigned int  i) const
inline

Definition at line 76 of file DDHCalBarrelAlgo.h.

References detWidth2, and i.

Referenced by constructInsideDetectors().

76 {return detWidth2[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > detWidth2
std::string DDHCalBarrelAlgo::getGenMaterial ( ) const
inline

Definition at line 17 of file DDHCalBarrelAlgo.h.

References genMaterial.

Referenced by constructGeneralVolume().

17 {return genMaterial;}
std::string genMaterial
int DDHCalBarrelAlgo::getLayerAbsorb ( unsigned int  i) const
inline

Definition at line 39 of file DDHCalBarrelAlgo.h.

References i, and layerAbsorb.

Referenced by constructInsideSector().

39 {return layerAbsorb[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< int > layerAbsorb
double DDHCalBarrelAlgo::getLayerAlpha ( unsigned  i) const
inline

Definition at line 36 of file DDHCalBarrelAlgo.h.

References i, and layerAlpha.

Referenced by constructInsideSector().

36 {return layerAlpha[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > layerAlpha
double DDHCalBarrelAlgo::getLayerD1 ( unsigned  i) const
inline

Definition at line 34 of file DDHCalBarrelAlgo.h.

References i, and layerD1.

Referenced by constructInsideSector().

34 {return layerD1[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > layerD1
double DDHCalBarrelAlgo::getLayerD2 ( unsigned  i) const
inline

Definition at line 35 of file DDHCalBarrelAlgo.h.

References i, and layerD2.

Referenced by constructInsideSector().

35 {return layerD2[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > layerD2
double DDHCalBarrelAlgo::getLayerGap ( unsigned int  i) const
inline

Definition at line 40 of file DDHCalBarrelAlgo.h.

References i, and layerGap.

Referenced by constructInsideSector().

40 {return layerGap[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > layerGap
int DDHCalBarrelAlgo::getLayerId ( unsigned  i) const
inline

Definition at line 30 of file DDHCalBarrelAlgo.h.

References i, and layerId.

Referenced by constructInsideSector().

30 {return layerId[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< int > layerId
std::string DDHCalBarrelAlgo::getLayerLabel ( unsigned  i) const
inline

Definition at line 31 of file DDHCalBarrelAlgo.h.

References i, and layerLabel.

Referenced by constructInsideSector().

31 {return layerLabel[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > layerLabel
std::string DDHCalBarrelAlgo::getLayerMaterial ( unsigned  i) const
inline

Definition at line 32 of file DDHCalBarrelAlgo.h.

References i, and layerMat.

Referenced by constructInsideSector().

32 {return layerMat[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > layerMat
double DDHCalBarrelAlgo::getLayerT1 ( unsigned  i) const
inline

Definition at line 37 of file DDHCalBarrelAlgo.h.

References i, and layerT1.

Referenced by constructInsideSector().

37 {return layerT1[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > layerT1
double DDHCalBarrelAlgo::getLayerT2 ( unsigned  i) const
inline

Definition at line 38 of file DDHCalBarrelAlgo.h.

References i, and layerT2.

Referenced by constructInsideSector().

38 {return layerT2[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > layerT2
double DDHCalBarrelAlgo::getLayerWidth ( unsigned  i) const
inline

Definition at line 33 of file DDHCalBarrelAlgo.h.

References i, and layerWidth.

Referenced by constructInsideSector().

33 {return layerWidth[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > layerWidth
std::string DDHCalBarrelAlgo::getMidAbsMat ( unsigned int  i) const
inline

Definition at line 60 of file DDHCalBarrelAlgo.h.

References i, and midMat.

Referenced by constructMidLayer().

60 {return midMat[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > midMat
std::string DDHCalBarrelAlgo::getMidAbsName ( unsigned int  i) const
inline

Definition at line 59 of file DDHCalBarrelAlgo.h.

References i, and midName.

Referenced by constructMidLayer().

59 {return midName[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > midName
int DDHCalBarrelAlgo::getMidAbsorber ( ) const
inline

Definition at line 58 of file DDHCalBarrelAlgo.h.

References nMidAbs.

Referenced by constructMidLayer().

58 {return nMidAbs;}
double DDHCalBarrelAlgo::getMidAbsT ( unsigned int  i) const
inline

Definition at line 62 of file DDHCalBarrelAlgo.h.

References i, and midT.

Referenced by constructMidLayer().

62 {return midT[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > midT
double DDHCalBarrelAlgo::getMidAbsW ( unsigned int  i) const
inline

Definition at line 61 of file DDHCalBarrelAlgo.h.

References i, and midW.

Referenced by constructMidLayer().

61 {return midW[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > midW
double DDHCalBarrelAlgo::getMiddleD ( ) const
inline

Definition at line 56 of file DDHCalBarrelAlgo.h.

References middleD.

Referenced by constructMidLayer().

56 {return middleD;}
std::string DDHCalBarrelAlgo::getMiddleMat ( ) const
inline

Definition at line 55 of file DDHCalBarrelAlgo.h.

References middleMat.

Referenced by constructMidLayer().

55 {return middleMat;}
std::string middleMat
double DDHCalBarrelAlgo::getMiddleW ( ) const
inline

Definition at line 57 of file DDHCalBarrelAlgo.h.

References middleW.

Referenced by constructMidLayer().

57 {return middleW;}
int DDHCalBarrelAlgo::getNhalf ( ) const
inline

Definition at line 20 of file DDHCalBarrelAlgo.h.

References nhalf.

Referenced by constructGeneralVolume().

20 {return nhalf;}
int DDHCalBarrelAlgo::getNLayers ( ) const
inline

Definition at line 29 of file DDHCalBarrelAlgo.h.

References nLayers.

Referenced by constructInsideSector().

29 {return nLayers;}
int DDHCalBarrelAlgo::getNsectors ( ) const
inline

Definition at line 18 of file DDHCalBarrelAlgo.h.

References nsectors.

Referenced by constructGeneralVolume(), and constructInsideSector().

18 {return nsectors;}
int DDHCalBarrelAlgo::getNsectortot ( ) const
inline

Definition at line 19 of file DDHCalBarrelAlgo.h.

References nsectortot.

Referenced by constructGeneralVolume().

19 {return nsectortot;}
double DDHCalBarrelAlgo::getRin ( ) const
inline

Definition at line 21 of file DDHCalBarrelAlgo.h.

References rin.

Referenced by constructGeneralVolume(), and constructInsideSector().

21 {return rin;}
double DDHCalBarrelAlgo::getRmax ( unsigned int  i) const
inline

Definition at line 26 of file DDHCalBarrelAlgo.h.

References i, and rmax.

Referenced by constructGeneralVolume(), constructInsideLayers(), constructInsideSector(), constructMidLayer(), and constructSideLayer().

26 {return rmax[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > rmax
double DDHCalBarrelAlgo::getRout ( ) const
inline

Definition at line 22 of file DDHCalBarrelAlgo.h.

References rout.

Referenced by constructGeneralVolume().

22 {return rout;}
int DDHCalBarrelAlgo::getRzones ( ) const
inline
std::string DDHCalBarrelAlgo::getSideAbsMat ( unsigned int  i) const
inline

Definition at line 47 of file DDHCalBarrelAlgo.h.

References i, and sideAbsMat.

Referenced by constructSideLayer().

47 {return sideAbsMat[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > sideAbsMat
std::string DDHCalBarrelAlgo::getSideAbsName ( unsigned int  i) const
inline

Definition at line 46 of file DDHCalBarrelAlgo.h.

References i, and sideAbsName.

Referenced by constructSideLayer().

46 {return sideAbsName[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > sideAbsName
int DDHCalBarrelAlgo::getSideAbsorber ( ) const
inline

Definition at line 45 of file DDHCalBarrelAlgo.h.

References nSideAbs.

Referenced by constructSideLayer().

45 {return nSideAbs;}
double DDHCalBarrelAlgo::getSideAbsW ( unsigned int  i) const
inline

Definition at line 48 of file DDHCalBarrelAlgo.h.

References i, and sideAbsW.

Referenced by constructSideLayer().

48 {return sideAbsW[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > sideAbsW
double DDHCalBarrelAlgo::getSideD ( unsigned int  i) const
inline

Definition at line 43 of file DDHCalBarrelAlgo.h.

References i, and sideD.

Referenced by constructSideLayer().

43 {return sideD[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > sideD
std::string DDHCalBarrelAlgo::getSideMat ( unsigned int  i) const
inline

Definition at line 42 of file DDHCalBarrelAlgo.h.

References i, and sideMat.

Referenced by constructSideLayer().

42 {return sideMat[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > sideMat
double DDHCalBarrelAlgo::getSideT ( unsigned int  i) const
inline

Definition at line 44 of file DDHCalBarrelAlgo.h.

References i, and sideT.

Referenced by constructSideLayer().

44 {return sideT[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > sideT
double DDHCalBarrelAlgo::getTanTheta ( unsigned int  i) const
inline

Definition at line 24 of file DDHCalBarrelAlgo.h.

References i, and ttheta.

Referenced by constructGeneralVolume(), constructInsideLayers(), constructInsideSector(), constructMidLayer(), and constructSideLayer().

24 {return ttheta[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > ttheta
double DDHCalBarrelAlgo::getTheta ( unsigned int  i) const
inline

Definition at line 25 of file DDHCalBarrelAlgo.h.

References i, and theta.

25 {return theta[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > theta
double DDHCalBarrelAlgo::getZoff ( unsigned int  i) const
inline

Definition at line 27 of file DDHCalBarrelAlgo.h.

References i, and zoff.

Referenced by constructGeneralVolume(), constructInsideLayers(), constructInsideSector(), constructMidLayer(), and constructSideLayer().

27 {return zoff[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > zoff
void DDHCalBarrelAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 37 of file DDHCalBarrelAlgo.cc.

References absorbD, absorbMat, absorbName, absorbT, dbl_to_int(), detdP1, detdP2, detMat, detMatPl, detMatSc, detPosY, detRot, detT11, detT12, detT21, detT22, detTsc, detType, detWidth1, detWidth2, genMaterial, i, idName, idNameSpace, idOffset, layerAbsorb, layerAlpha, layerD1, layerD2, layerGap, layerId, layerLabel, layerMat, layerT1, layerT2, layerWidth, LogDebug, middleD, middleMat, middleW, midMat, midName, midT, midW, nAbsorber, nhalf, nLayers, nMidAbs, DDCurrentNamespace::ns(), nsectors, nsectortot, nSideAbs, SpecificationBuilder_cfi::parent(), rin, rmax, rotHalf, rotns, rout, rzones, sideAbsMat, sideAbsName, sideAbsW, sideD, sideMat, sideT, funct::tan(), theta, ttheta, and zoff.

41  {
42 
43  genMaterial = sArgs["MaterialName"];
44  nsectors = int (nArgs["NSector"]);
45  nsectortot = int (nArgs["NSectorTot"]);
46  nhalf = int (nArgs["NHalf"]);
47  rin = nArgs["RIn"];
48  rout = nArgs["ROut"];
49  rzones = int (nArgs["RZones"]);
50  rotHalf = sArgs["RotHalf"];
51  rotns = sArgs["RotNameSpace"];
52 
53  theta = vArgs["Theta"];
54  rmax = vArgs["RMax"];
55  zoff = vArgs["ZOff"];
56  int i = 0;
57  for (i = 0; i < rzones; i++) {
58  ttheta.push_back(tan(theta[i])); //*deg already done in XML
59  }
60  if (rzones > 3)
61  rmax[2] = (zoff[3] - zoff[2]) / ttheta[2];
62 
63  LogDebug("HCalGeom") << "DDHCalBarrelAlgo debug: General material "
64  << genMaterial << "\tSectors " << nsectors << ", "
65  << nsectortot <<"\tHalves " << nhalf
66  << "\tRotation matrix " << rotns << ":" << rotHalf
67  << "\n\t\t" << rin << "\t" << rout << "\t" << rzones;
68  for (i = 0; i < rzones; i++) {
69  LogDebug("HCalGeom") << "\tTheta[" << i << "] = " << theta[i] << "\trmax["
70  << i << "] = " << rmax[i] << "\tzoff[" << i << "] = "
71  << zoff[i];
72  }
74  //Layers
75  nLayers = int(nArgs["NLayers"]);
76  LogDebug("HCalGeom") << "DDHCalBarrelAlgo debug: Layer\t" << nLayers;
77  layerId = dbl_to_int (vArgs["Id"]);
78  layerLabel = vsArgs["LayerLabel"];
79  layerMat = vsArgs["LayerMat"];
80  layerWidth = vArgs["LayerWidth"];
81  layerD1 = vArgs["D1"];
82  layerD2 = vArgs["D2"];
83  layerAlpha = vArgs["Alpha2"];
84  layerT1 = vArgs["T1"];
85  layerT2 = vArgs["T2"];
86  layerAbsorb = dbl_to_int(vArgs["AbsL"]);
87  layerGap = vArgs["Gap"];
88  for (i = 0; i < nLayers; i++) {
89  LogDebug("HCalGeom") << layerLabel[i] << "\t" << layerId[i] << "\t"
90  << layerMat[i] << "\t" << layerWidth[i] << "\t"
91  << layerD1[i] << "\t" << layerD2[i] << "\t"
92  << layerAlpha[i] << "\t" << layerT1[i] << "\t"
93  << layerT2[i] << "\t" << layerAbsorb[i] << "\t"
94  << layerGap[i];
95  }
96 
98  //Absorber Layers and middle part
99  absorbName = vsArgs["AbsorbName"];
100  absorbMat = vsArgs["AbsorbMat"];
101  absorbD = vArgs["AbsorbD"];
102  absorbT = vArgs["AbsorbT"];
103  nAbsorber = absorbName.size();
104  for (i = 0; i < nAbsorber; i++) {
105  LogDebug("HCalGeom") << "DDHCalBarrelAlgo debug: " << absorbName[i]
106  <<" Material " << absorbMat[i] << " d " << absorbD[i]
107  << " t " <<absorbT[i];
108  }
109  middleMat = sArgs["MiddleMat"];
110  middleD = nArgs["MiddleD"];
111  middleW = nArgs["MiddleW"];
112  LogDebug("HCalGeom") << "DDHCalBarrelAlgo debug: Middle material "
113  << middleMat << " d " << middleD << " w " << middleW;
114  midName = vsArgs["MidAbsName"];
115  midMat = vsArgs["MidAbsMat"];
116  midW = vArgs["MidAbsW"];
117  midT = vArgs["MidAbsT"];
118  nMidAbs = midName.size();
119  for (i = 0; i < nMidAbs; i++) {
120  LogDebug("HCalGeom") << "DDHCalBarrelAlgo debug: " << midName[i]
121  << " Material " << midMat[i] << " W " << midW[i]
122  << " T " << midT[i];
123  }
124 
125  //Absorber layers in the side part
126  sideMat = vsArgs["SideMat"];
127  sideD = vArgs["SideD"];
128  sideT = vArgs["SideT"];
129  int nSide = sideMat.size();
130  for (int i = 0; i < nSide; i++) {
131  LogDebug("HCalGeom") << "DDHCalBarrelAlgo debug: Side material "
132  << sideMat[i] << " d " << sideD[i] << " t "
133  << sideT[i];
134  }
135  sideAbsName = vsArgs["SideAbsName"];
136  sideAbsMat = vsArgs["SideAbsMat"];
137  sideAbsW = vArgs["SideAbsW"];
138  nSideAbs = sideAbsName.size();
139  for (i = 0; i < nSideAbs; i++) {
140  LogDebug("HCalGeom") << "DDHCalBarrelAlgo debug: " << sideAbsName[i]
141  <<" Material " << sideAbsMat[i] << " W "
142  << sideAbsW[i];
143  }
144 
146  // Detectors
147 
148  detMat = sArgs["DetMat"];
149  detRot = sArgs["DetRot"];
150  detMatPl = sArgs["DetMatPl"];
151  detMatSc = sArgs["DetMatSc"];
152  LogDebug("HCalGeom") << "DDHCalBarrelAlgo debug: Detector (" << nLayers
153  << ") Rotation matrix " << rotns << ":" << detRot
154  << "\n\t\t" << detMat << "\t" << detMatPl << "\t"
155  << detMatSc;
156 
157  detType = dbl_to_int(vArgs["DetType"]);
158  detdP1 = vArgs["DetdP1"];
159  detdP2 = vArgs["DetdP2"];
160  detT11 = vArgs["DetT11"];
161  detT12 = vArgs["DetT12"];
162  detTsc = vArgs["DetTsc"];
163  detT21 = vArgs["DetT21"];
164  detT22 = vArgs["DetT22"];
165  detWidth1 = vArgs["DetWidth1"];
166  detWidth2 = vArgs["DetWidth2"];
167  detPosY = dbl_to_int(vArgs["DetPosY"]);
168  for (i = 0; i < nLayers; i ++) {
169  LogDebug("HCalGeom") << i+1 << "\t" << detType[i] << "\t" << detdP1[i]
170  << ", " << detdP2[i] << "\t" << detT11[i] << ", "
171  << detT12[i] << "\t" << detTsc[i] << "\t" << detT21[i]
172  <<", " << detT22[i] << "\t" << detWidth1[i] << "\t"
173  << detWidth2[i] << "\t" << detPosY[i];
174  }
175 
176  // idName = parentName.name();
177  idName = sArgs["MotherName"];
179  idOffset = int (nArgs["IdOffset"]);
180  DDName parentName = parent().name();
181  LogDebug("HCalGeom") << "DDHCalBarrelAlgo debug: Parent " << parentName
182  <<" idName " << idName << " NameSpace " << idNameSpace
183  << " Offset " << idOffset;
184 }
#define LogDebug(id)
std::vector< std::string > absorbMat
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > midMat
std::vector< double > sideAbsW
std::vector< std::string > layerLabel
std::string idNameSpace
std::vector< double > layerD2
std::vector< std::string > layerMat
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
std::vector< int > layerId
static std::string & ns()
std::vector< double > rmax
std::string detMatSc
std::string genMaterial
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::vector< double > layerT1
std::vector< double > detdP2
std::vector< double > detWidth2
std::vector< std::string > sideAbsName
std::vector< double > detdP1
std::vector< double > absorbT
std::vector< double > detWidth1
std::vector< double > layerGap
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< double > layerAlpha
std::vector< double > detT22
std::vector< int > layerAbsorb
std::vector< std::string > sideAbsMat
std::vector< double > sideT
std::vector< double > detTsc
std::vector< std::string > midName
std::vector< std::string > sideMat
std::vector< double > detT21
std::vector< int > detPosY
std::vector< int > detType
std::string detMatPl
std::vector< double > zoff
std::vector< double > sideD
std::vector< double > detT11
std::vector< double > absorbD
std::vector< double > ttheta
std::vector< double > theta
std::string middleMat
std::vector< double > layerWidth
std::vector< std::string > absorbName
std::vector< double > midW
std::vector< double > layerD1
std::vector< double > detT12
std::vector< double > midT
std::vector< double > layerT2

Member Data Documentation

std::vector<double> DDHCalBarrelAlgo::absorbD
private

Definition at line 169 of file DDHCalBarrelAlgo.h.

Referenced by getAbsorbD(), and initialize().

std::vector<std::string> DDHCalBarrelAlgo::absorbMat
private

Definition at line 168 of file DDHCalBarrelAlgo.h.

Referenced by getAbsorbMat(), and initialize().

std::vector<std::string> DDHCalBarrelAlgo::absorbName
private

Definition at line 167 of file DDHCalBarrelAlgo.h.

Referenced by getAbsorbName(), and initialize().

std::vector<double> DDHCalBarrelAlgo::absorbT
private

Definition at line 170 of file DDHCalBarrelAlgo.h.

Referenced by getAbsorbT(), and initialize().

std::vector<double> DDHCalBarrelAlgo::detdP1
private

Definition at line 205 of file DDHCalBarrelAlgo.h.

Referenced by getDetdP1(), and initialize().

std::vector<double> DDHCalBarrelAlgo::detdP2
private

Definition at line 206 of file DDHCalBarrelAlgo.h.

Referenced by getDetdP2(), and initialize().

std::string DDHCalBarrelAlgo::detMat
private

Definition at line 200 of file DDHCalBarrelAlgo.h.

Referenced by getDetMat(), and initialize().

std::string DDHCalBarrelAlgo::detMatPl
private

Definition at line 202 of file DDHCalBarrelAlgo.h.

Referenced by getDetMatPl(), and initialize().

std::string DDHCalBarrelAlgo::detMatSc
private

Definition at line 203 of file DDHCalBarrelAlgo.h.

Referenced by getDetMatSc(), and initialize().

std::vector<int> DDHCalBarrelAlgo::detPosY
private

Definition at line 214 of file DDHCalBarrelAlgo.h.

Referenced by getDetPosY(), and initialize().

std::string DDHCalBarrelAlgo::detRot
private

Definition at line 201 of file DDHCalBarrelAlgo.h.

Referenced by constructInsideLayers(), and initialize().

std::vector<double> DDHCalBarrelAlgo::detT11
private

Definition at line 207 of file DDHCalBarrelAlgo.h.

Referenced by getDetT11(), and initialize().

std::vector<double> DDHCalBarrelAlgo::detT12
private

Definition at line 208 of file DDHCalBarrelAlgo.h.

Referenced by getDetT12(), and initialize().

std::vector<double> DDHCalBarrelAlgo::detT21
private

Definition at line 210 of file DDHCalBarrelAlgo.h.

Referenced by getDetT21(), and initialize().

std::vector<double> DDHCalBarrelAlgo::detT22
private

Definition at line 211 of file DDHCalBarrelAlgo.h.

Referenced by getDetT22(), and initialize().

std::vector<double> DDHCalBarrelAlgo::detTsc
private

Definition at line 209 of file DDHCalBarrelAlgo.h.

Referenced by getDetTsc(), and initialize().

std::vector<int> DDHCalBarrelAlgo::detType
private

Definition at line 204 of file DDHCalBarrelAlgo.h.

Referenced by getDetType(), and initialize().

std::vector<double> DDHCalBarrelAlgo::detWidth1
private

Definition at line 212 of file DDHCalBarrelAlgo.h.

Referenced by getDetWidth1(), and initialize().

std::vector<double> DDHCalBarrelAlgo::detWidth2
private

Definition at line 213 of file DDHCalBarrelAlgo.h.

Referenced by getDetWidth2(), and initialize().

std::string DDHCalBarrelAlgo::genMaterial
private

Definition at line 114 of file DDHCalBarrelAlgo.h.

Referenced by getGenMaterial(), and initialize().

std::string DDHCalBarrelAlgo::idName
private
std::string DDHCalBarrelAlgo::idNameSpace
private
int DDHCalBarrelAlgo::idOffset
private

Definition at line 218 of file DDHCalBarrelAlgo.h.

Referenced by constructInsideLayers(), and initialize().

std::vector<int> DDHCalBarrelAlgo::layerAbsorb
private

Definition at line 163 of file DDHCalBarrelAlgo.h.

Referenced by getLayerAbsorb(), and initialize().

std::vector<double> DDHCalBarrelAlgo::layerAlpha
private

Definition at line 160 of file DDHCalBarrelAlgo.h.

Referenced by getLayerAlpha(), and initialize().

std::vector<double> DDHCalBarrelAlgo::layerD1
private

Definition at line 158 of file DDHCalBarrelAlgo.h.

Referenced by getLayerD1(), and initialize().

std::vector<double> DDHCalBarrelAlgo::layerD2
private

Definition at line 159 of file DDHCalBarrelAlgo.h.

Referenced by getLayerD2(), and initialize().

std::vector<double> DDHCalBarrelAlgo::layerGap
private

Definition at line 164 of file DDHCalBarrelAlgo.h.

Referenced by getLayerGap(), and initialize().

std::vector<int> DDHCalBarrelAlgo::layerId
private

Definition at line 154 of file DDHCalBarrelAlgo.h.

Referenced by getLayerId(), and initialize().

std::vector<std::string> DDHCalBarrelAlgo::layerLabel
private

Definition at line 155 of file DDHCalBarrelAlgo.h.

Referenced by getLayerLabel(), and initialize().

std::vector<std::string> DDHCalBarrelAlgo::layerMat
private

Definition at line 156 of file DDHCalBarrelAlgo.h.

Referenced by getLayerMaterial(), and initialize().

std::vector<double> DDHCalBarrelAlgo::layerT1
private

Definition at line 161 of file DDHCalBarrelAlgo.h.

Referenced by getLayerT1(), and initialize().

std::vector<double> DDHCalBarrelAlgo::layerT2
private

Definition at line 162 of file DDHCalBarrelAlgo.h.

Referenced by getLayerT2(), and initialize().

std::vector<double> DDHCalBarrelAlgo::layerWidth
private

Definition at line 157 of file DDHCalBarrelAlgo.h.

Referenced by getLayerWidth(), and initialize().

double DDHCalBarrelAlgo::middleD
private

Definition at line 172 of file DDHCalBarrelAlgo.h.

Referenced by getMiddleD(), and initialize().

std::string DDHCalBarrelAlgo::middleMat
private

Definition at line 171 of file DDHCalBarrelAlgo.h.

Referenced by getMiddleMat(), and initialize().

double DDHCalBarrelAlgo::middleW
private

Definition at line 173 of file DDHCalBarrelAlgo.h.

Referenced by getMiddleW(), and initialize().

std::vector<std::string> DDHCalBarrelAlgo::midMat
private

Definition at line 176 of file DDHCalBarrelAlgo.h.

Referenced by getMidAbsMat(), and initialize().

std::vector<std::string> DDHCalBarrelAlgo::midName
private

Definition at line 175 of file DDHCalBarrelAlgo.h.

Referenced by getMidAbsName(), and initialize().

std::vector<double> DDHCalBarrelAlgo::midT
private

Definition at line 178 of file DDHCalBarrelAlgo.h.

Referenced by getMidAbsT(), and initialize().

std::vector<double> DDHCalBarrelAlgo::midW
private

Definition at line 177 of file DDHCalBarrelAlgo.h.

Referenced by getMidAbsW(), and initialize().

int DDHCalBarrelAlgo::nAbsorber
private

Definition at line 166 of file DDHCalBarrelAlgo.h.

Referenced by getAbsorberN(), and initialize().

int DDHCalBarrelAlgo::nhalf
private

Definition at line 117 of file DDHCalBarrelAlgo.h.

Referenced by getNhalf(), and initialize().

int DDHCalBarrelAlgo::nLayers
private

Definition at line 153 of file DDHCalBarrelAlgo.h.

Referenced by getNLayers(), and initialize().

int DDHCalBarrelAlgo::nMidAbs
private

Definition at line 174 of file DDHCalBarrelAlgo.h.

Referenced by getMidAbsorber(), and initialize().

int DDHCalBarrelAlgo::nsectors
private

Definition at line 115 of file DDHCalBarrelAlgo.h.

Referenced by getNsectors(), and initialize().

int DDHCalBarrelAlgo::nsectortot
private

Definition at line 116 of file DDHCalBarrelAlgo.h.

Referenced by getNsectortot(), and initialize().

int DDHCalBarrelAlgo::nSideAbs
private

Definition at line 183 of file DDHCalBarrelAlgo.h.

Referenced by getSideAbsorber(), and initialize().

double DDHCalBarrelAlgo::rin
private
std::vector<double> DDHCalBarrelAlgo::rmax
private

Definition at line 121 of file DDHCalBarrelAlgo.h.

Referenced by constructMidLayer(), getRmax(), and initialize().

std::string DDHCalBarrelAlgo::rotHalf
private

Definition at line 124 of file DDHCalBarrelAlgo.h.

Referenced by constructGeneralVolume(), and initialize().

std::string DDHCalBarrelAlgo::rotns
private

Definition at line 125 of file DDHCalBarrelAlgo.h.

Referenced by constructGeneralVolume(), constructInsideLayers(), and initialize().

double DDHCalBarrelAlgo::rout
private
int DDHCalBarrelAlgo::rzones
private

Definition at line 119 of file DDHCalBarrelAlgo.h.

Referenced by getRzones(), and initialize().

std::vector<std::string> DDHCalBarrelAlgo::sideAbsMat
private

Definition at line 185 of file DDHCalBarrelAlgo.h.

Referenced by getSideAbsMat(), and initialize().

std::vector<std::string> DDHCalBarrelAlgo::sideAbsName
private

Definition at line 184 of file DDHCalBarrelAlgo.h.

Referenced by getSideAbsName(), and initialize().

std::vector<double> DDHCalBarrelAlgo::sideAbsW
private

Definition at line 186 of file DDHCalBarrelAlgo.h.

Referenced by getSideAbsW(), and initialize().

std::vector<double> DDHCalBarrelAlgo::sideD
private

Definition at line 181 of file DDHCalBarrelAlgo.h.

Referenced by getSideD(), and initialize().

std::vector<std::string> DDHCalBarrelAlgo::sideMat
private

Definition at line 180 of file DDHCalBarrelAlgo.h.

Referenced by getSideMat(), and initialize().

std::vector<double> DDHCalBarrelAlgo::sideT
private

Definition at line 182 of file DDHCalBarrelAlgo.h.

Referenced by getSideT(), and initialize().

std::vector<double> DDHCalBarrelAlgo::theta
private

Definition at line 120 of file DDHCalBarrelAlgo.h.

Referenced by getTheta(), initialize(), and Tau.Tau::zImpact().

std::vector<double> DDHCalBarrelAlgo::ttheta
private

Definition at line 123 of file DDHCalBarrelAlgo.h.

Referenced by getTanTheta(), and initialize().

std::vector<double> DDHCalBarrelAlgo::zoff
private

Definition at line 122 of file DDHCalBarrelAlgo.h.

Referenced by getZoff(), and initialize().