ATLAS Offline Software
gvxysxyHandler.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/AGDDGvxy.h"
11 #include <iostream>
12 
13 using namespace xercesc;
14 
15 gvxysxyHandler::gvxysxyHandler(const std::string& s,
17  : XMLHandler(s, c)
18 {
19 // std::cout<<"Creating handler for gvxy"<<std::endl;
20 }
21 
23  xercesc::DOMNode *t)
24 {
25  bool res;
26  std::string name=getAttributeAsString(c, t, "name");
27  std::string material=getAttributeAsString(c, t, "material");
28  double dZ=getAttributeAsDouble(c, t, "dZ");
29 
30  AGDDGvxy *vol=new AGDDGvxy(name, c.GetVolumeStore(), c.GetSectionStore());
31  vol->SetMaterial(material);
32  vol->SetDz(dZ);
33 
34  StopLoop(true);
35 
36  std::vector<TwoPoint> points;
37 
38  gvxy_pointHandler* pointHand = dynamic_cast<gvxy_pointHandler*>
39  (c.GetHandlerStore().GetHandler("gvxy_point"));
40  if (!pointHand) std::abort();
41 
42  IAGDDParser& parser = *c.GetParser();
43  DOMNode *child;
44  for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
45  {
46  if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
47  parser.elementLoop(c, child);
48  TwoPoint p = pointHand->CurrentTwoPoint();
49  points.push_back(p);
50  }
51  }
52 
53  int nPoints=points.size();
54 // std::cout<<"npoints "<<nPoints<<std::endl;
55  TwoPoint *v=new TwoPoint[4*nPoints];
56  for (int i=0;i<nPoints;i++)
57  {
58  v[i]=points[i];
59  v[nPoints+i].x(-points[nPoints-1-i].x());
60  v[nPoints+i].y(points[nPoints-1-i].y());
61  v[2*nPoints+i].x(-points[i].x());
62  v[2*nPoints+i].y(-points[i].y());
63  v[3*nPoints+i].x(points[nPoints-1-i].x());
64  v[3*nPoints+i].y(-points[nPoints-1-i].y());
65  }
66  nPoints=4*nPoints;
67 
68  for (int i=0;i<nPoints;i++)
69  vol->SetPoint(v[i]);
70 
71  delete[] v;
72 
73  std::string col=getAttributeAsString(c, t, "color",res);
74  if (res)
75  vol->SetColor(col);
76 }
AGDDController.h
gvxy_pointHandler
Definition: gvxy_pointHandler.h:12
python.CaloScaleNoiseConfig.parser
parser
Definition: CaloScaleNoiseConfig.py:75
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
XercesParser.h
gvxy_pointHandler.h
gvxysxyHandler::ElementHandle
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
Definition: gvxysxyHandler.cxx:22
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
x
#define x
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
gvxysxyHandler.h
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:221
XMLHandler
Definition: XMLHandler.h:15
query_example.col
col
Definition: query_example.py:7
gvxy_pointHandler::CurrentTwoPoint
TwoPoint CurrentTwoPoint()
Definition: gvxy_pointHandler.h:18
python.PyAthena.v
v
Definition: PyAthena.py:154
y
#define y
AGDDGvxy::SetPoint
void SetPoint(TwoPoint p)
Definition: AGDDGvxy.h:24
AGDDVolume::SetColor
void SetColor(const std::string &c)
Definition: AGDDVolume.h:36
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
gvxysxyHandler::gvxysxyHandler
gvxysxyHandler(const std::string &, AGDDController &c)
Definition: gvxysxyHandler.cxx:15