ATLAS Offline Software
gvxyHandler.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "AGDDModel/AGDDGvxy.h"
11 #include <iostream>
12 
13 using namespace xercesc;
14 
15 gvxyHandler::gvxyHandler(const std::string& s,
17  : XMLHandler(s, c)
18 {
19 }
20 
22  xercesc::DOMNode *t)
23 {
24  bool res;
25  std::string name=getAttributeAsString(c, t, "name");
26  std::string material=getAttributeAsString(c, t, "material");
27  double dZ=getAttributeAsDouble(c, t, "dZ");
28 
29  AGDDGvxy *vol=new AGDDGvxy(name, c.GetVolumeStore(), c.GetSectionStore());
30  vol->SetMaterial(material);
31  vol->SetDz(dZ);
32 
33  std::vector<TwoPoint> points;
34  StopLoop(true);
35 
36  gvxy_pointHandler* pointHand = dynamic_cast<gvxy_pointHandler*>
37  (c.GetHandlerStore().GetHandler("gvxy_point"));
38  if (!pointHand) std::abort();
39 
40  IAGDDParser& parser = *c.GetParser();
41  DOMNode *child;
42  for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
43  {
44  if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
45  parser.elementLoop(c, child);
46  TwoPoint p = pointHand->CurrentTwoPoint();
47  points.push_back(p);
48  }
49  }
50 
51  int nPoints=points.size();
52  for (int i=0;i<nPoints;i++)
53  vol->SetPoint(points[i]);
54 
55  std::string col=getAttributeAsString(c, t, "color",res);
56  if (res)
57  vol->SetColor(col);
58 }
AGDDController.h
gvxy_pointHandler
Definition: gvxy_pointHandler.h:12
python.CaloScaleNoiseConfig.parser
parser
Definition: CaloScaleNoiseConfig.py:75
gvxyHandler::ElementHandle
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
Definition: gvxyHandler.cxx:21
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
XercesParser.h
gvxy_pointHandler.h
gvxyHandler::gvxyHandler
gvxyHandler(const std::string &, AGDDController &c)
Definition: gvxyHandler.cxx:15
IAGDDParser
Definition: IAGDDParser.h:15
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
XMLHandler::getAttributeAsDouble
double getAttributeAsDouble(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition: XMLHandler.cxx:78
TwoPoint
Definition: TwoPoint.h:8
AGDDController
Definition: AGDDController.h:30
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AGDDVolume::SetMaterial
void SetMaterial(const std::string &n)
Definition: AGDDVolume.h:24
AGDDGvxy
Definition: AGDDGvxy.h:14
lumiFormat.i
int i
Definition: lumiFormat.py:85
XMLHandlerStore.h
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
AGDDGvxy.h
XMLHandler::getAttributeAsString
std::string getAttributeAsString(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition: XMLHandler.cxx:69
AGDDGvxy::SetDz
void SetDz(double v)
Definition: AGDDGvxy.h:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
XMLHandler
Definition: XMLHandler.h:15
query_example.col
col
Definition: query_example.py:7
gvxy_pointHandler::CurrentTwoPoint
TwoPoint CurrentTwoPoint()
Definition: gvxy_pointHandler.h:18
AGDDGvxy::SetPoint
void SetPoint(TwoPoint p)
Definition: AGDDGvxy.h:24
AGDDVolume::SetColor
void SetColor(const std::string &c)
Definition: AGDDVolume.h:36
gvxyHandler.h
python.compressB64.c
def c
Definition: compressB64.py:93
XMLHandler::StopLoop
void StopLoop(bool)
Definition: XMLHandler.cxx:28
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97