ATLAS Offline Software
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 
9 #include "AGDDModel/AGDDPgon.h"
11 #include <iostream>
12 
13 using namespace xercesc;
14 
15 pgonHandler::pgonHandler(const std::string& s,
17  : XMLHandler(s, c)
18 {
19 // std::cout<<"Creating handler for pgon"<<std::endl;
20 }
21 
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
polyplaneHandler
Definition: polyplaneHandler.h:12
python.CaloScaleNoiseConfig.parser
parser
Definition: CaloScaleNoiseConfig.py:75
AGDDPgon::SetNbPhi
void SetNbPhi(int i)
Definition: AGDDPgon.h:26
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
polyplaneHandler.h
XercesParser.h
AGDDPgon.h
IAGDDParser
Definition: IAGDDParser.h:15
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
pgonHandler::pgonHandler
pgonHandler(const std::string &, AGDDController &c)
Definition: pgonHandler.cxx:15
AGDDController
Definition: AGDDController.h:30
polyplaneHandler::CurrentPolyplane
const Polyplane & CurrentPolyplane()
Definition: polyplaneHandler.h:18
Polyplane
Definition: Polyplane.h:8
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AGDDVolume::SetMaterial
void SetMaterial(const std::string &n)
Definition: AGDDVolume.h:24
XMLHandlerStore.h
XMLHandler::getAttributeAsVector
std::vector< double > getAttributeAsVector(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition: XMLHandler.cxx:100
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
AGDDPgon::SetProfile
void SetProfile(double phi0, double dphi)
Definition: AGDDPgon.h:25
XMLHandler::getAttributeAsString
std::string getAttributeAsString(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition: XMLHandler.cxx:69
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
pgonHandler::ElementHandle
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
Definition: pgonHandler.cxx:22
XMLHandler
Definition: XMLHandler.h:15
query_example.col
col
Definition: query_example.py:7
pgonHandler.h
XMLHandler::getAttributeAsInt
int getAttributeAsInt(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition: XMLHandler.cxx:89
AGDDVolume::SetColor
void SetColor(const std::string &c)
Definition: AGDDVolume.h:36
AGDDPgon::SetPlane
void SetPlane(double ri, double ro, double z)
Definition: AGDDPgon.h:19
AGDDPgon
Definition: AGDDPgon.h:13
python.compressB64.c
def c
Definition: compressB64.py:93
XMLHandler::StopLoop
void StopLoop(bool)
Definition: XMLHandler.cxx:28