diff --git a/DDG4/lcio/LCIOConversions.cpp b/DDG4/lcio/LCIOConversions.cpp index f471d1ca163fe0f924893da198bb00ccf94caf84..d846d64c82e04746ff33af6467f72f27b39aa0e1 100644 --- a/DDG4/lcio/LCIOConversions.cpp +++ b/DDG4/lcio/LCIOConversions.cpp @@ -187,7 +187,7 @@ namespace DD4hep { float contrib_pos[] = {float(c.x/mm), float(c.y/mm), float(c.z/mm)}; EVENT::MCParticle* lc_mcp = (EVENT::MCParticle*)lc_parts->getElementAt(trackID); if ( hit_creation_mode == Geant4Sensitive::DETAILED_MODE ) - lc_hit->addMCParticleContribution(lc_mcp, c.deposit/GeV, c.time/ns, lc_mcp->getPDG(), contrib_pos); + lc_hit->addMCParticleContribution(lc_mcp, c.deposit/GeV, c.time/ns, c.pdgID, contrib_pos); else lc_hit->addMCParticleContribution(lc_mcp, c.deposit/GeV, c.time/ns); } diff --git a/DDRec/src/gear/createGearForCLIC.cpp b/DDRec/src/gear/createGearForCLIC.cpp index 8f2fb6f900e09db6c6aaeac459595f0b15856787..5be273352a49d203be066bfb77644870e3418b70 100644 --- a/DDRec/src/gear/createGearForCLIC.cpp +++ b/DDRec/src/gear/createGearForCLIC.cpp @@ -39,34 +39,11 @@ namespace DD4hep{ std::cout << " **** running plugin createGearForCLIC ! " << std::endl ; - - //========= TPC ============================================================================== - try{ - - DetElement tpcDE = lcdd.detector("TPC") ; - - FixedPadSizeTPCData* tpc = tpcDE.extension<FixedPadSizeTPCData>() ; - - gear::TPCParametersImpl* gearTPC = new gear::TPCParametersImpl( tpc->driftLength /dd4hep::mm , gear::PadRowLayout2D::POLAR ) ; - - gearTPC->setPadLayout( new gear::FixedPadSizeDiskLayout( tpc->rMinReadout/dd4hep::mm , tpc->rMaxReadout/dd4hep::mm, tpc->padHeight/dd4hep::mm, - tpc->padWidth/dd4hep::mm , tpc->maxRow, tpc->padGap /dd4hep::mm ) ) ; - - gearTPC->setDoubleVal("tpcInnerRadius", tpc->rMin/dd4hep::mm ) ; // inner r of support tube - gearTPC->setDoubleVal("tpcOuterRadius", tpc->rMax/dd4hep::mm ) ; // outer radius of TPC - gearTPC->setDoubleVal("tpcInnerWallThickness", tpc->innerWallThickness/dd4hep::mm ) ; // thickness of inner shell - gearTPC->setDoubleVal("tpcOuterWallThickness", tpc->outerWallThickness/dd4hep::mm ) ; // thickness of outer shell - - tpcDE.addExtension< GearHandle >( new GearHandle( gearTPC, "TPCParameters" ) ) ; - - } catch( std::runtime_error& e ){ - std::cerr << " >>>> " << e.what() << std::endl ; - } - + //========= VXD ============================================================================== try{ - DetElement vxdDE = lcdd.detector("Vertex") ; + DetElement vxdDE = lcdd.detector("VertexBarrel") ; ZPlanarData* vxd = vxdDE.extension<ZPlanarData>() ; @@ -75,8 +52,10 @@ namespace DD4hep{ gear::ZPlanarParametersImpl* gearVXD = new gear::ZPlanarParametersImpl( vxdType, vxd->rInnerShell/dd4hep::mm, vxd->rOuterShell/dd4hep::mm, vxd->zHalfShell/dd4hep::mm , vxd->gapShell/dd4hep::mm , 0. ) ; +// std::cout<<"Got "<<vxd->layers.size()<<" layers."<<std::endl; for(unsigned i=0,n=vxd->layers.size() ; i<n; ++i){ - +// std::cout<<"Working on layer "<<i<<" for a total of "<<n<<" layers."<<std::endl; + const DDRec::ZPlanarData::LayerLayout& l = vxd->layers[i] ; // FIXME set rad lengths to 0 -> need to get from DD4hep .... @@ -86,6 +65,8 @@ namespace DD4hep{ } + std::cout<<"Added layers"<<std::endl; + GearHandle* handle = new GearHandle( gearVXD, "VXDParameters" ) ; // quick hack for now: add the one material that is needed by KalDet : @@ -101,14 +82,15 @@ namespace DD4hep{ const MaterialVec& materials = matMgr.materialsBetween( a , b ) ; + std::cout<<"Calculating material average."<<std::endl; MaterialData mat = ( materials.size() > 1 ? matMgr.createAveragedMaterial( materials ) : materials[0].first ) ; - // std::cout << " ####### found materials between points : " << a << " and " << b << " : " ; - // for( unsigned i=0,n=materials.size();i<n;++i){ - // std::cout << materials[i].first.name() << "[" << materials[i].second << "], " ; - // } - // std::cout << std::endl ; - // std::cout << " averaged material : " << mat << std::endl ; + std::cout << " ####### found materials between points : " << a << " and " << b << " : " ; + for( unsigned i=0,n=materials.size();i<n;++i){ + std::cout << materials[i].first.name() << "[" << materials[i].second << "], " ; + } + std::cout << std::endl ; + std::cout << " averaged material : " << mat << std::endl ; handle->addMaterial( "VXDSupportMaterial", mat.A(), mat.Z() , mat.density()/(dd4hep::kg/(dd4hep::g*dd4hep::m3)) , mat.radiationLength()/dd4hep::mm , mat.interactionLength()/dd4hep::mm ) ; @@ -120,7 +102,7 @@ namespace DD4hep{ } //========= SIT ============================================================================== - + /* try{ DetElement sitDE = lcdd.detector("SIT") ; @@ -295,7 +277,7 @@ namespace DD4hep{ } catch( std::runtime_error& e ){ std::cerr << " >>>> " << e.what() << std::endl ; - } + } */ //========= CALO ============================================================================== @@ -305,18 +287,18 @@ namespace DD4hep{ std::map< std::string, std::string > caloMap ; caloMap["HCalBarrel"] = "HcalBarrelParameters" ; - caloMap["ECalBarrel"] = "EcalBarrelParameters" ; - caloMap["ECalEndcap"] = "EcalEndcapParameters" ; - caloMap["ECalPlug"] = "EcalPlugParameters" ; - caloMap["YokeBarrel"] = "YokeBarrelParameters" ; - caloMap["YokeEndcap"] = "YokeEndcapParameters" ; - caloMap["YokePlug"] = "YokePlugParameters" ; - caloMap["HCalBarrel"] = "HcalBarrelParameters" ; +// caloMap["ECalBarrel"] = "EcalBarrelParameters" ; +// caloMap["ECalEndcap"] = "EcalEndcapParameters" ; +// caloMap["ECalPlug"] = "EcalPlugParameters" ; +// caloMap["YokeBarrel"] = "YokeBarrelParameters" ; +// caloMap["YokeEndcap"] = "YokeEndcapParameters" ; +// caloMap["YokePlug"] = "YokePlugParameters" ; +// caloMap["HCalBarrel"] = "HcalBarrelParameters" ; caloMap["HCalEndcap"] = "HcalEndcapParameters" ; - caloMap["HCalRing"] = "HcalRingParameters" ; - caloMap["LCal"] = "LcalParameters" ; - caloMap["LHCal"] = "LHcalParameters" ; - caloMap["BeamCal"] = "BeamCalParameters" ; +// caloMap["HCalRing"] = "HcalRingParameters" ; +// caloMap["LCal"] = "LcalParameters" ; +// caloMap["LHCal"] = "LHcalParameters" ; +// caloMap["BeamCal"] = "BeamCalParameters" ; for( std::map< std::string, std::string >::const_iterator it = caloMap.begin() ; it != caloMap.end() ; ++it ){ diff --git a/doc/release.notes b/doc/release.notes index 52aa903303098c988187e27adb8aa507bbcfec8d..55b2d7b625b71259f0115dd009f035743710e1fb 100644 --- a/doc/release.notes +++ b/doc/release.notes @@ -3,6 +3,11 @@ DD4hep ---- Release Notes ================================= +2015/05/22 Nikiforos Nikiforou +----------------------- + - Fixed bug in DDG4/lcio/LCIOConversions.cpp, which stored only the PDG of the primary particle + in multiple particle contributions in SimCalorimeterHits instead of both the primary and secondary PDGs. + 2015/05/13 Markus Frank -----------------------