Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite and Improvements for PFRecHit and PFCluster Producers #2730

Merged
merged 61 commits into from Mar 14, 2014

Conversation

lgray
Copy link
Contributor

@lgray lgray commented Mar 5, 2014

Built on top of CMSSW_7_1_X_2014-03-05-0200.
For testing on top of pre3 use the branch: pfcluster_rebuild_onpre3.

This PR is a complete rewrite of PFRecHit and PFCluster Producers/Algos.
The rewrite focuses on making the clustering and rechit building modular and easy to adapt to using new detector information.

NOTE: PFRootEvent is removed from the release, it is likely to come back in some form later.

Expected changes:

  • Timing improvements to PFRecHit and PFCluster producers across the board
    • Some large, esp. preshower rechits
  • Changes per-cluster in energy and position assignment in some small cases where we have corrected the navigation topology. ECAL and HCAL are affected here.
    • Previously it was sometimes the case that a was 'a' neighbor of 'b' but 'b' was not of 'a' in ecal endcap.
    • We no longer use the CaloTower det ID navigation, this causes some churn in the HCAL clusters.
  • Some very minor churn (one in few million clusters) for HO/HF/Preshower from fast_log / fast_expf
  • Churn in Jet and MET responses per-event due to cluster changes, but no change in the resulting distribution Mean/RMS/Tails.

Additional comments from Michalis (reproduced up here to pull everything together):

  • Also let me comment that the (almost transient) PF DataFormats on RecHits and Clusters have been changed to accomodate the new changes. Since they didnt allow to assign navigation for more complicated geometries [i.e 3D ]
  • A quality cut in the HO is removed since the photodetectors are being replaced with SiPMs. We expect an increase in HO clusters and rechits in rings 1/2. This is seen in antons' analysis.
    • This quality cut will be added back now in this PR.

@bachtis
Copy link
Contributor

bachtis commented Mar 5, 2014

Also let me comment that the (almost transient) PF DataFormats on RecHits and Clusters have been changed to accomodate the new changes. Since they didnt allow to assign navigation for more complicated geometries [i.e 3D ]

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2014

A new Pull Request was created by @lgray (Lindsey Gray) for CMSSW_7_1_X.

Rewrite and Improvements for PFRecHit and PFCluster Producers

It involves the following packages:

DataFormats/ParticleFlowReco
HLTrigger/Configuration
RecoParticleFlow/Configuration
RecoParticleFlow/PFClusterProducer
RecoParticleFlow/PFRootEvent

@perrotta, @cmsbuild, @thspeer, @fwyzard, @Martin-Grunewald, @anton-a, @nclopezo, @slava77, @Degano can you please review it and eventually sign? Thanks.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@nclopezo
Copy link
Contributor

nclopezo commented Mar 5, 2014

@lgray
Hi Lindsey,
This pull request is unmergeable, could you please rebase it?

@lgray
Copy link
Contributor Author

lgray commented Mar 5, 2014

@nclopezo what IB should I take?

@Martin-Grunewald
Copy link
Contributor

-1
HLTrigger/Configuration changes have to go through ConfDB.

@lgray
Copy link
Contributor Author

lgray commented Mar 5, 2014

@Martin-Grunewald The HLT changes are patch for making tests run so that we could validate this change set. We can remove those changes and go through conf db in another step.

@nclopezo
Copy link
Contributor

nclopezo commented Mar 5, 2014

@lgray you should take CMSSW_7_1_X_2014-03-05-0200

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2014

Pull request #2730 was updated. @perrotta, @cmsbuild, @thspeer, @fwyzard, @Martin-Grunewald, @anton-a, @nclopezo, @slava77, @Degano can you please check and sign again.

@lgray
Copy link
Contributor Author

lgray commented Mar 5, 2014

re-rebasing to CMSSW_7_1_X_2014-03-05-0200... jumped the gun and rebased to the afternoon IB first.

@lgray
Copy link
Contributor Author

lgray commented Mar 5, 2014

@nclopezo now on CMSSW_7_1_X_2014-03-05-0200

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2014

Pull request #2730 was updated. @perrotta, @cmsbuild, @thspeer, @fwyzard, @Martin-Grunewald, @anton-a, @nclopezo, @slava77, @Degano can you please check and sign again.

@lgray
Copy link
Contributor Author

lgray commented Mar 5, 2014

Sorry for the noise, fixed obvious problem from rebasing.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2014

Pull request #2730 was updated. @perrotta, @cmsbuild, @thspeer, @fwyzard, @Martin-Grunewald, @anton-a, @nclopezo, @slava77, @Degano can you please check and sign again.

@lgray
Copy link
Contributor Author

lgray commented Mar 5, 2014

---- PLOT DUMP ----

ECAL Cluster Energies (from RelValTTBar_13):
ecal_energy_overlay_linear
ecal_energy_overlay

HCAL Cluster Energies:
hcal_energy_overlay_linear
hcal_energy_overlay

PS Cluster Energies:
ps_energy_overlay_linear
ps_energy_overlay

MET Response:
met_response_linear
met_response

Jet Response:
response

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2014

-1
When I ran the RelVals I found an error in the following worklfows:
50101.0 step2

runTheMatrix-results/50101.0_SingleMuPt10+SingleMuPt10FSIdINPUT+SingleMuPt10FS_ID/step2_SingleMuPt10+SingleMuPt10FSIdINPUT+SingleMuPt10FS_ID.log
----- Begin Fatal Exception 05-Mar-2014 17:33:08 CET-----------------------
An exception of category 'FileReadError' occurred while
   [0] Processing run: 1 lumi: 5 event: 12001
   [1] Running path 'FEVTDEBUGHLToutput_step'
   [2] Calling event method for module PoolOutputModule/'FEVTDEBUGHLToutput'
   [3] Reading branch recoPFRecHits_particleFlowRecHitECAL__HLT.
   Additional Info:
      [a] Fatal Root Error: @SUB=TStreamerInfo::BuildOld
Cannot convert reco::PFRecHit::neighbours4_ from type:vector to type:edm::RefVector,reco::PFRecHit,edm::refhelper::FindUsingAdvance,reco::PFRecHit> >, skip element
----- End Fatal Exception -------------------------------------------------

you can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-2730/362/summary.html

@bachtis
Copy link
Contributor

bachtis commented Mar 5, 2014

Yes this is because the dataformats have changed .... are old dataformats written on this test as input?


/// transient layer
PFLayer::Layer layer_;

#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
/// \todo move to PFClusterTools
static std::atomic<int> depthCorMode_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance this could be moved as the comment says? Would help aleviate threading concerns.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you mean the std::atomic stuff. I am pretty sure none of those variables are used any more.

@Martin-Grunewald
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_1_X IBs unless changes or unless it breaks tests. @nclopezo, @ktf can you please take care of it?

@lgray
Copy link
Contributor Author

lgray commented Mar 13, 2014

@ktf Possible to merge? @anton-a ran and produced results using the latest commit.

@slava77
Copy link
Contributor

slava77 commented Mar 13, 2014

Here's a bit cherry-picked summary for timing in pf-related modules
in CMSSW_7_1_X_2014-03-12-1400 using 200 events of matrix wflow 202.0

        particleFlowRecHitECAL   12.6115 ms/ev -> 19.8254 ms/ev
        particleFlowRecHitPS     17.1531 ms/ev -> 20.6083 ms/ev
        particleFlowClusterPS    20.7397 ms/ev -> 15.0606 ms/ev
        particleFlowClusterECAL          108.816 ms/ev -> 34.6245 ms/ev
        particleFlowClusterECALUncorrected       34.6637 ms/ev   (new module, need to add to above)
        particleFlowClusterHCAL          35.9695 ms/ev -> 19.7524 ms/ev
        particleFlowRecHitHO     0.218994 ms/ev -> 1.17935 ms/ev
        multi5x5SuperClustersWithPreshower       34.6906 ms/ev -> 22.3338 ms/ev  (not sure about this one)

The only somewhat surprising part is the particleFlowRecHitHO, which is increased by a factor of a few. I see the same difference in HO pfrechit in this final PR as well as with your initial submission
#2730 4616648

@bachtis
Copy link
Contributor

bachtis commented Mar 13, 2014

@slava77 is this data or MC ? If it is data it could be that the cleaning is done at the end now and we should ignore since the cuts will change..If it is MC the only change is that I am now using in all modules the CaloNavigator class to find neighbours [check PFRecHitCaloNavigator] so this class could possibly be centrally optimized?

@slava77
Copy link
Contributor

slava77 commented Mar 13, 2014

wflow 202.0 is ttbar MC with 2012-like pileup

@bachtis
Copy link
Contributor

bachtis commented Mar 13, 2014

Then it has to .be the navigator [I assume there are no rechits to be cleaned in this sample] .In that case I can not do something since the custom navigation that was done in PFhad small problems.....

@slava77
Copy link
Contributor

slava77 commented Mar 13, 2014

It looks like all the cost in the HO is in PFHcalRecHitCreator importRecHits (the navigation doesn't really show up), based on igprof.
Looking at PFHcalRecHitCreator.h, I think the main reason for more CPU is that you create a PFRecHit (which includes quite a bit of geometry manipulations) before the threshold and other quality checks. The old code does it only after the HO hit passes cuts.

@bachtis
Copy link
Contributor

bachtis commented Mar 13, 2014

Thanks! OK but I dont want to change that .. When the quality tests are running you need to have the PFrecHit since the quality tests can change its energy etc. We need this functionality to migrate the HF clustering from hits [where short +long fibre is combined ] and to calibrate specific towers in boundaries. Since cumulatively we are doing much better I would prefer to stay like this .

@slava77
Copy link
Contributor

slava77 commented Mar 13, 2014

On 3/13/14, 5:12 PM, bachtis wrote:

Thanks! OK but I dont want to change that .. When the quality tests are
running you need to have the PFrecHit since the quality tests can change
its energy etc. We need this functionality to migrate the HF clustering
from hits [where short +long fibre is combined ] and to calibrate
specific towers in boundaries. Since cumulatively we are doing much
better I would prefer to stay like this .

OK.
In this case the cost is fairly low.
Also, it's specific to the Run-1 HO hit "quality" (only inner rings are
good for pf).
So, this increase in relative weight is going to go away


Reply to this email directly or view it on GitHub
#2730 (comment).


Vyacheslav (Slava) Krutelyov
TAMU: Physics Dept Texas A&M MS4242, College Station, TX 77843-4242
CERN: 42-R-027
AIM/Skype: siava16 googleTalk: slava77@gmail.com
(630) 291-5128 Cell (US) +41 76 275 7116 Cell (CERN)



iEvent.getByToken(recHitToken_,recHitHandle);
for (unsigned int i=0;i<recHitHandle->size();++i) {
const Digi& erh = (*recHitHandle)[i];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dereferencing a handle has a non-zero cost (just because the implementation is not inlined).
You are doing it here for every single hit.
This looks common for all of the code in this PR (just inherited from the old PF code).

@bachtis
Copy link
Contributor

bachtis commented Mar 13, 2014

OK will fix that . Indeed it was copy paste from old module . I will have a technical commit next week towards the HCAl migration to hits [dactivated ] so I will add this.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_1_X IBs unless changes (tests are also fine). @nclopezo, @ktf can you please take care of it?

ktf added a commit that referenced this pull request Mar 14, 2014
Reco -- Rewrite and Improvements for PFRecHit and PFCluster Producers
@ktf ktf merged commit 371428d into cms-sw:CMSSW_7_1_X Mar 14, 2014
lgray added a commit to lgray/cmssw that referenced this pull request Mar 14, 2014
lgray added a commit to lgray/cmssw that referenced this pull request Mar 14, 2014
ktf added a commit that referenced this pull request Mar 17, 2014
Reco -- Further code review from the end of #2730
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet