Skip to content
Snippets Groups Projects
Commit 1fa60ff2 authored by Frank Gaede's avatar Frank Gaede
Browse files

- add DetectorData inforamtion to ZPlanarTracker (needed for Gear )

 - fixed bug in MaterialManager (protect against empty material list)
 - allow missing detectors in createGearForILD
parent f58f8857
No related branches found
No related tags found
No related merge requests found
...@@ -114,6 +114,13 @@ namespace DD4hep { ...@@ -114,6 +114,13 @@ namespace DD4hep {
node1=node2; node1=node2;
} }
//fg: protect against empty list:
if( _mV.empty() ){
_mV.push_back( std::make_pair( Material( node1->GetMedium() ), totDist ) ) ;
}
_tgeoMgr->ClearTracks(); _tgeoMgr->ClearTracks();
_tgeoMgr->CleanGarbage(); _tgeoMgr->CleanGarbage();
......
This diff is collapsed.
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
</layer> </layer>
</detector> </detector>
<detector name="SIT" type="ZPlanarTracker" vis="SITVis" id="1" limits="Tracker_limits" readout="SITCollection" insideTrackingVolume="true"> <detector name="SIT" type="ZPlanarTracker" vis="SITVis" id="2" limits="Tracker_limits" readout="SITCollection" insideTrackingVolume="true">
<layer nLadders="10" phi0="0.000000000e+00" id="0"> <layer nLadders="10" phi0="0.000000000e+00" id="0">
<ladder distance="1.531000000e+02*mm" thickness="1.000000000e+00*mm" width="9.916044311e+01*mm" length="3.680000000e+02*mm" offset="0.000000000e+00*mm" material="CarbonFiber" /> <ladder distance="1.531000000e+02*mm" thickness="1.000000000e+00*mm" width="9.916044311e+01*mm" length="3.680000000e+02*mm" offset="0.000000000e+00*mm" material="CarbonFiber" />
<sensitive distance="1.529000000e+02*mm" thickness="2.000000000e-01*mm" width="9.916044311e+01*mm" length="3.680000000e+02*mm" offset="0.000000000e+00*mm" material="G4_Si"/> <sensitive distance="1.529000000e+02*mm" thickness="2.000000000e-01*mm" width="9.916044311e+01*mm" length="3.680000000e+02*mm" offset="0.000000000e+00*mm" material="G4_Si"/>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include "DD4hep/DetFactoryHelper.h" #include "DD4hep/DetFactoryHelper.h"
#include "DDRec/Surface.h" #include "DDRec/Surface.h"
#include "DDRec/DetectorData.h"
using namespace DD4hep; using namespace DD4hep;
using namespace DD4hep::Geometry; using namespace DD4hep::Geometry;
...@@ -31,6 +33,8 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { ...@@ -31,6 +33,8 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) {
PlacedVolume pv; PlacedVolume pv;
DDRec::ZPlanarData* zPlanarData = new DDRec::ZPlanarData ;
//========= loop over layer elements in xml ====================================== //========= loop over layer elements in xml ======================================
for(xml_coll_t c(e, _U(layer) ); c; ++c) { for(xml_coll_t c(e, _U(layer) ); c; ++c) {
...@@ -85,6 +89,30 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { ...@@ -85,6 +89,30 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) {
//----------------------------------- //-----------------------------------
// store the data in an extension to be used for reconstruction
DDRec::ZPlanarData::LayerLayout thisLayer ;
thisLayer.sensorsPerLadder = 1 ; // for now only one planar sensor
thisLayer.lengthSensor = 2. * sens_zhalf ;
thisLayer.distanceSupport = supp_distance ;
thisLayer.offsetSupport = supp_offset ;
thisLayer.thicknessSupport = supp_thickness ;
thisLayer.zHalfSupport = supp_zhalf ;
thisLayer.widthSupport = supp_width ;
thisLayer.distanceSensitive = sens_distance ;
thisLayer.offsetSensitive = sens_offset ;
thisLayer.thicknessSensitive = sens_thickness ;
thisLayer.zHalfSensitive = sens_zhalf ;
thisLayer.widthSensitive = sens_width ;
thisLayer.ladderNumber = nLadders ;
thisLayer.phi0 = phi0 ;
zPlanarData->layers.push_back( thisLayer ) ;
//-----------------------------------
Material supp_mat = lcdd.material( supp_matS ) ; Material supp_mat = lcdd.material( supp_matS ) ;
Material sens_mat = lcdd.material( sens_matS ) ; Material sens_mat = lcdd.material( sens_matS ) ;
...@@ -170,6 +198,9 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { ...@@ -170,6 +198,9 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) {
} }
tracker.addExtension< DDRec::ZPlanarData >( zPlanarData ) ;
Volume mother = lcdd.pickMotherVolume( tracker ) ; Volume mother = lcdd.pickMotherVolume( tracker ) ;
pv = mother.placeVolume(assembly); pv = mother.placeVolume(assembly);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment