ATLAS Offline Software
Loading...
Searching...
No Matches
compositionHandler.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
9#include <iostream>
13
14
15using namespace xercesc;
16
19 : XMLHandler(s, c)
20{
21}
22
24 xercesc::DOMNode *t)
25{
26 std::string name=getAttributeAsString(c, t, "name");
27// if (msgLog().level()<=MSG::DEBUG)
28// msgLog()<<MSG::DEBUG<<" Composition "<<name<<endmsg;
29
30 AGDDComposition *cm=new AGDDComposition(name, c.GetVolumeStore(), c.GetSectionStore());
31
32 StopLoop(true);
33 DOMNode *child;
34
35 int before=c.GetPositionerStore().NrOfPositioners();
36
37 IAGDDParser& parser = *c.GetParser();
38 for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
39 {
40 if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
41 parser.elementLoop(c, child);
42 }
43 }
44
45 int after=c.GetPositionerStore().NrOfPositioners();
46 for (int i=before;i<after;i++)
47 {
48 AGDDPositioner *posit=c.GetPositionerStore().GetPositioner(i);
49 if (c.GetVolumeStore().Exist(posit->Volume()))
50 cm->AddDaughter(posit);
51 }
52
53}
const std::string & Volume()
void StopLoop(bool)
XMLHandler(const std::string &n, AGDDController &c)
std::string getAttributeAsString(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
compositionHandler(const std::string &, AGDDController &c)