diff --git a/DDRec/include/DDRec/DetectorData.h b/DDRec/include/DDRec/DetectorData.h index 5ffc69723c214f13ea695e5f168c530070a0ce8a..ed6f8336918ed615236eb128b2ca56537496e80a 100644 --- a/DDRec/include/DDRec/DetectorData.h +++ b/DDRec/include/DDRec/DetectorData.h @@ -121,26 +121,6 @@ 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 ; @@ -240,6 +220,39 @@ namespace DD4hep { typedef StructExtension<ZDiskPetalsStruct> ZDiskPetalsData ; + /** Simple data structure defining a support + * structure built from consecutive conical + * sections. Could be used for example to + * describe the central beam pipe as needed + * for track reconstruction. + * + * @author F.Gaede, CERN/DESY + * @date Oct, 29 2014 + * @version $Id: $ + */ + struct ConicalSupportStruct{ + + /// if true the sections are repeated at negative z + bool isSymmetricInZ ; + + struct Section{ + /// inner r at start of section + double rInner ; + /// outer r at start of section + double rOuter ; + /// z position at start of section + double zPos ; + } ; + + /** The consecutive sections of the structure. + * The end of one sections is defined by the start + * the next. + */ + std::vector<Section> sections ; + + } ; + + typedef StructExtension<ConicalSupportStruct> ConicalSupportData ; } /* namespace DDRec */ diff --git a/DDRec/src/gear/createGearForILD.cpp b/DDRec/src/gear/createGearForILD.cpp index c82bbf6d17a0c6875d7d15dd03b567d483f7025f..13c6c1507f26f4f8eeb90dd854bd063afeb22130 100644 --- a/DDRec/src/gear/createGearForILD.cpp +++ b/DDRec/src/gear/createGearForILD.cpp @@ -192,6 +192,40 @@ namespace DD4hep{ ftdDE.addExtension< GearHandle >( new GearHandle( gearFTD, "FTDParameters" ) ) ; + + //============================================================================================ + + DetElement tubeDE = lcdd.detector("Tube") ; + + ConicalSupportData* tube = tubeDE.extension<ConicalSupportData>() ; + + gear::GearParametersImpl* gearTUBE = new gear::GearParametersImpl(); + + tube->isSymmetricInZ = true ; + + unsigned n = tube->sections.size() ; + + std::vector<double> rInner(n) ; + std::vector<double> rOuter(n) ; + std::vector<double> zStart(n) ; + + for(unsigned i=0 ; i<n ; ++i){ + + const ConicalSupportData::Section& s = tube->sections[i] ; + + rInner[i] = s.rInner/ dd4hep::mm ; + rOuter[i] = s.rOuter/ dd4hep::mm ; + zStart[i] = s.zPos / dd4hep::mm ; + + // FIXME set rad lengths to 0 -> need to get from DD4hep .... + } + + gearTUBE->setDoubleVals("RInner" , rInner ) ; + gearTUBE->setDoubleVals("ROuter" , rOuter ) ; + gearTUBE->setDoubleVals("Z" , zStart ) ; + + + tubeDE.addExtension< GearHandle >( new GearHandle( gearTUBE, "BeamPipe" ) ) ; //============================================================================================