test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDEcalAPDAlgo.cc
Go to the documentation of this file.
1 #include <cmath>
2 #include <algorithm>
3 
10 
12  m_vecCerPos ( ),
13  m_APDHere (0),
14 
15  m_capName (""),
16  m_capMat (""),
17  m_capXSize (0),
18  m_capYSize (0),
19  m_capThick (0),
20 
21  m_CERName (""),
22  m_CERMat (""),
23  m_CERXSize (0),
24  m_CERYSize (0),
25  m_CERThick (0),
26 
27  m_BSiName (""),
28  m_BSiMat (""),
29  m_BSiXSize (0),
30  m_BSiYSize (0),
31  m_BSiThick (0),
32 
33  m_APDName (""),
34  m_APDMat (""),
35  m_APDSide (0),
36  m_APDThick (0),
37  m_APDZ (0),
38  m_APDX1 (0),
39  m_APDX2 (0),
40 
41  m_ATJName (""),
42  m_ATJMat (""),
43  m_ATJThick (0),
44 
45  m_SGLName (""),
46  m_SGLMat (""),
47  m_SGLThick (0),
48 
49  m_AGLName (""),
50  m_AGLMat (""),
51  m_AGLThick (0),
52 
53  m_ANDName (""),
54  m_ANDMat (""),
55  m_ANDThick (0) {
56 
57  LogDebug("EcalGeom") << "DDEcalAPDAlgo info: Creating an instance" ;
58 }
59 
61 
63  const DDVectorArguments & vArgs,
64  const DDMapArguments & mArgs,
65  const DDStringArguments & sArgs,
66  const DDStringVectorArguments & vsArgs) {
67 
68  LogDebug("EcalGeom") << "DDEcalAPDAlgo info: Initialize" ;
69 
70  m_idNameSpace = parent().name().ns();
71 
72  m_vecCerPos= vArgs["CerPos" ] ;
73  m_APDHere = (int)(nArgs["APDHere"]) ;
74 
75  m_capName = sArgs["CapName"] ;
76  m_capMat = sArgs["CapMat"] ;
77  m_capXSize = nArgs["CapXSize"] ;
78  m_capYSize = nArgs["CapYSize"] ;
79  m_capThick = nArgs["CapThick"] ;
80 
81  m_CERName = sArgs["CerName"] ;
82  m_CERMat = sArgs["CerMat"] ;
83  m_CERXSize = nArgs["CerXSize"] ;
84  m_CERYSize = nArgs["CerYSize"] ;
85  m_CERThick = nArgs["CerThick"] ;
86 
87  m_BSiName = sArgs["BSiName"] ;
88  m_BSiMat = sArgs["BSiMat"] ;
89  m_BSiXSize = nArgs["BSiXSize"] ;
90  m_BSiYSize = nArgs["BSiYSize"] ;
91  m_BSiThick = nArgs["BSiThick"] ;
92 
93  m_APDName = sArgs["APDName"] ;
94  m_APDMat = sArgs["APDMat"] ;
95  m_APDSide = nArgs["APDSide"] ;
96  m_APDThick = nArgs["APDThick"] ;
97  m_APDZ = nArgs["APDZ"] ;
98  m_APDX1 = nArgs["APDX1"] ;
99  m_APDX2 = nArgs["APDX2"] ;
100 
101  m_ATJName = sArgs["ATJName"] ;
102  m_ATJMat = sArgs["ATJMat"] ;
103  m_ATJThick = nArgs["ATJThick"] ;
104 
105  m_SGLName = sArgs["SGLName"] ;
106  m_SGLMat = sArgs["SGLMat"] ;
107  m_SGLThick = nArgs["SGLThick"] ;
108 
109  m_AGLName = sArgs["AGLName"] ;
110  m_AGLMat = sArgs["AGLMat"] ;
111  m_AGLThick = nArgs["AGLThick"] ;
112 
113  m_ANDName = sArgs["ANDName"] ;
114  m_ANDMat = sArgs["ANDMat"] ;
115  m_ANDThick = nArgs["ANDThick"] ;
116 
117  LogDebug("EcalGeom") << "DDEcalAPDAlgo info: end initialize" ;
118 }
119 
121 // DDEcalBarrelAlgo methods...
123 
125 
126  LogDebug("EcalGeom") << "******** DDEcalAPDAlgo execute!" << std::endl ;
127 
128 //++++++++++++++++++++++++++++++++++ APD ++++++++++++++++++++++++++++++++++
129  const DDName capDDName (capName().name()) ;
130 
131  DDSolid capSolid ( DDSolidFactory::box( capDDName, capXSize()/2.,
132  capYSize()/2., capThick()/2. ) ) ;
133 
134  const unsigned int copyCAP ( 1 ) ;
135 
136  const DDLogicalPart capLog ( capDDName, capMat(), capSolid ) ;
137 
138  const DDName sglDDName ( sglName().name()) ;
139 
140  DDSolid sglSolid ( DDSolidFactory::box( sglDDName, capXSize()/2.,
141  capYSize()/2., sglThick()/2. ) ) ;
142 
143  const DDLogicalPart sglLog ( sglDDName, sglMat(), sglSolid ) ;
144 
145  const unsigned int copySGL ( 1 ) ;
146 
147  const DDName cerDDName ( cerName().name() ) ;
148 
149  DDSolid cerSolid ( DDSolidFactory::box( cerDDName, cerXSize()/2.,
150  cerYSize()/2., cerThick()/2. ) ) ;
151 
152  const DDLogicalPart cerLog ( cerDDName, cerMat(), cerSolid ) ;
153 
154  const unsigned int copyCER ( 1 ) ;
155 
156  const DDName bsiDDName ( bsiName().name() ) ;
157 
158  DDSolid bsiSolid ( DDSolidFactory::box( bsiDDName, bsiXSize()/2.,
159  bsiYSize()/2., bsiThick()/2. ) ) ;
160 
161  const DDLogicalPart bsiLog ( bsiDDName, bsiMat(), bsiSolid ) ;
162 
163  const unsigned int copyBSi ( 1 ) ;
164 
165  const DDName atjDDName ( atjName().name() ) ;
166 
167  DDSolid atjSolid ( DDSolidFactory::box( atjDDName, apdSide()/2.,
168  apdSide()/2., atjThick()/2. ) ) ;
169 
170  const DDLogicalPart atjLog ( atjDDName, atjMat(), atjSolid ) ;
171 
172  const unsigned int copyATJ ( 1 ) ;
173 
174  const DDName aglDDName ( aglName().name() ) ;
175 
176  DDSolid aglSolid ( DDSolidFactory::box( aglDDName, bsiXSize()/2.,
177  bsiYSize()/2., aglThick()/2. ) ) ;
178 
179  const DDLogicalPart aglLog ( aglDDName, aglMat(), aglSolid ) ;
180 
181  const unsigned int copyAGL ( 1 ) ;
182 
183  const DDName andDDName ( andName().name() ) ;
184 
185  DDSolid andSolid ( DDSolidFactory::box( andDDName, apdSide()/2.,
186  apdSide()/2., andThick()/2. ) ) ;
187 
188  const DDLogicalPart andLog ( andDDName, andMat(), andSolid ) ;
189 
190  const unsigned int copyAND ( 1 ) ;
191 
192  const DDName apdDDName ( apdName().name() ) ;
193 
194  DDSolid apdSolid ( DDSolidFactory::box( apdDDName, apdSide()/2.,
195  apdSide()/2., apdThick()/2. ) ) ;
196 
197  const DDLogicalPart apdLog ( apdDDName, apdMat(), apdSolid ) ;
198 
199  const unsigned int copyAPD ( 1 ) ;
200 
201  if ( 0 != apdHere() ) {
202  cpv.position(aglLog, bsiLog, copyAGL,
203  DDTranslation(0,0,-aglThick()/2.+bsiThick()/2.),DDRotation());
204 
205  cpv.position(andLog, bsiLog, copyAND,
206  DDTranslation(0, 0, -andThick()/2.-aglThick()+bsiThick()/2.),
207  DDRotation() ) ;
208 
209  cpv.position(apdLog, bsiLog, copyAPD,
210  DDTranslation(0,0,-apdThick()/2.-andThick()-aglThick()+bsiThick()/2.),
211  DDRotation() ) ;
212 
213  cpv.position(atjLog, bsiLog, copyATJ,
214  DDTranslation(0,0,-atjThick()/2.-apdThick()-andThick()-aglThick()+bsiThick()/2. ),
215  DDRotation() ) ;
216 
217  cpv.position(bsiLog, cerLog, copyBSi,
218  DDTranslation(0,0,-bsiThick()/2.+cerThick()/2.),DDRotation());
219 
220  cpv.position(sglLog, capLog, copySGL,
221  DDTranslation(0,0,-sglThick()/2.+capThick()/2.),DDRotation());
222 
223  cpv.position(cerLog, capLog, copyCER,
224  DDTranslation(0,0,-sglThick()-cerThick()/2.+capThick()/2.),
225  DDRotation() ) ;
226 
227  cpv.position(capLog, parent().name(), copyCAP,
228  DDTranslation(vecCerPos()[0],vecCerPos()[1],vecCerPos()[2]),
229  DDRotation() ) ;
230  }
231 
232  LogDebug("EcalGeom") << "******** DDEcalAPDAlgo test: end it..." ;
233 }
234 
236 
237  const std::pair<std::string,std::string> temp ( DDSplit(s) ) ;
238  if ( temp.second == "" ) {
239  return DDName( temp.first, m_idNameSpace ) ;
240  } else {
241  return DDName( temp.first, temp.second );
242  }
243 }
#define LogDebug(id)
DDMaterial sglMat() const
Definition: DDEcalAPDAlgo.h:57
DDName cerName() const
Definition: DDEcalAPDAlgo.h:44
std::string m_BSiName
Definition: DDEcalAPDAlgo.h:99
double bsiThick() const
Definition: DDEcalAPDAlgo.h:54
double m_CERXSize
Definition: DDEcalAPDAlgo.h:95
std::string m_ATJMat
DDMaterial bsiMat() const
Definition: DDEcalAPDAlgo.h:51
DDName atjName() const
Definition: DDEcalAPDAlgo.h:60
DDMaterial apdMat() const
Definition: DDEcalAPDAlgo.h:73
DDMaterial aglMat() const
Definition: DDEcalAPDAlgo.h:65
int apdHere() const
Definition: DDEcalAPDAlgo.h:36
std::string m_SGLName
const std::vector< double > & vecCerPos() const
Definition: DDEcalAPDAlgo.h:35
double cerThick() const
Definition: DDEcalAPDAlgo.h:48
std::string m_BSiMat
std::string m_AGLMat
double m_capXSize
Definition: DDEcalAPDAlgo.h:89
DDName ddname(const std::string &s) const
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
double cerYSize() const
Definition: DDEcalAPDAlgo.h:47
double apdSide() const
Definition: DDEcalAPDAlgo.h:74
double andThick() const
Definition: DDEcalAPDAlgo.h:70
std::string m_CERName
Definition: DDEcalAPDAlgo.h:93
std::string m_idNameSpace
Definition: DDEcalAPDAlgo.h:82
std::string m_capMat
Definition: DDEcalAPDAlgo.h:88
type of data representation of DDCompactView
Definition: DDCompactView.h:77
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
double sglThick() const
Definition: DDEcalAPDAlgo.h:58
std::string m_CERMat
Definition: DDEcalAPDAlgo.h:94
double m_CERThick
Definition: DDEcalAPDAlgo.h:97
std::string m_APDName
DDMaterial cerMat() const
Definition: DDEcalAPDAlgo.h:45
double bsiXSize() const
Definition: DDEcalAPDAlgo.h:52
std::string m_APDMat
std::string m_AGLName
DDName sglName() const
Definition: DDEcalAPDAlgo.h:56
double capThick() const
Definition: DDEcalAPDAlgo.h:42
DDMaterial capMat() const
Definition: DDEcalAPDAlgo.h:39
double apdThick() const
Definition: DDEcalAPDAlgo.h:75
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
double capXSize() const
Definition: DDEcalAPDAlgo.h:40
DDName aglName() const
Definition: DDEcalAPDAlgo.h:64
std::string m_SGLMat
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:519
DDMaterial atjMat() const
Definition: DDEcalAPDAlgo.h:61
double m_capYSize
Definition: DDEcalAPDAlgo.h:90
double m_CERYSize
Definition: DDEcalAPDAlgo.h:96
DDName apdName() const
Definition: DDEcalAPDAlgo.h:72
double bsiYSize() const
Definition: DDEcalAPDAlgo.h:53
std::string m_capName
Definition: DDEcalAPDAlgo.h:87
double cerXSize() const
Definition: DDEcalAPDAlgo.h:46
double m_capThick
Definition: DDEcalAPDAlgo.h:91
DDMaterial andMat() const
Definition: DDEcalAPDAlgo.h:69
double atjThick() const
Definition: DDEcalAPDAlgo.h:62
std::string m_ANDMat
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
std::vector< double > m_vecCerPos
Definition: DDEcalAPDAlgo.h:84
std::string m_ATJName
double capYSize() const
Definition: DDEcalAPDAlgo.h:41
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
virtual ~DDEcalAPDAlgo()
DDName bsiName() const
Definition: DDEcalAPDAlgo.h:50
DDName andName() const
Definition: DDEcalAPDAlgo.h:68
DDName capName() const
Definition: DDEcalAPDAlgo.h:38
double aglThick() const
Definition: DDEcalAPDAlgo.h:66
std::string m_ANDName
void execute(DDCompactView &cpv)