ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
AGDD
AGDDHandlers
src
pgonHandler.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/pgonHandler.h
"
6
#include "
AGDDControl/XercesParser.h
"
7
#include "
AGDDControl/XMLHandlerStore.h
"
8
#include "
AGDDControl/AGDDController.h
"
9
#include "
AGDDModel/AGDDPgon.h
"
10
#include "
AGDDHandlers/polyplaneHandler.h
"
11
#include <iostream>
12
13
using namespace
xercesc;
14
15
pgonHandler::pgonHandler
(
const
std::string& s,
16
AGDDController
& c)
17
:
XMLHandler
(s, c)
18
{
19
// std::cout<<"Creating handler for pgon"<<std::endl;
20
}
21
22
void
pgonHandler::ElementHandle
(
AGDDController
& c,
23
xercesc::DOMNode *t)
24
{
25
// std::cout<<"handling for pgon";
26
bool
res
;
27
std::string name=
getAttributeAsString
(c, t,
"name"
,
res
);
28
std::string material=
getAttributeAsString
(c, t,
"material"
,
res
);
29
int
nbPhi=
getAttributeAsInt
(c, t,
"nbPhi"
,
res
);
30
31
AGDDPgon
*vol=
new
AGDDPgon
(name, c.GetVolumeStore(), c.GetSectionStore());
32
vol->
SetMaterial
(material);
33
vol->
SetNbPhi
(nbPhi);
34
35
std::string col=
getAttributeAsString
(c, t,
"color"
,
res
);
36
if
(
res
)
37
vol->
SetColor
(col);
38
39
std::vector<double> vvv=
getAttributeAsVector
(c, t,
"profile"
,
res
);
40
if
(
res
)
41
vol->
SetProfile
(vvv[0],vvv[1]);
42
else
43
vol->
SetProfile
(0.,360.);
44
45
StopLoop
(
true
);
46
47
DOMNode* child;
48
49
polyplaneHandler
* pplaneHand =
dynamic_cast<
polyplaneHandler
*
>
50
(c.GetHandlerStore().GetHandler(
"polyplane"
));
51
if
(!pplaneHand) std::abort();
52
53
IAGDDParser
& parser = *c.GetParser();
54
for
(child=t->getFirstChild();child!=0;child=child->getNextSibling())
55
{
56
if
(child->getNodeType()==DOMNode::ELEMENT_NODE) {
57
parser.elementLoop(c, child);
58
Polyplane
p = pplaneHand->
CurrentPolyplane
();
59
vol->
SetPlane
(p.rin(),p.rou(),p.z());
60
}
61
}
62
63
}
AGDDController.h
AGDDPgon.h
res
std::pair< std::vector< unsigned int >, bool > res
Definition
JetGroupProductTest.cxx:11
XMLHandlerStore.h
XercesParser.h
AGDDController
Definition
AGDDController.h:30
AGDDPgon
Definition
AGDDPgon.h:13
AGDDPgon::SetNbPhi
void SetNbPhi(int i)
Definition
AGDDPgon.h:26
AGDDPgon::SetPlane
void SetPlane(double ri, double ro, double z)
Definition
AGDDPgon.h:19
AGDDPgon::SetProfile
void SetProfile(double phi0, double dphi)
Definition
AGDDPgon.h:25
AGDDVolume::SetMaterial
void SetMaterial(const std::string &n)
Definition
AGDDVolume.h:24
AGDDVolume::SetColor
void SetColor(const std::string &c)
Definition
AGDDVolume.h:36
IAGDDParser
Definition
IAGDDParser.h:15
Polyplane
Definition
Polyplane.h:8
XMLHandler::StopLoop
void StopLoop(bool)
Definition
XMLHandler.cxx:28
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::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
pgonHandler::ElementHandle
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
Definition
pgonHandler.cxx:22
pgonHandler::pgonHandler
pgonHandler(const std::string &, AGDDController &c)
Definition
pgonHandler.cxx:15
polyplaneHandler
Definition
polyplaneHandler.h:12
polyplaneHandler::CurrentPolyplane
const Polyplane & CurrentPolyplane()
Definition
polyplaneHandler.h:18
pgonHandler.h
polyplaneHandler.h
Generated on
for ATLAS Offline Software by
1.17.0