From 8dc8d8213228b31ccb2cdb9c9610f54800bd0535 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Wed, 23 Jul 2014 20:28:46 +0200 Subject: [PATCH 1/3] hack to remove linking in the same layer --- RecoParticleFlow/PFClusterProducer/src/Arbor.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RecoParticleFlow/PFClusterProducer/src/Arbor.cc b/RecoParticleFlow/PFClusterProducer/src/Arbor.cc index c1fef9c44aa89..3405ec5e40032 100644 --- a/RecoParticleFlow/PFClusterProducer/src/Arbor.cc +++ b/RecoParticleFlow/PFClusterProducer/src/Arbor.cc @@ -286,7 +286,7 @@ void BuildInitLink() const auto& PosB = cleanedHits[found[j0].data]; PosDiffAB = PosA - PosB; - if( PosDiffAB.Mag2() < InitLinkThreshold2 ) // || ( PosDiffAB.Mag() < 1.6*InitLinkThreshold && PosDiffAB.Dot(PosB) < 0.9*PosDiffAB.Mag()*PosB.Mag() ) ) //Distance threshold to be optimized - should also depends on Geometry + if( std::abs(PosDiffAB.Z()) > 1e-3 && PosDiffAB.Mag2() < InitLinkThreshold2 ) // || ( PosDiffAB.Mag() < 1.6*InitLinkThreshold && PosDiffAB.Dot(PosB) < 0.9*PosDiffAB.Mag()*PosB.Mag() ) ) //Distance threshold to be optimized - should also depends on Geometry { std::pair a_Link; if( PosA.Mag2() > PosB.Mag2() ) @@ -461,7 +461,8 @@ void LinkIteration() //Energy corrections, semi-local correction PosB = cleanedHits[found[j1].data]; DiffPosAB = PosB - PosA; - if( DiffPosAB.Mag2() < IterLinkThreshold2 && + if( std::abs(DiffPosAB.Z()) > 1e-3 && + DiffPosAB.Mag2() < IterLinkThreshold2 && DiffPosAB.Mag2() > InitLinkThreshold2 && DiffPosAB.Angle(RefDir[i1]) < 0.8 ) { From 941fb6d443d8bf5924ac9752a0689db6b8411cb1 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Mon, 4 Aug 2014 12:01:38 +0100 Subject: [PATCH 2/3] use hash map when finding HGC neighbours instead of tree based map --- .../interface/PFRecHitCaloNavigator.h | 185 +++++++++------- .../interface/PFRecHitNavigatorBase.h | 24 +- .../plugins/PFRecHitProducer.cc | 21 +- .../plugins/PFRecHitProducer.h | 1 + .../python/particleFlowRecHitHGCEE_cfi.py | 1 + .../python/particleFlowRecHitHGCHEB_cfi.py | 1 + .../python/particleFlowRecHitHGCHEF_cfi.py | 1 + .../PFClusterProducer/test/hgcal_rechits.fwc | 208 +++++++++++++++--- .../PFClusterProducer/test/run_display.sh | 2 +- 9 files changed, 328 insertions(+), 116 deletions(-) diff --git a/RecoParticleFlow/PFClusterProducer/interface/PFRecHitCaloNavigator.h b/RecoParticleFlow/PFClusterProducer/interface/PFRecHitCaloNavigator.h index 5c7d18ad6d6a4..35d73971e3649 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/PFRecHitCaloNavigator.h +++ b/RecoParticleFlow/PFClusterProducer/interface/PFRecHitCaloNavigator.h @@ -41,84 +41,113 @@ class PFRecHitCaloNavigator : public PFRecHitNavigatorBase { virtual ~PFRecHitCaloNavigator() { if(!ownsTopo) { topology_.release(); } } - void associateNeighbours(reco::PFRecHit& hit,std::auto_ptr& hits,edm::RefProd& refProd) { - constexpr unsigned short halfDim = 1; // range in each dimension - constexpr unsigned short dimSize = 3; - constexpr CaloDirection directions[6] = { NORTH, SOUTH, EAST, WEST, UP, DOWN }; // max available directions - - DET detid( hit.detId() ); - if( detid.null() ) return; - // this is a ripoff of getWindow() from CaloSubDetTopology - NeighbourInfo cellsInWindow; - DET tmpId(detid); - NeighbourInfo fringe; - fringe.emplace_back(tmpId,std::make_tuple(0,0,0)); - - std::vector > visited_cells; - visited_cells.resize(std::pow(dimSize,DIM)); - - while (fringe.size() > 0) { - NeighbourInfo::value_type cur = fringe.back(); - fringe.pop_back(); - // check all 2*DIM neighbours (in case of 2D only check NSEW) - for (unsigned dirnum = 0; dirnum < 2*DIM; ++dirnum) { - Coordinate neighbour = getNeighbourIndex(cur.second,directions[dirnum]); - //If outside the window range - if ( std::get<0>(neighbour) < -halfDim || - std::get<0>(neighbour) > halfDim || - std::get<1>(neighbour) < -halfDim || - std::get<1>(neighbour) > halfDim || - std::get<2>(neighbour) < -halfDim || - std::get<2>(neighbour) > halfDim ) - continue; - - //Found integer index in the matrix - unsigned int_index = ( std::get<0>(neighbour) + halfDim + - dimSize * (std::get<1>(neighbour) + halfDim ) + - (DIM==3)*dimSize*dimSize * ( std::get<2>(neighbour) + halfDim ) ); - assert(int_index < visited_cells.size()); - - // check whether we have seen this neighbour already - if (visited_cells[int_index].first.visited) - // we have seen this one already - continue; - - // a new cell, get the DetId of the neighbour, mark it - // as visited and add it to the fringe - visited_cells[int_index].first.visited = true; - std::vector neighbourCells = getNeighbours(cur.first,directions[dirnum]); - - if ( neighbourCells.size() == 1 ) { - visited_cells[int_index].first.cell = neighbourCells[0]; - visited_cells[int_index].second = neighbour; - } else if ( neighbourCells.size() == 0 ) { - visited_cells[int_index].first.cell = DetId(0); - visited_cells[int_index].second = neighbour; - } else { - throw cms::Exception("getWindowError") << "Not supported subdetector for getWindow method"; - } - - if (!visited_cells[int_index].first.cell.null()) - fringe.emplace_back(visited_cells[int_index].first.cell,neighbour); - - } // loop over all possible directions - } // while some cells are left on the fringe - - for (unsigned int i=0; i(coord) != 0 || - std::get<1>(coord) != 0 || - std::get<2>(coord) != 0 ) { - associateNeighbour( id,hit,hits,refProd, - std::get<0>(coord), - std::get<1>(coord), - std::get<2>(coord) ); - } - } - } - } + void associateNeighbours(reco::PFRecHit& hit, + std::auto_ptr& hits, + const DetIdToHitIdx& hitmap, + edm::RefProd& refProd) override { + auto visited_cells = std::move( getWindow( hit ) ); + for (unsigned int i=0; i(coord) != 0 || + std::get<1>(coord) != 0 || + std::get<2>(coord) != 0 ) { + associateNeighbour( id,hit,hits,hitmap,refProd, + std::get<0>(coord), + std::get<1>(coord), + std::get<2>(coord) ); + } + } + } + } + + void associateNeighbours(reco::PFRecHit& hit, + std::auto_ptr& hits, + edm::RefProd& refProd) { + auto visited_cells = std::move( getWindow( hit ) ); + for (unsigned int i=0; i(coord) != 0 || + std::get<1>(coord) != 0 || + std::get<2>(coord) != 0 ) { + associateNeighbour( id,hit,hits,refProd, + std::get<0>(coord), + std::get<1>(coord), + std::get<2>(coord) ); + } + } + } + } + + + std::vector > getWindow(reco::PFRecHit& hit) { + constexpr unsigned short halfDim = 1; // range in each dimension + constexpr unsigned short dimSize = 3; + constexpr CaloDirection directions[6] = { NORTH, SOUTH, EAST, WEST, UP, DOWN }; // max available directions + + DET detid( hit.detId() ); + if( detid.null() ) return std::vector >(); + // this is a ripoff of getWindow() from CaloSubDetTopology + NeighbourInfo cellsInWindow; + DET tmpId(detid); + NeighbourInfo fringe; + fringe.emplace_back(tmpId,std::make_tuple(0,0,0)); + + std::vector > visited_cells; + visited_cells.resize(std::pow(dimSize,DIM)); + + while (fringe.size() > 0) { + NeighbourInfo::value_type cur = fringe.back(); + fringe.pop_back(); + // check all 2*DIM neighbours (in case of 2D only check NSEW) + for (unsigned dirnum = 0; dirnum < 2*DIM; ++dirnum) { + Coordinate neighbour = getNeighbourIndex(cur.second,directions[dirnum]); + //If outside the window range + if ( std::get<0>(neighbour) < -halfDim || + std::get<0>(neighbour) > halfDim || + std::get<1>(neighbour) < -halfDim || + std::get<1>(neighbour) > halfDim || + std::get<2>(neighbour) < -halfDim || + std::get<2>(neighbour) > halfDim ) + continue; + + //Found integer index in the matrix + unsigned int_index = ( std::get<0>(neighbour) + halfDim + + dimSize * (std::get<1>(neighbour) + halfDim ) + + (DIM==3)*dimSize*dimSize * ( std::get<2>(neighbour) + halfDim ) ); + assert(int_index < visited_cells.size()); + + // check whether we have seen this neighbour already + if (visited_cells[int_index].first.visited) + // we have seen this one already + continue; + + // a new cell, get the DetId of the neighbour, mark it + // as visited and add it to the fringe + visited_cells[int_index].first.visited = true; + std::vector neighbourCells = getNeighbours(cur.first,directions[dirnum]); + + if ( neighbourCells.size() == 1 ) { + visited_cells[int_index].first.cell = neighbourCells[0]; + visited_cells[int_index].second = neighbour; + } else if ( neighbourCells.size() == 0 ) { + visited_cells[int_index].first.cell = DetId(0); + visited_cells[int_index].second = neighbour; + } else { + throw cms::Exception("getWindowError") << "Not supported subdetector for getWindow method"; + } + + if (!visited_cells[int_index].first.cell.null()) + fringe.emplace_back(visited_cells[int_index].first.cell,neighbour); + + } // loop over all possible directions + } // while some cells are left on the fringe + + return visited_cells; + } protected: std::unique_ptr topology_; diff --git a/RecoParticleFlow/PFClusterProducer/interface/PFRecHitNavigatorBase.h b/RecoParticleFlow/PFClusterProducer/interface/PFRecHitNavigatorBase.h index ddebf1960f1af..c4d7ddb59ea3a 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/PFRecHitNavigatorBase.h +++ b/RecoParticleFlow/PFClusterProducer/interface/PFRecHitNavigatorBase.h @@ -21,9 +21,12 @@ #include "Geometry/CaloGeometry/interface/TruncatedPyramid.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" +#include class PFRecHitNavigatorBase { public: + typedef std::unordered_map DetIdToHitIdx; + PFRecHitNavigatorBase() {} PFRecHitNavigatorBase(const edm::ParameterSet& iConfig) {} @@ -31,10 +34,14 @@ class PFRecHitNavigatorBase { virtual void beginEvent(const edm::EventSetup&)=0; virtual void associateNeighbours(reco::PFRecHit&,std::auto_ptr&,edm::RefProd&)=0; + virtual void associateNeighbours(reco::PFRecHit&, + std::auto_ptr&, + const DetIdToHitIdx&, + edm::RefProd&) {}; protected: - + // assumes sorted void associateNeighbour(const DetId& id, reco::PFRecHit& hit,std::auto_ptr& hits,edm::RefProd& refProd,short eta, short phi,short depth) { const reco::PFRecHit temp(id,PFLayer::NONE,0.0,math::XYZPoint(0,0,0),math::XYZVector(0,0,0),std::vector()); auto found_hit = std::lower_bound(hits->begin(),hits->end(), @@ -47,7 +54,20 @@ class PFRecHitNavigatorBase { hit.addNeighbour(eta,phi,depth,reco::PFRecHitRef(refProd,std::distance(hits->begin(),found_hit))); } } - + // map to indices is provided + void associateNeighbour(const DetId& id, + reco::PFRecHit& hit, + std::auto_ptr& hits, + const DetIdToHitIdx& hitmap, + edm::RefProd& refProd, + short eta, short phi,short depth) { + auto found_hit = hitmap.find(id.rawId()); + if( found_hit != hitmap.end() ) { + auto begin = hits->begin(); + auto hit_pos = begin + found_hit->second; + hit.addNeighbour(eta,phi,depth,reco::PFRecHitRef(refProd,std::distance(begin,hit_pos))); + } + } }; diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc index 5da9d34e27dbf..ab1fd3a1410c3 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc @@ -7,7 +7,8 @@ namespace { } } - PFRecHitProducer:: PFRecHitProducer(const edm::ParameterSet& iConfig) +PFRecHitProducer:: PFRecHitProducer(const edm::ParameterSet& iConfig): + _useHitMap(iConfig.getUntrackedParameter("useHitMap",false)) { produces(); @@ -52,14 +53,26 @@ void creators_.at(i)->importRecHits(out,cleaned,iEvent,iSetup); } - std::sort(out->begin(),out->end(),sortByDetId); + if(!_useHitMap) std::sort(out->begin(),out->end(),sortByDetId); + + reco::PFRecHitCollection& outprod = *out; + PFRecHitNavigatorBase::DetIdToHitIdx hitmap(outprod.size()); + if( _useHitMap ) { + for( unsigned i = 0 ; i < outprod.size(); ++i ) { + hitmap[outprod[i].detId()] = i; + } + } //create a refprod here edm::RefProd refProd = iEvent.getRefBeforePut(); - for( unsigned int i=0;isize();++i) { - navigator_->associateNeighbours(out->at(i),out,refProd); + for( unsigned int i=0;iassociateNeighbours(outprod[i],out,hitmap,refProd); + } else { + navigator_->associateNeighbours(outprod[i],out,refProd); + } } iEvent.put(out,""); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.h b/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.h index 28983036cae60..a3db544c01c25 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.h +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.h @@ -26,6 +26,7 @@ class PFRecHitProducer : public edm::EDProducer { static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: + const bool _useHitMap; virtual void produce(edm::Event&, const edm::EventSetup&) override; std::vector > creators_; std::unique_ptr navigator_; diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCEE_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCEE_cfi.py index 2cc4652982e89..049c21f86f523 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCEE_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCEE_cfi.py @@ -1,6 +1,7 @@ import FWCore.ParameterSet.Config as cms particleFlowRecHitHGCEE = cms.EDProducer("PFRecHitProducer", + useHitMap = cms.untracked.bool(True), navigator = cms.PSet( name = cms.string("PFRecHitHGCEENavigator"), topologySource = cms.string("HGCalEESensitive"), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCHEB_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCHEB_cfi.py index c7f63b3ca916f..e7cb507b278a6 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCHEB_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCHEB_cfi.py @@ -1,6 +1,7 @@ import FWCore.ParameterSet.Config as cms particleFlowRecHitHGCHEB = cms.EDProducer("PFRecHitProducer", + useHitMap = cms.untracked.bool(True), navigator = cms.PSet( name = cms.string("PFRecHitHGCHENavigator"), topologySource = cms.string("HGCalHEScintillatorSensitive"), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCHEF_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCHEF_cfi.py index 5615b9ca7da57..e8d01dd94ee9c 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCHEF_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowRecHitHGCHEF_cfi.py @@ -1,6 +1,7 @@ import FWCore.ParameterSet.Config as cms particleFlowRecHitHGCHEF = cms.EDProducer("PFRecHitProducer", + useHitMap = cms.untracked.bool(True), navigator = cms.PSet( name = cms.string("PFRecHitHGCHENavigator"), topologySource = cms.string("HGCalHESiliconSensitive"), diff --git a/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc b/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc index 1b918813d32cf..6fb000b21c9a1 100644 --- a/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc +++ b/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc @@ -96,10 +96,10 @@ - std::vector<reco::CaloJet> + std::vector<reco::PFJet> - iterativeCone5CaloJets + ak5PFJets @@ -362,10 +362,10 @@ - std::vector<reco::MET> + std::vector<reco::PFMET> - tcMet + pfMet @@ -652,7 +652,7 @@ 1009 - t + f 31 @@ -686,7 +686,7 @@ 1011 - t + f 32 @@ -720,7 +720,7 @@ 1014 - t + f 33 @@ -734,6 +734,116 @@ + + + std::vector<reco::GenParticle> + + + genParticles + + + + + + + + + + + + 1019 + + + t + + + 34 + + + GenParticles + + + 0 + + + + + 0 + + + 2 + + + + + + + std::vector<SimTrack> + + + g4SimHits + + + + + + + + + + + + 1029 + + + t + + + 35 + + + SimTracks + + + 0 + + + + + + + std::vector<reco::PFCandidate> + + + particleFlow + + + + + + + + + + + + 1000 + + + t + + + 36 + + + PF Candidates + + + 0 + + + + @@ -787,7 +897,7 @@ 54 - 31 + 44 1263 @@ -901,22 +1011,22 @@ 1 - -0.660885 + -0.401173 - -0.653181 + -0.563483 - 0.369579 + 0.722185 0 - 0.702949 + 0.814632 - -0.71124 + -0.579978 0 @@ -925,25 +1035,25 @@ 0 - 0.262858 + 0.41885 - 0.259795 + 0.588315 - 0.9292 + 0.691701 0 - -2205.43 + -1458.17 - -2147.69 + -2016.83 - 1314.98 + 2612.92 1 @@ -985,19 +1095,19 @@ 0 - -0.180542 + -52.4547 - 0.521286 + -37.8377 - 24.0227 + 317.74 1 - 28.329 + 3.09973 @@ -1399,7 +1509,7 @@ 0 - Pt + pT pt 1 eta @@ -1417,12 +1527,6 @@ emf emEnergyFraction() 3 - size_eta - sqrt(etaetaMoment) - 3 - size_phi - sqrt(phiphiMoment) - 3 pT @@ -1482,7 +1586,7 @@ 3 - MET + et et 1 phi @@ -1533,6 +1637,46 @@ charge 0 + + Pt + pt + 1 + eta + eta + 3 + phi + phi + 3 + ECAL + p4().E() * emEnergyFraction() + 1 + HCAL + p4().E() * energyFractionHadronic() + 1 + emf + emEnergyFraction() + 3 + size_eta + sqrt(etaetaMoment) + 3 + size_phi + sqrt(phiphiMoment) + 3 + + + MET + et + 1 + phi + phi + 3 + sumEt + sumEt + 1 + mEtSig + mEtSig + 3 + pT pt @@ -1634,6 +1778,8 @@ reco::Jet reco::MET reco::Muon + reco::PFJet + reco::PFMET reco::Photon reco::Track reco::Vertex diff --git a/RecoParticleFlow/PFClusterProducer/test/run_display.sh b/RecoParticleFlow/PFClusterProducer/test/run_display.sh index 72b3beb6f68d4..f36f11d10a0e0 100755 --- a/RecoParticleFlow/PFClusterProducer/test/run_display.sh +++ b/RecoParticleFlow/PFClusterProducer/test/run_display.sh @@ -1,6 +1,6 @@ #!/bin/bash -cmsShow -c ${CMSSW_BASE}/src/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc -g /afs/cern.ch/user/l/lgray/work/public/xHGCAL/cmsRecoGeom1-HGCAL.root --sim-geom-file /afs/cern.ch/user/l/lgray/work/public/xHGCAL/cmsSimGeom-14-HGCAL.root /afs/cern.ch/user/l/lgray/work/public/CMSSW_6_2_X_SLHC_2014-07-17-0200/src/matrix_tests/simple_jet_gun/step3.root +cmsShow -c ${CMSSW_BASE}/src/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc -g /home/lgray/xHGCAL/cmsRecoGeom1-HGCAL.root --sim-geom-file /home/lgray/xHGCAL/cmsSimGeom-14-HGCAL.root /home/lgray/CMSSW_6_2_0_SLHC16/src/matrix_tests/simple_jet_gun/step3.root #12202_SinglePionPt35+SinglePionPt35_Extended2023HGCalMuon_GenSimFull+DigiFull_Extended2023HGCalMuon+RecoFull_Extended2023HGCalMuon+HARVESTFull_Extended2023HGCalMuon From f03a5d1b972888955c8f199f497c99eae8d093d8 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Wed, 24 Sep 2014 12:42:23 +0200 Subject: [PATCH 3/3] tuning up clustering based on initial geometry fixes Conflicts: RecoParticleFlow/PFClusterProducer/test/run_display.sh --- .../python/particleFlowClusterHGCEE_cfi.py | 4 +-- .../python/particleFlowClusterHGCHEB_cfi.py | 4 +-- .../python/particleFlowClusterHGCHEF_cfi.py | 6 ++-- .../PFClusterProducer/test/hgcal_rechits.fwc | 34 +++++++++---------- .../PFClusterProducer/test/run_display.sh | 3 +- .../plugins/kdtrees/KDTreeLinkerTrackHGC.h | 9 +++-- 6 files changed, 32 insertions(+), 28 deletions(-) diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCEE_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCEE_cfi.py index 50bb5301bed76..df7362265294c 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCEE_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCEE_cfi.py @@ -26,8 +26,8 @@ _manqiArborClusterizer_HGCEE = cms.PSet( algoName = cms.string("SimpleArborClusterizer"), # use basic pad sizes in HGCEE - cellSize = cms.double(10.0), - layerThickness = cms.double(16.0), + cellSize = cms.double(16.0), + layerThickness = cms.double(18.0), distSeedForMerge = cms.double(20.0), killNoiseClusters = cms.bool(True), maxNoiseClusterSize = cms.uint32(3), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCHEB_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCHEB_cfi.py index c74a8e068b2aa..68e2aabd180bf 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCHEB_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCHEB_cfi.py @@ -23,8 +23,8 @@ _manqiArborClusterizer_HGCHEB = cms.PSet( algoName = cms.string("SimpleArborClusterizer"), # use basic pad sizes in HGCEE - cellSize = cms.double(30.0), - layerThickness = cms.double(55.0), + cellSize = cms.double(35.0), + layerThickness = cms.double(65.0), distSeedForMerge = cms.double(20.0), killNoiseClusters = cms.bool(True), maxNoiseClusterSize = cms.uint32(3), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCHEF_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCHEF_cfi.py index 1b45cd31973e6..1fb91a182e124 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCHEF_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHGCHEF_cfi.py @@ -23,9 +23,9 @@ _manqiArborClusterizer_HGCHEF = cms.PSet( algoName = cms.string("SimpleArborClusterizer"), # use basic pad sizes in HGCEE - cellSize = cms.double(10.0), - layerThickness = cms.double(45.0), - distSeedForMerge = cms.double(20.0), + cellSize = cms.double(15.0), + layerThickness = cms.double(55.0), + distSeedForMerge = cms.double(30.0), killNoiseClusters = cms.bool(True), maxNoiseClusterSize = cms.uint32(3), thresholdsByDetector = cms.VPSet( ) diff --git a/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc b/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc index 6fb000b21c9a1..8e45338d548dc 100644 --- a/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc +++ b/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc @@ -894,10 +894,10 @@ - 54 + 106 - 44 + 23 1263 @@ -1011,22 +1011,22 @@ 1 - -0.401173 + 0.769709 - -0.563483 + 0.13655 - 0.722185 + 0.623623 0 - 0.814632 + -0.174677 - -0.579978 + 0.984626 0 @@ -1035,25 +1035,25 @@ 0 - 0.41885 + -0.614034 - 0.588315 + -0.108934 - 0.691701 + 0.781726 0 - -1458.17 + 2877.96 - -2016.83 + 498.315 - 2612.92 + 2219.76 1 @@ -1095,19 +1095,19 @@ 0 - -52.4547 + 0.281389 - -37.8377 + 0.577909 - 317.74 + 6.85455 1 - 3.09973 + 5.46292 diff --git a/RecoParticleFlow/PFClusterProducer/test/run_display.sh b/RecoParticleFlow/PFClusterProducer/test/run_display.sh index f36f11d10a0e0..45f194a88c37e 100755 --- a/RecoParticleFlow/PFClusterProducer/test/run_display.sh +++ b/RecoParticleFlow/PFClusterProducer/test/run_display.sh @@ -1,6 +1,7 @@ #!/bin/bash -cmsShow -c ${CMSSW_BASE}/src/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc -g /home/lgray/xHGCAL/cmsRecoGeom1-HGCAL.root --sim-geom-file /home/lgray/xHGCAL/cmsSimGeom-14-HGCAL.root /home/lgray/CMSSW_6_2_0_SLHC16/src/matrix_tests/simple_jet_gun/step3.root +cmsShow -c ${CMSSW_BASE}/src/RecoParticleFlow/PFClusterProducer/test/hgcal_rechits.fwc -g ~/work/public/xHGCAL/cmsRecoGeom1-HGCAL.root --sim-geom-file ~/work/public/xHGCAL/cmsSimGeom-14-HGCAL.root ${CMSSW_BASE}/src/matrix_tests/14801_FourMuPt1_200+FourMuPt_1_200_Extended2023HGCalV4_GenSimFull+DigiFull_Extended2023HGCalV4+RecoFull_Extended2023HGCalV4+HARVESTFull_Extended2023HGCalV4/step3.root + #12202_SinglePionPt35+SinglePionPt35_Extended2023HGCalMuon_GenSimFull+DigiFull_Extended2023HGCalMuon+RecoFull_Extended2023HGCalMuon+HARVESTFull_Extended2023HGCalMuon diff --git a/RecoParticleFlow/PFProducer/plugins/kdtrees/KDTreeLinkerTrackHGC.h b/RecoParticleFlow/PFProducer/plugins/kdtrees/KDTreeLinkerTrackHGC.h index a9d49e131db53..203d3b52c2353 100644 --- a/RecoParticleFlow/PFProducer/plugins/kdtrees/KDTreeLinkerTrackHGC.h +++ b/RecoParticleFlow/PFProducer/plugins/kdtrees/KDTreeLinkerTrackHGC.h @@ -99,6 +99,7 @@ KDTreeLinkerTrackHGC::insertFieldClusterElt(reco::PFBlockEl // We create a list of hgcCluster fieldClusterSet_.insert(hgcCluster); + /* DetId seedId( clusterref->seed() ); unsigned seedLayer = 1000; if( seedId.det() == DetId::Forward ) { @@ -111,10 +112,12 @@ KDTreeLinkerTrackHGC::insertFieldClusterElt(reco::PFBlockEl throw cms::Exception("BadSeedRecHit") << "HGC KDTree Linker only accepts HGC DetIds! got: " << seedId.det(); } + */ for(size_t rhit = 0; rhit < fraction.size(); ++rhit) { const reco::PFRecHitRef& rh = fraction[rhit].recHitRef(); double fract = fraction[rhit].fraction(); + /* DetId rhId( rh->detId() ); unsigned rhLayer = 1000; @@ -128,8 +131,8 @@ KDTreeLinkerTrackHGC::insertFieldClusterElt(reco::PFBlockEl throw cms::Exception("BadRecHit") << "HGC KDTree Linker only accepts HGC DetIds! got: " << rhId.det(); } - - if ( (rh.isNull()) || (fract < 1E-4) || rhLayer != seedLayer ) + */ + if ( (rh.isNull()) || (fract < 1E-4) ) // || rhLayer != seedLayer ) continue; const reco::PFRecHit& rechit = *rh; @@ -233,7 +236,7 @@ void // Estimate the maximal envelope in phi/eta that will be used to find rechit candidates. // Same envelope for cap et barrel rechits. - double range = getCristalPhiEtaMaxSize() * (2.0 + 1.0 / std::min(1., trackPt / 2.)); + double range = getCristalPhiEtaMaxSize() * (2.0 + 1.0 / std::min(1., 0.5*trackPt )); // We search for all candidate recHits, ie all recHits contained in the maximal size envelope. std::vector recHits;