Skip to content
Snippets Groups Projects
Commit 74e39cf7 authored by Jihee Kim's avatar Jihee Kim
Browse files

Created ZDC source file and added read in parameters

parent 8be6749a
No related branches found
No related tags found
1 merge request!11Resolve "Implement ffi_ZDC"
Pipeline #7694 failed
#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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment