ATLAS Offline Software
Loading...
Searching...
No Matches
pconHandler.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
11#include <iostream>
12
13
14using namespace xercesc;
15
16pconHandler::pconHandler(const std::string& s,
18 : XMLHandler(s, c)
19{
20}
21
23 xercesc::DOMNode *t)
24{
25 bool res;
26 std::string name=getAttributeAsString(c, t, "name",res);
27 std::string material=getAttributeAsString(c, t, "material",res);
28
29 AGDDPcon *vol=new AGDDPcon(name, c.GetVolumeStore(), c.GetSectionStore());
30 vol->SetMaterial(material);
31
32 std::string col=getAttributeAsString(c, t, "color",res);
33 if (res)
34 vol->SetColor(col);
35
36 std::vector<double> vvv=getAttributeAsVector(c, t, "profile",res);
37 if (res)
38 vol->SetProfile(vvv[0],vvv[1]);
39 else
40 vol->SetProfile(0.,360.);
41
42 StopLoop(true);
43 DOMNode* child;
44
45 polyplaneHandler* pplaneHand = dynamic_cast<polyplaneHandler*>
46 (c.GetHandlerStore().GetHandler("polyplane"));
47 if (!pplaneHand) std::abort();
48
49 IAGDDParser& parser = *c.GetParser();
50 for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
51 {
52 if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
53 parser.elementLoop(c, child);
54 Polyplane p = pplaneHand->CurrentPolyplane();
55 vol->SetPlane(p.rin(),p.rou(),p.z());
56 }
57 }
58
59
60}
std::pair< std::vector< unsigned int >, bool > res
void SetPlane(double ri, double ro, double z)
Definition AGDDPcon.h:19
void SetProfile(double phi0, double dphi)
Definition AGDDPcon.h:25
void SetMaterial(const std::string &n)
Definition AGDDVolume.h:24
void SetColor(const std::string &c)
Definition AGDDVolume.h:36
void StopLoop(bool)
std::vector< double > getAttributeAsVector(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
XMLHandler(const std::string &n, AGDDController &c)
std::string getAttributeAsString(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
pconHandler(const std::string &, AGDDController &c)
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
const Polyplane & CurrentPolyplane()