CMS 3D CMS Logo

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

#include <DDHGCalEEAlgo.h>

Inheritance diagram for DDHGCalEEAlgo:

Classes

struct  HGCalEEPar
 

Public Member Functions

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

Protected Member Functions

void constructLayers (DDLogicalPart, DDCompactView &cpv)
 
HGCalEEPar parameterLayer (double rinF, double routF, double rinB, double routB, double zi, double zo)
 
double rMax (double z)
 

Private Attributes

std::vector< int > copyNumber
 
std::vector< int > heightType
 
std::string idName
 
std::string idNameSpace
 
std::vector< int > layerType
 
std::vector< std::string > materials
 
std::vector< std::string > names
 
std::vector< double > rMaxFront
 
std::string rotstr
 
int sectors
 
double slopeB
 
std::vector< double > slopeT
 
std::vector< double > thick
 
std::vector< double > thickBlock
 
std::vector< double > zFront
 
double zMinBlock
 

Detailed Description

Definition at line 10 of file DDHGCalEEAlgo.h.

Constructor & Destructor Documentation

DDHGCalEEAlgo::DDHGCalEEAlgo ( )

Definition at line 20 of file DDHGCalEEAlgo.cc.

20  {
21  edm::LogInfo("HGCalGeom") << "DDHGCalEEAlgo info: Creating an instance";
22 }
DDHGCalEEAlgo::~DDHGCalEEAlgo ( )
virtual

Definition at line 24 of file DDHGCalEEAlgo.cc.

24 {}

Member Function Documentation

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

Definition at line 89 of file DDHGCalEEAlgo.cc.

References DDHGCalEEAlgo::HGCalEEPar::alp, DDHGCalEEAlgo::HGCalEEPar::bl1, DDHGCalEEAlgo::HGCalEEPar::bl2, filterCSVwithJSON::copy, copyNumber, dbl_to_string(), DDBase< N, C >::ddname(), DDSplit(), plotBeamSpotDB::first, heightType, i, idNameSpace, cuy::ii, layerType, materials, mergeVDriftHistosByStation::name, DDBase< N, C >::name(), names, parameterLayer(), DDHGCalEEAlgo::HGCalEEPar::phi, DDCompactView::position(), diffTwoXMLs::r1, rMax(), makeMuonMisalignmentScenario::rot, rotstr, edm::second(), slopeB, AlCaHLTBitMon_QueryRunRegistry::string, DDHGCalEEAlgo::HGCalEEPar::theta, thick, thickBlock, DDHGCalEEAlgo::HGCalEEPar::tl1, DDHGCalEEAlgo::HGCalEEPar::tl2, DDSolidFactory::trap(), DDHGCalEEAlgo::HGCalEEPar::xpos, DDHGCalEEAlgo::HGCalEEPar::yh1, DDHGCalEEAlgo::HGCalEEPar::yh2, DDHGCalEEAlgo::HGCalEEPar::ypos, zMinBlock, and DDHGCalEEAlgo::HGCalEEPar::zpos.

Referenced by execute().

89  {
90 
91  edm::LogInfo("HGCalGeom") << "DDHGCalEEAlgo test: \t\tInside Layers";
92 
94  //Pointers to the Rotation Matrices and to the Materials
96 
97  double zi(zMinBlock), zz(zMinBlock);
98  for (unsigned int i=0; i<layerType.size(); i++) {
99  int ii = layerType[i];
100  int copy = copyNumber[ii];
101  ++copyNumber[ii];
102  double layer_thick = thickBlock[i];
103 
104  if (heightType[i] == 0) zz = zi;
105  double zlayer = zz + layer_thick;
106  double zo = zi + thick[ii];
107  double rinF = zi * slopeB;
108  double rinB = zlayer * slopeB;
109  double routF = (heightType[i] == 0) ? rMax(zi) : rMax(zz);
110  double routB = rMax(zo);
111 
112  std::string name = "HGCal"+names[ii]+dbl_to_string(copy);
113  edm::LogInfo("HGCalGeom") << "DDHGCalEEAlgo test: Layer " << i << ":"
114  << ii << " Front " << zi << ", " << rinF << ", "
115  << routF << " Back " << zo << ", " << rinB
116  << ", " << routB << " superlayer thickness "
117  << layer_thick;
118  DDHGCalEEAlgo::HGCalEEPar parm = parameterLayer(rinF, routF, rinB,
119  routB, zi, zo);
121  0.5*thick[ii], parm.theta,
122  parm.phi, parm.yh1, parm.bl1,
123  parm.tl1, parm.alp, parm.yh2,
124  parm.bl2, parm.tl2, parm.alp);
125 
126  DDName matName(DDSplit(materials[ii]).first,
127  DDSplit(materials[ii]).second);
128  DDMaterial matter(matName);
129  DDLogicalPart glog = DDLogicalPart(solid.ddname(), matter, solid);
130  edm::LogInfo("HGCalGeom") << "DDHGCalEEAlgo test: "
131  << solid.name() << " Trap made of " << matName
132  << " of dimensions " << 0.5*thick[ii] << ", "
133  << parm.theta/CLHEP::deg << ", "
134  << parm.phi/CLHEP::deg << ", " << parm.yh1
135  << ", " << parm.bl1 << ", " << parm.tl1
136  << ", " << parm.alp/CLHEP::deg << ", "
137  << parm.yh2 << ", " << parm.bl2 << ", "
138  << parm.tl2 << ", " << parm.alp/CLHEP::deg;
139  DDTranslation r1(parm.xpos, parm.ypos, parm.zpos);
140  cpv.position(glog, module, copy, r1, rot);
141  edm::LogInfo("HGCalGeom") << "DDHGCalEEAlgo test: " << glog.name()
142  << " number " << copy << " positioned in "
143  << module.name() << " at " << r1 << " with "
144  << rot;
145  zi = zo;
146  } // End of loop on layers
147 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > thick
Definition: DDHGCalEEAlgo.h:47
const N & name() const
Definition: DDBase.h:78
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
std::vector< std::string > names
Definition: DDHGCalEEAlgo.h:42
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:14
std::vector< std::string > materials
Definition: DDHGCalEEAlgo.h:41
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
int ii
Definition: cuy.py:588
double rMax(double z)
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
U second(std::pair< T, U > const &p)
std::string idNameSpace
Definition: DDHGCalEEAlgo.h:56
double zMinBlock
Definition: DDHGCalEEAlgo.h:49
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
std::vector< double > thickBlock
Definition: DDHGCalEEAlgo.h:48
std::vector< int > layerType
Definition: DDHGCalEEAlgo.h:44
std::vector< int > heightType
Definition: DDHGCalEEAlgo.h:45
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:723
std::string rotstr
Definition: DDHGCalEEAlgo.h:43
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
HGCalEEPar parameterLayer(double rinF, double routF, double rinB, double routB, double zi, double zo)
const N & ddname() const
Definition: DDBase.h:80
std::vector< int > copyNumber
Definition: DDHGCalEEAlgo.h:46
void DDHGCalEEAlgo::execute ( DDCompactView cpv)

Definition at line 82 of file DDHGCalEEAlgo.cc.

References constructLayers().

82  {
83 
84  edm::LogInfo("HGCalGeom") << "==>> Constructing DDHGCalEEAlgo...";
85  constructLayers (parent(), cpv);
86  edm::LogInfo("HGCalGeom") << "<<== End of DDHGCalEEAlgo construction ...";
87 }
void constructLayers(DDLogicalPart, DDCompactView &cpv)
void DDHGCalEEAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 26 of file DDHGCalEEAlgo.cc.

References copyNumber, dbl_to_int(), heightType, i, idName, idNameSpace, layerType, materials, names, DDCurrentNamespace::ns(), rMaxFront, rotstr, sectors, slopeB, slopeT, thick, thickBlock, zFront, and zMinBlock.

30  {
31 
32  materials = vsArgs["MaterialNames"];
33  names = vsArgs["VolumeNames"];
34  thick = vArgs["Thickness"];
35  rotstr = sArgs["Rotation"];
36  layerType = dbl_to_int(vArgs["LayerType"]);
37  heightType = dbl_to_int(vArgs["HeightType"]);
38  thickBlock = vArgs["LayerThick"];
39  zMinBlock = nArgs["zMinBlock"];
40  for (unsigned int i=0; i<materials.size(); ++i) {
41  copyNumber.push_back(1);
42  }
43  edm::LogInfo("HGCalGeom") << "DDHGCalEEAlgo: " << materials.size()
44  << " volumes to be put with rotation " << rotstr
45  << " starting at " << zMinBlock;
46  for (unsigned int i=0; i<names.size(); ++i)
47  edm::LogInfo("HGCalGeom") << "Volume [" << i << "] " << names[i]
48  << " of thickness " << thick[i]
49  << " filled with " << materials[i]
50  << " first copy number " << copyNumber[i];
51  edm::LogInfo("HGCalGeom") << "DDHGCalEEAlgo: " << layerType.size()
52  << " layers";
53  for (unsigned int i=0; i<layerType.size(); ++i)
54  edm::LogInfo("HGCalGeom") << "Layer [" << i << "] with material type "
55  << layerType[i] << " height type "
56  << heightType[i] << " block thickness "
57  << thickBlock[i];
58 
59  sectors = (int)(nArgs["Sectors"]);
60  slopeB = nArgs["SlopeBottom"];
61  slopeT = vArgs["SlopeTop"];
62  zFront = vArgs["ZFront"];
63  rMaxFront = vArgs["RMaxFront"];
64  idName = parent().name().name();
66  edm::LogInfo("HGCalGeom") << "DDHGCalEEAlgo: Bottom slope " << slopeB
67  << " " << slopeT.size() << " slopes for top";
68  for (unsigned int i=0; i<slopeT.size(); ++i)
69  edm::LogInfo("HGCalGeom") << "Block [" << i << "] Zmin " << zFront[i]
70  << " Rmax " << rMaxFront[i] << " Slope "
71  << slopeT[i];
72  edm::LogInfo("HGCalGeom") << "DDHGCalEEAlgo: Sectors " << sectors
73  << "\tNameSpace:Name " << idNameSpace
74  << ":" << idName;
75 
76 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > thick
Definition: DDHGCalEEAlgo.h:47
std::vector< std::string > names
Definition: DDHGCalEEAlgo.h:42
std::vector< std::string > materials
Definition: DDHGCalEEAlgo.h:41
static std::string & ns()
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.cc:4
std::string idNameSpace
Definition: DDHGCalEEAlgo.h:56
double zMinBlock
Definition: DDHGCalEEAlgo.h:49
std::vector< double > thickBlock
Definition: DDHGCalEEAlgo.h:48
std::vector< int > layerType
Definition: DDHGCalEEAlgo.h:44
std::vector< int > heightType
Definition: DDHGCalEEAlgo.h:45
std::string rotstr
Definition: DDHGCalEEAlgo.h:43
std::vector< double > rMaxFront
Definition: DDHGCalEEAlgo.h:54
std::vector< double > slopeT
Definition: DDHGCalEEAlgo.h:52
std::vector< double > zFront
Definition: DDHGCalEEAlgo.h:53
std::string idName
Definition: DDHGCalEEAlgo.h:55
std::vector< int > copyNumber
Definition: DDHGCalEEAlgo.h:46
DDHGCalEEAlgo::HGCalEEPar DDHGCalEEAlgo::parameterLayer ( double  rinF,
double  routF,
double  rinB,
double  routB,
double  zi,
double  zo 
)
protected

Definition at line 151 of file DDHGCalEEAlgo.cc.

References DDHGCalEEAlgo::HGCalEEPar::alp, alpha, DDHGCalEEAlgo::HGCalEEPar::bl1, DDHGCalEEAlgo::HGCalEEPar::bl2, funct::cos(), DDHGCalEEAlgo::HGCalEEPar::phi, pi, sectors, funct::sin(), funct::tan(), DDHGCalEEAlgo::HGCalEEPar::theta, DDHGCalEEAlgo::HGCalEEPar::tl1, DDHGCalEEAlgo::HGCalEEPar::tl2, DDHGCalEEAlgo::HGCalEEPar::xpos, DDHGCalEEAlgo::HGCalEEPar::yh1, DDHGCalEEAlgo::HGCalEEPar::yh2, DDHGCalEEAlgo::HGCalEEPar::ypos, and DDHGCalEEAlgo::HGCalEEPar::zpos.

Referenced by constructLayers().

152  {
153 
155  //Given rin, rout compute parameters of the trapezoid and
156  //position of the trapezoid for a standrd layer
157  double alpha = CLHEP::pi/sectors;
158  edm::LogInfo("HGCalGeom") << "Input: Front " << rinF << " " << routF << " "
159  << zi << " Back " << rinB << " " << routB << " "
160  << zo << " Alpha " << alpha/CLHEP::deg;
161 
162  parm.yh2 = parm.yh1 = 0.5 * (routF*cos(alpha) - rinB);
163  parm.bl2 = parm.bl1 = rinB * tan(alpha);
164  parm.tl2 = parm.tl1 = routF * sin(alpha);
165  parm.xpos = 0.5*(routF*cos(alpha)+rinB);
166  parm.ypos = 0.0;
167  parm.zpos = 0.5*(zi+zo);
168  parm.alp = parm.theta = parm.phi = 0;
169  edm::LogInfo("HGCalGeom") << "Output Dimensions " << parm.yh1 << " "
170  << parm.bl1 << " " << parm.tl1 << " " << parm.yh2
171  << " " << parm.bl2 << " " << parm.tl2 << " "
172  << parm.alp/CLHEP::deg <<" "<<parm.theta/CLHEP::deg
173  << " " << parm.phi/CLHEP::deg << " Position "
174  << parm.xpos << " " << parm.ypos <<" " <<parm.zpos;
175  return parm;
176 }
float alpha
Definition: AMPTWrapper.h:95
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const Double_t pi
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double DDHGCalEEAlgo::rMax ( double  z)
protected

Definition at line 178 of file DDHGCalEEAlgo.cc.

References relval_2017::k, alignCSCRings::r, rMaxFront, slopeT, and zFront.

Referenced by constructLayers().

178  {
179 
180  double r(0);
181  unsigned int ik(0);
182  for (unsigned int k=0; k<slopeT.size(); ++k) {
183  if (z < zFront[k]) break;
184  r = rMaxFront[k] + (z - zFront[k]) * slopeT[k];
185  ik = k;
186  }
187  edm::LogInfo("HGCalGeom") << "rMax : " << z << ":" << ik << ":" << r ;
188  return r;
189 }
std::vector< double > rMaxFront
Definition: DDHGCalEEAlgo.h:54
std::vector< double > slopeT
Definition: DDHGCalEEAlgo.h:52
std::vector< double > zFront
Definition: DDHGCalEEAlgo.h:53

Member Data Documentation

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

Definition at line 46 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().

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

Definition at line 45 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().

std::string DDHGCalEEAlgo::idName
private

Definition at line 55 of file DDHGCalEEAlgo.h.

Referenced by initialize().

std::string DDHGCalEEAlgo::idNameSpace
private

Definition at line 56 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().

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

Definition at line 44 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().

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

Definition at line 41 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().

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

Definition at line 42 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().

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

Definition at line 54 of file DDHGCalEEAlgo.h.

Referenced by initialize(), and rMax().

std::string DDHGCalEEAlgo::rotstr
private

Definition at line 43 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().

int DDHGCalEEAlgo::sectors
private

Definition at line 50 of file DDHGCalEEAlgo.h.

Referenced by initialize(), and parameterLayer().

double DDHGCalEEAlgo::slopeB
private

Definition at line 51 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().

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

Definition at line 52 of file DDHGCalEEAlgo.h.

Referenced by initialize(), and rMax().

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

Definition at line 47 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().

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

Definition at line 48 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().

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

Definition at line 53 of file DDHGCalEEAlgo.h.

Referenced by initialize(), and rMax().

double DDHGCalEEAlgo::zMinBlock
private

Definition at line 49 of file DDHGCalEEAlgo.h.

Referenced by constructLayers(), and initialize().