ATLAS Offline Software
posXYZHandler.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include "GeoModelKernel/Units.h"
9 #include "GaudiKernel/MsgStream.h"
11 
12 #include <iostream>
13 
14 posXYZHandler::posXYZHandler(const std::string& s,
16  : XMLHandler(s, c)
17 {
18 }
19 
21  xercesc::DOMNode *t)
22 {
23  bool res=false;
24  bool posRet=false;
25  bool rotRet=false;
26  std::string volume=getAttributeAsString(c, t, "volume",res);
27  std::string sym=getAttributeAsString(c, t, "sym",res);
28  if (res) {
29  MsgStream log(Athena::getMessageSvc(),"posXYZHandler");
30  log<<MSG::INFO<<"ElementHandle() - symmetry implemented for "<<volume<<endmsg;
31  }
32  std::string sRot="";
33  GeoTrf::Vector3D cvec(0,0,0);
34  GeoTrf::Transform3D crot = GeoTrf::Transform3D::Identity();
35  std::vector<double> X_Y_Z=getAttributeAsVector(c, t, "X_Y_Z",posRet);
36  if (posRet) cvec =GeoTrf::Vector3D(X_Y_Z[0],X_Y_Z[1],X_Y_Z[2]);
37  std::vector<double> rot=getAttributeAsVector(c, t, "rot",rotRet);
38  if (rotRet) crot = crot*GeoTrf::RotateZ3D(rot[2]*GeoModelKernelUnits::degree)*GeoTrf::RotateY3D(rot[1]*GeoModelKernelUnits::degree)*GeoTrf::RotateX3D(rot[0]*GeoModelKernelUnits::degree);
39  new AGDDPositioner(c.GetPositionerStore(),
40  c.GetVolumeStore(),volume,GeoTrf::Translation3D(cvec)*crot);
41 }
posXYZHandler::ElementHandle
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
Definition: posXYZHandler.cxx:20
AGDDController.h
AGDDPositioner.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
posXYZHandler.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
AGDDPositioner
Definition: AGDDPositioner.h:18
AGDDController
Definition: AGDDController.h:30
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
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
XMLHandler::getAttributeAsString
std::string getAttributeAsString(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition: XMLHandler.cxx:69
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
XMLHandler
Definition: XMLHandler.h:15
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
python.compressB64.c
def c
Definition: compressB64.py:93
posXYZHandler::posXYZHandler
posXYZHandler(const std::string &, AGDDController &c)
Definition: posXYZHandler.cxx:14
python.SystemOfUnits.degree
tuple degree
Definition: SystemOfUnits.py:106