ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
AGDD
AGDDHandlers
src
mposPhiHandler.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
AGDDHandlers/mposPhiHandler.h
"
6
#include "
AGDDKernel/AGDDPositioner.h
"
7
#include "
AGDDControl/AGDDController.h
"
8
#include "GeoModelKernel/Units.h"
9
#include "GaudiKernel/MsgStream.h"
10
#include "
AthenaKernel/getMessageSvc.h
"
11
12
#include <iostream>
13
14
mposPhiHandler::mposPhiHandler
(
const
std::string& s,
15
AGDDController
& c)
16
:
XMLHandler
(s, c)
17
{
18
}
19
20
void
mposPhiHandler::ElementHandle
(
AGDDController
& c,
21
xercesc::DOMNode *t)
22
{
23
24
bool
res
;
25
std::string volume=
getAttributeAsString
(c, t,
"volume"
);
26
int
icopy=
getAttributeAsInt
(c, t,
"ncopy"
,0);
27
double
phi0=
getAttributeAsDouble
(c, t,
"Phi0"
,
res
);
28
if
(!
res
) phi0=0;
29
double
dphi=
getAttributeAsDouble
(c, t,
"dPhi"
,
res
);
30
31
if
(!
res
)
// dphi must be calculated
32
{
33
if
(icopy>0)
34
dphi=360./icopy;
35
else
36
{
37
MsgStream log(
Athena::getMessageSvc
(),
"mposPhiHandler"
);
38
log<<MSG::WARNING<<
"ElementHandle() - both icopy and dphi are nullptr!! volume "
<<volume<<
" cannot continue!"
<<
endmsg
;
39
return
;
40
}
41
}
42
bool
impliedRot;
43
std::string s;
44
std::string iR=
getAttributeAsString
(c, t,
"impliedRot"
,impliedRot);
45
if
(impliedRot) s=iR;
46
double
lateral_displacement=
getAttributeAsDouble
(c, t,
"S"
,
res
);
47
if
(!
res
) lateral_displacement=0;
48
49
std::vector<double> vvv =
getAttributeAsVector
(c, t,
"R_Z"
,
res
);
50
double
rad=0,zpos=0;
51
if
(
res
)
52
{
53
rad=vvv[0];
54
zpos=vvv[1];
55
}
56
57
GeoTrf::Transform3D crot = GeoTrf::Transform3D::Identity();
58
59
vvv=
getAttributeAsVector
(c, t,
"rot"
,
res
);
60
if
(
res
)
61
{
62
crot = crot*GeoTrf::RotateZ3D(vvv[2]*GeoModelKernelUnits::degree)*GeoTrf::RotateY3D(vvv[1]*GeoModelKernelUnits::degree)*GeoTrf::RotateX3D(vvv[0]*GeoModelKernelUnits::degree);
63
}
64
65
for
(
int
i=0;i<icopy;i++)
66
{
67
GeoTrf::Vector2D position(rad,lateral_displacement);
68
double
phi
=phi0+dphi*i;
69
position = Eigen::Rotation2Dd(
phi
*GeoModelKernelUnits::degree)*position;
70
71
double
x
=position.x();
72
double
y
=position.y();
73
74
GeoTrf::Vector3D cvec=GeoTrf::Vector3D(
x
,
y
,zpos);
75
if
(s!=
"false"
&&i>0) crot = GeoTrf::RotateZ3D(dphi*GeoModelKernelUnits::degree)*crot;
76
else
if
(s!=
"false"
&&i==0) crot = GeoTrf::RotateZ3D(phi0*GeoModelKernelUnits::degree)*crot;
77
78
new
AGDDPositioner
(c.GetPositionerStore(),
79
c.GetVolumeStore(),
80
volume,GeoTrf::Translation3D(cvec)*crot);
81
}
82
}
AGDDController.h
AGDDPositioner.h
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
res
std::pair< std::vector< unsigned int >, bool > res
Definition
JetGroupProductTest.cxx:11
y
#define y
x
#define x
AGDDController
Definition
AGDDController.h:30
AGDDPositioner
Definition
AGDDPositioner.h:18
XMLHandler::getAttributeAsInt
int getAttributeAsInt(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition
XMLHandler.cxx:89
XMLHandler::getAttributeAsVector
std::vector< double > getAttributeAsVector(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition
XMLHandler.cxx:100
XMLHandler::getAttributeAsDouble
double getAttributeAsDouble(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition
XMLHandler.cxx:78
XMLHandler::XMLHandler
XMLHandler(const std::string &n, AGDDController &c)
Definition
XMLHandler.cxx:15
XMLHandler::getAttributeAsString
std::string getAttributeAsString(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition
XMLHandler.cxx:69
mposPhiHandler::ElementHandle
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
Definition
mposPhiHandler.cxx:20
mposPhiHandler::mposPhiHandler
mposPhiHandler(const std::string &, AGDDController &c)
Definition
mposPhiHandler.cxx:14
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
mposPhiHandler.h
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
Generated on
for ATLAS Offline Software by
1.17.0