CMS 3D CMS Logo

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

#include <DDHCalFibreBundle.h>

Inheritance diagram for DDHCalFibreBundle:

Public Member Functions

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

Private Attributes

std::vector< double > areaSection
 
std::vector< int > bundle
 
std::string childPrefix
 
double deltaPhi
 
double deltaZ
 
std::string idNameSpace
 
std::string material
 
int numberPhi
 
std::vector< double > rEnd
 
std::vector< double > rStart
 
double tilt
 

Detailed Description

Definition at line 10 of file DDHCalFibreBundle.h.

Constructor & Destructor Documentation

DDHCalFibreBundle::DDHCalFibreBundle ( )

Definition at line 19 of file DDHCalFibreBundle.cc.

References LogDebug.

19  {
20  LogDebug("HCalGeom") <<"DDHCalFibreBundle info: Creating an instance";
21 }
#define LogDebug(id)
DDHCalFibreBundle::~DDHCalFibreBundle ( )
virtual

Definition at line 23 of file DDHCalFibreBundle.cc.

23 {}

Member Function Documentation

void DDHCalFibreBundle::execute ( DDCompactView cpv)

Definition at line 64 of file DDHCalFibreBundle.cc.

References areaSection, bundle, childPrefix, DDSolidFactory::cons(), filterCSVwithJSON::copy, funct::cos(), DDrot(), DDSplit(), deltaPhi, deltaZ, dPhi(), plotBeamSpotDB::first, i, cuy::ib, idNameSpace, dqm-mbProfile::log, LogDebug, material, mergeVDriftHistosByStation::name, numberPhi, SpecificationBuilder_cfi::parent(), phi, DDCompactView::position(), rEnd, makeMuonMisalignmentScenario::rot, idealTransformation::rotation, rStart, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, and tilt.

64  {
65 
66  DDName mother = parent().name();
68  DDMaterial matter(matname);
69 
70  // Create the rotation matrices
71  double dPhi = deltaPhi/numberPhi;
72  std::vector<DDRotation> rotation;
73  for (int i=0; i<numberPhi; ++i) {
74  double phi = -0.5*deltaPhi+(i+0.5)*dPhi;
75  double phideg = phi/CLHEP::deg;
76  std::string rotstr = "R0"+ std::to_string(phideg);
78  if (!rot) {
79  LogDebug("HCalGeom") << "DDHCalFibreBundle test: Creating a new "
80  << "rotation " << rotstr << "\t" << 90 << ","
81  << phideg << "," << 90 << "," << (phideg+90)
82  << ", 0, 0";
83  rot = DDrot(DDName(rotstr, idNameSpace), 90*CLHEP::deg, phi,
84  90*CLHEP::deg, (90*CLHEP::deg+phi), 0, 0);
85  }
86  rotation.push_back(rot);
87  }
88 
89  // Create the solids and logical parts
90  std::vector<DDLogicalPart> logs;
91  for (unsigned int i=0; i<areaSection.size(); ++i) {
92  double r0 = rEnd[i]/std::cos(tilt);
93  double dStart = areaSection[i]/(2*dPhi*rStart[i]);
94  double dEnd = areaSection[i]/(2*dPhi*r0);
95  std::string name = childPrefix + std::to_string(i);
97  rStart[i]-dStart, rStart[i]+dStart,
98  r0-dEnd, r0+dEnd, -0.5*dPhi, dPhi);
99  LogDebug("HCalGeom") << "DDHCalFibreBundle test: Creating a new solid "
100  << name << " a cons with dZ " << deltaZ << " rStart "
101  << rStart[i]-dStart << ":" << rStart[i]+dStart
102  << " rEnd " << r0-dEnd << ":" << r0+dEnd << " Phi "
103  << -0.5*dPhi/CLHEP::deg << ":" << 0.5*dPhi/CLHEP::deg;
104  DDLogicalPart log(DDName(name, idNameSpace), matter, solid);
105  logs.push_back(log);
106  }
107 
108  // Now posiiton them
109  int copy = 0;
110  int nY = (int)(bundle.size())/numberPhi;
111  for (unsigned int i=0; i<bundle.size(); i++) {
112  DDTranslation tran(0,0,0);
113  int ir = (int)(i)/nY;
114  if (ir >= numberPhi) ir = numberPhi-1;
115  int ib = bundle[i];
116  copy++;
117  if (ib>=0 && ib<(int)(logs.size())) {
118  cpv.position(logs[ib], mother, copy, tran, rotation[ir]);
119  LogDebug("HCalGeom") << "DDHCalFibreBundle test: " << logs[ib].name()
120  << " number " << copy << " positioned in "
121  << mother << " at " << tran << " with "
122  << rotation[ir];
123  }
124  }
125 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
int ib
Definition: cuy.py:660
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:798
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
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
U second(std::pair< T, U > const &p)
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< double > areaSection
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
std::string idNameSpace
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::vector< double > rEnd
std::vector< double > rStart
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
std::vector< int > bundle
std::string childPrefix
void DDHCalFibreBundle::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 25 of file DDHCalFibreBundle.cc.

References areaSection, bundle, childPrefix, dbl_to_int(), deltaPhi, deltaZ, i, idNameSpace, LogDebug, material, DDCurrentNamespace::ns(), numberPhi, SpecificationBuilder_cfi::parent(), rEnd, rStart, and tilt.

29  {
30 
31  deltaPhi = nArgs["DeltaPhi"];
32  deltaZ = nArgs["DeltaZ"];
33  numberPhi = int(nArgs["NumberPhi"]);
34  material = sArgs["Material"];
35  areaSection = vArgs["AreaSection"];
36  rStart = vArgs["RadiusStart"];
37  rEnd = vArgs["RadiusEnd"];
38  bundle = dbl_to_int(vArgs["Bundles"]);
39  tilt = nArgs["TiltAngle"];
40 
42  childPrefix = sArgs["Child"];
43  DDName parentName = parent().name();
44  LogDebug("HCalGeom") << "DDHCalFibreBundle debug: Parent " << parentName
45  << " with " << bundle.size() << " children with prefix "
46  << childPrefix << ", material " << material << " with "
47  << numberPhi << " bundles along phi; width of mother "
48  << deltaZ << " along Z, " << deltaPhi/CLHEP::deg
49  << " along phi and with " << rStart.size()
50  << " different bundle types";
51  for (unsigned int i=0; i<areaSection.size(); ++i)
52  LogDebug("HCalGeom") << "DDHCalFibreBundle debug: Child[" << i << "] Area "
53  << areaSection[i] << " R at Start " << rStart[i]
54  << " R at End " << rEnd[i];
55  LogDebug("HCalGeom") << "DDHCalFibreBundle debug: NameSpace "
56  << idNameSpace << " Tilt Angle " << tilt/CLHEP::deg
57  << " Bundle type at different positions";
58  for (unsigned int i=0; i<bundle.size(); ++i) {
59  LogDebug("HCalGeom") << "DDHCalFibreBundle debug: Position[" << i << "] "
60  << " with Type " << bundle[i];
61  }
62 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
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.h:7
std::vector< double > areaSection
std::string idNameSpace
std::vector< double > rEnd
std::vector< double > rStart
std::vector< int > bundle
std::string childPrefix

Member Data Documentation

std::vector<double> DDHCalFibreBundle::areaSection
private

Definition at line 34 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

std::vector<int> DDHCalFibreBundle::bundle
private

Definition at line 37 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

std::string DDHCalFibreBundle::childPrefix
private

Definition at line 28 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

double DDHCalFibreBundle::deltaPhi
private

Definition at line 31 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

double DDHCalFibreBundle::deltaZ
private

Definition at line 30 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

std::string DDHCalFibreBundle::idNameSpace
private

Definition at line 27 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

std::string DDHCalFibreBundle::material
private

Definition at line 29 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

int DDHCalFibreBundle::numberPhi
private

Definition at line 32 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

std::vector<double> DDHCalFibreBundle::rEnd
private

Definition at line 36 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

std::vector<double> DDHCalFibreBundle::rStart
private

Definition at line 35 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().

double DDHCalFibreBundle::tilt
private

Definition at line 33 of file DDHCalFibreBundle.h.

Referenced by execute(), and initialize().