diff --git a/DDRec/include/DDRec/DetectorData.h b/DDRec/include/DDRec/DetectorData.h index 3c833b63651f4083f4b81b55b54c7f3e3953fb96..60d3abd14a7afccd7b9be941bd4d6199cb5b9523 100644 --- a/DDRec/include/DDRec/DetectorData.h +++ b/DDRec/include/DDRec/DetectorData.h @@ -70,6 +70,15 @@ namespace DD4hep { /// The outer radius of the support shell. double rOuterShell ; + /// width of the strips (if applicable ) + double widthStrip ; + /// length of the strips (if applicable ) + double lengthStrip ; + /// strip pitch (if applicable ) + double pitchStrip ; + /// strip stereo angle (if applicable ) + double angleStrip ; + /**Internal helper struct for defining the layer layout. Layers are defined * with a sensitive part and a support part. */ @@ -81,6 +90,11 @@ namespace DD4hep { /// Azimuthal angle of the (outward pointing) normal of the first ladder. double phi0 ; + /// number of sensor per ladder + int sensorsPerLadder ; + /// sensor length (if divided in sensors) + double lengthSensor ; + /// The distance of the ladder support from the origin (IP). double distanceSupport ; /// The thickness of the ladder support from the origin (IP). @@ -106,6 +120,26 @@ namespace DD4hep { std::vector<LayerLayout> layers ; + /* + DDRec::ZPlanarData::LayerLayout thisLayer ; + thisLayer.sensorsPerLadder = + thisLayer.lengthSensor = + + thisLayer.distanceSupport = + thisLayer.offsetSupport = + thisLayer.thicknessSupport = + thisLayer.zHalfSupport = + thisLayer.widthSupport = + + thisLayer.distanceSensitive = + thisLayer.offsetSensitive = + thisLayer.thicknessSensitive = + thisLayer.zHalfSensitive = + thisLayer.widthSensitive = + + thisLayer.ladderNumber = + thisLayer.phi0 = + */ } ; typedef StructExtension<ZPlanarStruct> ZPlanarData ; diff --git a/DDRec/src/gear/DDGear.cpp b/DDRec/src/gear/DDGear.cpp index d90fd0c588bbb1d548ee4a161ac52276aaac18d8..dbdeee2b8a23b3c374e82ff517bb870b6d3f68a3 100644 --- a/DDRec/src/gear/DDGear.cpp +++ b/DDRec/src/gear/DDGear.cpp @@ -99,10 +99,10 @@ namespace DD4hep{ else if( gearH->name() == "LcalParameters" ) { gearMgr->setLcalParameters ( dynamic_cast<gear::CalorimeterParameters* >( gearH->takeGearObject() ) ) ; } else if( gearH->name() == "LHcalParameters" ) { gearMgr->setLHcalParameters ( dynamic_cast<gear::CalorimeterParameters* >( gearH->takeGearObject() ) ) ; } else if( gearH->name() == "BeamCalParameters" ) { gearMgr->setBeamCalParameters ( dynamic_cast<gear::CalorimeterParameters* >( gearH->takeGearObject() ) ) ; } - else if( gearH->name() == "ZPlanarParameters" ) { gearMgr->setVXDParameters ( dynamic_cast<gear::ZPlanarParameters* >( gearH->takeGearObject() ) ) ; } + else if( gearH->name() == "VXDParameters" ) { gearMgr->setVXDParameters ( dynamic_cast<gear::ZPlanarParameters* >( gearH->takeGearObject() ) ) ; } else if( gearH->name() == "FTDParameters" ) { gearMgr->setFTDParameters ( dynamic_cast<gear::FTDParameters* >( gearH->takeGearObject() ) ) ; } - else if( gearH->name() == "ZPlanarParameters" ) { gearMgr->setSITParameters ( dynamic_cast<gear::ZPlanarParameters* >( gearH->takeGearObject() ) ) ; } - else if( gearH->name() == "ZPlanarParameters" ) { gearMgr->setSETParameters ( dynamic_cast<gear::ZPlanarParameters* >( gearH->takeGearObject() ) ) ; } + else if( gearH->name() == "SITParameters" ) { gearMgr->setSITParameters ( dynamic_cast<gear::ZPlanarParameters* >( gearH->takeGearObject() ) ) ; } + else if( gearH->name() == "SETParameters" ) { gearMgr->setSETParameters ( dynamic_cast<gear::ZPlanarParameters* >( gearH->takeGearObject() ) ) ; } else if( gearH->name() == "SiPlanesParameters" ) { gearMgr->setSiPlanesParameters ( dynamic_cast<gear::SiPlanesParameters* >( gearH->takeGearObject() ) ) ; } else { diff --git a/DDRec/src/gear/createGearForILD.cpp b/DDRec/src/gear/createGearForILD.cpp index 9c48d0c91541a4c9926f271f6c22095b47fcb844..780009d7d521dc68222ff7a146e4669e94e84205 100644 --- a/DDRec/src/gear/createGearForILD.cpp +++ b/DDRec/src/gear/createGearForILD.cpp @@ -57,8 +57,8 @@ namespace DD4hep{ ZPlanarData* vxd = vxdDE.extension<ZPlanarData>() ; // ZPlanarParametersImpl (int type, double shellInnerRadius, double shellOuterRadius, double shellHalfLength, double shellGap, double shellRadLength) - int type = gear::ZPlanarParameters::CMOS ; - gear::ZPlanarParametersImpl* gearVXD = new gear::ZPlanarParametersImpl( type, vxd->rInnerShell/dd4hep::mm, vxd->rOuterShell/dd4hep::mm, + int vxdType = gear::ZPlanarParameters::CMOS ; + gear::ZPlanarParametersImpl* gearVXD = new gear::ZPlanarParametersImpl( vxdType, vxd->rInnerShell/dd4hep::mm, vxd->rOuterShell/dd4hep::mm, vxd->zHalfShell/dd4hep::mm , vxd->gapShell/dd4hep::mm , 0. ) ; for(unsigned i=0,n=vxd->layers.size() ; i<n; ++i){ @@ -72,8 +72,77 @@ namespace DD4hep{ } - vxdDE.addExtension< GearHandle >( new GearHandle( gearVXD, "ZPlanarParameters" ) ) ; + vxdDE.addExtension< GearHandle >( new GearHandle( gearVXD, "VXDParameters" ) ) ; + //========= SIT ============================================================================== + + DetElement sitDE = lcdd.detector("SIT") ; + + ZPlanarData* sit = sitDE.extension<ZPlanarData>() ; + + // ZPlanarParametersImpl (int type, double shellInnerRadius, double shellOuterRadius, double shellHalfLength, double shellGap, double shellRadLength) + int sitType = gear::ZPlanarParameters::CCD ; + gear::ZPlanarParametersImpl* gearSIT = new gear::ZPlanarParametersImpl( sitType, sit->rInnerShell/dd4hep::mm, sit->rOuterShell/dd4hep::mm, + sit->zHalfShell/dd4hep::mm , sit->gapShell/dd4hep::mm , 0. ) ; + std::vector<int> n_sensors_per_ladder ; + + for(unsigned i=0,n=sit->layers.size() ; i<n; ++i){ + + const DDRec::ZPlanarData::LayerLayout& l = sit->layers[i] ; + + // FIXME set rad lengths to 0 -> need to get from DD4hep .... + gearSIT->addLayer( l.ladderNumber, l.phi0, + l.distanceSupport/dd4hep::mm, l.offsetSupport/dd4hep::mm, l. thicknessSupport/dd4hep::mm, l.zHalfSupport/dd4hep::mm, l.widthSupport/dd4hep::mm, 0. , + l.distanceSensitive/dd4hep::mm, l.offsetSensitive/dd4hep::mm, l. thicknessSensitive/dd4hep::mm, l.zHalfSensitive/dd4hep::mm, l.widthSensitive/dd4hep::mm, 0. ) ; + + + n_sensors_per_ladder.push_back( l.sensorsPerLadder); + } + + gearSIT->setDoubleVal("strip_width_mm" , sit->widthStrip / dd4hep::mm ) ; + gearSIT->setDoubleVal("strip_length_mm" , sit->lengthStrip/ dd4hep::mm ) ; + gearSIT->setDoubleVal("strip_pitch_mm" , sit->pitchStrip / dd4hep::mm ) ; + gearSIT->setDoubleVal("strip_angle_deg" , sit->angleStrip / dd4hep::deg ) ; + + + gearSIT->setIntVals("n_sensors_per_ladder",n_sensors_per_ladder); + + sitDE.addExtension< GearHandle >( new GearHandle( gearSIT, "SITParameters" ) ) ; + //============================================================================================ + + DetElement setDE = lcdd.detector("SET") ; + + ZPlanarData* set = setDE.extension<ZPlanarData>() ; + + // ZPlanarParametersImpl (int type, double shellInnerRadius, double shellOuterRadius, double shellHalfLength, double shellGap, double shellRadLength) + int setType = gear::ZPlanarParameters::CCD ; + gear::ZPlanarParametersImpl* gearSET = new gear::ZPlanarParametersImpl( setType, set->rInnerShell/dd4hep::mm, set->rOuterShell/dd4hep::mm, + set->zHalfShell/dd4hep::mm , set->gapShell/dd4hep::mm , 0. ) ; + // std::vector<int> n_sensors_per_ladder ; + n_sensors_per_ladder.clear() ; + + for(unsigned i=0,n=set->layers.size() ; i<n; ++i){ + + const DDRec::ZPlanarData::LayerLayout& l = set->layers[i] ; + + // FIXME set rad lengths to 0 -> need to get from DD4hep .... + gearSET->addLayer( l.ladderNumber, l.phi0, + l.distanceSupport/dd4hep::mm, l.offsetSupport/dd4hep::mm, l. thicknessSupport/dd4hep::mm, l.zHalfSupport/dd4hep::mm, l.widthSupport/dd4hep::mm, 0. , + l.distanceSensitive/dd4hep::mm, l.offsetSensitive/dd4hep::mm, l. thicknessSensitive/dd4hep::mm, l.zHalfSensitive/dd4hep::mm, l.widthSensitive/dd4hep::mm, 0. ) ; + + + n_sensors_per_ladder.push_back( l.sensorsPerLadder); + } + + gearSET->setDoubleVal("strip_width_mm" , set->widthStrip / dd4hep::mm ) ; + gearSET->setDoubleVal("strip_length_mm" , set->lengthStrip/ dd4hep::mm ) ; + gearSET->setDoubleVal("strip_pitch_mm" , set->pitchStrip / dd4hep::mm ) ; + gearSET->setDoubleVal("strip_angle_deg" , set->angleStrip / dd4hep::deg ) ; + + + gearSET->setIntVals("n_sensors_per_ladder",n_sensors_per_ladder); + + setDE.addExtension< GearHandle >( new GearHandle( gearSET, "SETParameters" ) ) ; //============================================================================================ // --- LCDD::apply() expects return code 1 if all went well ! ----