From c4d0fb14cc9a0a261736267a11ee552c0b4232a2 Mon Sep 17 00:00:00 2001 From: Markus Frank <markus.frank@cern.ch> Date: Fri, 22 Feb 2013 17:11:32 +0000 Subject: [PATCH] Have a common representation for all unicode macros. Fix UtilityApps to print message if plugins are not found. --- DDExamples/AlignDet/src/BoxDetector_geo.cpp | 6 +-- .../src/CylindricalBarrelCalorimeter_geo.cpp | 6 +-- .../src/CylindricalEndcapCalorimeter_geo.cpp | 6 +-- DDExamples/CLICSiD/src/DiskTracker_geo.cpp | 10 ++-- .../src/DiskTracker_no_shortcuts_geo.cpp | 4 +- DDExamples/CLICSiD/src/EcalBarrel_geo.cpp | 4 +- .../CLICSiD/src/ForwardDetector_geo.cpp | 4 +- .../CLICSiD/src/MultiLayerTracker_geo.cpp | 10 ++-- .../CLICSiD/src/PolyconeSupport_geo.cpp | 2 +- .../src/PolyhedraBarrelCalorimeter2_geo.cpp | 8 +-- .../src/PolyhedraEndcapCalorimeter2_geo.cpp | 4 +- .../CLICSiD/src/SiTrackerBarrel_geo.cpp | 16 +++--- .../CLICSiD/src/SiTrackerEndcap2_geo.cpp | 12 ++--- .../ILDExDet/src/compact/ILDExSIT_geo.cpp | 6 +-- .../ILDExDet/src/compact/ILDExTPC_geo.cpp | 16 +++--- .../ILDExDet/src/compact/ILDExVXD_geo.cpp | 6 +-- DDExamples/ILDExDet/src/compact/LP1_geo.cpp | 20 +++---- .../ILDExDet/src/compact/TPCPrototype_geo.cpp | 16 +++--- DDExamples/ILDExDet/src/compact/Template.cpp | 2 +- .../src/compact/Tesla_BeamCal01_geo.cpp | 10 ++-- .../src/compact/Tesla_ClicYoke01_geo.cpp | 22 ++++---- .../src/compact/Tesla_LumiCalX_geo.cpp | 10 ++-- .../src/compact/Tesla_SEcal03_geo.cpp | 54 +++++++++---------- .../ILDExDet/src/compact/Tesla_SFtd05_geo.cpp | 28 +++++----- .../src/compact/Tesla_SHcalSc02_geo.cpp | 10 ++-- .../ILDExDet/src/compact/Tesla_SSit03_geo.cpp | 10 ++-- .../ILDExDet/src/compact/Tesla_VXD03_geo.cpp | 2 +- .../ILDExDet/src/compact/Tesla_ftd01_geo.cpp | 12 ++--- .../ILDExDet/src/compact/Tesla_hcal04_geo.cpp | 52 +++++++++--------- .../src/compact/Tesla_maskX01_geo.cpp | 6 +-- .../ILDExDet/src/compact/Tesla_tpc06_geo.cpp | 32 +++++------ .../ILDExDet/src/compact/Tesla_tube01_geo.cpp | 10 ++-- .../src/compact/Tesla_tubeX01_geo.cpp | 6 +-- .../ILDExDet/src/compact/Tesla_yoke02_geo.cpp | 6 +-- .../compact/VersatileDiskRowLayoutSeg_geo.cpp | 6 +-- DDExamples/UtilityApps/src/converter.cpp | 43 ++++----------- DDExamples/UtilityApps/src/display.cpp | 45 +++++----------- DDExamples/UtilityApps/src/plugin_runner.cpp | 35 +++--------- 38 files changed, 247 insertions(+), 310 deletions(-) diff --git a/DDExamples/AlignDet/src/BoxDetector_geo.cpp b/DDExamples/AlignDet/src/BoxDetector_geo.cpp index 1da515fd6..94e78e248 100644 --- a/DDExamples/AlignDet/src/BoxDetector_geo.cpp +++ b/DDExamples/AlignDet/src/BoxDetector_geo.cpp @@ -15,9 +15,9 @@ using namespace DD4hep::Geometry; static Ref_t create_element(LCDD& lcdd, xml_h e, Ref_t) { xml_det_t x_det = e; string name = x_det.nameStr(); - xml_comp_t box (x_det.child(_X(box))); - xml_dim_t pos (x_det.child(_X(position))); - xml_dim_t rot (x_det.child(_X(rotation))); + xml_comp_t box (x_det.child(_U(box))); + xml_dim_t pos (x_det.child(_U(position))); + xml_dim_t rot (x_det.child(_U(rotation))); Material mat (lcdd.material(x_det.materialStr())); DetElement det (name,x_det.id()); Volume det_vol(name+"_vol",Box(box.x(),box.y(),box.z()), mat); diff --git a/DDExamples/CLICSiD/src/CylindricalBarrelCalorimeter_geo.cpp b/DDExamples/CLICSiD/src/CylindricalBarrelCalorimeter_geo.cpp index 1e2badf2c..6dac0e51d 100644 --- a/DDExamples/CLICSiD/src/CylindricalBarrelCalorimeter_geo.cpp +++ b/DDExamples/CLICSiD/src/CylindricalBarrelCalorimeter_geo.cpp @@ -25,7 +25,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double r = rmin; int n = 0; - for(xml_coll_t c(x_det,_X(layer)); c; ++c) { + for(xml_coll_t c(x_det,_U(layer)); c; ++c) { xml_comp_t x_layer = c; for(int i=0, m=0, repeat=x_layer.repeat(); i<repeat; ++i, m=0) { string layer_name = det_name + _toString(n,"_layer%d"); @@ -33,7 +33,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Volume layer_vol(layer_name,layer_tub,air); double rlayer = r; - for(xml_coll_t l(x_layer,_X(slice)); l; ++l, ++m) { + for(xml_coll_t l(x_layer,_U(slice)); l; ++l, ++m) { xml_comp_t x_slice = l; double router = r + x_slice.thickness(); Material slice_mat = lcdd.material(x_slice.materialStr()); @@ -63,7 +63,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { envelopeVol.setAttributes(lcdd,x_det.regionStr(),x_det.limitsStr(),x_det.visStr()); PlacedVolume physvol = lcdd.pickMotherVolume(sdet).placeVolume(envelopeVol,IdentityPos()); - physvol.addPhysVolID("system",sdet.id()).addPhysVolID(_A(barrel),0); + physvol.addPhysVolID("system",sdet.id()).addPhysVolID(_U(barrel),0); sdet.setPlacement(physvol); return sdet; } diff --git a/DDExamples/CLICSiD/src/CylindricalEndcapCalorimeter_geo.cpp b/DDExamples/CLICSiD/src/CylindricalEndcapCalorimeter_geo.cpp index 2e32eae10..bf3f0d5ad 100644 --- a/DDExamples/CLICSiD/src/CylindricalEndcapCalorimeter_geo.cpp +++ b/DDExamples/CLICSiD/src/CylindricalEndcapCalorimeter_geo.cpp @@ -28,17 +28,17 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double z = zmin; int n = 0; - for(xml_coll_t c(x_det,_X(layer)); c; ++c) { + for(xml_coll_t c(x_det,_U(layer)); c; ++c) { xml_comp_t x_layer = c; double layerWidth = 0; - for(xml_coll_t l(x_layer,_X(slice)); l; ++l) + for(xml_coll_t l(x_layer,_U(slice)); l; ++l) layerWidth += xml_comp_t(l).thickness(); for(int i=0, m=0, repeat=x_layer.repeat(); i<repeat; ++i, m=0) { double zlayer = z; string layer_name = det_name + _toString(n,"_layer%d"); Volume layer_vol(layer_name,Tube(rmin,rmax,layerWidth),air); - for(xml_coll_t l(x_layer,_X(slice)); l; ++l, ++m) { + for(xml_coll_t l(x_layer,_U(slice)); l; ++l, ++m) { xml_comp_t x_slice = l; double w = x_slice.thickness(); string slice_name = layer_name + _toString(m,"slice%d"); diff --git a/DDExamples/CLICSiD/src/DiskTracker_geo.cpp b/DDExamples/CLICSiD/src/DiskTracker_geo.cpp index fb1d3b0f7..6af61dcb7 100644 --- a/DDExamples/CLICSiD/src/DiskTracker_geo.cpp +++ b/DDExamples/CLICSiD/src/DiskTracker_geo.cpp @@ -21,7 +21,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Volume motherVol = lcdd.pickMotherVolume(sdet); int l_num = 0; - for(xml_coll_t i(x_det,_X(layer)); i; ++i, ++l_num) { + for(xml_coll_t i(x_det,_U(layer)); i; ++i, ++l_num) { xml_comp_t x_layer = i; string l_nam = det_name+_toString(l_num,"_layer%d"); double zmin = x_layer.inner_z(); @@ -30,14 +30,14 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double z = zmin, layerWidth = 0.; int s_num = 0; - for(xml_coll_t j(x_layer,_X(slice)); j; ++j) { + for(xml_coll_t j(x_layer,_U(slice)); j; ++j) { double thickness = xml_comp_t(j).thickness(); layerWidth += thickness; } Tube l_tub(rmin,rmax,layerWidth,2*M_PI); Volume l_vol(l_nam,l_tub,air); l_vol.setVisAttributes(lcdd,x_layer.visStr()); - for(xml_coll_t j(x_layer,_X(slice)); j; ++j, ++s_num) { + for(xml_coll_t j(x_layer,_U(slice)); j; ++j, ++s_num) { xml_comp_t x_slice = j; double thick = x_slice.thickness(); Material mat = lcdd.material(x_slice.materialStr()); @@ -68,8 +68,8 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { sdet.add(layerR.setPlacement(lpvR)); } } - if ( x_det.hasAttr(_A(combineHits)) ) { - sdet.setCombineHits(x_det.attr<bool>(_A(combineHits)),sens); + if ( x_det.hasAttr(_U(combineHits)) ) { + sdet.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens); } return sdet; } diff --git a/DDExamples/CLICSiD/src/DiskTracker_no_shortcuts_geo.cpp b/DDExamples/CLICSiD/src/DiskTracker_no_shortcuts_geo.cpp index 4b9495c75..efa873469 100644 --- a/DDExamples/CLICSiD/src/DiskTracker_no_shortcuts_geo.cpp +++ b/DDExamples/CLICSiD/src/DiskTracker_no_shortcuts_geo.cpp @@ -76,8 +76,8 @@ static Ref_t create_detector(LCDD& lcdd, XML::Element x_det, SensitiveDetector s layer.setPlacement(lpv); if ( reflect ) { PlacedVolume lpvR = motherVol.placeVolume(l_vol,Position(0,0,-zmin-layerWidth/2),ReflectRot()); - lpvR.addPhysVolID(_X(system),sdet.id()); - lpvR.addPhysVolID(_X(barrel),2); + lpvR.addPhysVolID("system",sdet.id()); + lpvR.addPhysVolID("barrel",2); DetElement layerR = layer.clone(l_nam+"_reflect"); sdet.add(layerR.setPlacement(lpvR)); } diff --git a/DDExamples/CLICSiD/src/EcalBarrel_geo.cpp b/DDExamples/CLICSiD/src/EcalBarrel_geo.cpp index 488bc871e..48d06003c 100644 --- a/DDExamples/CLICSiD/src/EcalBarrel_geo.cpp +++ b/DDExamples/CLICSiD/src/EcalBarrel_geo.cpp @@ -73,7 +73,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { // Loop over the sets of layer elements in the detector. int l_num = 0; - for(xml_coll_t li(x_det,_X(layer)); li; ++li) { + for(xml_coll_t li(x_det,_U(layer)); li; ++li) { xml_comp_t x_layer = li; int repeat = x_layer.repeat(); // Loop over number of repeats for this layer. @@ -91,7 +91,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { // Loop over the sublayers or slices for this layer. int s_num = 0; double s_pos_z = -(l_thickness / 2); - for(xml_coll_t si(x_layer,_X(slice)); si; ++si) { + for(xml_coll_t si(x_layer,_U(slice)); si; ++si) { xml_comp_t x_slice = si; string s_name = _toString(s_num,"slice%d"); double s_thick = x_slice.thickness(); diff --git a/DDExamples/CLICSiD/src/ForwardDetector_geo.cpp b/DDExamples/CLICSiD/src/ForwardDetector_geo.cpp index cd118c50a..c997ef9d5 100644 --- a/DDExamples/CLICSiD/src/ForwardDetector_geo.cpp +++ b/DDExamples/CLICSiD/src/ForwardDetector_geo.cpp @@ -67,7 +67,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { // Process each layer element. double layerPosZ = -thickness / 2; double layerDisplZ = 0; - for(xml_coll_t c(x_det,XML::Tag_layer); c; ++c) { + for(xml_coll_t c(x_det,_U(layer)); c; ++c) { xml_comp_t x_layer = c; double layerThickness = layering.singleLayerThickness(x_layer); @@ -98,7 +98,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { int sliceCount = 0; double slicePosZ = -layerThickness / 2; double sliceDisplZ = 0; - for(xml_coll_t l(x_layer,XML::Tag_slice); l; ++l, ++m) { + for(xml_coll_t l(x_layer,_U(slice)); l; ++l, ++m) { xml_comp_t x_slice = l; string slice_nam = _toString(sliceCount,"slice%d"); /** Get slice parameters. */ diff --git a/DDExamples/CLICSiD/src/MultiLayerTracker_geo.cpp b/DDExamples/CLICSiD/src/MultiLayerTracker_geo.cpp index 2acb3ae3e..9ac5deb12 100644 --- a/DDExamples/CLICSiD/src/MultiLayerTracker_geo.cpp +++ b/DDExamples/CLICSiD/src/MultiLayerTracker_geo.cpp @@ -21,7 +21,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Volume motherVol = lcdd.pickMotherVolume(sdet); int n = 0; - for(xml_coll_t i(x_det,_X(layer)); i; ++i, ++n) { + for(xml_coll_t i(x_det,_U(layer)); i; ++i, ++n) { xml_comp_t x_layer = i; string l_name = det_name+_toString(n,"_layer%d"); DetElement layer(sdet,_toString(n,"layer%d"),x_layer.id()); @@ -32,7 +32,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double r = rmin; int m = 0; - for(xml_coll_t j(x_layer,_X(slice)); j; ++j, ++m) { + for(xml_coll_t j(x_layer,_U(slice)); j; ++j, ++m) { xml_comp_t x_slice = j; Material mat = lcdd.material(x_slice.materialStr()); string s_name= l_name+_toString(m,"_slice%d"); @@ -56,11 +56,11 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { l_vol.setVisAttributes(lcdd,x_layer.visStr()); PlacedVolume lpv = motherVol.placeVolume(l_vol,IdentityPos()); - lpv.addPhysVolID("system",sdet.id()).addPhysVolID(_X(barrel),0); + lpv.addPhysVolID("system",sdet.id()).addPhysVolID("barrel",0); layer.setPlacement(lpv); } - if ( x_det.hasAttr(_A(combineHits)) ) { - sdet.setCombineHits(x_det.attr<bool>(_A(combineHits)),sens); + if ( x_det.hasAttr(_U(combineHits)) ) { + sdet.setCombineHits(x_det.combineHits(),sens); } return sdet; } diff --git a/DDExamples/CLICSiD/src/PolyconeSupport_geo.cpp b/DDExamples/CLICSiD/src/PolyconeSupport_geo.cpp index 7e795bef1..f2c884b35 100644 --- a/DDExamples/CLICSiD/src/PolyconeSupport_geo.cpp +++ b/DDExamples/CLICSiD/src/PolyconeSupport_geo.cpp @@ -20,7 +20,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, Ref_t) { vector<double> rmin,rmax,z; int num = 0; - for(xml_coll_t c(e,_X(zplane)); c; ++c, ++num) { + for(xml_coll_t c(e,_U(zplane)); c; ++c, ++num) { xml_comp_t dim(c); rmin.push_back(dim.rmin()); rmax.push_back(dim.rmax()); diff --git a/DDExamples/CLICSiD/src/PolyhedraBarrelCalorimeter2_geo.cpp b/DDExamples/CLICSiD/src/PolyhedraBarrelCalorimeter2_geo.cpp index cc7cc0953..9d948b4f3 100644 --- a/DDExamples/CLICSiD/src/PolyhedraBarrelCalorimeter2_geo.cpp +++ b/DDExamples/CLICSiD/src/PolyhedraBarrelCalorimeter2_geo.cpp @@ -61,11 +61,11 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { DetElement stave("stave0",x_det.id()); Volume motherVol = lcdd.pickMotherVolume(sdet); - for(xml_coll_t c(x_det,_X(layer)); c; ++c) { + for(xml_coll_t c(x_det,_U(layer)); c; ++c) { xml_comp_t x_layer = c; int repeat = x_layer.repeat(); totalRepeat += repeat; - totalSlices += x_layer.numChildren(_X(slice)); + totalSlices += x_layer.numChildren(_U(slice)); } PolyhedraRegular polyhedra(numSides,rmin,rmin+totalThickness,detZ); @@ -94,7 +94,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { // Set envelope volume attributes. envelopeVol.setAttributes(lcdd,x_det.regionStr(),x_det.limitsStr(),x_det.visStr()); - for(xml_coll_t c(x_det,_X(layer)); c; ++c) { + for(xml_coll_t c(x_det,_U(layer)); c; ++c) { xml_comp_t x_layer = c; int repeat = x_layer.repeat(); // Get number of times to repeat this layer. const Layer* lay = layering.layer(layer_num); // Get the layer from the layering engine. @@ -112,7 +112,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { // Create the slices (sublayers) within the layer. double slice_pos_z = -(layer_thickness / 2); int slice_number = 0; - for(xml_coll_t k(x_layer,_X(slice)); k; ++k) { + for(xml_coll_t k(x_layer,_U(slice)); k; ++k) { xml_comp_t x_slice = k; string slice_name = layer_name + _toString(slice_number,"_slice%d"); double slice_thickness = x_slice.thickness(); diff --git a/DDExamples/CLICSiD/src/PolyhedraEndcapCalorimeter2_geo.cpp b/DDExamples/CLICSiD/src/PolyhedraEndcapCalorimeter2_geo.cpp index 392d38070..cdcc7a6fa 100644 --- a/DDExamples/CLICSiD/src/PolyhedraEndcapCalorimeter2_geo.cpp +++ b/DDExamples/CLICSiD/src/PolyhedraEndcapCalorimeter2_geo.cpp @@ -32,7 +32,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { int layerType = 0; double layerZ = -totalThickness/2; - for(xml_coll_t c(x_det,_X(layer)); c; ++c) { + for(xml_coll_t c(x_det,_U(layer)); c; ++c) { xml_comp_t x_layer = c; double l_thick = layering.layer(l_num)->thickness(); string l_name = det_name + _toString(layerType,"_layer%d"); @@ -41,7 +41,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { int s_num = 0; double sliceZ = -l_thick/2; - for(xml_coll_t s(x_layer,_X(slice)); s; ++s) { + for(xml_coll_t s(x_layer,_U(slice)); s; ++s) { xml_comp_t x_slice = s; string s_name = l_name + _toString(s_num,"_slice%d"); double s_thick = x_slice.thickness(); diff --git a/DDExamples/CLICSiD/src/SiTrackerBarrel_geo.cpp b/DDExamples/CLICSiD/src/SiTrackerBarrel_geo.cpp index 3503c0024..2c6c429a2 100644 --- a/DDExamples/CLICSiD/src/SiTrackerBarrel_geo.cpp +++ b/DDExamples/CLICSiD/src/SiTrackerBarrel_geo.cpp @@ -21,16 +21,16 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Volume motherVol = lcdd.pickMotherVolume(sdet); map<string, Volume> volumes; - for(xml_coll_t mi(x_det,_X(module)); mi; ++mi) { + for(xml_coll_t mi(x_det,_U(module)); mi; ++mi) { xml_comp_t x_mod = mi; - xml_comp_t m_env = x_mod.child(_X(module_envelope)); + xml_comp_t m_env = x_mod.child(_U(module_envelope)); string m_nam = x_mod.nameStr(); Volume m_vol(det_name+"_"+m_nam,Box(m_env.width(),m_env.length(),m_env.thickness()),air); DetElement m_elt(sdet, m_nam, det_id); int ncomponents = 0, sensor_number = 0; volumes[m_nam] = m_vol; - for(xml_coll_t ci(x_mod,_X(module_component)); ci; ++ci, ++ncomponents) { + for(xml_coll_t ci(x_mod,_U(module_component)); ci; ++ci, ++ncomponents) { xml_comp_t x_comp = ci; xml_comp_t x_pos = x_comp.position(false); xml_comp_t x_rot = x_comp.rotation(false); @@ -55,7 +55,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { } if ( x_comp.isSensitive() ) { sens.setType("tracker"); - c_phv.addPhysVolID(_X(sensor),sensor_number++); + c_phv.addPhysVolID(_U(sensor),sensor_number++); c_vol.setSensitiveDetector(sens); } DetElement c_elt(m_elt,c_nam,det_id); @@ -64,11 +64,11 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { } m_vol.setVisAttributes(lcdd.visAttributes(x_mod.visStr())); } - for(xml_coll_t li(x_det,_X(layer)); li; ++li) { + for(xml_coll_t li(x_det,_U(layer)); li; ++li) { xml_comp_t x_layer = li; - xml_comp_t x_barrel = x_layer.child(_X(barrel_envelope)); - xml_comp_t x_layout = x_layer.child(_X(rphi_layout)); - xml_comp_t z_layout = x_layer.child(_X(z_layout)); // Get the <z_layout> element. + xml_comp_t x_barrel = x_layer.child(_U(barrel_envelope)); + xml_comp_t x_layout = x_layer.child(_U(rphi_layout)); + xml_comp_t z_layout = x_layer.child(_U(z_layout)); // Get the <z_layout> element. int lay_id = x_layer.id(); string m_nam = x_layer.moduleStr(); DetElement m_elt = sdet.child(m_nam); diff --git a/DDExamples/CLICSiD/src/SiTrackerEndcap2_geo.cpp b/DDExamples/CLICSiD/src/SiTrackerEndcap2_geo.cpp index 2397cdb44..7e9c73429 100644 --- a/DDExamples/CLICSiD/src/SiTrackerEndcap2_geo.cpp +++ b/DDExamples/CLICSiD/src/SiTrackerEndcap2_geo.cpp @@ -27,7 +27,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double posY; map<string,Volume> modules; - for(xml_coll_t mi(x_det,_X(module)); mi; ++mi, ++m_id) { + for(xml_coll_t mi(x_det,_U(module)); mi; ++mi, ++m_id) { xml_comp_t x_mod = mi; string m_nam = x_mod.nameStr(); xml_comp_t trd = x_mod.trd(); @@ -35,7 +35,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double x2 = trd.x2(); double z = trd.z(); double y1, y2, total_thickness=0.; - xml_coll_t ci(x_mod,_X(module_component)); + xml_coll_t ci(x_mod,_U(module_component)); for(ci.reset(), total_thickness=0.0; ci; ++ci) total_thickness += xml_comp_t(ci).thickness(); @@ -52,7 +52,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { vol.setVisAttributes(lcdd.visAttributes(c.visStr())); PlacedVolume phv = m_volume.placeVolume(vol,Position(0,posY+c_thick/2,0)); - phv.addPhysVolID(_X(component),c_id); + phv.addPhysVolID(_U(component),c_id); if ( c.isSensitive() ) { sens.setType("tracker"); sdet.check(n_sensor > 1,"SiTrackerEndcap2::fromCompact: "+c_name+" Max of 2 modules allowed!"); @@ -64,17 +64,17 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { } modules[m_nam] = m_volume; } - for(xml_coll_t li(x_det,_X(layer)); li; ++li) { + for(xml_coll_t li(x_det,_U(layer)); li; ++li) { xml_comp_t x_layer(li); int l_id = x_layer.id(); int mod_num = 0; - for(xml_coll_t ri(x_layer,_X(ring)); ri; ++ri) { + for(xml_coll_t ri(x_layer,_U(ring)); ri; ++ri) { xml_comp_t x_ring = ri; double r = x_ring.r(); double phi0 = x_ring.phi0(0); double zstart = x_ring.zstart(); double dz = x_ring.dz(0); - int nmodules = x_ring.attr<int>(_A(nmodules)); + int nmodules = x_ring.nmodules(); string m_nam = x_ring.moduleStr(); Volume m_vol = modules[m_nam]; double iphi = 2*M_PI/nmodules; diff --git a/DDExamples/ILDExDet/src/compact/ILDExSIT_geo.cpp b/DDExamples/ILDExDet/src/compact/ILDExSIT_geo.cpp index e23254ad1..d85cd5824 100644 --- a/DDExamples/ILDExDet/src/compact/ILDExSIT_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/ILDExSIT_geo.cpp @@ -18,10 +18,10 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { DetElement sit(name,x_det.id()); Volume mother = lcdd.pickMotherVolume(sit); - for(xml_coll_t c(e,_X(layer)); c; ++c) { + for(xml_coll_t c(e,_U(layer)); c; ++c) { xml_comp_t x_layer (c); - xml_comp_t x_support (x_layer.child(_X(support))); - xml_comp_t x_ladder (x_layer.child(_X(ladder))); + xml_comp_t x_support (x_layer.child(_U(support))); + xml_comp_t x_ladder (x_layer.child(_U(ladder))); int layer_id = x_layer.id(); int nLadders = x_ladder.number(); string layername = name+_toString(layer_id,"_layer%d"); diff --git a/DDExamples/ILDExDet/src/compact/ILDExTPC_geo.cpp b/DDExamples/ILDExDet/src/compact/ILDExTPC_geo.cpp index 974694e83..30b219191 100644 --- a/DDExamples/ILDExDet/src/compact/ILDExTPC_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/ILDExTPC_geo.cpp @@ -20,7 +20,7 @@ using namespace DD4hep::Geometry; static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { xml_det_t x_det = e; - xml_comp_t x_tube (x_det.child(_X(tubs))); + xml_comp_t x_tube (x_det.child(_U(tubs))); string name = x_det.nameStr(); Material mat (lcdd.material(x_det.materialStr())); //if data is needed do this @@ -32,12 +32,12 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Tube tpc_tub(x_tube.rmin(),x_tube.rmax(),x_tube.zhalf()); Volume tpc_vol(name+"_envelope_volume", tpc_tub, mat); - for(xml_coll_t c(e,_X(detector)); c; ++c) { + for(xml_coll_t c(e,_U(detector)); c; ++c) { xml_comp_t px_det (c); - xml_comp_t px_tube (px_det.child(_X(tubs))); - xml_dim_t px_pos (px_det.child(_X(position))); - xml_dim_t px_rot (px_det.child(_X(rotation))); - xml_comp_t px_mat (px_det.child(_X(material))); + xml_comp_t px_tube (px_det.child(_U(tubs))); + xml_dim_t px_pos (px_det.child(_U(position))); + xml_dim_t px_rot (px_det.child(_U(rotation))); + xml_comp_t px_mat (px_det.child(_U(material))); string part_nam(px_det.nameStr()); Material part_mat(lcdd.material(px_mat.nameStr())); DetElement part_det(part_nam,px_det.typeStr(),px_det.id()); @@ -66,10 +66,10 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { tpcData->endplate=part_det; //modules int mdcount=0; - for(xml_coll_t m(px_det,_X(modules)); m; ++m) { + for(xml_coll_t m(px_det,_U(modules)); m; ++m) { xml_comp_t modules (m); string m_name = modules.nameStr(); - for(xml_coll_t r(modules,_X(row)); r; ++r) { + for(xml_coll_t r(modules,_U(row)); r; ++r) { xml_comp_t row(r); int nmodules = row.nModules(); int rowID=row.RowID(); diff --git a/DDExamples/ILDExDet/src/compact/ILDExVXD_geo.cpp b/DDExamples/ILDExDet/src/compact/ILDExVXD_geo.cpp index 27317e774..d5d9fd833 100644 --- a/DDExamples/ILDExDet/src/compact/ILDExVXD_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/ILDExVXD_geo.cpp @@ -24,12 +24,12 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Volume mother = lcdd.pickMotherVolume(vxd); - for(xml_coll_t c(e,_X(layer)); c; ++c) { + for(xml_coll_t c(e,_U(layer)); c; ++c) { xml_comp_t x_layer (c); - xml_comp_t x_support (x_layer.child(_X(support))); - xml_comp_t x_ladder (x_layer.child(_X(ladder))); + xml_comp_t x_support (x_layer.child(_U(support))); + xml_comp_t x_ladder (x_layer.child(_U(ladder))); int layer_id = x_layer.id(); int nLadders = x_ladder.number(); diff --git a/DDExamples/ILDExDet/src/compact/LP1_geo.cpp b/DDExamples/ILDExDet/src/compact/LP1_geo.cpp index b88f0af80..770e59fac 100644 --- a/DDExamples/ILDExDet/src/compact/LP1_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/LP1_geo.cpp @@ -20,7 +20,7 @@ using namespace DD4hep::Geometry; static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { xml_det_t x_det = e; - xml_comp_t x_tube (x_det.child(_X(tubs))); + xml_comp_t x_tube (x_det.child(_U(tubs))); string name = x_det.nameStr(); Material mat (lcdd.material(x_det.materialStr())); //if data is needed do this @@ -32,12 +32,12 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Tube tpc_tub(x_tube.rmin(),x_tube.rmax(),x_tube.zhalf()); Volume tpc_vol(name+"_envelope_volume", tpc_tub, mat); - for(xml_coll_t c(e,_X(detector)); c; ++c) { + for(xml_coll_t c(e,_U(detector)); c; ++c) { xml_comp_t px_det (c); - xml_comp_t px_tube (px_det.child(_X(tubs))); - xml_dim_t px_pos (px_det.child(_X(position))); - xml_dim_t px_rot (px_det.child(_X(rotation))); - xml_comp_t px_mat (px_det.child(_X(material))); + xml_comp_t px_tube (px_det.child(_U(tubs))); + xml_dim_t px_pos (px_det.child(_U(position))); + xml_dim_t px_rot (px_det.child(_U(rotation))); + xml_comp_t px_mat (px_det.child(_U(material))); string part_nam(px_det.nameStr()); Material part_mat(lcdd.material(px_mat.nameStr())); DetElement part_det(part_nam,px_det.typeStr(),px_det.id()); @@ -65,10 +65,10 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { tpcData->endplate=part_det; //modules int mdcount=0; - for(xml_coll_t m(px_det,_X(modules)); m; ++m) { + for(xml_coll_t m(px_det,_U(modules)); m; ++m) { xml_comp_t modules (m); string m_name = modules.nameStr(); - for(xml_coll_t mr(modules,_X(module)); mr; ++mr) { + for(xml_coll_t mr(modules,_U(module)); mr; ++mr) { xml_comp_t mod(mr); int modID=mod.id(); //shape of module @@ -82,9 +82,9 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Readout xml_pads(lcdd.readout(mod.padType())); //placing modules DetElement module(part_det,m_nam,modID); - xml_dim_t px_modpos (mod.child(_X(position))); + xml_dim_t px_modpos (mod.child(_U(position))); Position mod_pos(px_modpos.x(),px_modpos.y(),px_modpos.z()); - xml_dim_t px_modrot (mod.child(_X(rotation))); + xml_dim_t px_modrot (mod.child(_U(rotation))); Rotation mod_rot(px_modrot.x(),px_modrot.y(),px_modrot.z()*M_PI/180); PlacedVolume m_phv = part_vol.placeVolume(mr_vol,mod_pos,mod_rot); m_phv.addPhysVolID("module",modID); diff --git a/DDExamples/ILDExDet/src/compact/TPCPrototype_geo.cpp b/DDExamples/ILDExDet/src/compact/TPCPrototype_geo.cpp index 46deea699..cf3c3e0e6 100644 --- a/DDExamples/ILDExDet/src/compact/TPCPrototype_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/TPCPrototype_geo.cpp @@ -20,7 +20,7 @@ using namespace DD4hep::Geometry; static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { xml_det_t x_det = e; - xml_comp_t x_tube (x_det.child(_X(tubs))); + xml_comp_t x_tube (x_det.child(_U(tubs))); string name = x_det.nameStr(); Material mat (lcdd.material(x_det.materialStr())); //if data is needed do this @@ -32,12 +32,12 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Tube tpc_tub(x_tube.rmin(),x_tube.rmax(),x_tube.zhalf()); Volume tpc_vol(name+"_envelope_volume", tpc_tub, mat); - for(xml_coll_t c(e,_X(detector)); c; ++c) { + for(xml_coll_t c(e,_U(detector)); c; ++c) { xml_comp_t px_det (c); - xml_comp_t px_tube (px_det.child(_X(tubs))); - xml_dim_t px_pos (px_det.child(_X(position))); - xml_dim_t px_rot (px_det.child(_X(rotation))); - xml_comp_t px_mat (px_det.child(_X(material))); + xml_comp_t px_tube (px_det.child(_U(tubs))); + xml_dim_t px_pos (px_det.child(_U(position))); + xml_dim_t px_rot (px_det.child(_U(rotation))); + xml_comp_t px_mat (px_det.child(_U(material))); string part_nam(px_det.nameStr()); Material part_mat(lcdd.material(px_mat.nameStr())); DetElement part_det(part_nam,px_det.typeStr(),px_det.id()); @@ -65,10 +65,10 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { tpcData->endplate=part_det; //modules int mdcount=0; - for(xml_coll_t m(px_det,_X(modules)); m; ++m) { + for(xml_coll_t m(px_det,_U(modules)); m; ++m) { xml_comp_t modules (m); string m_name = modules.nameStr(); - for(xml_coll_t r(modules,_X(row)); r; ++r) { + for(xml_coll_t r(modules,_U(row)); r; ++r) { xml_comp_t row(r); int nmodules = row.nModules(); int rowID=row.RowID(); diff --git a/DDExamples/ILDExDet/src/compact/Template.cpp b/DDExamples/ILDExDet/src/compact/Template.cpp index 44847b15b..1c941910b 100644 --- a/DDExamples/ILDExDet/src/compact/Template.cpp +++ b/DDExamples/ILDExDet/src/compact/Template.cpp @@ -23,7 +23,7 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { xml_comp_t x_endcap = x_det.child(Unicode("endcap")); param_t barrel = { x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.zhalf()}; param_t endcap = { x_endcap.inner_r(), x_endcap.outer_r(), x_endcap.thickness()/2.0}; - int symmetry = x_det.child(Unicode("symmetry")).attr<int>(_A(value)); + int symmetry = x_det.child(Unicode("symmetry")).attr<int>(_U(value)); double tilt = M_PI/symmetry - M_PI/2.0; // Visualisation attributes diff --git a/DDExamples/ILDExDet/src/compact/Tesla_BeamCal01_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_BeamCal01_geo.cpp index 1c1857b25..3c07212c6 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_BeamCal01_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_BeamCal01_geo.cpp @@ -106,11 +106,11 @@ DetElement BeamCal01::construct(LCDD& l, xml_det_t x_det, SensitiveDetector sens } for(xml_coll_t c(x_det.child(_U(params)),_U(param)); c; ++c) { - string nam = c.attr<string>(_A(name)); - if ( nam == "dSensor" ) dSensor = c.attr<double>(_A(value)); // Diamond thickness - if ( nam == "dAirgap" ) dAirgap = c.attr<double>(_A(value)); // Layer gap (air) - if ( nam == "dElboard" ) dElboard = c.attr<double>(_A(value)); // PCB (Kapton) - if ( nam == "dElectrMet" ) dElectrMet = c.attr<double>(_A(value)); // Sensor Electrode Metalisation (gold) + string nam = c.attr<string>(_U(name)); + if ( nam == "dSensor" ) dSensor = c.attr<double>(_U(value)); // Diamond thickness + if ( nam == "dAirgap" ) dAirgap = c.attr<double>(_U(value)); // Layer gap (air) + if ( nam == "dElboard" ) dElboard = c.attr<double>(_U(value)); // PCB (Kapton) + if ( nam == "dElectrMet" ) dElectrMet = c.attr<double>(_U(value)); // Sensor Electrode Metalisation (gold) } dLayer = dAbsorber+dSensor+dElectrMet+dElboard+dAirgap; //layer thickness double length = dLayer*nLayers; //total length of the calorimeter diff --git a/DDExamples/ILDExDet/src/compact/Tesla_ClicYoke01_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_ClicYoke01_geo.cpp index 0583e1a51..f59003e8b 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_ClicYoke01_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_ClicYoke01_geo.cpp @@ -346,9 +346,9 @@ DetElement ClicYoke01::construct(LCDD& l, xml_det_t x_det) { self.assign(dynamic_cast<Value<TNamed,ClicYoke01>*>(this),name,x_det.typeStr()); self._data().id = x_det.id(); Assembly assembly(name); - xml_comp_t x_yoke = x_det.child(_U(yoke)); - xml_comp_t x_muon = x_det.child(_U(muon)); - symmetry = x_yoke.attr<double>(_U(symmetry)); + xml_comp_t x_yoke = x_det.child(_Unicode(yoke)); + xml_comp_t x_muon = x_det.child(_Unicode(muon)); + symmetry = x_yoke.attr<double>(_Unicode(symmetry)); PlacedVolume pv; @@ -366,17 +366,17 @@ DetElement ClicYoke01::construct(LCDD& l, xml_det_t x_det) { endcap.outer_r = barrel.outer_r; //----------------------------------------- muon ------------------------------- - iron_thickness = x_muon.attr<double>(_U(iron_thickness)); - layer_thickness = x_muon.attr<double>(_U(layer_thickness)); - yokeBarrelEndcapGap = x_muon.attr<double>(_U(barrel_endcap_gap)); - cell_dim_x = x_muon.attr<double>(_U(cell_size)); - cell_dim_z = x_muon.attr<double>(_U(cell_size)); - num_layer = x_muon.attr<int>(_U(number_of_layers)); + iron_thickness = x_muon.attr<double>(_Unicode(iron_thickness)); + layer_thickness = x_muon.attr<double>(_Unicode(layer_thickness)); + yokeBarrelEndcapGap = x_muon.attr<double>(_Unicode(barrel_endcap_gap)); + cell_dim_x = x_muon.attr<double>(_Unicode(cell_size)); + cell_dim_z = x_muon.attr<double>(_Unicode(cell_size)); + num_layer = x_muon.attr<int>(_Unicode(number_of_layers)); m_hasPlug = lcdd->constant<int>("Yoke_with_plug") == 1; HCAL_z = lcdd->constant<double>("calorimeter_region_zmax"); HCAL_R_max = lcdd->constant<double>("Hcal_R_max"); - HCAL_plug_gap = x_muon.attr<double>(_U(Hcal_plug_gap)); + HCAL_plug_gap = x_muon.attr<double>(_Unicode(Hcal_plug_gap)); HCAL_plug_thickness = zStartEndcap - HCAL_z - HCAL_plug_gap; HCAL_plug_zpos = zStartEndcap - HCAL_plug_thickness/2; @@ -398,7 +398,7 @@ DetElement ClicYoke01::construct(LCDD& l, xml_det_t x_det) { chamberVis = lcdd->visAttributes("YokeChamberVis"); limitSet = lcdd->limitSet(x_det.limitsStr()); - collectRPClayers(x_det.child(_U(rpcs))); + collectRPClayers(x_det.child(_Unicode(rpcs))); collectSensitiveDetectors(x_det); //-------------------------------------------------- diff --git a/DDExamples/ILDExDet/src/compact/Tesla_LumiCalX_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_LumiCalX_geo.cpp index f16b9823b..1bb5d6a9c 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_LumiCalX_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_LumiCalX_geo.cpp @@ -15,18 +15,18 @@ using namespace DD4hep::Geometry; static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { xml_det_t x_det = e; - xml_comp_t x_layer= e.child(_X(layer)); + xml_comp_t x_layer= e.child(_U(layer)); string name = x_det.nameStr(); Material air = lcdd.air(); DetElement side("pos",x_det.id()); // LumiCal dimensions - int n_layers = x_layer.attr<int>(_A(nmodules)); + int n_layers = x_layer.nmodules(); double bx_angle = x_layer.crossing_angle(); double cal_innerradius = x_layer.inner_r(); double cal_outerradius = x_layer.outer_r(); - double ncell_theta = x_layer.attr<double>(_A(thetaBins)); - double ncell_phi = x_layer.attr<double>(_A(phiBins)); + double ncell_theta = x_layer.attr<double>(_U(thetaBins)); + double ncell_phi = x_layer.attr<double>(_U(phiBins)); double z_begin = x_layer.inner_z(); double layer_gap = x_layer.gap(); @@ -36,7 +36,7 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double cell_thick = 0.0; Material supp_mat, abs_mat, cell_mat; VisAttr supp_vis, abs_vis, cell_vis; - for(xml_coll_t c(x_layer,_X(slice)); c; ++c) { + for(xml_coll_t c(x_layer,_U(slice)); c; ++c) { xml_comp_t slice = c; string nam = slice.nameStr(); if ( nam == "support" ) { diff --git a/DDExamples/ILDExDet/src/compact/Tesla_SEcal03_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_SEcal03_geo.cpp index a5b4da764..a806dbd29 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_SEcal03_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_SEcal03_geo.cpp @@ -141,18 +141,18 @@ DetElement SEcal03::construct(LCDD& l, xml_det_t x_det) { name = x_det.nameStr(); self.assign(dynamic_cast<Value<TNamed,SEcal03>*>(this),name,x_det.typeStr()); self._data().id = x_det.id(); - xml_comp_t x_param = x_det.child(_U(param)); - xml_comp_t x_barrel = x_det.child(_X(barrel)); - xml_comp_t x_endcap = x_det.child(_X(endcap)); - xml_comp_t x_shield = x_det.child(_U(pcbshield)); - xml_comp_t m_xml_slab = x_det.child(_U(slab)); - xml_comp_t m_xml_slab_shield = m_xml_slab.child(_U(shielding)); - xml_comp_t m_xml_slab_copper = m_xml_slab.child(_U(copper)); - xml_comp_t m_xml_slab_sensitive= m_xml_slab.child(_U(sensitive)); - xml_comp_t m_xml_slab_ground = m_xml_slab.child(_U(ground)); - xml_comp_t m_xml_slab_glue = m_xml_slab.child(_U(glue)); - - double endcap_extra_size = x_endcap.attr<double>(_U(extra_size)); + xml_comp_t x_param = x_det.child(_Unicode(param)); + xml_comp_t x_barrel = x_det.child(_U(barrel)); + xml_comp_t x_endcap = x_det.child(_U(endcap)); + xml_comp_t x_shield = x_det.child(_Unicode(pcbshield)); + xml_comp_t m_xml_slab = x_det.child(_Unicode(slab)); + xml_comp_t m_xml_slab_shield = m_xml_slab.child(_Unicode(shielding)); + xml_comp_t m_xml_slab_copper = m_xml_slab.child(_Unicode(copper)); + xml_comp_t m_xml_slab_sensitive= m_xml_slab.child(_Unicode(sensitive)); + xml_comp_t m_xml_slab_ground = m_xml_slab.child(_Unicode(ground)); + xml_comp_t m_xml_slab_glue = m_xml_slab.child(_Unicode(glue)); + + double endcap_extra_size = x_endcap.attr<double>(_Unicode(extra_size)); double crossing_angle = x_param.crossing_angle(); Assembly assembly(name+"_assembly"); // Hosting volume @@ -160,20 +160,20 @@ DetElement SEcal03::construct(LCDD& l, xml_det_t x_det) { // User limits for this sub detector m_limits = lcdd->limitSet(x_det.limitsStr()); - m_cables_gap = x_param.attr<double>(_U(cables_gap)); - m_lateral_face_thickness = x_param.attr<double>(_U(lateral_face_thickness)); - m_fiber_thickness = x_param.attr<double>(_U(fiber_thickness)); - m_cell_size = x_param.attr<double>(_U(cell_size)); - m_guard_ring_size = x_param.attr<double>(_U(guard_ring_size)); - m_front_thickness = x_param.attr<double>(_U(front_face_thickness)); - m_support_thickness = x_param.attr<double>(_U(support_thickness)); + m_cables_gap = x_param.attr<double>(_Unicode(cables_gap)); + m_lateral_face_thickness = x_param.attr<double>(_Unicode(lateral_face_thickness)); + m_fiber_thickness = x_param.attr<double>(_Unicode(fiber_thickness)); + m_cell_size = x_param.attr<double>(_Unicode(cell_size)); + m_guard_ring_size = x_param.attr<double>(_Unicode(guard_ring_size)); + m_front_thickness = x_param.attr<double>(_Unicode(front_face_thickness)); + m_support_thickness = x_param.attr<double>(_Unicode(support_thickness)); m_shield.vis = lcdd->visAttributes(x_shield.visStr()); m_shield.material = lcdd->material(x_shield.materialStr()); m_shield.thickness = x_shield.thickness(); m_slab.vis = lcdd->visAttributes("EcalSlabVis"); - m_slab.h_fiber_thickness = m_xml_slab.attr<double>(_U(h_fiber_thickness)); + m_slab.h_fiber_thickness = m_xml_slab.attr<double>(_Unicode(h_fiber_thickness)); m_slab.shield_thickness = m_xml_slab_shield.thickness(); m_slab.ground_thickness = m_xml_slab_ground.thickness(); m_slab.ground_mat = lcdd->material(m_xml_slab_ground.materialStr()); @@ -188,7 +188,7 @@ DetElement SEcal03::construct(LCDD& l, xml_det_t x_det) { m_radiatorVis = lcdd->visAttributes("EcalRadiatorVis"); size_t i=0; - for(xml_coll_t c(x_det,_X(layer)); c; ++c, ++i) { + for(xml_coll_t c(x_det,_U(layer)); c; ++c, ++i) { xml_comp_t layer(c); m_layers[i].nLayer = layer.repeat(); m_layers[i].thickness = layer.thickness(); @@ -199,7 +199,7 @@ DetElement SEcal03::construct(LCDD& l, xml_det_t x_det) { m_numLayer = m_layers[0].nLayer + m_layers[1].nLayer + m_layers[2].nLayer; m_slab.total_thickness = m_slab.shield_thickness + m_slab.copper_thickness + m_shield.thickness + m_slab.sensitive_thickness + m_slab.glue_thickness + - m_slab.ground_thickness + x_param.attr<double>(_U(alveolus_gap)) / 2; + m_slab.ground_thickness + x_param.attr<double>(_Unicode(alveolus_gap)) / 2; double total_thickness = m_layers[0].nLayer * m_layers[0].thickness + m_layers[1].nLayer * m_layers[1].thickness + @@ -208,7 +208,7 @@ DetElement SEcal03::construct(LCDD& l, xml_det_t x_det) { (m_numLayer + 1) * (m_slab.total_thickness + (N_FIBERS_ALVOULUS + 1 ) * m_fiber_thickness) + // slabs plus fiber around and inside m_support_thickness + m_front_thickness; - m_barrel.numTowers = x_barrel.attr<int>(_U(towers)); + m_barrel.numTowers = x_barrel.attr<int>(_Unicode(towers)); m_barrel.thickness = total_thickness; m_barrel.inner_r = x_barrel.inner_r(); m_barrel.dim_z = 2 * x_barrel.zhalf() / 5; @@ -216,7 +216,7 @@ DetElement SEcal03::construct(LCDD& l, xml_det_t x_det) { m_barrel.top = 2 * std::tan(M_PI/8) * m_barrel.inner_r; //m_barrel.bottom - 2* m_barrel.thickness; m_barrel.vis = lcdd->visAttributes(x_barrel.visStr()); m_barrel.material = lcdd->material(x_barrel.materialStr()); - m_barrel.radiatorMaterial = lcdd->material(x_barrel.attr<string>(_U(radiatorMaterial))); + m_barrel.radiatorMaterial = lcdd->material(x_barrel.attr<string>(_Unicode(radiatorMaterial))); double module_z_offset = m_barrel.dim_z*2.5 + m_cables_gap + m_barrel.thickness/2.; m_endcap.vis = lcdd->visAttributes(x_endcap.visStr()); @@ -230,8 +230,8 @@ DetElement SEcal03::construct(LCDD& l, xml_det_t x_det) { 2 * m_slab.h_fiber_thickness - 2 * m_slab.shield_thickness); - double siPlateSize = x_endcap.attr<double>(_U(center_box_size)) - - 2 * m_lateral_face_thickness - 2 * x_endcap.attr<double>(_U(ring_gap)); + double siPlateSize = x_endcap.attr<double>(_Unicode(center_box_size)) - + 2 * m_lateral_face_thickness - 2 * x_endcap.attr<double>(_Unicode(ring_gap)); m_centerTubDisplacement = m_endcap.dim_z * std::tan(crossing_angle); m_center_tube = Tube(0,m_endcap.rmin,total_thickness); @@ -308,7 +308,7 @@ DetElement SEcal03::construct(LCDD& l, xml_det_t x_det) { lcdd->addSensitiveDetector(sd); sd = m_endcap.sensDet = SensitiveDetector("EcalEndcapRings","calorimeter"); - ro = lcdd->readout(x_endcap.attr<string>(_U(ring_readout))); + ro = lcdd->readout(x_endcap.attr<string>(_Unicode(ring_readout))); sd.setHitsCollection(ro.name()); sd.setReadout(ro); lcdd->addSensitiveDetector(sd); diff --git a/DDExamples/ILDExDet/src/compact/Tesla_SFtd05_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_SFtd05_geo.cpp index 4054d5802..5a90cb861 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_SFtd05_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_SFtd05_geo.cpp @@ -54,17 +54,17 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens_det) { (TUBE_IPOuterBulge_end_z-TUBE_IPOuterTube_end_z); // Now get the variables global to the FTD cables_thickness, ftd1_vtx3_distance_z, etc - double beamTubeClearance = x_par.attr<double>(_U(beamtube_clearance)); - double outer_cyl_thickness = x_par.attr<double>(_U(outer_cylinder_total_thickness)); + double beamTubeClearance = x_par.attr<double>(_Unicode(beamtube_clearance)); + double outer_cyl_thickness = x_par.attr<double>(_Unicode(outer_cylinder_total_thickness)); double inner_cyl_thickness = outer_cyl_thickness; - double cable_shield_thickness = x_par.attr<double>(_U(cable_shield_thickness)); - double cables_thickness = x_par.attr<double>(_U(cables_thickness)); - double ftd1_vtx3_distance_z = x_par.attr<double>(_U(ftd1_vtx3_distance_z)); - double ftd7_ecal_distance_z = x_par.attr<double>(_U(ftd7_ecal_distance_z)); - double ftd1_sit1_radial_diff = x_par.attr<double>(_U(ftd1_sit1_radial_diff)); - double ftd2_sit1_radial_diff = x_par.attr<double>(_U(ftd2_sit1_radial_diff)); - double ftd3_sit2_radial_diff = x_par.attr<double>(_U(ftd3_sit2_radial_diff)); - double ftd4to7_tpc_radial_gap = x_par.attr<double>(_U(ftd4to7_tpc_radial_gap)); + double cable_shield_thickness = x_par.attr<double>(_Unicode(cable_shield_thickness)); + double cables_thickness = x_par.attr<double>(_Unicode(cables_thickness)); + double ftd1_vtx3_distance_z = x_par.attr<double>(_Unicode(ftd1_vtx3_distance_z)); + double ftd7_ecal_distance_z = x_par.attr<double>(_Unicode(ftd7_ecal_distance_z)); + double ftd1_sit1_radial_diff = x_par.attr<double>(_Unicode(ftd1_sit1_radial_diff)); + double ftd2_sit1_radial_diff = x_par.attr<double>(_Unicode(ftd2_sit1_radial_diff)); + double ftd3_sit2_radial_diff = x_par.attr<double>(_Unicode(ftd3_sit2_radial_diff)); + double ftd4to7_tpc_radial_gap = x_par.attr<double>(_Unicode(ftd4to7_tpc_radial_gap)); // Helper class for parameter transformations struct cone_t { double rmin1, rmax1, rmin2, rmax2, zhalf; @@ -95,7 +95,7 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens_det) { #if 0 double minDiskThickness = numeric_limits<double>::max(); for(xml_coll_t c(x_disks,_U(disk)); c; ++c) { - double val = c.attr<double>(_U(si_thickness)); + double val = c.attr<double>(_Unicode(si_thickness)); if ( minDiskThickness > val ) minDiskThickness = val; } //... The sensitive layer: Threshold is 20% of a MIP. For Si we have 340 KeV/mm as MIP. @@ -118,9 +118,9 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens_det) { double z_pos = 0; double z_end = 0; - double si_thickness = x_disk.attr<double>(_U(si_thickness)); - double support_thickness = x_disk.attr<double>(_U(support_thickness)); - double z_rel = x_disk.attr<double>(_U(z_ReltoTPCLength)); + double si_thickness = x_disk.attr<double>(_Unicode(si_thickness)); + double support_thickness = x_disk.attr<double>(_Unicode(support_thickness)); + double z_rel = x_disk.attr<double>(_Unicode(z_ReltoTPCLength)); switch (id) { case 1: diff --git a/DDExamples/ILDExDet/src/compact/Tesla_SHcalSc02_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_SHcalSc02_geo.cpp index 64ffb5aa4..d5b86309a 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_SHcalSc02_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_SHcalSc02_geo.cpp @@ -135,8 +135,8 @@ DetElement SHcalSc02::construct(LCDD& l, xml_det_t x_det) { self.assign(dynamic_cast<Value<TNamed,SHcalSc02>*>(this),name,x_det.typeStr()); self._data().id = x_det.id(); - xml_comp_t x_barrel = x_det.child(_X(barrel)); - xml_comp_t x_endcap = x_det.child(_X(endcap)); + xml_comp_t x_barrel = x_det.child(_U(barrel)); + xml_comp_t x_endcap = x_det.child(_U(endcap)); xml_comp_t x_barrel_rad = x_barrel.child(_U(radiator)); xml_comp_t x_endcap_rad = x_endcap.child(_U(radiator)); @@ -153,9 +153,9 @@ DetElement SHcalSc02::construct(LCDD& l, xml_det_t x_det) { m_moduleVis = lcdd->visAttributes(xml_comp_t(x_det.child(_U(module))).visStr()); m_scintillatorVis = lcdd->visAttributes(xml_comp_t(x_det.child(_U(scintillator))).visStr()); m_chamberVis = lcdd->visAttributes(xml_comp_t(x_det.child(_U(chamber))).visStr()); - m_chamberGapVis = lcdd->visAttributes(xml_comp_t(x_det.child(_U(chambergap))).visStr()); - m_barrel.gapVis = lcdd->visAttributes(xml_comp_t(x_barrel.child(_U(gap))).visStr()); - m_supportTrapVis = lcdd->visAttributes(xml_comp_t(x_det.child(_U(supporttrap))).visStr()); + m_chamberGapVis = lcdd->visAttributes(xml_comp_t(x_det.child(_Unicode(chambergap))).visStr()); + m_barrel.gapVis = lcdd->visAttributes(xml_comp_t(x_barrel.child(_Unicode(gap))).visStr()); + m_supportTrapVis = lcdd->visAttributes(xml_comp_t(x_det.child(_Unicode(supporttrap))).visStr()); m_limits = lcdd->limitSet(x_det.limitsStr()); diff --git a/DDExamples/ILDExDet/src/compact/Tesla_SSit03_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_SSit03_geo.cpp index 7a85ac1da..2286bb69e 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_SSit03_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_SSit03_geo.cpp @@ -23,12 +23,12 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double TPC_Ecal_Hcal_barrel_halfZ = lcdd.constant<double>("TPC_Ecal_Hcal_barrel_halfZ"); double VXD_outer_radius = lcdd.constant<double>("VXD_outer_radius"); double TPC_inner_radius = lcdd.constant<double>("TPC_inner_radius"); - double sit1_sit2_relative_gap = x_par.attr<double>(_U(sit1_sit2_relative_gap)); - double sit2_tpc_gap = x_par.attr<double>(_U(sit2_tpc_gap)); - Layer sensitive = { x_par.attr<double>(_U(sensitive_thickness)),0, + double sit1_sit2_relative_gap = x_par.attr<double>(_Unicode(sit1_sit2_relative_gap)); + double sit2_tpc_gap = x_par.attr<double>(_Unicode(sit2_tpc_gap)); + Layer sensitive = { x_par.attr<double>(_Unicode(sensitive_thickness)),0, lcdd.material("silicon_2.33gccm"), lcdd.visAttributes("SITSensitiveVis") }; - Layer support = { x_par.attr<double>(_U(support_thickness)),0, + Layer support = { x_par.attr<double>(_Unicode(support_thickness)),0, lcdd.material("Graphite"), lcdd.visAttributes("SITSupportVis") }; @@ -38,7 +38,7 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { theSITSD = new TRKSD00("SIT", sensitive.thickness * mm * 340 * keV* 0.2); RegisterSensitiveDetector(theSITSD); #endif - for(xml_coll_t c(x_det.child("layers"),_U(layer)); c; ++c) { + for(xml_coll_t c(x_det.child(_U(layers)),_U(layer)); c; ++c) { xml_comp_t x_layer(c); int id = x_layer.id(); string layer_nam = name+_toString(id,"_layer%d"); diff --git a/DDExamples/ILDExDet/src/compact/Tesla_VXD03_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_VXD03_geo.cpp index 57dc9982e..a1c4ea6d3 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_VXD03_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_VXD03_geo.cpp @@ -89,7 +89,7 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Volume motherVol = lcdd.pickMotherVolume(vxd); - for(xml_coll_t c(e,_X(layer)); c; ++c) { + for(xml_coll_t c(e,_U(layer)); c; ++c) { xml_comp_t x_layer(c); xml_comp_t x_ladders(c.child(Unicode("ladder"))); LayerParams layer; diff --git a/DDExamples/ILDExDet/src/compact/Tesla_ftd01_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_ftd01_geo.cpp index cec223c7b..84e267a9e 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_ftd01_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_ftd01_geo.cpp @@ -53,10 +53,10 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Assembly ftdVol(name); Volume motherVol = lcdd.pickMotherVolume(sdet); - xml_comp_t x_disks = x_det.child(_U(disks)); - xml_comp_t x_cables = x_det.child(_U(cables)); - xml_comp_t x_cylinder = x_det.child(_U(cylinder)); - xml_comp_t x_support = x_det.child(_U(support)); + xml_comp_t x_disks = x_det.child(_Unicode(disks)); + xml_comp_t x_cables = x_det.child(_Unicode(cables)); + xml_comp_t x_cylinder = x_det.child(_Unicode(cylinder)); + xml_comp_t x_support = x_det.child(_Unicode(support)); xml_comp_t x_inner_support = x_support.child(_U(inner)); xml_comp_t x_outer_support = x_support.child(_U(outer)); @@ -67,8 +67,8 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Material supportMat = lcdd.material(x_support.materialStr()); Material diskMat = lcdd.material(x_disks.materialStr()); - double si_thickness = x_disks.attr<double>(_U(si_thickness1)); - double si_thickness2 = x_disks.attr<double>(_U(si_thickness2)); + double si_thickness = x_disks.attr<double>(_Unicode(si_thickness1)); + double si_thickness2 = x_disks.attr<double>(_Unicode(si_thickness2)); double inner_support_thickness = x_inner_support.thickness(); double inner_support_length = x_inner_support.length(); double outer_support_thickness = x_outer_support.thickness(); diff --git a/DDExamples/ILDExDet/src/compact/Tesla_hcal04_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_hcal04_geo.cpp index 952bbaf4c..0dc86b8e3 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_hcal04_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_hcal04_geo.cpp @@ -142,35 +142,35 @@ DetElement Hcal04::construct(LCDD& l, xml_det_t x_det) { m_moduleVis = lcdd->visAttributes(x_module.visStr()); m_endModuleVis = lcdd->visAttributes(x_end_module.visStr()); m_endcapModuleVis = lcdd->visAttributes(x_endcap_module.visStr()); - m_chamberVis = lcdd->visAttributes(x_param.attr<string>(_U(chamber_vis))); + m_chamberVis = lcdd->visAttributes(x_param.attr<string>(_Unicode(chamber_vis))); m_scintVis = lcdd->visAttributes(x_scintillator.visStr()); m_scintMaterial = lcdd->material(x_scintillator.materialStr()); //--------- BarrelHcal Sensitive detector ----- - m_model = x_param.attr<string>(_U(sensitive_model)); - m_fiberGap = x_param.attr<double>(_U(fiber_gap)); - m_radiatorMat = lcdd->material(x_param.attr<string>(_U(radiator_material))); + m_model = x_param.attr<string>(_Unicode(sensitive_model)); + m_fiberGap = x_param.attr<double>(_Unicode(fiber_gap)); + m_radiatorMat = lcdd->material(x_param.attr<string>(_Unicode(radiator_material))); - m_barrel.chamber_thickness = x_barrel.attr<double>(_U(chamber_thickness)); - m_barrel.numLayer = x_barrel.attr<int>(_U(num_layer)); + m_barrel.chamber_thickness = x_barrel.attr<double>(_Unicode(chamber_thickness)); + m_barrel.numLayer = x_barrel.attr<int>(_Unicode(num_layer)); m_barrel.inner_r = x_barrel.inner_r(); // Paremeters for regular barrel modules - m_barrel.chamber_dim_z = x_module.attr<double>(_U(chamber_dim_z)); - m_barrel.module_dim_z = x_module.attr<double>(_U(dim_z)); - m_barrel.bottom_dim_x = x_module.attr<double>(_U(bottom_dim_x)); - m_barrel.middle_dim_x = x_module.attr<double>(_U(middle_dim_x)); - m_barrel.top_dim_x = x_module.attr<double>(_U(top_dim_x)); - m_barrel.y1_for_x = x_module.attr<double>(_U(y_dim1_for_x)); - m_barrel.y2_for_x = x_module.attr<double>(_U(y_dim2_for_x)); - m_barrel.cell_dim_x = x_module.attr<double>(_U(cell_dim_x)); - m_barrel.cell_dim_z = x_module.attr<double>(_U(cell_dim_z)); + m_barrel.chamber_dim_z = x_module.attr<double>(_Unicode(chamber_dim_z)); + m_barrel.module_dim_z = x_module.attr<double>(_Unicode(dim_z)); + m_barrel.bottom_dim_x = x_module.attr<double>(_Unicode(bottom_dim_x)); + m_barrel.middle_dim_x = x_module.attr<double>(_Unicode(middle_dim_x)); + m_barrel.top_dim_x = x_module.attr<double>(_Unicode(top_dim_x)); + m_barrel.y1_for_x = x_module.attr<double>(_Unicode(y_dim1_for_x)); + m_barrel.y2_for_x = x_module.attr<double>(_Unicode(y_dim2_for_x)); + m_barrel.cell_dim_x = x_module.attr<double>(_Unicode(cell_dim_x)); + m_barrel.cell_dim_z = x_module.attr<double>(_Unicode(cell_dim_z)); // Parameters for barrel end-module - m_barrel.y1_for_z = x_end_module.attr<double>(_U(y_dim1_for_z)); - m_barrel.y2_for_z = x_end_module.attr<double>(_U(y_dim2_for_z)); - m_barrel.y3_for_z = x_end_module.attr<double>(_U(y_dim3_for_z)); - m_barrel.top_end_dim_z = x_end_module.attr<double>(_U(top_end_dim_z)); + m_barrel.y1_for_z = x_end_module.attr<double>(_Unicode(y_dim1_for_z)); + m_barrel.y2_for_z = x_end_module.attr<double>(_Unicode(y_dim2_for_z)); + m_barrel.y3_for_z = x_end_module.attr<double>(_Unicode(y_dim3_for_z)); + m_barrel.top_end_dim_z = x_end_module.attr<double>(_Unicode(top_end_dim_z)); // if RPC1 read the RPC parameters if ( m_model == "RPC1" ) { @@ -194,7 +194,7 @@ DetElement Hcal04::construct(LCDD& l, xml_det_t x_det) { Layer layer; Module module; m_barrel.layers.clear(); - for(xml_coll_t c(x_barrel.child(_U(layers)),_X(layer)); c; ++c) { + for(xml_coll_t c(x_barrel.child(_U(layers)),_U(layer)); c; ++c) { xml_comp_t l(c); layer.id = l.id(); layer.values.layer.dim_x = l.dim_x(); @@ -204,7 +204,7 @@ DetElement Hcal04::construct(LCDD& l, xml_det_t x_det) { assert(m_barrel.numLayer != m_barrel.layers.size()); // Read the barrel end-layers m_barrel.end_layers.clear(); - for(xml_coll_t c(x_barrel.child(_U(end_layers)),_U(end_layer)); c; ++c) { + for(xml_coll_t c(x_barrel.child(_Unicode(end_layers)),_Unicode(end_layer)); c; ++c) { xml_comp_t l(c); layer.id = l.id(); layer.values.end_layer.dim_z = l.dim_z(); @@ -213,7 +213,7 @@ DetElement Hcal04::construct(LCDD& l, xml_det_t x_det) { } assert(m_barrel.numLayer != m_barrel.end_layers.size()); m_barrel.staves.clear(); - for(xml_coll_t c(x_barrel.child(_X(staves)),_X(stave)); c; ++c) { + for(xml_coll_t c(x_barrel.child(_U(staves)),_U(stave)); c; ++c) { xml_comp_t s(c); stave.id = s.id(); stave.phi = s.phi(); @@ -222,10 +222,10 @@ DetElement Hcal04::construct(LCDD& l, xml_det_t x_det) { m_barrel.staves.push_back(stave); } m_barrel.modules.clear(); - for(xml_coll_t c(x_barrel.child(_X(modules)),_X(module)); c; ++c) { + for(xml_coll_t c(x_barrel.child(_U(modules)),_U(module)); c; ++c) { xml_comp_t m(c); module.id = m.id(); - module.type = m.attr<int>(_A(type)); + module.type = m.attr<int>(_U(type)); module.z_offset = m.z_offset(); m_barrel.modules.push_back(module); } @@ -233,7 +233,7 @@ DetElement Hcal04::construct(LCDD& l, xml_det_t x_det) { { // Read the endcap structure int cnt=0; Layer layer; - for(xml_coll_t c(x_endcap.child(_U(positions)),_X(position)); c; ++c, ++cnt) { + for(xml_coll_t c(x_endcap.child(_Unicode(positions)),_U(position)); c; ++c, ++cnt) { xml_comp_t ec(c); m_endcap.side[cnt].id = ec.id(); m_endcap.side[cnt].position = Position(ec.x(),ec.y(),ec.z()); @@ -246,7 +246,7 @@ DetElement Hcal04::construct(LCDD& l, xml_det_t x_det) { cout << name << ": End cap: rmin=" << m_endcap.rmin << " rmax=" << m_endcap.rmax << " dz=" << m_endcap.dz << endl; // Read the endcap layers m_endcap.layers.clear(); - for(xml_coll_t c(x_endcap.child(_X(layers)),_X(layer)); c; ++c) { + for(xml_coll_t c(x_endcap.child(_U(layers)),_U(layer)); c; ++c) { xml_comp_t l(c); layer.id = l.id(); layer.values.endcap_layer.dummy = 0; diff --git a/DDExamples/ILDExDet/src/compact/Tesla_maskX01_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_maskX01_geo.cpp index 7acd6cd9d..9f04aba9b 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_maskX01_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_maskX01_geo.cpp @@ -35,11 +35,11 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector) { struct dim_t { double inner_r, outer_r, z; }; for(xml_coll_t c(x_det,_U(component)); c; ++c) { xml_comp_t x_c = c; - xml_comp_t x_end = c.child(_A(end)); - xml_comp_t x_start = c.child(_A(start)); + xml_comp_t x_end = c.child(_U(end)); + xml_comp_t x_start = c.child(_U(start)); double angle = 0; string nam = x_c.nameStr(); - int crossType = x_c.attr<int>(_U(crossType)); + int crossType = x_c.attr<int>(_Unicode(crossType)); Material mat = lcdd.material(x_c.materialStr()); VisAttr vis = lcdd.visAttributes(x_c.visStr()); dim_t end = { x_end.inner_r(), x_end.outer_r(), x_end.z()}; diff --git a/DDExamples/ILDExDet/src/compact/Tesla_tpc06_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_tpc06_geo.cpp index 9825ace59..cc554038e 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_tpc06_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_tpc06_geo.cpp @@ -18,30 +18,30 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens_det) { PlacedVolume pv; xml_det_t x_det = e; string name = x_det.nameStr(); - xml_comp_t x_envelope = x_det.child(_U(envelope)); - xml_comp_t x_endplates = x_det.child(_U(endplates)); - xml_comp_t x_endplPars = x_det.child(_U(endplate_param)); - xml_comp_t x_barrel = x_det.child(_U(barrel)); - xml_comp_t x_inner = x_det.child(_U(inner_wall)); - xml_comp_t x_outer = x_det.child(_U(outer_wall)); - xml_comp_t x_pads = x_det.child(_U(pads)); - xml_comp_t x_cathode = x_det.child(_U(cathode)); + xml_comp_t x_envelope = x_det.child(_Unicode(envelope)); + xml_comp_t x_endplates = x_det.child(_Unicode(endplates)); + xml_comp_t x_endplPars = x_det.child(_Unicode(endplate_param)); + xml_comp_t x_barrel = x_det.child(_Unicode(barrel)); + xml_comp_t x_inner = x_det.child(_Unicode(inner_wall)); + xml_comp_t x_outer = x_det.child(_Unicode(outer_wall)); + xml_comp_t x_pads = x_det.child(_Unicode(pads)); + xml_comp_t x_cathode = x_det.child(_Unicode(cathode)); Material mixMat = lcdd.material(x_endplPars.materialStr()); - Material gasMat = lcdd.material(x_barrel.attr<string>(_U(chamberGas))); + Material gasMat = lcdd.material(x_barrel.attr<string>(_Unicode(chamberGas))); Material cathodeMat = lcdd.material(x_cathode.materialStr()); Material mylarMat = lcdd.material("Mylar"); - double dzEndPlate = x_endplPars.attr<double>(_U(electronics_backend_thickness)); - double dzCathode = x_barrel.attr<double>(_U(dzCathode)); - double cathode_mylar = x_barrel.attr<double>(_U(cathode_mylar)); - double cathode_copper = x_barrel.attr<double>(_U(cathode_cupper)); + double dzEndPlate = x_endplPars.attr<double>(_Unicode(electronics_backend_thickness)); + double dzCathode = x_barrel.attr<double>(_Unicode(dzCathode)); + double cathode_mylar = x_barrel.attr<double>(_Unicode(cathode_mylar)); + double cathode_copper = x_barrel.attr<double>(_Unicode(cathode_cupper)); cylinder_t env = { x_envelope.inner_r(), x_envelope.outer_r(), x_envelope.zhalf() }; cylinder_t wall = { x_inner.thickness(), x_outer.thickness(), 0.0}; cylinder_t gas = { env.inner_r + wall.inner_r, env.outer_r - wall.outer_r, env.z}; - cylinder_t delta= { x_barrel.attr<double>(_U(drInnerInsensitive)), - x_barrel.attr<double>(_U(drOuterInsensitive)), + cylinder_t delta= { x_barrel.attr<double>(_Unicode(drInnerInsensitive)), + x_barrel.attr<double>(_Unicode(drOuterInsensitive)), env.z - dzEndPlate - dzCathode/2}; cylinder_t sens = { env.inner_r + delta.inner_r, env.outer_r - delta.outer_r, @@ -127,7 +127,7 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens_det) { double fracRadLength = 0; double zCursor = -dzEndPlate / 2; int np = 0; - for(xml_coll_t c(x_endplates,_U(endplate)); c; ++c, ++np) { + for(xml_coll_t c(x_endplates,_Unicode(endplate)); c; ++c, ++np) { xml_comp_t p(c); double dz = p.dz(); string vis = p.visStr(); diff --git a/DDExamples/ILDExDet/src/compact/Tesla_tube01_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_tube01_geo.cpp index a25b9e584..2b407de7f 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_tube01_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_tube01_geo.cpp @@ -23,10 +23,10 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector) { DetElement beampipe(name,x_det.id()); Assembly beampipeVol("assembly"); Volume motherVol = lcdd.pickMotherVolume(beampipe); - xml_comp_t x_central = x_det.child(_U(central_tube)); - xml_comp_t x_lateral = x_det.child(_U(lateral_tubes)); - xml_comp_t x_ends = x_det.child(_U(ends)); - xml_comp_t x_vacuum = x_det.child(_U(vacuum)); + xml_comp_t x_central = x_det.child(_Unicode(central_tube)); + xml_comp_t x_lateral = x_det.child(_Unicode(lateral_tubes)); + xml_comp_t x_ends = x_det.child(_Unicode(ends)); + xml_comp_t x_vacuum = x_det.child(_Unicode(vacuum)); Material beampipeMat = lcdd.material(xml_comp_t(x_det).materialStr()); Material ironMat = lcdd.material("Iron"); Material vacuumMat = lcdd.vacuum(); @@ -99,7 +99,7 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector) { } { // VXD strip lines on lateral tubes - xml_comp_t s = x_det.child(_U(strips)); + xml_comp_t s = x_det.child(_Unicode(strips)); Tube tube(lateral.radius+lateral.thickness+s.gap(), lateral.radius+lateral.thickness+s.gap()+s.thickness(),inner_zhalf); Volume vol(name+"_lateral_Strips",tube,lcdd.material(s.materialStr())); diff --git a/DDExamples/ILDExDet/src/compact/Tesla_tubeX01_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_tubeX01_geo.cpp index 923faa454..42ef44822 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_tubeX01_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_tubeX01_geo.cpp @@ -52,13 +52,13 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, Ref_t) { struct dim_t { double inner_r, outer_r, z; }; for(xml_coll_t c(x_det.child(_U(tubes)),_U(tube)); c; ++c) { xml_comp_t x_c = c; - xml_comp_t x_end = c.child(_A(end)); - xml_comp_t x_start = c.child(_A(start)); + xml_comp_t x_end = c.child(_U(end)); + xml_comp_t x_start = c.child(_U(start)); dim_t end = { x_end.inner_r(), x_end.outer_r(), x_end.z()}; dim_t start = { x_start.inner_r(), x_start.outer_r(), x_start.z()}; Material mat = lcdd.material(x_c.materialStr()); VisAttr vis = lcdd.visAttributes(x_c.visStr()); - int crossType = x_c.attr<int>(_U(crossType)); + int crossType = x_c.attr<int>(_Unicode(crossType)); double angle = 0; string nam = x_c.nameStr(); diff --git a/DDExamples/ILDExDet/src/compact/Tesla_yoke02_geo.cpp b/DDExamples/ILDExDet/src/compact/Tesla_yoke02_geo.cpp index afd02eea8..b7f566539 100644 --- a/DDExamples/ILDExDet/src/compact/Tesla_yoke02_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/Tesla_yoke02_geo.cpp @@ -19,11 +19,11 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { string name = x_det.nameStr(); DetElement sdet(name,x_det.id()); Assembly assembly(name); - xml_comp_t x_barrel = x_det.child(Unicode("barrel")); - xml_comp_t x_endcap = x_det.child(Unicode("endcap")); + xml_comp_t x_barrel = x_det.child(_Unicode(barrel)); + xml_comp_t x_endcap = x_det.child(_Unicode(endcap)); param_t barrel = { x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.zhalf()}; param_t endcap = { x_endcap.inner_r(), x_endcap.outer_r(), x_endcap.thickness()/2.0}; - int symmetry = x_det.child(Unicode("symmetry")).attr<int>(_A(value)); + int symmetry = x_det.child(Unicode("symmetry")).attr<int>(_U(value)); double tilt = M_PI/symmetry - M_PI/2.0; // Visualisation attributes diff --git a/DDExamples/ILDExDet/src/compact/VersatileDiskRowLayoutSeg_geo.cpp b/DDExamples/ILDExDet/src/compact/VersatileDiskRowLayoutSeg_geo.cpp index 93e358c70..c1af79fd1 100644 --- a/DDExamples/ILDExDet/src/compact/VersatileDiskRowLayoutSeg_geo.cpp +++ b/DDExamples/ILDExDet/src/compact/VersatileDiskRowLayoutSeg_geo.cpp @@ -12,13 +12,13 @@ using namespace DD4hep::Geometry; static Ref_t create_VersatileDiskRowLayoutSeg(lcdd_t& /* lcdd */, const xml_h& e) { VersatileDiskRowLayoutSeg obj; VersatileDiskRowLayoutData *dataExt=new VersatileDiskRowLayoutData(); - if ( e.hasAttr(_A(rmin)) ) dataExt->setRMin(e.attr<int>(_A(rmin))); + if ( e.hasAttr(_U(rmin)) ) dataExt->setRMin(e.attr<int>(_U(rmin))); //loop rows to fill VersatileDiskRowLayoutSeg - for(xml_coll_t r(e,_X(row)); r; ++r) { + for(xml_coll_t r(e,_U(row)); r; ++r) { dataExt->addRow(r.attr<int>(Unicode("nPads")), r.attr<double>(Unicode("padPitch")), r.attr<double>(Unicode("rowHeight")), - r.attr<double>(_A(offset))); + r.attr<double>(_U(offset))); } obj.setExtension<VersatileDiskRowLayoutData>(dataExt); return obj; diff --git a/DDExamples/UtilityApps/src/converter.cpp b/DDExamples/UtilityApps/src/converter.cpp index 86fec7003..d846d0b94 100644 --- a/DDExamples/UtilityApps/src/converter.cpp +++ b/DDExamples/UtilityApps/src/converter.cpp @@ -8,19 +8,7 @@ // Author : M.Frank // //==================================================================== - -// Framework include files -#include "DD4hep/LCDD.h" - -// C/C++ include files -#include <iostream> -#include <cstdlib> -#include <vector> -#include <cerrno> -#include <string> - -using namespace std; -using namespace DD4hep::Geometry; +#include "run_plugin.h" //______________________________________________________________________________ namespace { @@ -68,23 +56,14 @@ int main(int argc,char** argv) { if ( geo_files.empty() || (!compact2lcdd && !compact2gdml && !compact2pand)) usage(); - try { - LCDD& lcdd = LCDD::getInstance(); - // Load compact files - lcdd.apply("DD4hepCompactLoader",int(geo_files.size()),&geo_files[0]); - if ( compact2lcdd ) - lcdd.apply("DD4hepGeometry2LCDD",output,&argv[output]); - else if ( compact2gdml ) - lcdd.apply("DD4hepGeometry2GDML",output,&argv[output]); - else if ( compact2pand ) - lcdd.apply("DD4hepGeometry2PANDORA",output,&argv[output]); - return 0; - } - catch(const exception& e) { - cout << e.what() << endl; - } - catch(...) { - cout << "UNKNOWN Exception" << endl; - } - return EINVAL; + LCDD& lcdd = LCDD::getInstance(); + // Load compact files + run_plugin(lcdd,"DD4hepCompactLoader",int(geo_files.size()),&geo_files[0]); + if ( compact2lcdd ) + run_plugin(lcdd,"DD4hepGeometry2LCDD",output,&argv[output]); + else if ( compact2gdml ) + run_plugin(lcdd,"DD4hepGeometry2GDML",output,&argv[output]); + else if ( compact2pand ) + run_plugin(lcdd,"DD4hepGeometry2PANDORA",output,&argv[output]); + return 0; } diff --git a/DDExamples/UtilityApps/src/display.cpp b/DDExamples/UtilityApps/src/display.cpp index e21a364c1..831aebe3d 100644 --- a/DDExamples/UtilityApps/src/display.cpp +++ b/DDExamples/UtilityApps/src/display.cpp @@ -8,21 +8,9 @@ // Author : M.Frank // //==================================================================== - -// Framework include files -#include "DD4hep/LCDD.h" +#include "run_plugin.h" #include "TRint.h" -// C/C++ include files -#include <iostream> -#include <cstdlib> -#include <vector> -#include <cerrno> -#include <string> - -using namespace std; -using namespace DD4hep::Geometry; - //______________________________________________________________________________ namespace { void usage() { @@ -56,27 +44,18 @@ int main(int argc,char** argv) { if ( geo_files.empty() ) usage(); - try { + LCDD& lcdd = LCDD::getInstance(); + // Load all compact files + run_plugin(lcdd,"DD4hepCompactLoader",int(geo_files.size()),&geo_files[0]); + // Create an interactive ROOT application + if ( !dry_run ) { pair<int, char**> args(0,0); - LCDD& lcdd = LCDD::getInstance(); - // Load all compact files - lcdd.apply("DD4hepCompactLoader",int(geo_files.size()),&geo_files[0]); - // Create an interactive ROOT application - if ( !dry_run ) { - TRint app("DD4hepGeometryDisplay", &args.first, args.second); - lcdd.apply("DD4hepGeometryDisplay",args.first,args.second); - app.Run(); - } - else { - cout << "The geometry was loaded. Application now exiting." << endl; - } - return 0; - } - catch(const exception& e) { - cout << "Exception:" << e.what() << endl; + TRint app("DD4hepGeometryDisplay", &args.first, args.second); + run_plugin(lcdd,"DD4hepGeometryDisplay",args.first,args.second); + app.Run(); } - catch(...) { - cout << "UNKNOWN Exception" << endl; + else { + cout << "The geometry was loaded. Application now exiting." << endl; } - return EINVAL; + return 0; } diff --git a/DDExamples/UtilityApps/src/plugin_runner.cpp b/DDExamples/UtilityApps/src/plugin_runner.cpp index 6ee7d868f..cc8314c95 100644 --- a/DDExamples/UtilityApps/src/plugin_runner.cpp +++ b/DDExamples/UtilityApps/src/plugin_runner.cpp @@ -8,19 +8,7 @@ // Author : M.Frank // //==================================================================== - -// Framework include files -#include "DD4hep/LCDD.h" - -// C/C++ include files -#include <iostream> -#include <cstdlib> -#include <vector> -#include <cerrno> -#include <string> - -using namespace std; -using namespace DD4hep::Geometry; +#include "run_plugin.h" //______________________________________________________________________________ namespace { @@ -53,19 +41,10 @@ int main(int argc,char** argv) { if ( geo_files.empty() || plugin.empty() ) usage(); - try { - LCDD& lcdd = LCDD::getInstance(); - // Load compact files - lcdd.apply("DD4hepCompactLoader",int(geo_files.size()),&geo_files[0]); - // Execute plugin - lcdd.apply(plugin.c_str(),0,0); - return 0; - } - catch(const exception& e) { - cout << "Exception:" << e.what() << endl; - } - catch(...) { - cout << "UNKNOWN Exception" << endl; - } - return EINVAL; + LCDD& lcdd = LCDD::getInstance(); + // Load compact files + run_plugin(lcdd,"DD4hepCompactLoader",int(geo_files.size()),&geo_files[0]); + // Execute plugin + run_plugin(lcdd,plugin.c_str(),0,0); + return 0; } -- GitLab