CMS 3D CMS Logo

DDTBH4Algo.cc
Go to the documentation of this file.
1 // File: DDTBH4Algo.cc
3 // Description: Position inside the mother according to (eta,phi)
5 
6 #include <cmath>
7 #include <algorithm>
8 
15 #include "CLHEP/Units/GlobalSystemOfUnits.h"
16 
18  : m_idNameSpace(""),
19  m_BLZBeg(0),
20  m_BLZEnd(0),
21  m_BLZPiv(0),
22  m_BLRadius(0),
23  m_VacName(""),
24  m_VacMat(""),
25  m_vecVacZBeg(),
26  m_vecVacZEnd(),
27  m_WinName(""),
28  m_vecWinMat(),
29  m_vecWinZBeg(),
30  m_vecWinThick(),
31  m_TrgMat(""),
32  m_HoleMat(""),
33  m_TrgVetoHoleRadius(0),
34  m_vecTrgName(),
35  m_vecTrgSide(),
36  m_vecTrgThick(),
37  m_vecTrgPhi(),
38  m_vecTrgXOff(),
39  m_vecTrgYOff(),
40  m_vecTrgZPiv(),
41  m_FibFibName(""),
42  m_FibCladName(""),
43  m_FibFibMat(""),
44  m_FibCladMat(""),
45  m_FibSide(0),
46  m_FibCladThick(0),
47  m_FibLength(0),
48  m_vecFibPhi(),
49  m_vecFibXOff(),
50  m_vecFibYOff(),
51  m_vecFibZPiv()
52 
53 {
54  std::cout << "creating an instance if DDTBH4Algo" << std::endl;
55  LogDebug("EcalGeom") << "DDTBH4Algo test: Creating an instance";
56 }
57 
59 
60 DDRotation DDTBH4Algo::myrot(const std::string& s, const CLHEP::HepRotation& r) const {
61  return DDrot(
62  ddname(idNameSpace() + ":" + s),
63  std::make_unique<DDRotationMatrix>(r.xx(), r.xy(), r.xz(), r.yx(), r.yy(), r.yz(), r.zx(), r.zy(), r.zz()));
64 }
65 
67 
69  const std::pair<std::string, std::string> temp(DDSplit(s));
70  return DDName(temp.first, temp.second);
71 }
72 
74  const DDVectorArguments& vArgs,
75  const DDMapArguments& mArgs,
76  const DDStringArguments& sArgs,
77  const DDStringVectorArguments& vsArgs) {
79  m_BLZBeg = nArgs["BLZBeg"];
80  m_BLZEnd = nArgs["BLZEnd"];
81  m_BLZPiv = nArgs["BLZPiv"];
82  m_BLRadius = nArgs["BLRadius"];
83  m_VacName = sArgs["VacName"];
84  m_VacMat = sArgs["VacMat"];
85  m_vecVacZBeg = vArgs["VacZBeg"];
86  m_vecVacZEnd = vArgs["VacZEnd"];
87 
88  m_WinName = sArgs["WinName"];
89  m_vecWinMat = vsArgs["WinMat"];
90  m_vecWinZBeg = vArgs["WinZBeg"];
91  m_vecWinThick = vArgs["WinThick"];
92 
93  m_TrgMat = sArgs["TrgMat"];
94  m_HoleMat = sArgs["HoleMat"];
95  m_TrgVetoHoleRadius = nArgs["TrgVetoHoleRadius"];
96  m_vecTrgName = vsArgs["TrgName"];
97  m_vecTrgSide = vArgs["TrgSide"];
98  m_vecTrgThick = vArgs["TrgThick"];
99  m_vecTrgPhi = vArgs["TrgPhi"];
100  m_vecTrgXOff = vArgs["TrgXOff"];
101  m_vecTrgYOff = vArgs["TrgYOff"];
102  m_vecTrgZPiv = vArgs["TrgZPiv"];
103 
104  m_FibFibName = sArgs["FibFibName"];
105  m_FibCladName = sArgs["FibCladName"];
106  m_FibFibMat = sArgs["FibFibMat"];
107  m_FibCladMat = sArgs["FibCladMat"];
108  m_FibSide = nArgs["FibSide"];
109  m_FibCladThick = nArgs["FibCladThick"];
110  m_FibLength = nArgs["FibLength"];
111  m_vecFibPhi = vArgs["FibPhi"];
112  m_vecFibXOff = vArgs["FibXOff"];
113  m_vecFibYOff = vArgs["FibYOff"];
114  m_vecFibZPiv = vArgs["FibZPiv"];
115 }
116 
118  const unsigned int copyOne(1);
119 
120  const double halfZbl((blZEnd() - blZBeg()) / 2.);
121  for (unsigned int i(0); i != vecVacZBeg().size(); ++i) {
122  DDName vacNameNm(ddname(vacName() + std::to_string(i + 1)));
123  const double halfZvac((vecVacZEnd()[i] - vecVacZBeg()[i]) / 2.);
124  DDSolid vTubeSolid(DDSolidFactory::tubs(vacNameNm, halfZvac, 0, blRadius(), 0 * deg, 360 * deg));
125  const DDLogicalPart vacLog(vacNameNm, vacMat(), vTubeSolid);
126 
127  cpv.position(vacLog,
128  parent().name(),
129  1 + i,
130  DDTranslation(0, 0, -halfZbl + halfZvac + vecVacZBeg()[i] - blZBeg()),
131  DDRotation());
132  }
133 
134  for (unsigned int i(0); i != vecWinZBeg().size(); ++i) {
135  DDName wName(ddname(winName() + std::to_string(i + 1)));
136  DDSolid wTubeSolid(DDSolidFactory::tubs(wName, vecWinThick()[i] / 2., 0, blRadius(), 0 * deg, 360 * deg));
137  const DDLogicalPart wLog(wName, ddmat(vecWinMat()[i]), wTubeSolid);
138 
139  const double off(0 < vecWinZBeg()[i] ? vecWinZBeg()[i] : fabs(vecWinZBeg()[i]) - vecWinThick()[i]);
140 
141  cpv.position(wLog,
142  parent().name(),
143  1 + i,
144  DDTranslation(0, 0, -halfZbl + vecWinThick()[i] / 2. + off - blZBeg()),
145  DDRotation());
146  }
147 
148  for (unsigned int i(0); i != vecTrgName().size(); ++i) {
150  DDSolid tSolid(DDSolidFactory::box(tName, vecTrgSide()[i] / 2., vecTrgSide()[i] / 2., vecTrgThick()[i] / 2.));
151  const DDLogicalPart tLog(tName, trgMat(), tSolid);
152 
153  if (tName.name() == "VETO") {
154  DDName vName(ddname(tName.name() + "Hole"));
155  DDSolid vTubeSolid(
156  DDSolidFactory::tubs(vName, vecTrgThick()[i] / 2., 0, trgVetoHoleRadius(), 0 * deg, 360 * deg));
157  const DDLogicalPart vLog(vName, holeMat(), vTubeSolid);
158 
159  cpv.position(vLog, tName, copyOne, DDTranslation(0, 0, 0), DDRotation());
160  }
161 
162  cpv.position(tLog,
163  parent().name(),
164  copyOne,
165  DDTranslation(vecTrgXOff()[i], vecTrgYOff()[i], vecTrgZPiv()[i] - halfZbl + blZPiv() - blZBeg()),
166  myrot(tName.name() + "Rot", CLHEP::HepRotationZ(vecTrgPhi()[i])));
167  }
168 
169  DDName pName(fibCladName());
170  const double planeWidth(32.5 * fibSide() + 33.5 * fibCladThick());
171  const double planeThick(2 * fibSide() + 3 * fibCladThick());
172  DDSolid pSolid(DDSolidFactory::box(pName, planeWidth / 2., fibLength() / 2., planeThick / 2.));
173  const DDLogicalPart pLog(pName, fibCladMat(), pSolid);
174 
175  DDSolid fSolid(DDSolidFactory::box(fibFibName(), fibSide() / 2., fibLength() / 2., fibSide() / 2.));
176 
177  const DDLogicalPart fLog(fibFibName(), fibFibMat(), fSolid);
178 
179  for (unsigned int j(0); j != 32; ++j) {
180  const double xoff(planeWidth / 2. - (1 + j) * fibCladThick() - (1 + j) * fibSide());
181  const double zoff(-planeThick / 2 + fibCladThick() + fibSide() / 2.);
182  cpv.position(fLog, pName, 1 + j, DDTranslation(xoff, 0, zoff), DDRotation());
183 
184  cpv.position(fLog, pName, 33 + j, DDTranslation(xoff + (fibCladThick() + fibSide()) / 2., 0, -zoff), DDRotation());
185  }
186  for (unsigned int i(0); i != vecFibZPiv().size(); ++i) {
187  cpv.position(
188  pLog,
189  parent().name(),
190  1 + i,
192  vecFibXOff()[i] - 0.5 * fibSide(), vecFibYOff()[i], vecFibZPiv()[i] - halfZbl + blZPiv() - blZBeg()),
193  myrot(pName.name() + "Rot" + std::to_string(i), CLHEP::HepRotationZ(vecFibPhi()[i])));
194  }
195 }
DDTBH4Algo::m_FibFibMat
std::string m_FibFibMat
Definition: DDTBH4Algo.h:100
DDTBH4Algo::m_vecFibPhi
std::vector< double > m_vecFibPhi
Definition: DDTBH4Algo.h:105
DDTBH4Algo::m_vecTrgName
std::vector< std::string > m_vecTrgName
Definition: DDTBH4Algo.h:90
DDTBH4Algo::m_BLZBeg
double m_BLZBeg
Definition: DDTBH4Algo.h:74
DDCurrentNamespace.h
mps_fire.i
i
Definition: mps_fire.py:428
DDTBH4Algo::fibFibMat
DDMaterial fibFibMat() const
Definition: DDTBH4Algo.h:61
DDTBH4Algo::m_VacName
std::string m_VacName
Definition: DDTBH4Algo.h:78
DDTBH4Algo::idNameSpace
const std::string & idNameSpace() const
Definition: DDTBH4Algo.h:33
MessageLogger.h
DDTBH4Algo::m_FibLength
double m_FibLength
Definition: DDTBH4Algo.h:104
DDrot
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
DDTBH4Algo::fibFibName
DDName fibFibName() const
Definition: DDTBH4Algo.h:59
DDTBH4Algo::m_FibCladThick
double m_FibCladThick
Definition: DDTBH4Algo.h:103
DDTBH4Algo::myrot
DDRotation myrot(const std::string &s, const CLHEP::HepRotation &r) const
Definition: DDTBH4Algo.cc:60
DDTBH4Algo::vacMat
DDMaterial vacMat() const
Definition: DDTBH4Algo.h:40
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDTBH4Algo::m_BLRadius
double m_BLRadius
Definition: DDTBH4Algo.h:77
DDTBH4Algo::vecWinThick
const std::vector< double > & vecWinThick() const
Definition: DDTBH4Algo.h:46
DDSplit.h
DDTBH4Algo::vecTrgName
const std::vector< std::string > & vecTrgName() const
Definition: DDTBH4Algo.h:51
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DDTBH4Algo::m_vecFibYOff
std::vector< double > m_vecFibYOff
Definition: DDTBH4Algo.h:107
DDTBH4Algo::m_BLZEnd
double m_BLZEnd
Definition: DDTBH4Algo.h:75
DDTBH4Algo::m_vecVacZBeg
std::vector< double > m_vecVacZBeg
Definition: DDTBH4Algo.h:80
simpleEdmComparison.tName
tName
Definition: simpleEdmComparison.py:125
DDTBH4Algo::m_vecWinZBeg
std::vector< double > m_vecWinZBeg
Definition: DDTBH4Algo.h:84
DDTBH4Algo::vecFibPhi
const std::vector< double > & vecFibPhi() const
Definition: DDTBH4Algo.h:66
DDTBH4Algo::vecTrgYOff
const std::vector< double > & vecTrgYOff() const
Definition: DDTBH4Algo.h:56
DDTBH4Algo::m_FibCladName
std::string m_FibCladName
Definition: DDTBH4Algo.h:99
DDTBH4Algo::vecTrgThick
const std::vector< double > & vecTrgThick() const
Definition: DDTBH4Algo.h:53
DDTBH4Algo::blZEnd
double blZEnd() const
Definition: DDTBH4Algo.h:36
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
DDTBH4Algo::fibCladName
DDName fibCladName() const
Definition: DDTBH4Algo.h:60
DDTBH4Algo::m_HoleMat
std::string m_HoleMat
Definition: DDTBH4Algo.h:88
DDTBH4Algo::m_WinName
std::string m_WinName
Definition: DDTBH4Algo.h:82
DDTBH4Algo::vecTrgXOff
const std::vector< double > & vecTrgXOff() const
Definition: DDTBH4Algo.h:55
DDTBH4Algo::blZPiv
double blZPiv() const
Definition: DDTBH4Algo.h:37
DDTBH4Algo::~DDTBH4Algo
~DDTBH4Algo() override
Definition: DDTBH4Algo.cc:58
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DDTBH4Algo::fibSide
double fibSide() const
Definition: DDTBH4Algo.h:63
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDTBH4Algo::holeMat
DDMaterial holeMat() const
Definition: DDTBH4Algo.h:49
DDTBH4Algo::vecTrgPhi
const std::vector< double > & vecTrgPhi() const
Definition: DDTBH4Algo.h:54
DDTBH4Algo::m_idNameSpace
std::string m_idNameSpace
Definition: DDTBH4Algo.h:72
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDTBH4Algo::m_vecTrgPhi
std::vector< double > m_vecTrgPhi
Definition: DDTBH4Algo.h:93
DDTBH4Algo::blRadius
double blRadius() const
Definition: DDTBH4Algo.h:38
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
DDTBH4Algo::ddmat
DDMaterial ddmat(const std::string &s) const
Definition: DDTBH4Algo.cc:66
DDTBH4Algo::m_FibCladMat
std::string m_FibCladMat
Definition: DDTBH4Algo.h:101
DDTBH4Algo::winName
std::string winName() const
Definition: DDTBH4Algo.h:43
DDSolidFactory::tubs
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:653
DDSolid.h
DDTBH4Algo::vecFibYOff
const std::vector< double > & vecFibYOff() const
Definition: DDTBH4Algo.h:68
DDTBH4Algo::vecWinZBeg
const std::vector< double > & vecWinZBeg() const
Definition: DDTBH4Algo.h:45
DDTBH4Algo::vecVacZBeg
const std::vector< double > & vecVacZBeg() const
Definition: DDTBH4Algo.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDTBH4Algo::fibLength
double fibLength() const
Definition: DDTBH4Algo.h:65
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
DDTBH4Algo::m_vecTrgYOff
std::vector< double > m_vecTrgYOff
Definition: DDTBH4Algo.h:95
DDTBH4Algo::m_TrgVetoHoleRadius
double m_TrgVetoHoleRadius
Definition: DDTBH4Algo.h:89
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
DDTBH4Algo::fibCladMat
DDMaterial fibCladMat() const
Definition: DDTBH4Algo.h:62
DDTBH4Algo.h
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
DDTBH4Algo::execute
void execute(DDCompactView &cpv) override
Definition: DDTBH4Algo.cc:117
DDTBH4Algo::fibCladThick
double fibCladThick() const
Definition: DDTBH4Algo.h:64
DDLogicalPart.h
DDTBH4Algo::vecWinMat
const std::vector< std::string > & vecWinMat() const
Definition: DDTBH4Algo.h:44
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DDTBH4Algo::vecVacZEnd
const std::vector< double > & vecVacZEnd() const
Definition: DDTBH4Algo.h:42
DDTBH4Algo::m_FibFibName
std::string m_FibFibName
Definition: DDTBH4Algo.h:98
ReadMapType< double >
DDTBH4Algo::m_vecFibXOff
std::vector< double > m_vecFibXOff
Definition: DDTBH4Algo.h:106
DDTBH4Algo::initialize
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
Definition: DDTBH4Algo.cc:73
DDTBH4Algo::trgMat
DDMaterial trgMat() const
Definition: DDTBH4Algo.h:48
DDTBH4Algo::vecFibXOff
const std::vector< double > & vecFibXOff() const
Definition: DDTBH4Algo.h:67
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDTBH4Algo::m_vecFibZPiv
std::vector< double > m_vecFibZPiv
Definition: DDTBH4Algo.h:108
DDTBH4Algo::m_vecWinMat
std::vector< std::string > m_vecWinMat
Definition: DDTBH4Algo.h:83
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDTBH4Algo::m_BLZPiv
double m_BLZPiv
Definition: DDTBH4Algo.h:76
DDTBH4Algo::vecTrgSide
const std::vector< double > & vecTrgSide() const
Definition: DDTBH4Algo.h:52
DDTBH4Algo::m_vecVacZEnd
std::vector< double > m_vecVacZEnd
Definition: DDTBH4Algo.h:81
DDTBH4Algo::m_vecTrgSide
std::vector< double > m_vecTrgSide
Definition: DDTBH4Algo.h:91
DDTBH4Algo::m_TrgMat
std::string m_TrgMat
Definition: DDTBH4Algo.h:87
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
DDSolidFactory::box
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:533
DDTBH4Algo::trgVetoHoleRadius
double trgVetoHoleRadius() const
Definition: DDTBH4Algo.h:50
DDTBH4Algo::blZBeg
double blZBeg() const
Definition: DDTBH4Algo.h:35
DDTBH4Algo::m_vecWinThick
std::vector< double > m_vecWinThick
Definition: DDTBH4Algo.h:85
class-composition.parent
parent
Definition: class-composition.py:88
DDTBH4Algo::vacName
std::string vacName() const
Definition: DDTBH4Algo.h:39
DDTBH4Algo::vecTrgZPiv
const std::vector< double > & vecTrgZPiv() const
Definition: DDTBH4Algo.h:57
DDTBH4Algo::m_VacMat
std::string m_VacMat
Definition: DDTBH4Algo.h:79
DDTBH4Algo::m_vecTrgThick
std::vector< double > m_vecTrgThick
Definition: DDTBH4Algo.h:92
DDTBH4Algo::ddname
DDName ddname(const std::string &s) const
Definition: DDTBH4Algo.cc:68
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:76
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18
DDTBH4Algo::m_vecTrgXOff
std::vector< double > m_vecTrgXOff
Definition: DDTBH4Algo.h:94
DDTBH4Algo::m_vecTrgZPiv
std::vector< double > m_vecTrgZPiv
Definition: DDTBH4Algo.h:96
DDTBH4Algo::DDTBH4Algo
DDTBH4Algo()
Definition: DDTBH4Algo.cc:17
DDTBH4Algo::vecFibZPiv
const std::vector< double > & vecFibZPiv() const
Definition: DDTBH4Algo.h:69
DDTBH4Algo::m_FibSide
double m_FibSide
Definition: DDTBH4Algo.h:102