diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index d9e582958f2268d703c1cca13597776798d09369..a53bc0fa1c8f8b543f93397650fdc4e829977268 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -2,7 +2,7 @@ gaudi_subdir(Examples v0r0) find_package(podio REQUIRED) -find_package(plcio REQUIRED) +#find_package(plcio REQUIRED) find_package(LCIO REQUIRED) find_package(EDM4HEP REQUIRED) find_package(K4FWCore REQUIRED) @@ -11,7 +11,7 @@ set(Examples_srcs src/HelloWorld/*.cpp src/FirstSvc/*.cpp src/SecondAlg/*.cpp - src/PlcioTest/*.cpp + # src/PlcioTest/*.cpp src/Edm4hepTest/*.cpp ) @@ -21,8 +21,8 @@ gaudi_install_headers(Examples) # Modules gaudi_add_module(Examples ${Examples_srcs} - INCLUDE_DIRS K4FWCore GaudiAlgLib GaudiKernel ${plcio_INCLUDE_DIRS} ${podio_INCLUDE_DIRS} ${LCIO_INCLUDE_DIRS} - LINK_LIBRARIES K4FWCore GaudiAlgLib GaudiKernel ${LCIO_LIBRARIES} $ENV{PLCIO}/lib/libplcio.so + INCLUDE_DIRS K4FWCore GaudiAlgLib GaudiKernel ${podio_INCLUDE_DIRS} ${LCIO_INCLUDE_DIRS} + LINK_LIBRARIES K4FWCore GaudiAlgLib GaudiKernel ${LCIO_LIBRARIES} # Force loading the libraries. -Wl,--no-as-needed EDM4HEP::edm4hep EDM4HEP::edm4hepDict ${podio_LIBRARIES} podio::podioRootIO -Wl,--as-needed ) diff --git a/Examples/src/Edm4hepTest/Edm4hepWriteAlg.cpp b/Examples/src/Edm4hepTest/Edm4hepWriteAlg.cpp index 2e5457341b6e59bdefc30d95767eec2be708dc3b..b33d5e8045507a7514a7358aa8375f7e9326b544 100644 --- a/Examples/src/Edm4hepTest/Edm4hepWriteAlg.cpp +++ b/Examples/src/Edm4hepTest/Edm4hepWriteAlg.cpp @@ -38,10 +38,10 @@ StatusCode Edm4hepWriteAlg::execute() for ( int i = 0; i < 4; ++i ) { auto d = mcCol->create(); - d.addParent(p1); - d.addParent(p2); - p1.addDaughter(d); - p2.addDaughter(d); + d.addToParents(p1); + d.addToParents(p2); + p1.addToDaughters(d); + p2.addToDaughters(d); } return StatusCode::SUCCESS; diff --git a/Generator/src/HepMCRdr.cpp b/Generator/src/HepMCRdr.cpp index 491e0b47913a7815408c674e812055f0287b3421..c4bfb60d738e0780c523fe2f46f6ab7282c3c0b6 100644 --- a/Generator/src/HepMCRdr.cpp +++ b/Generator/src/HepMCRdr.cpp @@ -76,12 +76,12 @@ bool HepMCRdr::mutate(MyHepMC::GenEvent& event){ index++; if ( (*p)->production_vertex() ) { for ( HepMC::GenVertex::particle_iterator mother = (*p)->production_vertex()-> particles_begin(HepMC::parents); mother != (*p)->production_vertex()-> particles_end(HepMC::parents); ++mother ) { - pmc.addParent( event.m_mc_vec.at( pmcid_lmcid.at((*mother)->barcode()) ) ); + pmc.addToParents( event.m_mc_vec.at( pmcid_lmcid.at((*mother)->barcode()) ) ); } } if ( (*p)->end_vertex() ) { for ( HepMC::GenVertex::particle_iterator des =(*p)->end_vertex()-> particles_begin(HepMC::descendants); des != (*p)->end_vertex()-> particles_end(HepMC::descendants); ++des ) { - pmc.addDaughter( event.m_mc_vec.at( pmcid_lmcid.at((*des)->barcode()) ) ); + pmc.addToDaughters( event.m_mc_vec.at( pmcid_lmcid.at((*des)->barcode()) ) ); } } } diff --git a/Generator/src/SLCIORdr.cpp b/Generator/src/SLCIORdr.cpp index 13bd39ed18f56b5b79071c81ec366408548a34dd..2f0b940a339e0aa63a4a709220a4f0c56f2b0843 100644 --- a/Generator/src/SLCIORdr.cpp +++ b/Generator/src/SLCIORdr.cpp @@ -87,7 +87,7 @@ bool SLCIORdr::mutate(MyHepMC::GenEvent& event){ if(d==lcCol->getElementAt(i)) break; } if(i==NHEP) cout << "Heedm4hepInterfaceNew: error" << endl; - mcp->addDaughter(dynamic_cast<MCParticleImpl*>(lcMCVec->getElementAt(i))); + mcp->addToDaughters(dynamic_cast<MCParticleImpl*>(lcMCVec->getElementAt(i))); } */ @@ -133,12 +133,12 @@ bool SLCIORdr::mutate(MyHepMC::GenEvent& event){ //std::cout<<"mc at "<< i<<", parent size "<<mc_parents.size() <<std::endl; for(unsigned int j=0; j< mc_parents.size(); j++){int p_id = mc_parents.at(j)->id(); //std::cout<<"parent id "<<p_id<<std::endl; - pmc.addParent( event.m_mc_vec.at( pmcid_lmcid.at(p_id) ) ); + pmc.addToParents( event.m_mc_vec.at( pmcid_lmcid.at(p_id) ) ); } //std::cout<<"mc at "<< i<<", daughter size "<<mc_daughters.size() <<std::endl; for(unsigned int j=0; j< mc_daughters.size(); j++){int d_id = mc_daughters.at(j)->id(); //std::cout<<"daughter id "<<d_id<<std::endl; - pmc.addDaughter( event.m_mc_vec.at( pmcid_lmcid.at(d_id) ) ); + pmc.addToDaughters( event.m_mc_vec.at( pmcid_lmcid.at(d_id) ) ); } } event.SetEventHeader( m_processed_event, -99, 9999, "Generator"); diff --git a/Generator/src/StdHepRdr.cpp b/Generator/src/StdHepRdr.cpp index 3bc1412fe14ca9c56ece0bea6ae5167eb74a6ffb..09fa9ddc009f7be254dcd414154a726b7a4db0d1 100644 --- a/Generator/src/StdHepRdr.cpp +++ b/Generator/src/StdHepRdr.cpp @@ -67,12 +67,12 @@ bool StdHepRdr::mutate(MyHepMC::GenEvent& event){ //std::cout<<"mc at "<< i<<", parent size "<<mc_parents.size() <<std::endl; for(unsigned int j=0; j< mc_parents.size(); j++){int p_id = mc_parents.at(j)->id(); //std::cout<<"parent id "<<p_id<<std::endl; - pmc.addParent( event.m_mc_vec.at( pmcid_lmcid.at(p_id) ) ); + pmc.addToParents( event.m_mc_vec.at( pmcid_lmcid.at(p_id) ) ); } //std::cout<<"mc at "<< i<<", daughter size "<<mc_daughters.size() <<std::endl; for(unsigned int j=0; j< mc_daughters.size(); j++){int d_id = mc_daughters.at(j)->id(); //std::cout<<"daughter id "<<d_id<<std::endl; - pmc.addDaughter( event.m_mc_vec.at( pmcid_lmcid.at(d_id) ) ); + pmc.addToDaughters( event.m_mc_vec.at( pmcid_lmcid.at(d_id) ) ); } } diff --git a/Reconstruction/Digitisers/CMakeLists.txt b/Reconstruction/Digitisers/CMakeLists.txt index 7c0c14eab33249b3430b14234dae01d8a7272d3d..56952b161a470fb392408a69fa0e50f740258e6b 100644 --- a/Reconstruction/Digitisers/CMakeLists.txt +++ b/Reconstruction/Digitisers/CMakeLists.txt @@ -12,12 +12,12 @@ gaudi_depends_on_subdirs( Service/EventSeeder ) -set(Digitisers_srcs - src/*.cpp -) +# set(Digitisers_srcs +# src/*.cpp +# ) -# Modules -gaudi_add_module(Digitisers ${Digitisers_srcs} - INCLUDE_DIRS K4FWCore GaudiKernel GaudiAlgLib CLHEP gear ${plcio_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS} ${LCIO_INCLUDE_DIRS} - LINK_LIBRARIES K4FWCore GaudiKernel GaudiAlgLib CLHEP $ENV{GEAR}/lib/libgearsurf.so ${GSL_LIBRARIES} $ENV{PLCIO}/lib/libplcio.so ${LCIO_LIBRARIES} -) +# # Modules +# gaudi_add_module(Digitisers ${Digitisers_srcs} +# INCLUDE_DIRS K4FWCore GaudiKernel GaudiAlgLib CLHEP gear ${plcio_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS} ${LCIO_INCLUDE_DIRS} +# LINK_LIBRARIES K4FWCore GaudiKernel GaudiAlgLib CLHEP $ENV{GEAR}/lib/libgearsurf.so ${GSL_LIBRARIES} $ENV{PLCIO}/lib/libplcio.so ${LCIO_LIBRARIES} +# ) diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/CMakeLists.txt b/Reconstruction/PFA/Pandora/GaudiPandora/CMakeLists.txt index c60217b99ae686d08ecbd98a3f6c6df17e470c50..94651123bfa524ee7a6808b1f5420518a59a0254 100644 --- a/Reconstruction/PFA/Pandora/GaudiPandora/CMakeLists.txt +++ b/Reconstruction/PFA/Pandora/GaudiPandora/CMakeLists.txt @@ -13,7 +13,7 @@ message("ENV GEAR: $ENV{GEAR}") find_package(EDM4HEP REQUIRED ) include_directories(${EDM4HEP_INCLUDE_DIR}) -link_libraries("/cvmfs/cepcsw.ihep.ac.cn/prototype/releases/externals/97.0.0/EDM4hep/lib64/libedm4hep.so") + find_package(PandoraSDK REQUIRED ) include_directories(${PandoraSDK_INCLUDE_DIRS}) link_libraries(${PandoraSDK_LIBRARIES}) @@ -48,4 +48,8 @@ set(dir_include include) gaudi_add_module(GaudiPandora ${dir_srcs} INCLUDE_DIRS ${gsl_include} ${dir_include} GaudiKernel FWCore CLHEP ${LCIO_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} gear LINK_LIBRARIES ${gsl_lib1} ${gsl_lib2} GaudiKernel FWCore CLHEP ROOT ${LCIO_LIBRARIES} $ENV{GEAR}/lib/libgear.so $ENV{GEAR}/lib/libgearxml.so + -Wl,--no-as-needed + EDM4HEP::edm4hep EDM4HEP::edm4hepDict + -Wl,--as-needed + ) diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp index 401a6e7a8dabd6785684c6115cefeefeb23c5fdc..9489897f0c482c467cc35b9f5fd84d2cad8481bf 100644 --- a/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp +++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp @@ -618,7 +618,7 @@ StatusCode PandoraPFAlg::updateMap() edm4hep::SimCalorimeterHit sim_hit( it->getCellID(), it->getEnergy(), it->getPosition() ); edm4hep::CaloHitContribution conb ( MCParticle->at(i).getPDG(), it->getEnergy(), 0, it->getPosition() ); conb.setParticle( MCParticle->at(i) ); - sim_hit.addContribution(conb); + sim_hit.addToContributions(conb); edm4hep::MCRecoCaloAssociation calo_association; calo_association.setRec(*it); calo_association.setSim(sim_hit); diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/PfoCreator.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/PfoCreator.cpp index a3d35da1c0fe7bcf131b00998016e440210ba73b..a8c9f0c4b1c1f7fe2ec7bf32666ce3a1a4bd096c 100644 --- a/Reconstruction/PFA/Pandora/GaudiPandora/src/PfoCreator.cpp +++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/PfoCreator.cpp @@ -97,7 +97,7 @@ pandora::StatusCode PfoCreator::CreateParticleFlowObjects(CollectionMaps& collec //pClusterCollection->addElement(p_Cluster); edm4hep::ConstCluster p_ClusterCon = *p_Cluster; - pReconstructedParticle->addCluster(p_ClusterCon); + pReconstructedParticle->addToClusters(p_ClusterCon); } if (!hasTrack) @@ -157,7 +157,7 @@ void PfoCreator::SetClusterSubDetectorEnergies(const pandora::StringVector &subD edm4hep::CalorimeterHit *const pCalorimeterHit0 = (edm4hep::CalorimeterHit*)(pPandoraCaloHit->GetParentAddress()); const edm4hep::CalorimeterHit pCalorimeterHit = *pCalorimeterHit0; - p_Cluster->addHit(pCalorimeterHit); + p_Cluster->addToHits(pCalorimeterHit); const float caloHitEnergy(pCalorimeterHit.getEnergy()); hitE.push_back(caloHitEnergy); @@ -401,7 +401,7 @@ void PfoCreator::AddTracksToRecoParticle(const pandora::ParticleFlowObject *cons const pandora::Track *const pTrack(*tIter); const edm4hep::Track *const pLcioTrack0 = (edm4hep::Track*)(pTrack->GetParentAddress()); const edm4hep::Track pLcioTrack = *pLcioTrack0; - pReconstructedParticle->addTrack(pLcioTrack); + pReconstructedParticle->addToTracks(pLcioTrack); } } diff --git a/Reconstruction/PFA/Pandora/MatrixPandora/CMakeLists.txt b/Reconstruction/PFA/Pandora/MatrixPandora/CMakeLists.txt index 99429ca5eabab9c511c263dde0d5e99b04f249c3..73dc84e3d20f447bdf73fba3060bf1ae6e27c887 100644 --- a/Reconstruction/PFA/Pandora/MatrixPandora/CMakeLists.txt +++ b/Reconstruction/PFA/Pandora/MatrixPandora/CMakeLists.txt @@ -14,7 +14,7 @@ find_package(EDM4HEP REQUIRED ) #message("EDM4HEP_INCLUDE_DIRS: ${EDM4HEP_INCLUDE_DIR}") #message("EDM4HEP_LIB: ${EDM4HEP_LIBRARIES}") include_directories(${EDM4HEP_INCLUDE_DIR}) -link_libraries("/cvmfs/cepcsw.ihep.ac.cn/prototype/releases/externals/97.0.0/EDM4hep/lib64/libedm4hep.so") + find_package(PandoraSDK REQUIRED ) #message("PandoraSDK_INCLUDE_DIRS: ${PandoraSDK_INCLUDE_DIRS}") #message("PandoraSDK_LIB: ${PandoraSDK_LIBRARIES}") @@ -54,4 +54,7 @@ set(dir_include include) gaudi_add_module(MatrixPandora ${dir_srcs} INCLUDE_DIRS ${gsl_include} ${dir_include} GaudiKernel FWCore CLHEP ${LCIO_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} gear DD4hep LINK_LIBRARIES ${gsl_lib1} ${gsl_lib2} GaudiKernel FWCore CLHEP ROOT ${LCIO_LIBRARIES} $ENV{GEAR}/lib/libgear.so $ENV{GEAR}/lib/libgearxml.so DD4hep ${DD4hep_COMPONENT_LIBRARIES} DDRec + -Wl,--no-as-needed + EDM4HEP::edm4hep EDM4HEP::edm4hepDict + -Wl,--as-needed ) diff --git a/Reconstruction/PFA/Pandora/MatrixPandora/src/PandoraMatrixAlg.cpp b/Reconstruction/PFA/Pandora/MatrixPandora/src/PandoraMatrixAlg.cpp index 07527dbb236c6eb4bfcb62f00d256656f4544e15..e1d2e19986cb3d2b6da84407af94f474f543f427 100644 --- a/Reconstruction/PFA/Pandora/MatrixPandora/src/PandoraMatrixAlg.cpp +++ b/Reconstruction/PFA/Pandora/MatrixPandora/src/PandoraMatrixAlg.cpp @@ -625,7 +625,7 @@ StatusCode PandoraMatrixAlg::updateMap() edm4hep::SimCalorimeterHit sim_hit( it->getCellID(), it->getEnergy(), it->getPosition() ); edm4hep::CaloHitContribution conb ( MCParticle->at(i).getPDG(), it->getEnergy(), 0, it->getPosition() ); conb.setParticle( MCParticle->at(i) ); - sim_hit.addContribution(conb); + sim_hit.addToContributions(conb); edm4hep::MCRecoCaloAssociation calo_association; calo_association.setRec(*it); calo_association.setSim(sim_hit); diff --git a/Reconstruction/PFA/Pandora/MatrixPandora/src/PfoCreator.cpp b/Reconstruction/PFA/Pandora/MatrixPandora/src/PfoCreator.cpp index 1c6069c5762b9b2fc600671ddd0665e8f02f3986..b197f2dbb907b3c98597c5e7acf9b700208b155e 100644 --- a/Reconstruction/PFA/Pandora/MatrixPandora/src/PfoCreator.cpp +++ b/Reconstruction/PFA/Pandora/MatrixPandora/src/PfoCreator.cpp @@ -97,7 +97,7 @@ pandora::StatusCode PfoCreator::CreateParticleFlowObjects(CollectionMaps& collec //pClusterCollection->addElement(p_Cluster); edm4hep::ConstCluster p_ClusterCon = *p_Cluster; - pReconstructedParticle->addCluster(p_ClusterCon); + pReconstructedParticle->addToClusters(p_ClusterCon); } if (!hasTrack) @@ -157,7 +157,7 @@ void PfoCreator::SetClusterSubDetectorEnergies(const pandora::StringVector &subD edm4hep::CalorimeterHit *const pCalorimeterHit0 = (edm4hep::CalorimeterHit*)(pPandoraCaloHit->GetParentAddress()); const edm4hep::CalorimeterHit pCalorimeterHit = *pCalorimeterHit0; - p_Cluster->addHit(pCalorimeterHit); + p_Cluster->addToHits(pCalorimeterHit); const float caloHitEnergy(pCalorimeterHit.getEnergy()); hitE.push_back(caloHitEnergy); @@ -401,7 +401,7 @@ void PfoCreator::AddTracksToRecoParticle(const pandora::ParticleFlowObject *cons const pandora::Track *const pTrack(*tIter); const edm4hep::Track *const pLcioTrack0 = (edm4hep::Track*)(pTrack->GetParentAddress()); const edm4hep::Track pLcioTrack = *pLcioTrack0; - pReconstructedParticle->addTrack(pLcioTrack); + pReconstructedParticle->addToTracks(pLcioTrack); } } diff --git a/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp b/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp index 595ca3d7f76058c5d14b494a73e44d7c94436fc1..ea62694d1da2ccee06253d647dcf3599c7398d36 100644 --- a/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp +++ b/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp @@ -193,7 +193,7 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) { edm_calo_contrib.setTime(c.time/CLHEP::ns); edm_calo_contrib.setStepPosition(edm4hep::Vector3f(pos)); edm_calo_contrib.setParticle(mcCol->at(0)); // todo - edm_calo_hit.addContribution(edm_calo_contrib); + edm_calo_hit.addToContributions(edm_calo_contrib); } }