Skip to content
Snippets Groups Projects
Commit 3d5fa5ca authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: let CEPCSW work with the key4hep nightlies 2021-09-20.

parent 656ce73a
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,9 @@ gaudi_add_module(TotalInvMass
${ROOT_LIBRARIES}
)
target_include_directories(TotalInvMass
PUBLIC ${LCIO_INCLUDE_DIRS})
install(TARGETS TotalInvMass
EXPORT CEPCSWTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
......
......@@ -2,7 +2,8 @@
# Modules
gaudi_add_module(TrackInspect
SOURCES src/TrackInspectAlg.cpp
LINK DataHelperLib
LINK DataHelperLib
k4FWCore::k4FWCore
Gaudi::GaudiKernel
EDM4HEP::edm4hep
${ROOT_LIBRARIES}
......
......@@ -14,6 +14,10 @@ gaudi_add_module(GeomSvc
${ROOT_LIBRARIES}
)
target_include_directories(GeomSvc
PUBLIC ${GEAR_INCLUDE_DIRS}
)
install(TARGETS GeomSvc
EXPORT CEPCSWTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
......
......@@ -93,14 +93,21 @@ StatusCode DCHDigiAlg::execute()
info() << "Processing " << _nEvt << " events " << endmsg;
m_evt = _nEvt;
std::map<unsigned long long, std::vector<edm4hep::SimTrackerHit> > id_hits_map;
edm4hep::TrackerHitCollection* Vec = w_DigiDCHCol.createAndPut();
edm4hep::MCRecoTrackerAssociationCollection* AssoVec = w_AssociationCol.createAndPut();
const edm4hep::SimTrackerHitCollection* SimHitCol = r_SimDCHCol.get();
if (SimHitCol->size() == 0) {
return StatusCode::SUCCESS;
}
debug()<<"input sim hit size="<< SimHitCol->size() <<endmsg;
auto SimHit0 = SimHitCol->at(0);
std::map<unsigned long long, std::vector<decltype(SimHit0)> > id_hits_map;
//std::map<unsigned long long, std::vector<edm4hep::ConstSimTrackerhit> > id_hits_map;
for( int i = 0; i < SimHitCol->size(); i++ )
{
edm4hep::SimTrackerHit SimHit = SimHitCol->at(i);
auto SimHit = SimHitCol->at(i);
unsigned long long id = SimHit.getCellID();
float sim_hit_mom = sqrt( SimHit.getMomentum()[0]*SimHit.getMomentum()[0] + SimHit.getMomentum()[1]*SimHit.getMomentum()[1] + SimHit.getMomentum()[2]*SimHit.getMomentum()[2] );//GeV
if(sim_hit_mom < m_mom_threshold) continue;
......@@ -109,7 +116,7 @@ StatusCode DCHDigiAlg::execute()
if ( id_hits_map.find(id) != id_hits_map.end()) id_hits_map[id].push_back(SimHit);
else
{
std::vector<edm4hep::SimTrackerHit> vhit;
std::vector< decltype(SimHit) > vhit;
vhit.push_back(SimHit);
id_hits_map[id] = vhit ;
}
......@@ -118,7 +125,7 @@ StatusCode DCHDigiAlg::execute()
m_n_sim = 0;
m_n_digi = 0 ;
}
for(std::map<unsigned long long, std::vector<edm4hep::SimTrackerHit> >::iterator iter = id_hits_map.begin(); iter != id_hits_map.end(); iter++)
for(auto iter = id_hits_map.begin(); iter != id_hits_map.end(); iter++)
{
unsigned long long wcellid = iter->first;
auto trkHit = Vec->create();
......
......@@ -18,7 +18,7 @@ gaudi_add_library(DataHelperLib
src/TrackerHitHelper.cpp
LINK EDM4HEP::edm4hep
EDM4HEP::edm4hepDict
${GSL_LIBRARIES}
GSL::gsl
${CLHEP_LIBRARIES}
Identifier
)
......
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