diff --git a/.gitignore b/.gitignore index ff3f1269350fe375b8e24d380213435e8d84f590..58e07a1f21127cf993ab4773b5e501381060fd9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build.* +build spack* ./Generator/output/ ./Generator/options/ diff --git a/Analysis/TrackInspect/src/TrackInspectAlg.cpp b/Analysis/TrackInspect/src/TrackInspectAlg.cpp index 9e9fde8cc53671b41d5afdf806a85c7b8ceca6b6..281df767c6590c627909fc4661ffe108b2664b02 100644 --- a/Analysis/TrackInspect/src/TrackInspectAlg.cpp +++ b/Analysis/TrackInspect/src/TrackInspectAlg.cpp @@ -134,7 +134,7 @@ StatusCode TrackInspectAlg::execute(){ for (auto relCol: relCols) { if (relCol){ for (auto rel: *relCol){ - std::pair<edm4hep::ConstTrackerHit, edm4hep::ConstMCParticle> p = std::make_pair(rel.getRec(), rel.getSim().getMCParticle()); + std::pair<edm4hep::TrackerHit, edm4hep::MCParticle> p = std::make_pair(rel.getRec(), rel.getSim().getMCParticle()); if (hitmap.find(p) == hitmap.end()) hitmap[p] = 0.; hitmap[p] += rel.getWeight(); } @@ -163,7 +163,7 @@ StatusCode TrackInspectAlg::execute(){ for (auto particle: *mcpCol){ double match_weight = match(particle, track); if (match_weight > 0.2){ - std::tuple<edm4hep::ConstMCParticle, edm4hep::ConstTrack, double> tuple = std::make_tuple(particle, track, match_weight); + std::tuple<edm4hep::MCParticle, edm4hep::Track, double> tuple = std::make_tuple(particle, track, match_weight); matchvec.push_back(tuple); } } @@ -174,7 +174,7 @@ StatusCode TrackInspectAlg::execute(){ // MCParticleHitAssociator(mcpCol); m_nParticles = 0; for (auto particle: *mcpCol) { - std::vector<edm4hep::ConstTrack> theTracks = MCParticleTrackAssociator(particle); + std::vector<edm4hep::Track> theTracks = MCParticleTrackAssociator(particle); if (theTracks.size() == 0) { totalCandidates[m_nParticles] = 0; @@ -199,16 +199,16 @@ StatusCode TrackInspectAlg::execute(){ return StatusCode::SUCCESS; } -double TrackInspectAlg::match(edm4hep::ConstMCParticle particle, edm4hep::ConstTrack track){ +double TrackInspectAlg::match(edm4hep::MCParticle particle, edm4hep::Track track){ int NHits = track.trackerHits_size(); double matchedHits = 0; double usedHits = 0; for (int i = 0; i < NHits; i++) { - edm4hep::ConstTrackerHit hit = track.getTrackerHits(i); + edm4hep::TrackerHit hit = track.getTrackerHits(i); usedHits++; - std::pair<edm4hep::ConstTrackerHit, edm4hep::ConstMCParticle> ele = std::make_pair(hit, particle); + std::pair<edm4hep::TrackerHit, edm4hep::MCParticle> ele = std::make_pair(hit, particle); //std::cout << "lookup --> " << ele.first << std::endl; //if (hitmap.find(ele) != hitmap.end() ) { //std::cout << "find --> " << hitmap[ele] << std::endl; @@ -227,7 +227,7 @@ double TrackInspectAlg::match(edm4hep::ConstMCParticle particle, edm4hep::ConstT return matchedHits / usedHits; } -void TrackInspectAlg::Fill(edm4hep::ConstMCParticle particle, edm4hep::ConstTrack theTrack) { +void TrackInspectAlg::Fill(edm4hep::MCParticle particle, edm4hep::Track theTrack) { pid[m_nParticles] = particle.getPDG(); vx[m_nParticles] = particle.getVertex().x; @@ -287,8 +287,8 @@ void TrackInspectAlg::Fill(edm4hep::ConstMCParticle particle, edm4hep::ConstTrac } } -std::vector<edm4hep::ConstTrack> TrackInspectAlg::MCParticleTrackAssociator(edm4hep::ConstMCParticle theParticle) { - std::vector<edm4hep::ConstTrack> theTracks; +std::vector<edm4hep::Track> TrackInspectAlg::MCParticleTrackAssociator(edm4hep::MCParticle theParticle) { + std::vector<edm4hep::Track> theTracks; // std::cout << "The particle: " << theParticle.getPDG() << " " << theParticle << std::endl; for (auto matchtuple: matchvec){ if (std::get<0>(matchtuple) == theParticle){ diff --git a/Analysis/TrackInspect/src/TrackInspectAlg.h b/Analysis/TrackInspect/src/TrackInspectAlg.h index 99c7878e11654eae33f16f156ca38278fc0e128c..5e5dce1a13cd3b85862fa01d719d802023443005 100644 --- a/Analysis/TrackInspect/src/TrackInspectAlg.h +++ b/Analysis/TrackInspect/src/TrackInspectAlg.h @@ -42,9 +42,9 @@ class TrackInspectAlg : public Algorithm { Gaudi::Property<bool> _useSET{this, "useSET", true}; Gaudi::Property<bool> _useFTD{this, "useFTD", true}; - std::map<std::pair<edm4hep::ConstTrackerHit, edm4hep::ConstMCParticle>, double> hitmap; - std::vector<std::tuple<edm4hep::ConstMCParticle, edm4hep::ConstTrack, double>> matchvec; - double match(edm4hep::ConstMCParticle, edm4hep::ConstTrack); + std::map<std::pair<edm4hep::TrackerHit, edm4hep::MCParticle>, double> hitmap; + std::vector<std::tuple<edm4hep::MCParticle, edm4hep::Track, double>> matchvec; + double match(edm4hep::MCParticle, edm4hep::Track); void initializeRelationCollections(std::vector<const edm4hep::MCRecoTrackerAssociationCollection*> &relCols); @@ -52,10 +52,10 @@ class TrackInspectAlg : public Algorithm { std::string m_thisName; // TrackingEfficiency - void Fill(edm4hep::ConstMCParticle, edm4hep::ConstTrack); - std::vector<edm4hep::ConstTrack> MCParticleTrackAssociator(edm4hep::ConstMCParticle); + void Fill(edm4hep::MCParticle, edm4hep::Track); + std::vector<edm4hep::Track> MCParticleTrackAssociator(edm4hep::MCParticle); - std::map<edm4hep::ConstMCParticle, std::vector<edm4hep::ConstSimTrackerHit>> mcpHitMap; + std::map<edm4hep::MCParticle, std::vector<edm4hep::SimTrackerHit>> mcpHitMap; std::string treeFileName; NTuple::Tuple* m_tuple; diff --git a/Digitisers/G2CDArbor/src/G2CDArborAlg.cpp b/Digitisers/G2CDArbor/src/G2CDArborAlg.cpp index e90425840a7a7d3f9c1a706d81313cbb557519d1..2fbda2cc75388448ff365edff01e8a38019a183a 100644 --- a/Digitisers/G2CDArbor/src/G2CDArborAlg.cpp +++ b/Digitisers/G2CDArbor/src/G2CDArborAlg.cpp @@ -524,7 +524,7 @@ StatusCode G2CDArborAlg::execute() // for(int k=0; k<SimEcalhit->getNMCContributions(); k++) // { for(int k=0; k<SimEcalhit.contributions_size(); k++){ - edm4hep::ConstCaloHitContribution hitContribution = SimEcalhit.getContributions(k); + edm4hep::CaloHitContribution hitContribution = SimEcalhit.getContributions(k); // HitStepEn = SimEcalhit->getEnergyCont(k); HitStepEn = hitContribution.getEnergy(); if(HitStepEn > EmaxStep) @@ -626,7 +626,7 @@ StatusCode G2CDArborAlg::execute() // for(int k=0; k<SimHcalhit->getNMCContributions(); k++) // { for(int k=0; k<SimHcalhit.contributions_size(); k++){ - edm4hep::ConstCaloHitContribution hitContribution = SimHcalhit.getContributions(k); + edm4hep::CaloHitContribution hitContribution = SimHcalhit.getContributions(k); // HitStepEn = SimHcalhit->getEnergyCont(k); HitStepEn = hitContribution.getEnergy(); diff --git a/Digitisers/G2CDArbor/src/G2CDArborAlg.h b/Digitisers/G2CDArbor/src/G2CDArborAlg.h index 910675c9e930e4b3fe9a3c8390604898bf8dfaf2..08c04f0335266d3ecfbd035c0b30c6c798509161 100644 --- a/Digitisers/G2CDArbor/src/G2CDArborAlg.h +++ b/Digitisers/G2CDArbor/src/G2CDArborAlg.h @@ -6,7 +6,6 @@ #include "Gaudi/Property.h" #include "edm4hep/EventHeader.h" #include "edm4hep/EventHeaderCollection.h" -#include "edm4hep/SimCalorimeterHitConst.h" #include "edm4hep/SimCalorimeterHit.h" #include "edm4hep/CalorimeterHit.h" #include "edm4hep/CalorimeterHitCollection.h" diff --git a/Digitisers/SimHitMerge/src/SimHitMergeAlg.cpp b/Digitisers/SimHitMerge/src/SimHitMergeAlg.cpp index 5a447a9eb56e4baf2e0d58b6dadf227dfcbb3009..6556b9a168ee69b45edbc066920802b62f18efba 100644 --- a/Digitisers/SimHitMerge/src/SimHitMergeAlg.cpp +++ b/Digitisers/SimHitMerge/src/SimHitMergeAlg.cpp @@ -60,8 +60,8 @@ StatusCode SimHitMergeAlg::execute() for (unsigned int k0 = 0; k0 < m_inputColNames.size(); k0++) { - std::map<unsigned long long, edm4hep::SimCalorimeterHit> id_hit_map; - std::map<unsigned long long, std::vector<edm4hep::ConstCaloHitContribution> > id_vconb_map; + std::map<unsigned long long, edm4hep::MutableSimCalorimeterHit> id_hit_map; + std::map<unsigned long long, std::vector<edm4hep::CaloHitContribution> > id_vconb_map; edm4hep::SimCalorimeterHitCollection* mergedCol = m_OutputCollections[k0]->createAndPut(); auto col = m_InputCollections[k0]->get(); //std::cout<<"input="<<m_InputCollections[k0]->objKey()<<",size="<<col->size()<<std::endl; @@ -78,10 +78,10 @@ StatusCode SimHitMergeAlg::execute() //std::cout<<"DD_sim_hit::ProcessHits, sp x="<<Simhit.getPosition()[0]<<", y="<<Simhit.getPosition()[1]<<", z="<<Simhit.getPosition()[2]<<",edep="<<Simhit.getEnergy()<<std::endl; if ( id_hit_map.find(id) != id_hit_map.end()) id_hit_map[id].setEnergy(id_hit_map[id].getEnergy() + Simhit.getEnergy()); else { - edm4hep::SimCalorimeterHit newSimhit(Simhit.getCellID(), Simhit.getEnergy(), Simhit.getPosition()); + edm4hep::MutableSimCalorimeterHit newSimhit(Simhit.getCellID(), Simhit.getEnergy(), Simhit.getPosition()); id_hit_map[id] = newSimhit; } - std::vector<edm4hep::ConstCaloHitContribution> tmp_vconb ; + std::vector<edm4hep::CaloHitContribution> tmp_vconb ; for(int kk=0; kk<Simhit.contributions_size(); kk++){ tmp_vconb.push_back(Simhit.getContributions(kk)); } diff --git a/Digitisers/SimHitMerge/src/SimHitMergeAlg.h b/Digitisers/SimHitMerge/src/SimHitMergeAlg.h index 04b74aa08f60a7d3841676bfbf6e8ed68b6023a1..e2724a4e8dda528b253ab5189ddf14630eaafb93 100644 --- a/Digitisers/SimHitMerge/src/SimHitMergeAlg.h +++ b/Digitisers/SimHitMerge/src/SimHitMergeAlg.h @@ -6,7 +6,6 @@ #include "Gaudi/Property.h" #include "edm4hep/EventHeader.h" #include "edm4hep/EventHeaderCollection.h" -#include "edm4hep/SimCalorimeterHitConst.h" #include "edm4hep/SimCalorimeterHit.h" #include "edm4hep/SimCalorimeterHitCollection.h" #include "edm4hep/MCRecoCaloAssociationCollection.h" diff --git a/Generator/src/GtBeamBackgroundTool.cpp b/Generator/src/GtBeamBackgroundTool.cpp index c093caa74cc320745084d85b80829fc0d7421f17..1fe4797b5e42b8ded7f5a049e5d938ecd7e4acd6 100644 --- a/Generator/src/GtBeamBackgroundTool.cpp +++ b/Generator/src/GtBeamBackgroundTool.cpp @@ -66,7 +66,7 @@ bool GtBeamBackgroundTool::mutate(MyHepMC::GenEvent& event) { } // create the MC particle - edm4hep::MCParticle mcp = event.m_mc_vec.create(); + auto mcp = event.m_mc_vec.create(); mcp.setPDG(beamdata.pdgid); mcp.setGeneratorStatus(1); mcp.setSimulatorStatus(1); diff --git a/Generator/src/GtGunTool.cpp b/Generator/src/GtGunTool.cpp index c8c6ca826eb32685db09b69ed4936d0dc06cb24d..af2a98dd9fe5397312b31701cdb92c4cb1eb48a7 100644 --- a/Generator/src/GtGunTool.cpp +++ b/Generator/src/GtGunTool.cpp @@ -125,7 +125,7 @@ GtGunTool::mutate(MyHepMC::GenEvent& event) { double energy = energy_min==energy_max ? energy_min : CLHEP::RandFlat::shoot(energy_min, energy_max); // create the MC particle - edm4hep::MCParticle mcp = event.m_mc_vec.create(); + auto mcp = event.m_mc_vec.create(); mcp.setPDG(pdgcode); mcp.setGeneratorStatus(1); mcp.setSimulatorStatus(1); diff --git a/Generator/src/HepMCRdr.cpp b/Generator/src/HepMCRdr.cpp index c4bfb60d738e0780c523fe2f46f6ab7282c3c0b6..c89a619018d3b690d970dd2d80d85388f96e6bf2 100644 --- a/Generator/src/HepMCRdr.cpp +++ b/Generator/src/HepMCRdr.cpp @@ -39,7 +39,7 @@ bool HepMCRdr::mutate(MyHepMC::GenEvent& event){ int index = 0 ; for ( HepMC::GenEvent::particle_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p ) { //std::cout<<"start mc "<<index<<std::endl; - edm4hep::MCParticle mcp = event.m_mc_vec.create(); + auto mcp = event.m_mc_vec.create(); pmcid_lmcid.insert(std::pair<int, int>((*p)->barcode(),index)); index++; //std::cout<<"map<id,i>:"<<mc->id()<<","<< i <<std::endl; @@ -72,7 +72,7 @@ bool HepMCRdr::mutate(MyHepMC::GenEvent& event){ // second loop for setting parents and daughters index = 0 ; for ( HepMC::GenEvent::particle_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p ) { - edm4hep::MCParticle pmc = event.m_mc_vec.at(index); + auto pmc = event.m_mc_vec.at(index); 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 ) { diff --git a/Generator/src/SLCIORdr.cpp b/Generator/src/SLCIORdr.cpp index 2f0b940a339e0aa63a4a709220a4f0c56f2b0843..14dcec3af8c57a27dede1e28f92ec5d1a279a159 100644 --- a/Generator/src/SLCIORdr.cpp +++ b/Generator/src/SLCIORdr.cpp @@ -106,7 +106,7 @@ bool SLCIORdr::mutate(MyHepMC::GenEvent& event){ for (int i=0; i < n_mc; i++){ MCParticleImpl* mc = (MCParticleImpl*) lcMCVec->getElementAt(i); //std::cout<<"At mc :"<< i <<std::endl; - edm4hep::MCParticle mcp = event.m_mc_vec.create(); + auto mcp = event.m_mc_vec.create(); pmcid_lmcid.insert(std::pair<int, int>(mc->id(),i)); //std::cout<<"map<id,i>:"<<mc->id()<<","<< i <<std::endl; @@ -129,7 +129,7 @@ bool SLCIORdr::mutate(MyHepMC::GenEvent& event){ MCParticleImpl* mc = (MCParticleImpl*) lcMCVec->getElementAt(i); const MCParticleVec & mc_parents = mc->getParents(); const MCParticleVec & mc_daughters = mc->getDaughters(); - edm4hep::MCParticle pmc = event.m_mc_vec.at(i); + auto pmc = event.m_mc_vec.at(i); //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; diff --git a/Generator/src/StdHepRdr.cpp b/Generator/src/StdHepRdr.cpp index 09fa9ddc009f7be254dcd414154a726b7a4db0d1..b56342b0bfb25de4eb4ceee6b6d6362004bcb1bd 100644 --- a/Generator/src/StdHepRdr.cpp +++ b/Generator/src/StdHepRdr.cpp @@ -40,7 +40,7 @@ bool StdHepRdr::mutate(MyHepMC::GenEvent& event){ for (int i=0; i < n_mc; i++){ MCParticleImpl* mc = (MCParticleImpl*) mc_vec->getElementAt(i); //std::cout<<"At mc :"<< i <<std::endl; - edm4hep::MCParticle mcp = event.m_mc_vec.create(); + auto mcp = event.m_mc_vec.create(); pmcid_lmcid.insert(std::pair<int, int>(mc->id(),i)); //std::cout<<"map<id,i>:"<<mc->id()<<","<< i <<std::endl; @@ -63,7 +63,7 @@ bool StdHepRdr::mutate(MyHepMC::GenEvent& event){ MCParticleImpl* mc = (MCParticleImpl*) mc_vec->getElementAt(i); const MCParticleVec & mc_parents = mc->getParents(); const MCParticleVec & mc_daughters = mc->getDaughters(); - edm4hep::MCParticle pmc = event.m_mc_vec.at(i); + auto pmc = event.m_mc_vec.at(i); //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; diff --git a/Reconstruction/DCHDedx/src/RecDCHDedxAlg.cpp b/Reconstruction/DCHDedx/src/RecDCHDedxAlg.cpp index eaac6ffe1be6efd69df095a9500ba33562ca3c0d..64a78c49720ce253dcf661a2bb5a21c42e548838 100644 --- a/Reconstruction/DCHDedx/src/RecDCHDedxAlg.cpp +++ b/Reconstruction/DCHDedx/src/RecDCHDedxAlg.cpp @@ -86,7 +86,7 @@ StatusCode RecDCHDedxAlg::execute() return StatusCode::SUCCESS; } for(unsigned j=0; j<ptrkCol->size(); j++){ - std::map< edm4hep::ConstMCParticle, int > map_mc_count; + std::map< edm4hep::MCParticle, int > map_mc_count; auto tmp_track = ptrkCol->at(j); for(unsigned k=0; k< tmp_track.trackerHits_size(); k++){ for(unsigned z=0; z< assoCol->size(); z++){ @@ -99,7 +99,7 @@ StatusCode RecDCHDedxAlg::execute() } } - edm4hep::MCParticle tmp_mc; + edm4hep::MutableMCParticle tmp_mc; int max_cout = 0; for(auto iter = map_mc_count.begin(); iter != map_mc_count.end(); iter++ ){ if(iter->second > max_cout){ @@ -154,7 +154,7 @@ StatusCode RecDCHDedxAlg::execute() return StatusCode::SUCCESS; } for(unsigned j=0; j<ptrkCol->size(); j++){ - std::map< edm4hep::ConstMCParticle, int > map_mc_count; + std::map< edm4hep::MCParticle, int > map_mc_count; auto tmp_track = ptrkCol->at(j); for(unsigned k=0; k< tmp_track.trackerHits_size(); k++){ for(unsigned z=0; z< assoCol->size(); z++){ @@ -167,7 +167,7 @@ StatusCode RecDCHDedxAlg::execute() } } - edm4hep::MCParticle tmp_mc; + edm4hep::MutableMCParticle tmp_mc; int max_cout = 0; for(auto iter = map_mc_count.begin(); iter != map_mc_count.end(); iter++ ){ if(iter->second > max_cout){ diff --git a/Reconstruction/Digi_Calo/src/CaloDigiAlg.cpp b/Reconstruction/Digi_Calo/src/CaloDigiAlg.cpp index af65187c95ed83656ce9afaf6e92e96ddee7964e..daaedee509beada4c0552c40d4135f0fd40d89d8 100644 --- a/Reconstruction/Digi_Calo/src/CaloDigiAlg.cpp +++ b/Reconstruction/Digi_Calo/src/CaloDigiAlg.cpp @@ -45,7 +45,7 @@ StatusCode CaloDigiAlg::initialize() StatusCode CaloDigiAlg::execute() { - std::map<unsigned long long, edm4hep::SimCalorimeterHit> id_hit_map; + std::map<unsigned long long, edm4hep::MutableSimCalorimeterHit> id_hit_map; edm4hep::CalorimeterHitCollection* caloVec = w_DigiCaloCol.createAndPut(); edm4hep::MCRecoCaloAssociationCollection* caloAssoVec = w_CaloAssociationCol.createAndPut(); const edm4hep::SimCalorimeterHitCollection* SimHitCol = r_SimCaloCol.get(); @@ -68,7 +68,7 @@ StatusCode CaloDigiAlg::execute() tot_e += en; if ( id_hit_map.find(id) != id_hit_map.end()) id_hit_map[id].setEnergy(id_hit_map[id].getEnergy() + en); else { - edm4hep::SimCalorimeterHit newSimHit(SimHit.getCellID(), SimHit.getEnergy(), SimHit.getPosition()); + edm4hep::MutableSimCalorimeterHit newSimHit(SimHit.getCellID(), SimHit.getEnergy(), SimHit.getPosition()); id_hit_map[id] = newSimHit ; } diff --git a/Reconstruction/Digi_Calo/src/CaloDigiAlg.h b/Reconstruction/Digi_Calo/src/CaloDigiAlg.h index 9bfd5e3bfc7f2b919cf2d65a064e2d8a4a1e256d..86c4080f7455b5b17afc652f69ca20c74e441f2a 100644 --- a/Reconstruction/Digi_Calo/src/CaloDigiAlg.h +++ b/Reconstruction/Digi_Calo/src/CaloDigiAlg.h @@ -3,7 +3,6 @@ #include "k4FWCore/DataHandle.h" #include "GaudiAlg/GaudiAlgorithm.h" -#include "edm4hep/SimCalorimeterHitConst.h" #include "edm4hep/SimCalorimeterHit.h" #include "edm4hep/CalorimeterHit.h" #include "edm4hep/CalorimeterHitCollection.h" diff --git a/Reconstruction/PFA/Arbor/src/ArborToolLCIO.cc b/Reconstruction/PFA/Arbor/src/ArborToolLCIO.cc index b1e2c7363b093399d4c64fa7477065315149a261..a43f7c6e3a6b2a307475a8621448f40cfda68af7 100644 --- a/Reconstruction/PFA/Arbor/src/ArborToolLCIO.cc +++ b/Reconstruction/PFA/Arbor/src/ArborToolLCIO.cc @@ -18,7 +18,6 @@ #include "Gaudi/Property.h" #include "edm4hep/EventHeader.h" #include "edm4hep/EventHeaderCollection.h" -#include "edm4hep/SimCalorimeterHitConst.h" #include "edm4hep/SimCalorimeterHit.h" #include "edm4hep/CalorimeterHit.h" #include "edm4hep/CalorimeterHitCollection.h" @@ -122,7 +121,7 @@ ArborToolLCIO::ArborToolLCIO(const std::string& name,ISvcLocator* svcLoc) ArborToolLCIO::~ArborToolLCIO() { } -void ArborToolLCIO::ClusterBuilding( DataHandle<edm4hep::ClusterCollection>& _currbranchcoll, std::vector<edm4hep::ConstCalorimeterHit> Hits, branchcoll BranchOrder, int DHCALFlag ) +void ArborToolLCIO::ClusterBuilding( DataHandle<edm4hep::ClusterCollection>& _currbranchcoll, std::vector<edm4hep::CalorimeterHit> Hits, branchcoll BranchOrder, int DHCALFlag ) { //DataHandle<edm4hep::ClusterCollection> _currbranchcoll {"Name",Gaudi::DataHandle::Writer, this}; //DataHandle<edm4hep::ClusterCollection> _currbranchcoll=new ClusterType(Name, Gaudi::DataHandle::Writer, this); @@ -192,7 +191,7 @@ void ArborToolLCIO::ClusterBuilding( DataHandle<edm4hep::ClusterCollection>& _cu -int ArborToolLCIO::NHScaleV2( std::vector<edm4hep::ConstCalorimeterHit> clu0, int RatioX, int RatioY, int RatioZ ) +int ArborToolLCIO::NHScaleV2( std::vector<edm4hep::CalorimeterHit> clu0, int RatioX, int RatioY, int RatioZ ) { int ReScaledNH = 0; @@ -237,7 +236,7 @@ int ArborToolLCIO::NHScaleV2( std::vector<edm4hep::ConstCalorimeterHit> clu0, in return ReScaledNH; } -float ArborToolLCIO::FDV2( std::vector<edm4hep::ConstCalorimeterHit> clu) +float ArborToolLCIO::FDV2( std::vector<edm4hep::CalorimeterHit> clu) { float FractalDim = 0; int NReSizeHit[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -257,7 +256,7 @@ float ArborToolLCIO::FDV2( std::vector<edm4hep::ConstCalorimeterHit> clu) } -int ArborToolLCIO::NHScaleV3( edm4hep::ConstCluster clu0, int RatioX, int RatioY, int RatioZ ) +int ArborToolLCIO::NHScaleV3( edm4hep::Cluster clu0, int RatioX, int RatioY, int RatioZ ) { int ReScaledNH = 0; @@ -305,7 +304,7 @@ int ArborToolLCIO::NHScaleV3( edm4hep::ConstCluster clu0, int RatioX, int RatioY } -float ArborToolLCIO::FDV3( edm4hep::ConstCluster clu ){ +float ArborToolLCIO::FDV3( edm4hep::Cluster clu ){ float FractalDim = -1; int NReSizeHit[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -324,7 +323,7 @@ float ArborToolLCIO::FDV3( edm4hep::ConstCluster clu ){ } -float ArborToolLCIO::BushDis( edm4hep::ConstCluster clu1, edm4hep::ConstCluster clu2) +float ArborToolLCIO::BushDis( edm4hep::Cluster clu1, edm4hep::Cluster clu2) { float DisBetweenBush = 1.0E10; @@ -355,7 +354,7 @@ float ArborToolLCIO::BushDis( edm4hep::ConstCluster clu1, edm4hep::ConstCluster } -float ArborToolLCIO::DisPointToBush(TVector3 Pos1, edm4hep::ConstCluster clu1) +float ArborToolLCIO::DisPointToBush(TVector3 Pos1, edm4hep::Cluster clu1) { float Dis = 1.0E9; float HitDis = 1.0E8; @@ -377,7 +376,7 @@ float ArborToolLCIO::DisPointToBush(TVector3 Pos1, edm4hep::ConstCluster clu1) } -TVector3 ArborToolLCIO::ClusterCoG(edm4hep::ConstCluster inputCluster) +TVector3 ArborToolLCIO::ClusterCoG(edm4hep::Cluster inputCluster) { TVector3 CenterOfGravity; @@ -403,7 +402,7 @@ TVector3 ArborToolLCIO::ClusterCoG(edm4hep::ConstCluster inputCluster) } -edm4hep::ClusterCollection* ArborToolLCIO::ClusterVecColl( std::vector<edm4hep::ConstCluster> inputClusters, DataHandle<edm4hep::ClusterCollection>& m_clucol ) +edm4hep::ClusterCollection* ArborToolLCIO::ClusterVecColl( std::vector<edm4hep::Cluster> inputClusters, DataHandle<edm4hep::ClusterCollection>& m_clucol ) { edm4hep::ClusterCollection* vec_coll_Clusters = m_clucol.createAndPut(); @@ -445,9 +444,9 @@ edm4hep::ClusterCollection* ArborToolLCIO::ClusterVecColl( std::vector<edm4hep:: return vec_coll_Clusters; } -std::vector<edm4hep::ConstCluster> ArborToolLCIO::CollClusterVec(const edm4hep::ClusterCollection * input_coll ) +std::vector<edm4hep::Cluster> ArborToolLCIO::CollClusterVec(const edm4hep::ClusterCollection * input_coll ) { - std::vector<edm4hep::ConstCluster> outputClusterVec; + std::vector<edm4hep::Cluster> outputClusterVec; outputClusterVec.clear(); @@ -462,7 +461,7 @@ std::vector<edm4hep::ConstCluster> ArborToolLCIO::CollClusterVec(const edm4hep:: } -void ArborToolLCIO::NaiveCluConst(edm4hep::ConstCluster a0_clu,edm4hep::Cluster b0_clu) +void ArborToolLCIO::NaiveCluConst(edm4hep::Cluster a0_clu,edm4hep::Cluster b0_clu) { b0_clu.setPosition(a0_clu.getPosition()); b0_clu.setEnergy(a0_clu.getEnergy()); @@ -493,7 +492,7 @@ void ArborToolLCIO::NaiveCluConst(edm4hep::ConstCluster a0_clu,edm4hep::Cluster } -edm4hep::Cluster ArborToolLCIO::NaiveCluImpl(edm4hep::ConstCluster a0_clu) +edm4hep::Cluster ArborToolLCIO::NaiveCluImpl(edm4hep::Cluster a0_clu) { edm4hep::Cluster b0_clu; b0_clu.setPosition(a0_clu.getPosition()); @@ -525,9 +524,9 @@ edm4hep::Cluster ArborToolLCIO::NaiveCluImpl(edm4hep::ConstCluster a0_clu) return b0_clu; } -std::vector<edm4hep::ConstCalorimeterHit> ArborToolLCIO::CollHitVec(const edm4hep::CalorimeterHitCollection * input_coll, float EnergyThreshold) +std::vector<edm4hep::CalorimeterHit> ArborToolLCIO::CollHitVec(const edm4hep::CalorimeterHitCollection * input_coll, float EnergyThreshold) { - std::vector<edm4hep::ConstCalorimeterHit> outputHitVec; + std::vector<edm4hep::CalorimeterHit> outputHitVec; outputHitVec.clear(); @@ -544,7 +543,7 @@ std::vector<edm4hep::ConstCalorimeterHit> ArborToolLCIO::CollHitVec(const edm4he } -std::vector<edm4hep::Cluster> ArborToolLCIO::ClusterHitAbsorbtion( std::vector<edm4hep::ConstCluster> MainClusters, std::vector<edm4hep::ConstCalorimeterHit> IsoHits, float DisThreshold ) // Projective Distance + Hit Depth correlation; +std::vector<edm4hep::Cluster> ArborToolLCIO::ClusterHitAbsorbtion( std::vector<edm4hep::Cluster> MainClusters, std::vector<edm4hep::CalorimeterHit> IsoHits, float DisThreshold ) // Projective Distance + Hit Depth correlation; { std::vector<edm4hep::Cluster> outputClusterVec; @@ -582,7 +581,7 @@ std::vector<edm4hep::Cluster> ArborToolLCIO::ClusterHitAbsorbtion( std::vector<e } int N_frag_core_links = Frag_Core_Links.size(); - std::vector<edm4hep::ConstCalorimeterHit> tomerge_hits; + std::vector<edm4hep::CalorimeterHit> tomerge_hits; float ClusterEn = 0; for(int i2 = 0; i2 < N_Core; i2 ++) @@ -629,7 +628,7 @@ std::vector<edm4hep::Cluster> ArborToolLCIO::ClusterHitAbsorbtion( std::vector<e } -void ArborToolLCIO::NaiveMergeCluConst(std::vector<edm4hep::ConstCluster> inputCluVec,edm4hep::Cluster MergedClu) +void ArborToolLCIO::NaiveMergeCluConst(std::vector<edm4hep::Cluster> inputCluVec,edm4hep::Cluster MergedClu) { int NClu = inputCluVec.size(); @@ -693,7 +692,7 @@ void ArborToolLCIO::NaiveMergeCluConst(std::vector<edm4hep::ConstCluster> inputC } } -edm4hep::Cluster ArborToolLCIO::NaiveMergeClu(std::vector<edm4hep::ConstCluster> inputCluVec) +edm4hep::Cluster ArborToolLCIO::NaiveMergeClu(std::vector<edm4hep::Cluster> inputCluVec) { edm4hep::Cluster MergedClu; @@ -762,9 +761,9 @@ edm4hep::Cluster ArborToolLCIO::NaiveMergeClu(std::vector<edm4hep::ConstCluster> -std::vector<edm4hep::ConstCluster> ArborToolLCIO::ClusterAbsorbtion( std::vector<edm4hep::ConstCluster> MainClusters, std::vector<edm4hep::ConstCluster> FragClusters, float DisThreshold, float DepthSlope ) //ProjectiveDis +std::vector<edm4hep::Cluster> ArborToolLCIO::ClusterAbsorbtion( std::vector<edm4hep::Cluster> MainClusters, std::vector<edm4hep::Cluster> FragClusters, float DisThreshold, float DepthSlope ) //ProjectiveDis { - std::vector<edm4hep::ConstCluster> outputClusterVec; + std::vector<edm4hep::Cluster> outputClusterVec; int N_Core = MainClusters.size(); int N_frag = FragClusters.size(); @@ -805,7 +804,7 @@ std::vector<edm4hep::ConstCluster> ArborToolLCIO::ClusterAbsorbtion( std::vector } int N_frag_core_links = Frag_Core_Links.size(); - std::vector<edm4hep::ConstCluster> tomerge_clu; + std::vector<edm4hep::Cluster> tomerge_clu; for(int i4 = 0; i4 < N_Core; i4 ++) { @@ -824,7 +823,7 @@ std::vector<edm4hep::ConstCluster> ArborToolLCIO::ClusterAbsorbtion( std::vector } } auto a_mergedfrag_core = NaiveMergeClu(tomerge_clu); - edm4hep::ConstCluster a_mergedfrag_coreCon=a_mergedfrag_core; + edm4hep::Cluster a_mergedfrag_coreCon=a_mergedfrag_core; outputClusterVec.push_back(a_mergedfrag_core); } @@ -842,7 +841,7 @@ std::vector<edm4hep::ConstCluster> ArborToolLCIO::ClusterAbsorbtion( std::vector } -edm4hep::ClusterCollection* ArborToolLCIO::ClusterVecMerge( std::vector<edm4hep::ConstCluster> inputClusters, TMatrixF ConnectorMatrix, DataHandle<edm4hep::ClusterCollection>& clucol ) +edm4hep::ClusterCollection* ArborToolLCIO::ClusterVecMerge( std::vector<edm4hep::Cluster> inputClusters, TMatrixF ConnectorMatrix, DataHandle<edm4hep::ClusterCollection>& clucol ) { edm4hep::ClusterCollection* mergedbranches = clucol.createAndPut(); @@ -856,11 +855,11 @@ edm4hep::ClusterCollection* ArborToolLCIO::ClusterVecMerge( std::vector<edm4hep: cout<<"Size of Connector Matrix and inputClusterColl is not match"<<endl; } - vector<edm4hep::ConstCluster> branchToMerge; - edm4hep::ConstCluster Mergebranch_A; - edm4hep::ConstCluster Mergebranch_B; - edm4hep::ConstCluster tmpMergebranch; - edm4hep::ConstCluster Mainbranch (0); + vector<edm4hep::Cluster> branchToMerge; + edm4hep::Cluster Mergebranch_A; + edm4hep::Cluster Mergebranch_B; + edm4hep::Cluster tmpMergebranch; + edm4hep::Cluster Mainbranch (0); TVector3 tmpClusterSeedPos, MBSeedPos; @@ -934,7 +933,7 @@ edm4hep::ClusterCollection* ArborToolLCIO::ClusterVecMerge( std::vector<edm4hep: return mergedbranches; } -int ArborToolLCIO::JointsBetweenBush(edm4hep::ConstCluster a_Clu, edm4hep::ConstCluster b_Clu, float CellSize) +int ArborToolLCIO::JointsBetweenBush(edm4hep::Cluster a_Clu, edm4hep::Cluster b_Clu, float CellSize) { int NJoint = 0; int a_CluSize = a_Clu.hits_size(); @@ -964,7 +963,7 @@ int ArborToolLCIO::JointsBetweenBush(edm4hep::ConstCluster a_Clu, edm4hep::Const } -float* ArborToolLCIO::SimpleDisTrackClu( edm4hep::ConstTrack a_trk, edm4hep::ConstCluster a_clu) +float* ArborToolLCIO::SimpleDisTrackClu( edm4hep::Track a_trk, edm4hep::Cluster a_clu) { float* Distance = new float[3]; Distance[0] = 1.0E9; @@ -995,7 +994,7 @@ float* ArborToolLCIO::SimpleDisTrackClu( edm4hep::ConstTrack a_trk, edm4hep::Con return Distance; } -float ArborToolLCIO::SimpleBushTimeTrackClu(edm4hep::ConstTrack a_trk, edm4hep::ConstCluster a_clu) +float ArborToolLCIO::SimpleBushTimeTrackClu(edm4hep::Track a_trk, edm4hep::Cluster a_clu) { float Distance = 1.0E9; float Time = 0; @@ -1020,7 +1019,7 @@ float ArborToolLCIO::SimpleBushTimeTrackClu(edm4hep::ConstTrack a_trk, edm4hep:: return Time; } -int ArborToolLCIO::SimpleBushNC(edm4hep::ConstTrack a_trk, edm4hep::ConstCluster a_clu) +int ArborToolLCIO::SimpleBushNC(edm4hep::Track a_trk, edm4hep::Cluster a_clu) { float Distance = 1.0E9; //float Time = 0; @@ -1049,7 +1048,7 @@ int ArborToolLCIO::SimpleBushNC(edm4hep::ConstTrack a_trk, edm4hep::ConstCluste return NC; } -int ArborToolLCIO::ClusterFlag(edm4hep::ConstCluster a_tree, edm4hep::ConstTrack a_trk) +int ArborToolLCIO::ClusterFlag(edm4hep::Cluster a_tree, edm4hep::Track a_trk) { // give each charged core cluster a flag // Fragmentation: 999 @@ -1110,26 +1109,26 @@ int ArborToolLCIO::ClusterFlag(edm4hep::ConstCluster a_tree, edm4hep::ConstTrack EEClu_L10 = 0; - std::vector<edm4hep::ConstCalorimeterHit> Ecalhits; - std::vector<edm4hep::ConstCalorimeterHit> Hcalhits; - std::vector<edm4hep::ConstCalorimeterHit> allhits; - std::vector<edm4hep::ConstCalorimeterHit> EH_1; - std::vector<edm4hep::ConstCalorimeterHit> EH_2; - std::vector<edm4hep::ConstCalorimeterHit> EH_3; - std::vector<edm4hep::ConstCalorimeterHit> EH_4; - std::vector<edm4hep::ConstCalorimeterHit> EH_5; - std::vector<edm4hep::ConstCalorimeterHit> EH_6; - std::vector<edm4hep::ConstCalorimeterHit> HH_1; - std::vector<edm4hep::ConstCalorimeterHit> HH_2; - std::vector<edm4hep::ConstCalorimeterHit> HH_3; - std::vector<edm4hep::ConstCalorimeterHit> HH_4; - std::vector<edm4hep::ConstCalorimeterHit> HH_5; - std::vector<edm4hep::ConstCalorimeterHit> HH_6; - std::vector<edm4hep::ConstCalorimeterHit> HH_7; - std::vector<edm4hep::ConstCalorimeterHit> HH_8; - std::vector<edm4hep::ConstCalorimeterHit> HH_9; - std::vector<edm4hep::ConstCalorimeterHit> HH_0; - std::vector<edm4hep::ConstCalorimeterHit> Ecalf10hits; + std::vector<edm4hep::CalorimeterHit> Ecalhits; + std::vector<edm4hep::CalorimeterHit> Hcalhits; + std::vector<edm4hep::CalorimeterHit> allhits; + std::vector<edm4hep::CalorimeterHit> EH_1; + std::vector<edm4hep::CalorimeterHit> EH_2; + std::vector<edm4hep::CalorimeterHit> EH_3; + std::vector<edm4hep::CalorimeterHit> EH_4; + std::vector<edm4hep::CalorimeterHit> EH_5; + std::vector<edm4hep::CalorimeterHit> EH_6; + std::vector<edm4hep::CalorimeterHit> HH_1; + std::vector<edm4hep::CalorimeterHit> HH_2; + std::vector<edm4hep::CalorimeterHit> HH_3; + std::vector<edm4hep::CalorimeterHit> HH_4; + std::vector<edm4hep::CalorimeterHit> HH_5; + std::vector<edm4hep::CalorimeterHit> HH_6; + std::vector<edm4hep::CalorimeterHit> HH_7; + std::vector<edm4hep::CalorimeterHit> HH_8; + std::vector<edm4hep::CalorimeterHit> HH_9; + std::vector<edm4hep::CalorimeterHit> HH_0; + std::vector<edm4hep::CalorimeterHit> Ecalf10hits; @@ -1531,7 +1530,7 @@ int ArborToolLCIO::ClusterFlag(edm4hep::ConstCluster a_tree, edm4hep::ConstTrack } -int ArborToolLCIO::ActiveLayers( std::vector<edm4hep::ConstCalorimeterHit> clu ) +int ArborToolLCIO::ActiveLayers( std::vector<edm4hep::CalorimeterHit> clu ) { std::vector<int> hitlayers; hitlayers.clear(); @@ -1560,7 +1559,7 @@ int ArborToolLCIO::ActiveLayers( std::vector<edm4hep::ConstCalorimeterHit> clu } -float ArborToolLCIO::ClusterT0(edm4hep::ConstCluster a_Clu) +float ArborToolLCIO::ClusterT0(edm4hep::Cluster a_Clu) { float T0 = 1E9; float tmpTime = 0; @@ -1580,7 +1579,7 @@ float ArborToolLCIO::ClusterT0(edm4hep::ConstCluster a_Clu) } -int ArborToolLCIO::newPhotonTag(edm4hep::ConstCluster a_clu) +int ArborToolLCIO::newPhotonTag(edm4hep::Cluster a_clu) { int flag=0; @@ -1606,7 +1605,7 @@ int ArborToolLCIO::newPhotonTag(edm4hep::ConstCluster a_clu) } -int ArborToolLCIO::ClusterFlag1st(edm4hep::ConstCluster a_tree) +int ArborToolLCIO::ClusterFlag1st(edm4hep::Cluster a_tree) { int ClusterID = 211; int EcalNHit, HcalNHit, NH_ECALF10; @@ -1627,10 +1626,10 @@ int ArborToolLCIO::ClusterFlag1st(edm4hep::ConstCluster a_tree) maxDepth = -100; minDepth = 1E6; - std::vector<edm4hep::ConstCalorimeterHit> allhits; - std::vector<edm4hep::ConstCalorimeterHit> Ecalhits; - std::vector<edm4hep::ConstCalorimeterHit> Hcalhits; - std::vector<edm4hep::ConstCalorimeterHit> Ecalf10hits; + std::vector<edm4hep::CalorimeterHit> allhits; + std::vector<edm4hep::CalorimeterHit> Ecalhits; + std::vector<edm4hep::CalorimeterHit> Hcalhits; + std::vector<edm4hep::CalorimeterHit> Ecalf10hits; allhits.clear(); Ecalhits.clear(); @@ -1804,7 +1803,7 @@ int ArborToolLCIO::ClusterFlag1st(edm4hep::ConstCluster a_tree) return ClusterID; } -float ArborToolLCIO::ClusterEE(edm4hep::ConstCluster inputCluster) +float ArborToolLCIO::ClusterEE(edm4hep::Cluster inputCluster) { float ClusterEnergy = 0; float tmpCluEn = 0; @@ -1857,7 +1856,7 @@ float ArborToolLCIO::ClusterEE(edm4hep::ConstCluster inputCluster) } -float ArborToolLCIO::EMClusterEE( edm4hep::ConstCluster inputCluster ) +float ArborToolLCIO::EMClusterEE( edm4hep::Cluster inputCluster ) { float aaa = -50.2288, ab = 219.398,ac =0.17679,ad = 0.00241144; float ba = -56.6164,bbb = 162.647,bc = 0.679974,bd = 0.00423267,be = -0.324786; @@ -1945,7 +1944,7 @@ float ArborToolLCIO::EMClusterEE( edm4hep::ConstCluster inputCluster ) return EMC; } -std::vector<float> ArborToolLCIO::ClusterTime(edm4hep::ConstCluster inputCluster) +std::vector<float> ArborToolLCIO::ClusterTime(edm4hep::Cluster inputCluster) { std::vector<float> CluTimeVector; CluTimeVector.clear(); diff --git a/Reconstruction/PFA/Arbor/src/ArborToolLCIO.hh b/Reconstruction/PFA/Arbor/src/ArborToolLCIO.hh index d3aaeea19c0d37a5fb7c3062c6ce72f74bbf3f72..b97e3839845e1ae80cb548457647283a5475c9b3 100644 --- a/Reconstruction/PFA/Arbor/src/ArborToolLCIO.hh +++ b/Reconstruction/PFA/Arbor/src/ArborToolLCIO.hh @@ -39,7 +39,7 @@ public: CollectionMaps(); void clear(); std::map<std::string, std::vector<edm4hep::MCParticle> > collectionMap_MC; - std::map<std::string, std::vector<edm4hep::ConstCalorimeterHit> > collectionMap_CaloHit; + std::map<std::string, std::vector<edm4hep::CalorimeterHit> > collectionMap_CaloHit; std::map<std::string, std::vector<edm4hep::Vertex> > collectionMap_Vertex; std::map<std::string, std::vector<edm4hep::Track> > collectionMap_Track; std::map<std::string, std::vector<edm4hep::MCRecoCaloAssociation> > collectionMap_CaloRel; @@ -58,65 +58,65 @@ class ArborToolLCIO : public GaudiAlgorithm void Clean(); - void ClusterBuilding(DataHandle<edm4hep::ClusterCollection>& _currbranchcoll, std::vector<edm4hep::ConstCalorimeterHit> Hits, branchcoll BranchOrder, int DHCALFlag); + void ClusterBuilding(DataHandle<edm4hep::ClusterCollection>& _currbranchcoll, std::vector<edm4hep::CalorimeterHit> Hits, branchcoll BranchOrder, int DHCALFlag); - float ClusterT0(edm4hep::ConstCluster a_Clu); + float ClusterT0(edm4hep::Cluster a_Clu); - int NHScaleV2( std::vector<edm4hep::ConstCalorimeterHit> clu0, int RatioX, int RatioY, int RatioZ ); - float FDV2( std::vector<edm4hep::ConstCalorimeterHit> clu); + int NHScaleV2( std::vector<edm4hep::CalorimeterHit> clu0, int RatioX, int RatioY, int RatioZ ); + float FDV2( std::vector<edm4hep::CalorimeterHit> clu); - int NHScaleV3( edm4hep::ConstCluster clu0, int RatioX, int RatioY, int RatioZ ); + int NHScaleV3( edm4hep::Cluster clu0, int RatioX, int RatioY, int RatioZ ); - float FDV3( edm4hep::ConstCluster clu); + float FDV3( edm4hep::Cluster clu); - int ActiveLayers( std::vector<edm4hep::ConstCalorimeterHit> clu ); + int ActiveLayers( std::vector<edm4hep::CalorimeterHit> clu ); - float BushDis( edm4hep::ConstCluster clu1, edm4hep::ConstCluster clu2); + float BushDis( edm4hep::Cluster clu1, edm4hep::Cluster clu2); - float* SimpleDisTrackClu(edm4hep::ConstTrack a_trk, edm4hep::ConstCluster a_clu); + float* SimpleDisTrackClu(edm4hep::Track a_trk, edm4hep::Cluster a_clu); - float SimpleBushTimeTrackClu(edm4hep::ConstTrack a_trk, edm4hep::ConstCluster a_clu); + float SimpleBushTimeTrackClu(edm4hep::Track a_trk, edm4hep::Cluster a_clu); - int SimpleBushNC(edm4hep::ConstTrack a_trk, edm4hep::ConstCluster a_clu); + int SimpleBushNC(edm4hep::Track a_trk, edm4hep::Cluster a_clu); - float DisPointToBush( TVector3 Pos1, edm4hep::ConstCluster clu1); + float DisPointToBush( TVector3 Pos1, edm4hep::Cluster clu1); - TVector3 ClusterCoG(edm4hep::ConstCluster inputCluser); + TVector3 ClusterCoG(edm4hep::Cluster inputCluser); - edm4hep::ClusterCollection* ClusterVecMerge( std::vector<edm4hep::ConstCluster> inputClusters, TMatrixF ConnectorMatrix, DataHandle<edm4hep::ClusterCollection>& clucol ); + edm4hep::ClusterCollection* ClusterVecMerge( std::vector<edm4hep::Cluster> inputClusters, TMatrixF ConnectorMatrix, DataHandle<edm4hep::ClusterCollection>& clucol ); - edm4hep::ClusterCollection* ClusterVecColl( std::vector<edm4hep::ConstCluster> inputClusters, DataHandle<edm4hep::ClusterCollection>& m_clucol); + edm4hep::ClusterCollection* ClusterVecColl( std::vector<edm4hep::Cluster> inputClusters, DataHandle<edm4hep::ClusterCollection>& m_clucol); - edm4hep::Cluster NaiveCluImpl(edm4hep::ConstCluster a0_clu); - void NaiveCluConst(edm4hep::ConstCluster a0_clu, edm4hep::Cluster); + edm4hep::Cluster NaiveCluImpl(edm4hep::Cluster a0_clu); + void NaiveCluConst(edm4hep::Cluster a0_clu, edm4hep::Cluster); - std::vector<edm4hep::ConstCluster> CollClusterVec(const edm4hep::ClusterCollection * input_coll ); + std::vector<edm4hep::Cluster> CollClusterVec(const edm4hep::ClusterCollection * input_coll ); - std::vector<edm4hep::ConstCalorimeterHit> CollHitVec(const edm4hep::CalorimeterHitCollection * input_coll, float EnergyThreshold); + std::vector<edm4hep::CalorimeterHit> CollHitVec(const edm4hep::CalorimeterHitCollection * input_coll, float EnergyThreshold); - std::vector<edm4hep::Cluster> ClusterHitAbsorbtion( std::vector<edm4hep::ConstCluster> MainClusters, std::vector<edm4hep::ConstCalorimeterHit> IsoHits, float DisThreshold ); + std::vector<edm4hep::Cluster> ClusterHitAbsorbtion( std::vector<edm4hep::Cluster> MainClusters, std::vector<edm4hep::CalorimeterHit> IsoHits, float DisThreshold ); - edm4hep::Cluster NaiveMergeClu(std::vector<edm4hep::ConstCluster> inputCluVec); + edm4hep::Cluster NaiveMergeClu(std::vector<edm4hep::Cluster> inputCluVec); - void NaiveMergeCluConst(std::vector<edm4hep::ConstCluster> inputCluVec,edm4hep::Cluster MergedClu); - std::vector<edm4hep::ConstCluster> ClusterAbsorbtion( std::vector<edm4hep::ConstCluster> MainClusters, std::vector<edm4hep::ConstCluster> FragClusters, float thresholds, float DepthSlope ); + void NaiveMergeCluConst(std::vector<edm4hep::Cluster> inputCluVec,edm4hep::Cluster MergedClu); + std::vector<edm4hep::Cluster> ClusterAbsorbtion( std::vector<edm4hep::Cluster> MainClusters, std::vector<edm4hep::Cluster> FragClusters, float thresholds, float DepthSlope ); - int JointsBetweenBush(edm4hep::ConstCluster a_Clu, edm4hep::ConstCluster b_Clu, float CellSize); + int JointsBetweenBush(edm4hep::Cluster a_Clu, edm4hep::Cluster b_Clu, float CellSize); - TVector3 CluEndP(edm4hep::ConstCluster a_clu); + TVector3 CluEndP(edm4hep::Cluster a_clu); - int ClusterFlag(edm4hep::ConstCluster a_tree, edm4hep::ConstTrack a_trk); + int ClusterFlag(edm4hep::Cluster a_tree, edm4hep::Track a_trk); - int ClusterFlag1st(edm4hep::ConstCluster a_tree); + int ClusterFlag1st(edm4hep::Cluster a_tree); - int newPhotonTag(edm4hep::ConstCluster a_clu); - float ClusterEE(edm4hep::ConstCluster inputCluster); + int newPhotonTag(edm4hep::Cluster a_clu); + float ClusterEE(edm4hep::Cluster inputCluster); - float EMClusterEE( edm4hep::ConstCluster inputCluster ); + float EMClusterEE( edm4hep::Cluster inputCluster ); - std::vector<float> ClusterTime(edm4hep::ConstCluster inputCluster); + std::vector<float> ClusterTime(edm4hep::Cluster inputCluster); private: SmartIF<IGeomSvc> m_geosvc;//=service<IGeomSvc>("GeomSvc"); diff --git a/Reconstruction/PFA/Arbor/src/MarlinArbor.cc b/Reconstruction/PFA/Arbor/src/MarlinArbor.cc index e8b6e7d21cf5ba1d69b655292d13dab780da146e..fb930a683b1f6fb98db07028e453d2f8fc08a5dc 100755 --- a/Reconstruction/PFA/Arbor/src/MarlinArbor.cc +++ b/Reconstruction/PFA/Arbor/src/MarlinArbor.cc @@ -8,7 +8,6 @@ #include "Gaudi/Property.h" #include "edm4hep/EventHeader.h" #include "edm4hep/EventHeaderCollection.h" -#include "edm4hep/SimCalorimeterHitConst.h" #include "edm4hep/SimCalorimeterHit.h" #include "edm4hep/CalorimeterHit.h" #include "edm4hep/CalorimeterHitCollection.h" @@ -95,7 +94,7 @@ void MarlinArbor::HitsPreparation() cout<<"Start to prepare Hits"<<endl; } -void MarlinArbor::MakeIsoHits( std::vector<edm4hep::ConstCalorimeterHit> inputCaloHits, DataHandle<edm4hep::CalorimeterHitCollection>& m_hitcol) +void MarlinArbor::MakeIsoHits( std::vector<edm4hep::CalorimeterHit> inputCaloHits, DataHandle<edm4hep::CalorimeterHitCollection>& m_hitcol) { edm4hep::CalorimeterHitCollection* isohitcoll = m_hitcol.createAndPut(); @@ -124,9 +123,9 @@ StatusCode MarlinArbor::execute() std::vector< TVector3 > inputHitsPos; std::vector< ArborHit > inputABHit; - std::vector< edm4hep::ConstCalorimeterHit > inputHits; - std::vector< edm4hep::ConstCalorimeterHit > inputECALHits; - std::vector< edm4hep::ConstCalorimeterHit > inputHCALHits; + std::vector< edm4hep::CalorimeterHit > inputHits; + std::vector< edm4hep::CalorimeterHit > inputECALHits; + std::vector< edm4hep::CalorimeterHit > inputHCALHits; std::vector< std::vector<int> > Sequence; int LayerNum = 0; int StaveNum = 0; @@ -134,7 +133,7 @@ StatusCode MarlinArbor::execute() float Depth = 0; int KShift = 0; TVector3 TrkEndPointPos; - std::vector<edm4hep::ConstCalorimeterHit> IsoHits; + std::vector<edm4hep::CalorimeterHit> IsoHits; for(unsigned int i1 = 0; i1 < _calCollections.size(); i1++) { diff --git a/Reconstruction/PFA/Arbor/src/MarlinArbor.hh b/Reconstruction/PFA/Arbor/src/MarlinArbor.hh index 5f8a144494a3131c6bb4a4e7a732182e0b825833..e768ea3ff207d0dd91bbb8e1a5ddec1766190c8a 100644 --- a/Reconstruction/PFA/Arbor/src/MarlinArbor.hh +++ b/Reconstruction/PFA/Arbor/src/MarlinArbor.hh @@ -9,7 +9,6 @@ #include "Gaudi/Property.h" #include "edm4hep/EventHeader.h" #include "edm4hep/EventHeaderCollection.h" -#include "edm4hep/SimCalorimeterHitConst.h" #include "edm4hep/SimCalorimeterHit.h" #include "edm4hep/CalorimeterHit.h" #include "edm4hep/CalorimeterHitCollection.h" @@ -57,7 +56,7 @@ class MarlinArbor : public GaudiAlgorithm virtual StatusCode finalize() ; void HitsPreparation(); // LCEvent * evtP); - void MakeIsoHits(std::vector<edm4hep::ConstCalorimeterHit> inputCaloHits, DataHandle<edm4hep::CalorimeterHitCollection>& m_isohitcol); + void MakeIsoHits(std::vector<edm4hep::CalorimeterHit> inputCaloHits, DataHandle<edm4hep::CalorimeterHitCollection>& m_isohitcol); protected: std::string _colName; std::vector<std::string> _CalCollections; diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/CaloHitCreator.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/CaloHitCreator.h index 7be4f3eda09de92d827794c49f94d740a838b41d..87debdd87da87e2e46ae6305103e421e00ac03f2 100644 --- a/Reconstruction/PFA/Pandora/GaudiPandora/include/CaloHitCreator.h +++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/CaloHitCreator.h @@ -25,7 +25,7 @@ #include <string> -typedef std::vector<edm4hep::ConstCalorimeterHit *> CalorimeterHitVector; +typedef std::vector<edm4hep::CalorimeterHit *> CalorimeterHitVector; namespace gear { class GearMgr; } @@ -174,25 +174,25 @@ private: * @brief Get common calo hit properties: position, parent address, input energy and time * */ - void GetCommonCaloHitProperties(edm4hep::ConstCalorimeterHit *const pCaloHit, PandoraApi::CaloHit::Parameters &caloHitParameters) const; + void GetCommonCaloHitProperties(edm4hep::CalorimeterHit *const pCaloHit, PandoraApi::CaloHit::Parameters &caloHitParameters) const; /** * @brief Get end cap specific calo hit properties: cell size, absorber radiation and interaction lengths, normal vector * */ - void GetEndCapCaloHitProperties(edm4hep::ConstCalorimeterHit *const pCaloHit, const gear::LayerLayout &layerLayout, + void GetEndCapCaloHitProperties(edm4hep::CalorimeterHit *const pCaloHit, const gear::LayerLayout &layerLayout, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const; - void GetEndCapCaloHitProperties(edm4hep::ConstCalorimeterHit *const pCaloHit, const std::vector<dd4hep::rec::LayeredCalorimeterStruct::Layer> &layers, + void GetEndCapCaloHitProperties(edm4hep::CalorimeterHit *const pCaloHit, const std::vector<dd4hep::rec::LayeredCalorimeterStruct::Layer> &layers, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const; /** * @brief Get barrel specific calo hit properties: cell size, absorber radiation and interaction lengths, normal vector * */ - void GetBarrelCaloHitProperties(edm4hep::ConstCalorimeterHit *const pCaloHit, const gear::LayerLayout &layerLayout, + void GetBarrelCaloHitProperties(edm4hep::CalorimeterHit *const pCaloHit, const gear::LayerLayout &layerLayout, unsigned int barrelSymmetryOrder, float barrelPhi0, unsigned int staveNumber, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const; - void GetBarrelCaloHitProperties(edm4hep::ConstCalorimeterHit *const pCaloHit, const std::vector<dd4hep::rec::LayeredCalorimeterStruct::Layer> &layers, + void GetBarrelCaloHitProperties(edm4hep::CalorimeterHit *const pCaloHit, const std::vector<dd4hep::rec::LayeredCalorimeterStruct::Layer> &layers, unsigned int barrelSymmetryOrder, float barrelPhi0, unsigned int staveNumber, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const; @@ -200,13 +200,13 @@ private: * @brief Get number of active layers from position of a calo hit to the edge of the detector * */ - int GetNLayersFromEdge(edm4hep::ConstCalorimeterHit *const pCaloHit) const; + int GetNLayersFromEdge(edm4hep::CalorimeterHit *const pCaloHit) const; /** * @brief Get the maximum radius of a calo hit in a polygonal detector structure * */ - float GetMaximumRadius(edm4hep::ConstCalorimeterHit *const pCaloHit, const unsigned int symmetryOrder, const float phi0) const; + float GetMaximumRadius(edm4hep::CalorimeterHit *const pCaloHit, const unsigned int symmetryOrder, const float phi0) const; /** * @brief Get the layer coding string from the provided cell id encoding string diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/MCParticleCreator.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/MCParticleCreator.h index 90281ef238e4b9eaad4b94814e2e29f5e66d9deb..ba37ad54820b5970d0da2ee150d42b57d2987ea4 100644 --- a/Reconstruction/PFA/Pandora/GaudiPandora/include/MCParticleCreator.h +++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/MCParticleCreator.h @@ -78,7 +78,7 @@ private: const Settings m_settings; ///< The mc particle creator settings const pandora::Pandora *m_pPandora; ///< Address of the pandora object to create the mc particles const float m_bField; ///< The bfield - std::map<unsigned int, edm4hep::ConstMCParticle*>* m_id_pMC_map; + std::map<unsigned int, edm4hep::MCParticle*>* m_id_pMC_map; }; inline void MCParticleCreator::Reset() diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h index 7f6b57d2aa0ff26dae5b450d5da1a976f264c217..6a7a1bacfe9a26b462c645215dcc63370707d35a 100644 --- a/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h +++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h @@ -54,12 +54,12 @@ class CollectionMaps public: CollectionMaps(); void clear(); - std::map<std::string, std::vector<edm4hep::ConstMCParticle> > collectionMap_MC; - std::map<std::string, std::vector<edm4hep::ConstCalorimeterHit> > collectionMap_CaloHit; - std::map<std::string, std::vector<edm4hep::ConstVertex> > collectionMap_Vertex; - std::map<std::string, std::vector<edm4hep::ConstTrack> > collectionMap_Track; - std::map<std::string, std::vector<edm4hep::ConstMCRecoCaloAssociation> > collectionMap_CaloRel; - std::map<std::string, std::vector<edm4hep::ConstMCRecoTrackerAssociation> > collectionMap_TrkRel; + std::map<std::string, std::vector<edm4hep::MCParticle> > collectionMap_MC; + std::map<std::string, std::vector<edm4hep::CalorimeterHit> > collectionMap_CaloHit; + std::map<std::string, std::vector<edm4hep::Vertex> > collectionMap_Vertex; + std::map<std::string, std::vector<edm4hep::Track> > collectionMap_Track; + std::map<std::string, std::vector<edm4hep::MCRecoCaloAssociation> > collectionMap_CaloRel; + std::map<std::string, std::vector<edm4hep::MCRecoTrackerAssociation> > collectionMap_TrkRel; }; diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/TrackCreator.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/TrackCreator.h index 1094a3dd7803c140a008ba109855e2f2d4a3db37..b8b8ec1844545b8ea0456a5f95b284e58e58eaf3 100644 --- a/Reconstruction/PFA/Pandora/GaudiPandora/include/TrackCreator.h +++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/TrackCreator.h @@ -13,9 +13,7 @@ #include "GaudiKernel/ISvcLocator.h" #include "edm4hep/Track.h" -#include "edm4hep/TrackConst.h" #include "edm4hep/TrackState.h" -#include "edm4hep/ReconstructedParticleConst.h" #include "Api/PandoraApi.h" #include "Objects/Helix.h" @@ -24,9 +22,9 @@ namespace gear { class GearMgr; } class CollectionMaps; -typedef std::vector<edm4hep::ConstTrack *> TrackVector; +typedef std::vector<edm4hep::Track *> TrackVector; typedef std::set<unsigned int> TrackList; -typedef std::map<edm4hep::ConstTrack, int> TrackToPidMap; +typedef std::map<edm4hep::Track, int> TrackToPidMap; /* inline LCCollectionVec *newTrkCol(const std::string &name, LCEvent *evt , bool isSubset) { @@ -125,7 +123,7 @@ public: */ pandora::StatusCode CreateTrackAssociations(const CollectionMaps& collectionMaps); - edm4hep::ConstTrack* GetTrackAddress(const CollectionMaps& collectionMaps, const edm4hep::ConstTrack& pTrack ); + edm4hep::Track* GetTrackAddress(const CollectionMaps& collectionMaps, const edm4hep::Track& pTrack ); /** * @brief Create tracks, insert user code here * @@ -172,7 +170,7 @@ private: * * @param trackVec the vector of tracks associated with the vertex */ - bool IsConflictingRelationship(const edm4hep::ConstReconstructedParticle &Particle) const; + bool IsConflictingRelationship(const edm4hep::ReconstructedParticle &Particle) const; /** * @brief Whether a track is a v0 track @@ -198,7 +196,7 @@ private: * @brief Copy track states stored in tracks to pandora track parameters * */ - void GetTrackStates(edm4hep::ConstTrack *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; + void GetTrackStates(edm4hep::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; /** * @brief Copy track state from track state instance to pandora input track state @@ -210,13 +208,13 @@ private: * @brief Obtain track time when it reaches ECAL * */ - float CalculateTrackTimeAtCalorimeter(edm4hep::ConstTrack *const pTrack) const; + float CalculateTrackTimeAtCalorimeter(edm4hep::Track *const pTrack) const; /** * @brief Decide whether track reaches the ecal surface * */ - void TrackReachesECAL(edm4hep::ConstTrack *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; + void TrackReachesECAL(edm4hep::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; /** * @brief Determine whether a track can be used to form a pfo under the following conditions: @@ -224,7 +222,7 @@ private: * 2) if the track proves to have no cluster associations * */ - void DefineTrackPfoUsage(edm4hep::ConstTrack *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; + void DefineTrackPfoUsage(edm4hep::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; /** * @brief Whether track passes the quality cuts required in order to be used to form a pfo @@ -232,19 +230,19 @@ private: * * @return boolean */ - bool PassesQualityCuts(edm4hep::ConstTrack *const pTrack, const PandoraApi::Track::Parameters &trackParameters) const; + bool PassesQualityCuts(edm4hep::Track *const pTrack, const PandoraApi::Track::Parameters &trackParameters) const; /** * @brief Get number of hits in TPC of a track * */ - int GetNTpcHits(edm4hep::ConstTrack *const pTrack) const; + int GetNTpcHits(edm4hep::Track *const pTrack) const; /** * @brief Get number of hits in FTD of a track * */ - int GetNFtdHits(edm4hep::ConstTrack *const pTrack) const; + int GetNFtdHits(edm4hep::Track *const pTrack) const; const Settings m_settings; ///< The track creator settings const pandora::Pandora *m_pPandora; ///< Address of the pandora object to create tracks and track relationships diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/MCParticleCreator.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/MCParticleCreator.cpp index ce8b42d8519f51ec472103c402c41a0088b0e776..ef457a7b4a0691bd0df5666d59709efa87272844 100644 --- a/Reconstruction/PFA/Pandora/GaudiPandora/src/MCParticleCreator.cpp +++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/MCParticleCreator.cpp @@ -6,14 +6,10 @@ */ -#include "edm4hep/MCParticleConst.h" #include "edm4hep/MCParticle.h" #include "edm4hep/MCRecoCaloAssociation.h" -#include "edm4hep/SimCalorimeterHitConst.h" -#include "edm4hep/CaloHitContributionConst.h" #include "edm4hep/Track.h" #include "edm4hep/MCRecoTrackerAssociation.h" -#include "edm4hep/SimTrackerHitConst.h" #include "PandoraPFAlg.h" #include "MCParticleCreator.h" @@ -26,7 +22,7 @@ MCParticleCreator::MCParticleCreator(const Settings &settings, const pandora::Pa m_pPandora(pPandora), m_bField(settings.m_bField) { -m_id_pMC_map = new std::map<unsigned int, edm4hep::ConstMCParticle*>; +m_id_pMC_map = new std::map<unsigned int, edm4hep::MCParticle*>; } //------------------------------------------------------------------------------------------------------------------------------------------ @@ -70,7 +66,7 @@ pandora::StatusCode MCParticleCreator::CreateMCParticles(const CollectionMaps& c PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::MCParticle::Create(*m_pPandora, mcParticleParameters)); // Create parent-daughter relationships - for(std::vector<edm4hep::ConstMCParticle>::const_iterator itDaughter = pMcParticle.daughters_begin(), + for(std::vector<edm4hep::MCParticle>::const_iterator itDaughter = pMcParticle.daughters_begin(), itDaughterEnd = pMcParticle.daughters_end(); itDaughter != itDaughterEnd; ++itDaughter) { for (int ida = 0; ida < pMCParticleCollection.size(); ida++) @@ -108,7 +104,7 @@ pandora::StatusCode MCParticleCreator::CreateMCParticles(const CollectionMaps& c pandora::StatusCode MCParticleCreator::CreateCaloHitToMCParticleRelationships(const CollectionMaps& collectionMaps, const CalorimeterHitVector &calorimeterHitVector) const { - typedef std::map<edm4hep::ConstMCParticle *, float> MCParticleToEnergyWeightMap; + typedef std::map<edm4hep::MCParticle *, float> MCParticleToEnergyWeightMap; MCParticleToEnergyWeightMap mcParticleToEnergyWeightMap; for (StringVector::const_iterator iter = m_settings.m_CaloHitRelationCollections.begin(), iterEnd = m_settings.m_CaloHitRelationCollections.end(); @@ -177,7 +173,7 @@ pandora::StatusCode MCParticleCreator::CreateTrackToMCParticleRelationships(cons const pandora::Helix helixFit(pTrack->getTrackStates(0).phi, pTrack->getTrackStates(0).D0, pTrack->getTrackStates(0).Z0, pTrack->getTrackStates(0).omega, pTrack->getTrackStates(0).tanLambda, m_bField); const float recoMomentum(helixFit.GetMomentum().GetMagnitude()); // Use momentum magnitude to identify best mc particle - edm4hep::ConstMCParticle *pBestMCParticle = NULL; + edm4hep::MCParticle *pBestMCParticle = NULL; float bestDeltaMomentum(std::numeric_limits<float>::max()); try { diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp index 0e16f4e61e09dc01e9913d8349585045f99a3ec7..cfe8f2f25f1906723527534f6ec3154616c752c7 100644 --- a/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp +++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp @@ -5,7 +5,6 @@ #include "edm4hep/Vector3d.h" #include "edm4hep/SimCalorimeterHit.h" #include "edm4hep/CaloHitContribution.h" -#include "edm4hep/ClusterConst.h" #include <cmath> #include <algorithm> #include "gear/BField.h" @@ -653,16 +652,16 @@ StatusCode PandoraPFAlg::CreateMCRecoParticleAssociation() const edm4hep::ReconstructedParticleCollection* reco_col = m_ReconstructedParticleCollection_w.get(); for(int i=0; i<reco_col->size();i++) { - std::map<int, edm4hep::ConstMCParticle> mc_map; + std::map<int, edm4hep::MCParticle> mc_map; std::map<int, float > id_edep_map; float tot_en = 0 ; auto pReco = reco_col->at(i); for(int j=0; j < pReco.clusters_size(); j++) { - edm4hep::ConstCluster cluster = pReco.getClusters(j); + edm4hep::Cluster cluster = pReco.getClusters(j); for(int k=0; k < cluster.hits_size(); k++) { - edm4hep::ConstCalorimeterHit hit = cluster.getHits(k); + edm4hep::CalorimeterHit hit = cluster.getHits(k); for(auto iter = m_CollectionMaps->collectionMap_CaloRel.begin(); iter != m_CollectionMaps->collectionMap_CaloRel.end(); iter++) { for(auto it = iter->second.begin(); it != iter->second.end(); it ++) @@ -681,7 +680,7 @@ StatusCode PandoraPFAlg::CreateMCRecoParticleAssociation() } for(auto it = mc_map.begin(); it != mc_map.end(); it ++) { - edm4hep::MCRecoParticleAssociation association = pMCRecoParticleAssociationCollection->create(); + auto association = pMCRecoParticleAssociationCollection->create(); association.setRec(pReco); association.setSim(it->second); if(tot_en==0) diff --git a/Reconstruction/PFA/Pandora/MatrixPandora/include/CaloHitCreator.h b/Reconstruction/PFA/Pandora/MatrixPandora/include/CaloHitCreator.h index cdde80f0b47cd80d43a2ee361991b12c928b5ff0..15278d6f1ce26bc833c54295ca33866215d48a32 100644 --- a/Reconstruction/PFA/Pandora/MatrixPandora/include/CaloHitCreator.h +++ b/Reconstruction/PFA/Pandora/MatrixPandora/include/CaloHitCreator.h @@ -25,7 +25,7 @@ #include <string> -typedef std::vector<edm4hep::ConstCalorimeterHit *> CalorimeterHitVector; +typedef std::vector<edm4hep::CalorimeterHit *> CalorimeterHitVector; namespace gear { class GearMgr; } @@ -165,7 +165,7 @@ private: * @brief Get common calo hit properties: position, parent address, input energy and time * */ - void GetCommonCaloHitProperties(edm4hep::ConstCalorimeterHit *const pCaloHit, PandoraApi::CaloHit::Parameters &caloHitParameters) const; + void GetCommonCaloHitProperties(edm4hep::CalorimeterHit *const pCaloHit, PandoraApi::CaloHit::Parameters &caloHitParameters) const; /** * @brief Get end cap specific calo hit properties: cell size, absorber radiation and interaction lengths, normal vector @@ -175,7 +175,7 @@ private: * @param caloHitParameters the calo hit parameters to populate * @param absorberCorrection to receive the absorber thickness correction for the mip equivalent energy */ - void GetEndCapCaloHitProperties(edm4hep::ConstCalorimeterHit *const pCaloHit, const gear::LayerLayout &layerLayout, + void GetEndCapCaloHitProperties(edm4hep::CalorimeterHit *const pCaloHit, const gear::LayerLayout &layerLayout, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const; /** @@ -189,11 +189,11 @@ private: * @param caloHitParameters the calo hit parameters to populate * @param absorberCorrection to receive the absorber thickness correction for the mip equivalent energy */ - void GetBarrelCaloHitProperties(edm4hep::ConstCalorimeterHit *const pCaloHit, const gear::LayerLayout &layerLayout, + void GetBarrelCaloHitProperties(edm4hep::CalorimeterHit *const pCaloHit, const gear::LayerLayout &layerLayout, unsigned int barrelSymmetryOrder, float barrelPhi0, unsigned int staveNumber, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const; - void GetBarrelCaloHitProperties(edm4hep::ConstCalorimeterHit *const pCaloHit, const std::vector<dd4hep::rec::LayeredCalorimeterData::Layer> &layerLayout, + void GetBarrelCaloHitProperties(edm4hep::CalorimeterHit *const pCaloHit, const std::vector<dd4hep::rec::LayeredCalorimeterData::Layer> &layerLayout, unsigned int barrelSymmetryOrder, float barrelPhi0, unsigned int staveNumber, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const; /** @@ -201,7 +201,7 @@ private: * * @param pCaloHit the lcio calorimeter hit */ - int GetNLayersFromEdge(edm4hep::ConstCalorimeterHit *const pCaloHit) const; + int GetNLayersFromEdge(edm4hep::CalorimeterHit *const pCaloHit) const; /** * @brief Get the maximum radius of a calo hit in a polygonal detector structure @@ -212,10 +212,10 @@ private: * * @return the maximum radius */ - float GetMaximumRadius(edm4hep::ConstCalorimeterHit *const pCaloHit, const unsigned int symmetryOrder, const float phi0) const; + float GetMaximumRadius(edm4hep::CalorimeterHit *const pCaloHit, const unsigned int symmetryOrder, const float phi0) const; - void GetCoding(edm4hep::ConstCalorimeterHit* pCaloHit, long& sys, long& x, long& y, long& z) const ; - int GetBarrelLayer(edm4hep::ConstCalorimeterHit *const pCaloHit, const std::vector<dd4hep::rec::LayeredCalorimeterData::Layer> &layerLayout) const; + void GetCoding(edm4hep::CalorimeterHit* pCaloHit, long& sys, long& x, long& y, long& z) const ; + int GetBarrelLayer(edm4hep::CalorimeterHit *const pCaloHit, const std::vector<dd4hep::rec::LayeredCalorimeterData::Layer> &layerLayout) const; /** * @brief Get the layer coding string from the provided cell id encoding string * diff --git a/Reconstruction/PFA/Pandora/MatrixPandora/include/PandoraMatrixAlg.h b/Reconstruction/PFA/Pandora/MatrixPandora/include/PandoraMatrixAlg.h index 7a11b8137e4e6a564a23c92353d8fc0180c631c2..1c1c96315c5bd36fb6b081b8a7f214dafb14618a 100644 --- a/Reconstruction/PFA/Pandora/MatrixPandora/include/PandoraMatrixAlg.h +++ b/Reconstruction/PFA/Pandora/MatrixPandora/include/PandoraMatrixAlg.h @@ -59,12 +59,12 @@ public: CollectionMaps(); void clear(); - std::map<std::string, std::vector<edm4hep::ConstMCParticle> > collectionMap_MC; - std::map<std::string, std::vector<edm4hep::ConstCalorimeterHit> > collectionMap_CaloHit; - std::map<std::string, std::vector<edm4hep::ConstVertex> > collectionMap_Vertex; - std::map<std::string, std::vector<edm4hep::ConstTrack> > collectionMap_Track; - std::map<std::string, std::vector<edm4hep::ConstMCRecoCaloAssociation> > collectionMap_CaloRel; - std::map<std::string, std::vector<edm4hep::ConstMCRecoTrackerAssociation> > collectionMap_TrkRel; + std::map<std::string, std::vector<edm4hep::MCParticle> > collectionMap_MC; + std::map<std::string, std::vector<edm4hep::CalorimeterHit> > collectionMap_CaloHit; + std::map<std::string, std::vector<edm4hep::Vertex> > collectionMap_Vertex; + std::map<std::string, std::vector<edm4hep::Track> > collectionMap_Track; + std::map<std::string, std::vector<edm4hep::MCRecoCaloAssociation> > collectionMap_CaloRel; + std::map<std::string, std::vector<edm4hep::MCRecoTrackerAssociation> > collectionMap_TrkRel; }; diff --git a/Reconstruction/PFA/Pandora/MatrixPandora/include/TrackCreator.h b/Reconstruction/PFA/Pandora/MatrixPandora/include/TrackCreator.h index ffa8b90ab0a99d6e1022f43dddae40ca6de78d0b..8205cae95feb97420167d0d29009735a2d548d4b 100644 --- a/Reconstruction/PFA/Pandora/MatrixPandora/include/TrackCreator.h +++ b/Reconstruction/PFA/Pandora/MatrixPandora/include/TrackCreator.h @@ -14,9 +14,7 @@ #include "GaudiKernel/ISvcLocator.h" #include "edm4hep/Track.h" -#include "edm4hep/TrackConst.h" #include "edm4hep/TrackState.h" -#include "edm4hep/ReconstructedParticleConst.h" #include "Api/PandoraApi.h" #include "Objects/Helix.h" @@ -25,9 +23,9 @@ namespace gear { class GearMgr; } class CollectionMaps; -typedef std::vector<edm4hep::ConstTrack *> TrackVector; +typedef std::vector<edm4hep::Track *> TrackVector; typedef std::set<unsigned int> TrackList; -typedef std::map<edm4hep::ConstTrack, int> TrackToPidMap; +typedef std::map<edm4hep::Track, int> TrackToPidMap; /* inline LCCollectionVec *newTrkCol(const std::string &name, LCEvent *evt , bool isSubset) { @@ -127,7 +125,7 @@ public: */ pandora::StatusCode CreateTrackAssociations(const CollectionMaps& collectionMaps); - edm4hep::ConstTrack* GetTrackAddress(const CollectionMaps& collectionMaps, const edm4hep::ConstTrack& pTrack ); + edm4hep::Track* GetTrackAddress(const CollectionMaps& collectionMaps, const edm4hep::Track& pTrack ); /** * @brief Create tracks, insert user code here * @@ -199,7 +197,7 @@ private: * @brief Copy track states stored in lcio tracks to pandora track parameters * */ - void GetTrackStates(edm4hep::ConstTrack *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; + void GetTrackStates(edm4hep::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; /** * @brief Copy track state from lcio track state instance to pandora input track state @@ -211,13 +209,13 @@ private: * @brief Obtain track time when it reaches ECAL * */ - float CalculateTrackTimeAtCalorimeter(edm4hep::ConstTrack *const pTrack) const; + float CalculateTrackTimeAtCalorimeter(edm4hep::Track *const pTrack) const; /** * @brief Decide whether track reaches the ecal surface * */ - void TrackReachesECAL(edm4hep::ConstTrack *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; + void TrackReachesECAL(edm4hep::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; /** * @brief Determine whether a track can be used to form a pfo under the following conditions: @@ -225,7 +223,7 @@ private: * 2) if the track proves to have no cluster associations * */ - void DefineTrackPfoUsage(edm4hep::ConstTrack *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; + void DefineTrackPfoUsage(edm4hep::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; /** * @brief Whether track passes the quality cuts required in order to be used to form a pfo @@ -233,20 +231,20 @@ private: * * @return boolean */ - bool PassesQualityCuts(edm4hep::ConstTrack *const pTrack, const PandoraApi::Track::Parameters &trackParameters) const; + bool PassesQualityCuts(edm4hep::Track *const pTrack, const PandoraApi::Track::Parameters &trackParameters) const; /** * @brief Get number of hits in TPC of a track * */ - int GetNTpcHits(edm4hep::ConstTrack *const pTrack) const; + int GetNTpcHits(edm4hep::Track *const pTrack) const; /** * @brief Get number of hits in FTD of a track * * */ - int GetNFtdHits(edm4hep::ConstTrack *const pTrack) const; + int GetNFtdHits(edm4hep::Track *const pTrack) const; const Settings m_settings; ///< The track creator settings const pandora::Pandora *m_pPandora; ///< Address of the pandora object to create tracks and track relationships diff --git a/Reconstruction/PFA/Pandora/MatrixPandora/src/MCParticleCreator.cpp b/Reconstruction/PFA/Pandora/MatrixPandora/src/MCParticleCreator.cpp index 06c5aa2cb2dd541c43674d838f9dc5821804a83d..40f44d1a4a5a3f76cf8f527c704d855eeb709ddb 100644 --- a/Reconstruction/PFA/Pandora/MatrixPandora/src/MCParticleCreator.cpp +++ b/Reconstruction/PFA/Pandora/MatrixPandora/src/MCParticleCreator.cpp @@ -6,14 +6,10 @@ */ -#include "edm4hep/MCParticleConst.h" #include "edm4hep/MCParticle.h" #include "edm4hep/MCRecoCaloAssociation.h" -#include "edm4hep/SimCalorimeterHitConst.h" -#include "edm4hep/CaloHitContributionConst.h" #include "edm4hep/Track.h" #include "edm4hep/MCRecoTrackerAssociation.h" -#include "edm4hep/SimTrackerHitConst.h" @@ -30,7 +26,7 @@ MCParticleCreator::MCParticleCreator(const Settings &settings, const pandora::Pa m_pPandora(pPandora), m_bField(settings.m_bField) { -m_id_pMC_map = new std::map<unsigned int, edm4hep::ConstMCParticle*>; +m_id_pMC_map = new std::map<unsigned int, edm4hep::MCParticle*>; } //------------------------------------------------------------------------------------------------------------------------------------------ @@ -249,7 +245,7 @@ pandora::StatusCode MCParticleCreator::CreateCaloHitToMCParticleRelationships(co pandora::StatusCode MCParticleCreator::CreateCaloHitToMCParticleRelationships(const CollectionMaps& collectionMaps, const CalorimeterHitVector &calorimeterHitVector) const { std::cout<<"Do CreateCaloHitToMCParticleRelationships"<<std::endl; - typedef std::map<edm4hep::ConstMCParticle *, float> MCParticleToEnergyWeightMap; + typedef std::map<edm4hep::MCParticle *, float> MCParticleToEnergyWeightMap; MCParticleToEnergyWeightMap mcParticleToEnergyWeightMap; for (StringVector::const_iterator iter = m_settings.m_CaloHitRelationCollections.begin(), iterEnd = m_settings.m_CaloHitRelationCollections.end(); @@ -272,7 +268,7 @@ pandora::StatusCode MCParticleCreator::CreateCaloHitToMCParticleRelationships(co auto pSimHit = pMCRecoCaloAssociationCollection.at(ic).getSim(); for (int iCont = 0, iEnd = pSimHit.contributions_size(); iCont < iEnd; ++iCont) { - edm4hep::ConstCaloHitContribution conb = pSimHit.getContributions(iCont); + edm4hep::CaloHitContribution conb = pSimHit.getContributions(iCont); auto ipa = conb.getParticle(); float ien = conb.getEnergy(); if( m_id_pMC_map->find(ipa.id()) == m_id_pMC_map->end() ) continue; @@ -320,7 +316,7 @@ pandora::StatusCode MCParticleCreator::CreateTrackToMCParticleRelationships(cons const pandora::Helix helixFit(pTrack->getTrackStates(0).phi, pTrack->getTrackStates(0).D0, pTrack->getTrackStates(0).Z0, pTrack->getTrackStates(0).omega, pTrack->getTrackStates(0).tanLambda, m_bField); const float recoMomentum(helixFit.GetMomentum().GetMagnitude()); // Use momentum magnitude to identify best mc particle - edm4hep::ConstMCParticle *pBestMCParticle = NULL; + edm4hep::MCParticle *pBestMCParticle = NULL; float bestDeltaMomentum(std::numeric_limits<float>::max()); try { diff --git a/Reconstruction/PFA/Pandora/MatrixPandora/src/PandoraMatrixAlg.cpp b/Reconstruction/PFA/Pandora/MatrixPandora/src/PandoraMatrixAlg.cpp index 9ea004bb085efe009aa3a25fa59082f5ef0740c0..b0a1d7ca4fd4c57807960672cc588f5f3576cf7e 100644 --- a/Reconstruction/PFA/Pandora/MatrixPandora/src/PandoraMatrixAlg.cpp +++ b/Reconstruction/PFA/Pandora/MatrixPandora/src/PandoraMatrixAlg.cpp @@ -6,7 +6,6 @@ #include "edm4hep/Vector3d.h" #include "edm4hep/SimCalorimeterHit.h" #include "edm4hep/CaloHitContribution.h" -#include "edm4hep/ClusterConst.h" #include "UTIL/ILDConf.h" #include <cmath> #include <algorithm> @@ -639,16 +638,16 @@ StatusCode PandoraMatrixAlg::CreateMCRecoParticleAssociation() std::cout<<"CreateMCRecoParticleAssociation, reco_col size="<<reco_col->size()<<std::endl; for(int i=0; i<reco_col->size();i++) { - std::map<int, edm4hep::ConstMCParticle> mc_map; + std::map<int, edm4hep::MCParticle> mc_map; std::map<int, float > id_edep_map; float tot_en = 0 ; auto pReco = reco_col->at(i); for(int j=0; j < pReco.clusters_size(); j++) { - edm4hep::ConstCluster cluster = pReco.getClusters(j); + edm4hep::Cluster cluster = pReco.getClusters(j); for(int k=0; k < cluster.hits_size(); k++) { - edm4hep::ConstCalorimeterHit hit = cluster.getHits(k); + edm4hep::CalorimeterHit hit = cluster.getHits(k); for(auto iter = m_CollectionMaps->collectionMap_CaloRel.begin(); iter != m_CollectionMaps->collectionMap_CaloRel.end(); iter++) { for(auto it = iter->second.begin(); it != iter->second.end(); it ++) @@ -667,7 +666,7 @@ StatusCode PandoraMatrixAlg::CreateMCRecoParticleAssociation() } for(auto it = mc_map.begin(); it != mc_map.end(); it ++) { - edm4hep::MCRecoParticleAssociation association = pMCRecoParticleAssociationCollection->create(); + auto association = pMCRecoParticleAssociationCollection->create(); association.setRec(pReco); association.setSim(it->second); if(tot_en==0) diff --git a/Utilities/DataHelper/include/DataHelper/Navigation.h b/Utilities/DataHelper/include/DataHelper/Navigation.h index e3aadc88e52bf6bc7fad10051cecd0a25cc290e0..87ca762b9de7ad7dc499929dcad740033fea936b 100644 --- a/Utilities/DataHelper/include/DataHelper/Navigation.h +++ b/Utilities/DataHelper/include/DataHelper/Navigation.h @@ -17,9 +17,9 @@ class Navigation{ void AddTrackerHitCollection(const edm4hep::TrackerHitCollection* col){m_hitColVec.push_back(col);}; void AddTrackerAssociationCollection(const edm4hep::MCRecoTrackerAssociationCollection* col){m_assColVec.push_back(col);}; - edm4hep::ConstTrackerHit GetTrackerHit(const edm4hep::ObjectID& id, bool delete_by_caller=true); - std::vector<edm4hep::ConstSimTrackerHit> GetRelatedTrackerHit(const edm4hep::ObjectID& id); - std::vector<edm4hep::ConstSimTrackerHit> GetRelatedTrackerHit(const edm4hep::TrackerHit& hit); + edm4hep::TrackerHit GetTrackerHit(const edm4hep::ObjectID& id, bool delete_by_caller=true); + std::vector<edm4hep::SimTrackerHit> GetRelatedTrackerHit(const edm4hep::ObjectID& id); + std::vector<edm4hep::SimTrackerHit> GetRelatedTrackerHit(const edm4hep::TrackerHit& hit); //static Navigation* m_fNavigation; private: @@ -27,6 +27,6 @@ class Navigation{ //DataHandle<edm4hep::MCRecoTrackerAssociationCollection> _inHitAssColHdl{"FTDStripTrackerHitsAssociation", Gaudi::DataHandle::Reader, this}; std::vector<const edm4hep::TrackerHitCollection*> m_hitColVec; std::vector<const edm4hep::MCRecoTrackerAssociationCollection*> m_assColVec; - std::map<int, edm4hep::ConstTrackerHit> m_trkHits; + std::map<int, edm4hep::TrackerHit> m_trkHits; }; #endif diff --git a/Utilities/DataHelper/include/DataHelper/TrackExtended.h b/Utilities/DataHelper/include/DataHelper/TrackExtended.h index 687db47d972fabe2ecf9ecea4716a4d93d24f6eb..ba9ab0e450aed82672e8d23993816cd33a56513f 100644 --- a/Utilities/DataHelper/include/DataHelper/TrackExtended.h +++ b/Utilities/DataHelper/include/DataHelper/TrackExtended.h @@ -4,7 +4,6 @@ //#include "lcio.h" //#include "EVENT/LCIO.h" #include "edm4hep/Track.h" -#include "edm4hep/TrackConst.h" #include <vector> //#include "ClusterExtended.h" //#include "TrackerHitExtended.h" @@ -33,10 +32,10 @@ class TrackExtended { TrackExtended( ); TrackExtended( TrackerHitExtended * trackerhit ); - TrackExtended( edm4hep::ConstTrack track ); + TrackExtended( edm4hep::Track track ); ~TrackExtended(); - edm4hep::ConstTrack getTrack(); + edm4hep::Track getTrack(); const float * getSeedDirection(); const float * getSeedPosition(); ClusterExtendedVec & getClusterVec(); @@ -96,7 +95,7 @@ class TrackExtended { ClusterExtended *_superCluster; ClusterExtendedVec _clusterVec; GroupTracks * _group; - edm4hep::ConstTrack _track; + edm4hep::Track _track; float _seedDirection[3]; float _seedPosition[3]; TrackerHitExtendedVec _trackerHitVector; diff --git a/Utilities/DataHelper/include/DataHelper/TrackerHitExtended.h b/Utilities/DataHelper/include/DataHelper/TrackerHitExtended.h index 1962d59e99e6c146133deaaf7d1a6838253a4333..2aa83a4348a81bb5379121e87dd54a083c4e2873 100644 --- a/Utilities/DataHelper/include/DataHelper/TrackerHitExtended.h +++ b/Utilities/DataHelper/include/DataHelper/TrackerHitExtended.h @@ -24,14 +24,14 @@ class TrackerHitExtended { public: - TrackerHitExtended(const edm4hep::ConstTrackerHit trackerhit); + TrackerHitExtended(const edm4hep::TrackerHit trackerhit); ~TrackerHitExtended(); void setTrackExtended(TrackExtended * trackAR); void addTrackExtended(TrackExtended * trackAR); void setTrackerHitTo(TrackerHitExtended * hitTo); void setTrackerHitFrom(TrackerHitExtended * hitFrom); void setGenericDistance(float genericDistance); - //void setTrackerHit(edm4hep::ConstTrackerHit hit); + //void setTrackerHit(edm4hep::TrackerHit hit); void setYresTo(float yresTo); void setYresFrom(float yresFrom); void setDirVec(float * dirVec); @@ -42,7 +42,7 @@ class TrackerHitExtended { void setDet(int idet); void setUsedInFit(bool usedInFit); - edm4hep::ConstTrackerHit getTrackerHit(); + edm4hep::TrackerHit getTrackerHit(); TrackExtended * getTrackExtended(); TrackExtendedVec & getTrackExtendedVec(); TrackerHitExtended * getTrackerHitFrom(); @@ -59,7 +59,7 @@ class TrackerHitExtended { private: - edm4hep::ConstTrackerHit _trackerHit; + edm4hep::TrackerHit _trackerHit; TrackExtended * _trackAR; TrackerHitExtended * _hitTo; TrackerHitExtended * _hitFrom; diff --git a/Utilities/DataHelper/src/Navigation.cpp b/Utilities/DataHelper/src/Navigation.cpp index f31eadbd5c87939c61aaa388c4bfe1ccf2098004..cc81b7f0e01d514fc0cd158af6034476198560f6 100644 --- a/Utilities/DataHelper/src/Navigation.cpp +++ b/Utilities/DataHelper/src/Navigation.cpp @@ -19,13 +19,13 @@ Navigation::~Navigation(){ void Navigation::Initialize(){ m_hitColVec.clear(); m_assColVec.clear(); - for(std::map<int, edm4hep::ConstTrackerHit>::iterator it=m_trkHits.begin();it!=m_trkHits.end();it++){ + for(std::map<int, edm4hep::TrackerHit>::iterator it=m_trkHits.begin();it!=m_trkHits.end();it++){ // delete it->second; } m_trkHits.clear(); } -edm4hep::ConstTrackerHit Navigation::GetTrackerHit(const edm4hep::ObjectID& obj_id, bool delete_by_caller){ +edm4hep::TrackerHit Navigation::GetTrackerHit(const edm4hep::ObjectID& obj_id, bool delete_by_caller){ int id = obj_id.collectionID * 10000000 + obj_id.index; if(!delete_by_caller){ if(m_trkHits.find(id)!=m_trkHits.end()) return m_trkHits[id]; @@ -47,7 +47,7 @@ edm4hep::ConstTrackerHit Navigation::GetTrackerHit(const edm4hep::ObjectID& obj_ edm4hep::ObjectID this_id = hit.getObjectID(); if(this_id.collectionID!=obj_id.collectionID)break; else if(this_id.index==obj_id.index){ - edm4hep::ConstTrackerHit hit_copy = edm4hep::ConstTrackerHit(hit); + edm4hep::TrackerHit hit_copy = edm4hep::TrackerHit(hit); if(!delete_by_caller) m_trkHits[id] = hit_copy; return hit_copy;//&(m_trkHits[id]); } @@ -57,8 +57,8 @@ edm4hep::ConstTrackerHit Navigation::GetTrackerHit(const edm4hep::ObjectID& obj_ throw std::runtime_error("Not found TrackerHit"); } -std::vector<edm4hep::ConstSimTrackerHit> Navigation::GetRelatedTrackerHit(const edm4hep::ObjectID& id){ - std::vector<edm4hep::ConstSimTrackerHit> hits; +std::vector<edm4hep::SimTrackerHit> Navigation::GetRelatedTrackerHit(const edm4hep::ObjectID& id){ + std::vector<edm4hep::SimTrackerHit> hits; for(int i=0;i<m_assColVec.size();i++){ for(auto ass : *m_assColVec[i]){ edm4hep::ObjectID this_id = ass.getRec().getObjectID(); @@ -69,8 +69,8 @@ std::vector<edm4hep::ConstSimTrackerHit> Navigation::GetRelatedTrackerHit(const return hits; } -std::vector<edm4hep::ConstSimTrackerHit> Navigation::GetRelatedTrackerHit(const edm4hep::TrackerHit& hit){ - std::vector<edm4hep::ConstSimTrackerHit> hits; +std::vector<edm4hep::SimTrackerHit> Navigation::GetRelatedTrackerHit(const edm4hep::TrackerHit& hit){ + std::vector<edm4hep::SimTrackerHit> hits; for(int i=0;i<m_assColVec.size();i++){ for(auto ass : *m_assColVec[i]){ if(ass.getRec().getObjectID().collectionID != hit.getObjectID().collectionID) break; diff --git a/Utilities/DataHelper/src/TrackExtended.cc b/Utilities/DataHelper/src/TrackExtended.cc index 762247e6e3ca7a3b115fc8bacb69ced2fb6133c1..edf9d43bb06afc488e8ae6b3cacf08e874c2e39c 100644 --- a/Utilities/DataHelper/src/TrackExtended.cc +++ b/Utilities/DataHelper/src/TrackExtended.cc @@ -11,7 +11,7 @@ TrackExtended::TrackExtended( ) { _group = NULL; } -TrackExtended::TrackExtended(ConstTrack track) { +TrackExtended::TrackExtended(Track track) { _track = track; _superCluster = NULL; _trackerHitVector.clear(); @@ -32,7 +32,7 @@ TrackExtended::TrackExtended( TrackerHitExtended * trackerhit) { TrackExtended::~TrackExtended() {} -ConstTrack TrackExtended::getTrack() { +Track TrackExtended::getTrack() { if(!_track.isAvailable()){ std::cout << "Error: track not available" << _track.isAvailable() << " id= " << _track.id() << std::endl; throw std::runtime_error("Error: track not available"); diff --git a/Utilities/DataHelper/src/TrackerHitExtended.cc b/Utilities/DataHelper/src/TrackerHitExtended.cc index 394ab2cff09736836b522a6a607cb64b589b0346..6c3d794bd9f85d223b626ee570cb25810137ac69 100644 --- a/Utilities/DataHelper/src/TrackerHitExtended.cc +++ b/Utilities/DataHelper/src/TrackerHitExtended.cc @@ -1,7 +1,7 @@ #include "DataHelper/TrackExtended.h" #include "DataHelper/TrackerHitExtended.h" -TrackerHitExtended::TrackerHitExtended(const edm4hep::ConstTrackerHit trackerhit): +TrackerHitExtended::TrackerHitExtended(const edm4hep::TrackerHit trackerhit): _trackerHit(trackerhit){ _trackAR = NULL; _trackVecAR.clear(); @@ -41,7 +41,7 @@ void TrackerHitExtended::setGenericDistance(float genericDistance) { _genericDistance = genericDistance; } -//void TrackerHitExtended::setTrackerHit(edm4hep::ConstTrackerHit hit) { +//void TrackerHitExtended::setTrackerHit(edm4hep::TrackerHit hit) { // _trackerHit = hit; //} @@ -67,7 +67,7 @@ void TrackerHitExtended::setDet(int idet) { _idet = idet; } -edm4hep::ConstTrackerHit TrackerHitExtended::getTrackerHit() { +edm4hep::TrackerHit TrackerHitExtended::getTrackerHit() { return _trackerHit; } diff --git a/Utilities/KalDet/src/ild/common/ILDConeMeasLayer.h b/Utilities/KalDet/src/ild/common/ILDConeMeasLayer.h index ba2138e05cda6176e0dab8bee5b4a33fcb1a7998..19d617be5f637615f523997a4f7a839054fcf56e 100644 --- a/Utilities/KalDet/src/ild/common/ILDConeMeasLayer.h +++ b/Utilities/KalDet/src/ild/common/ILDConeMeasLayer.h @@ -60,7 +60,7 @@ public: Bool_t IsOnSurface(const TVector3 &xx) const; /** Convert LCIO Tracker Hit to an ILDCylinderHit */ - virtual ILDVTrackHit* ConvertLCIOTrkHit(edm4hep::ConstTrackerHit trkhit) const { + virtual ILDVTrackHit* ConvertLCIOTrkHit(edm4hep::TrackerHit trkhit) const { /* streamlog_out( ERROR ) << "Don't use this, it's not implemented!"; */ return NULL; diff --git a/Utilities/KalDet/src/ild/common/ILDCylinderHit.h b/Utilities/KalDet/src/ild/common/ILDCylinderHit.h index ca694e6eaf5353607a9f4b7ed8290ebc593317ba..3fb9f1fc18a56f7644baf1d441f5ebbd1b7e95a5 100644 --- a/Utilities/KalDet/src/ild/common/ILDCylinderHit.h +++ b/Utilities/KalDet/src/ild/common/ILDCylinderHit.h @@ -17,7 +17,7 @@ public: /** Constructor Taking R and Rphi coordinates and associated measurement layer, with bfield */ ILDCylinderHit(const TVMeasLayer &ms, Double_t *x, Double_t *dx, - Double_t bfield, edm4hep::ConstTrackerHit trkhit ) + Double_t bfield, edm4hep::TrackerHit trkhit ) : ILDVTrackHit(ms, x, dx, bfield, 2, trkhit) { /* no op */ } diff --git a/Utilities/KalDet/src/ild/common/ILDCylinderMeasLayer.h b/Utilities/KalDet/src/ild/common/ILDCylinderMeasLayer.h index fd408f0887c9c57911b79ae8f5be620030bca515..00914f6580882614e07115bfe1e1fb3ad13f33ca 100644 --- a/Utilities/KalDet/src/ild/common/ILDCylinderMeasLayer.h +++ b/Utilities/KalDet/src/ild/common/ILDCylinderMeasLayer.h @@ -71,7 +71,7 @@ public: TKalMatrix &H) const; /** Convert LCIO Tracker Hit to an ILDCylinderHit */ - virtual ILDVTrackHit* ConvertLCIOTrkHit(edm4hep::ConstTrackerHit trkhit) const ; + virtual ILDVTrackHit* ConvertLCIOTrkHit(edm4hep::TrackerHit trkhit) const ; /** Get the intersection and the CellID, needed for multilayers */ virtual int getIntersectionAndCellID(const TVTrack &hel, diff --git a/Utilities/KalDet/src/ild/common/ILDVMeasLayer.h b/Utilities/KalDet/src/ild/common/ILDVMeasLayer.h index 498c5608c5753764d821da93748d32fe365601ce..edd81744d67ec79c172acd253eaeb0c54226de10 100644 --- a/Utilities/KalDet/src/ild/common/ILDVMeasLayer.h +++ b/Utilities/KalDet/src/ild/common/ILDVMeasLayer.h @@ -13,7 +13,7 @@ #include "kaltest/TAttDrawable.h" #include "kaltest/KalTrackDim.h" #include "TString.h" -#include "edm4hep/TrackerHitConst.h" +#include "edm4hep/TrackerHit.h" #include <vector> @@ -44,7 +44,7 @@ public: inline Double_t GetBz() const { return _Bz; } /** Convert LCIO Tracker Hit to an ILDPLanarTrackHit */ - virtual ILDVTrackHit* ConvertLCIOTrkHit(edm4hep::ConstTrackerHit trkhit) const = 0 ; + virtual ILDVTrackHit* ConvertLCIOTrkHit(edm4hep::TrackerHit trkhit) const = 0 ; /** Check whether the measurement layer represents a series of detector elements */ bool isMultilayer() const { return _isMultiLayer; }