Skip to content
Snippets Groups Projects

Resolve "Implement ffi_ZDC"

Merged Jihee Kim requested to merge 30-implement-ffi_zdc into master
1 file
+ 39
0
Compare changes
  • Side-by-side
  • Inline
src/ffi_ZDC.cpp 0 → 100644
+ 39
0
 
#include <XML/Helper.h>
 
///////////////////////////////////////////
 
// Far Forward Ion Zero Degree Calorimeter
 
///////////////////////////////////////////
 
 
using namespace std;
 
using namespace dd4hep;
 
 
static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
 
{
 
xml_det_t x_det = e;
 
string detName = x_det.nameStr();
 
int detID = x_det.id();
 
 
xml_dim_t dim = x_det.dimensions();
 
double Width = dim.x();
 
double Thickness = dim.z();
 
 
xml_dim_t pos = x_det.position();
 
double x_pos = dd4hep::getAttrOrDefault(pos, _Unicode(x),0.0);
 
double z_pos = dd4hep::getAttrOrDefault(pos, _Unicode(z),0.0);
 
 
xml_dim_t rot = x_det.rotation();
 
double x_rot = dd4hep::getAttrOrDefault(rot, _Unicode(x),0.0);
 
double y_rot = dd4hep::getAttrOrDefault(rot, _Unicode(y),0.0);
 
double z_rot = dd4hep::getAttrOrDefault(rot, _Unicode(z),0.0);
 
 
 
 
 
DetElement det(detName, detID);
 
Volume motherVol = desc.pickMotherVolume(det);
 
Transform3D tr(RotationZYX(0., 0., 0.), Position(0., 0., 0.));
 
PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
 
det.setPlacement(detPV);
 
return det;
 
}
 
 
DECLARE_DETELEMENT(ffi_ZDC, createDetector)
Loading