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

Format for clustering CSC rechits with jet algorithms #35543

Closed
wants to merge 9 commits into from

Conversation

kakwok
Copy link
Contributor

@kakwok kakwok commented Oct 5, 2021

PR description:

This PR adds a new class CSCJetCandidate that builds from CSCRecHit2D and conform to Reco::Candidate format.
The new collection can be used for running jet algorithms on CSC rechits.
This is an essential ingredient for an HLT path for LLP in Run 3.

Presentation at Reco meeting, Oct 1

PR validation:

runTheMatrix.py -l limited -i all --ibeos
31 0 0 0 0 0 0 0 0 tests passed, 8 31 0 0 0 0 0 0 0 failed

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35543/25769

  • This PR adds an extra 24KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2021

A new Pull Request was created by @kakwok for master.

It involves the following packages:

  • DataFormats/CSCRecHit (reconstruction)
  • RecoLocalMuon/CSCRecHitD (reconstruction)

@jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@HuguesBrun, @calderona, @abbiendi, @Fedespring, @bellan, @sscruz, @jhgoh, @ptcox, @rovere, @trocino, @cericeci this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

Copy link
Contributor

@slava77 slava77 left a comment

Choose a reason for hiding this comment

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

this is just a quick set of comments on the style

#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
#include "DataFormats/MuonDetId/interface/CSCDetId.h"

class CSCJetCandidateProducer : public edm::stream::EDProducer<> {
Copy link
Contributor

Choose a reason for hiding this comment

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

header files are not needed for plugins; please merge this .h file contents into the CSCJetCandidateProducer.cc

all new modules should have a fillDescriptions method defined to provide a default configuration
https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideConfigurationValidationAndHelp

Comment on lines -3 to +1
<use name="DataFormats/TrackingRecHit"/>
<use name="DataFormats/Common"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

please revert to the old indentation

Comment on lines +20 to +22
<class name="reco::CSCJetCandidate" ClassVersion="4">
<version ClassVersion="3" checksum="1185432696"/>
<version ClassVersion="4" checksum="882507185"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<class name="reco::CSCJetCandidate" ClassVersion="4">
<version ClassVersion="3" checksum="1185432696"/>
<version ClassVersion="4" checksum="882507185"/>
<class name="reco::CSCJetCandidate" ClassVersion="3">
<version ClassVersion="3" checksum="882507185"/>

remove intermediate/unused class versions

edm::ESHandle<CSCGeometry> cscG;
edm::Handle<CSCRecHit2DCollection> cscRechits;

setup.get<MuonGeometryRecord>().get(cscG);
Copy link
Contributor

Choose a reason for hiding this comment

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

#include "DataFormats/Math/interface/Point3D.h"
#include "DataFormats/Common/interface/SortedCollection.h"

#include <DataFormats/CSCRecHit/interface/CSCRecHit2D.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

not used.

Suggested change
#include <DataFormats/CSCRecHit/interface/CSCRecHit2D.h>


namespace reco {

class CSCJetCandidate : public LeafCandidate {
Copy link
Contributor

Choose a reason for hiding this comment

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

I have (so far just minor) preference for such class to be in DataFormats/MuonReco.
Also, the purpose seems to be rather generic and we should probably consider making a more generic type that can handle transparently other muon detectors (DT/RPC/GEM).

Comment on lines +23 to +24
: LeafCandidate(0, LorentzVector(math::PtEtaPhiMLorentzVector(1.0, eta, phi, 0)), Point(0, 0, 0)) {
x_ = x;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
: LeafCandidate(0, LorentzVector(math::PtEtaPhiMLorentzVector(1.0, eta, phi, 0)), Point(0, 0, 0)) {
x_ = x;
: LeafCandidate(0, LorentzVector(math::PtEtaPhiMLorentzVector(1.0, eta, phi, 0)), Point(0, 0, 0)), x_(x) {

initializer list (before { is preferred to the use of the constructor body)

[the comment applies to the rest of the members]

@slava77
Copy link
Contributor

slava77 commented Oct 5, 2021

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 6, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-8a69e7/19421/summary.html
COMMIT: f5f3b03
CMSSW: CMSSW_12_1_X_2021-10-05-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/35543/19421/install.sh to create a dev area with all the needed externals and cmssw changes.

CMS StaticAnalyzer warnings: There are 1 EventSetupRecord::get warnings. See https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-8a69e7/19421/llvm-analysis/esrget-sa.txt for details.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 40
  • DQMHistoTests: Total histograms compared: 3219394
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3219366
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 39 files compared)
  • Checked 169 log files, 37 edm output root files, 40 DQM output files
  • TriggerResults: no differences found

@VinInn
Copy link
Contributor

VinInn commented Oct 6, 2021

is all this really needed?
would not be better to directly call FastJet and avoid to create new data objects and copy back and forth info?

@slava77
Copy link
Contributor

slava77 commented Oct 6, 2021

is all this really needed? would not be better to directly call FastJet and avoid to create new data objects and copy back and forth info?

@laurenhay
please check this PR and perhaps clarify if there is a (configurable) interface to call FastJet directly without redirecting the edm::Event data via a jet producer?

In the reco meeting discussion on Oct 1 the discussion was suggestive that the persisted products in the standard data tiers (e.g. miniAOD) was not yet planned/intended.

@laurenhay
Copy link
Contributor

Pulling in @rappoccio to clarify since he's been in contact with Martin on this. From what I understand it's a no, FastJet can only run on compatible jet objects.

@rappoccio
Copy link
Contributor

Hi, @VinInn and @slava77

Generally speaking, no, we can't do this at the moment. We really have to rewrite the data formats for this from scratch if we want to avoid the back-and-forth copy. We are in contact with the fastjet authors to put in the hooks so that we can avoid the copy and just run on flat vectors.

(In fact I put a proposal in to get a postdoc to work on this for HL-LHC but it wasn't deemed important enough so wasn't funded).

This would be an HL-LHC target, we definitely shouldn't hold up this PR.

@VinInn
Copy link
Contributor

VinInn commented Oct 7, 2021

Do not understand. you have just to copy RecHit position in FastJet jets. clusterize. copy back into Clusters.
you know: as in http://fastjet.fr/repo/doxygen-3.3.4/04-constituents_8cc_source.html
This is infinitely easier that what done here. I am very sorry but I see real problems for all this to be acceptable at HLT.
(even in reco, for what I would be concerned).

@ptcox
Copy link
Contributor

ptcox commented Oct 7, 2021 via email

@rappoccio
Copy link
Contributor

Hi @VinInn we've been doing this at the HLT level since 2009, it's no different from every other jet collection at HLT.

@ptcox this is for an EXO-based trigger from @kakwok for long-lived jets.

@ptcox
Copy link
Contributor

ptcox commented Oct 7, 2021 via email

@slava77
Copy link
Contributor

slava77 commented Oct 7, 2021

Hi Tim,

I thought that this analysis was closely known in the CSC DPG. I guess I've overestimated.
As I commented in the preliminary review, I have (so far just minor) preference for such class to be in DataFormats/MuonReco.

@ptcox
Copy link
Contributor

ptcox commented Oct 7, 2021 via email

@kakwok
Copy link
Contributor Author

kakwok commented Oct 7, 2021

Hi @ptcox , yes, it's a consumer of CSC rechits. We can move the code to DataFormats/MuonReco as suggested by @slava77

Hi @rappoccio, if I understand correctly, @VinInn 's proposal is to write a new producer directly calling fastjet, which plays the role of the fastjetJetProducer to cluster on csc rechit directly. Would that be possible?
We would still need a new data format to hold the cluster information though.

@rappoccio
Copy link
Contributor

Hi, @kakwok that is indeed @VinInn's suggestion but I don't see the advantage to having parallel software that does exactly the same thing that is implemented already in cmssw.

@dpiparo
Copy link
Contributor

dpiparo commented Oct 8, 2021

Isn't @VinInn perhaps trying to hint to the costs implied by the approach?

@rappoccio
Copy link
Contributor

@dpiparo they're the same as other jet HLT paths. I also don't see the advantage. We still have to copy rechits to a new DataFormat just like we do now, but @VinInn's suggestion has the disadvantage of having parallel code that implements exactly the same thing as FastjetProducer, but with fewer features implemented and less validation ;).

A better approach is to fix this "en masse" during / after Run 3 so the data handling in and out of fastjet is done in a better way. We're already in contact with the authors (along with IRIS-HEP people), and the way forward is relatively clear, we just need someone who can do the implementation.

@VinInn
Copy link
Contributor

VinInn commented Oct 8, 2021 via email

@rappoccio
Copy link
Contributor

So that @kakwok and collaborators can access information about the CSC rechits from the jets they're making. It needs to be persistified one way or another.

https://github.com/cms-sw/cmssw/pull/35543/files#diff-e9b281fcb4d161c1ad2090f7ea36ea1f78ce9dc27143496de45e16d6a7fb348aR62-R74

@VinInn
Copy link
Contributor

VinInn commented Oct 8, 2021 via email

@rappoccio
Copy link
Contributor

IMO, "a specific CSC cluster with a RefVector" is a new dataformat that should be encapsulated concisely.

Anyway, you all have the last word. I think it's not going to be faster in the end, it will duplicate code, and will needlessly add to the long-term maintenance and validation costs. My 0.02 CHF. I'll shut up now :)

@slava77
Copy link
Contributor

slava77 commented Oct 25, 2021

@kakwok
please clarify on the status of updates to this PR.
Thank you.

@kakwok
Copy link
Contributor Author

kakwok commented Oct 25, 2021

@slava77
As discussed in the Reco meeting earlier, I have created a new PR #35836 that implements the direct fastjet approach as suggested by @VinInn

@slava77
Copy link
Contributor

slava77 commented Oct 25, 2021

-1

superseded by #35836

@perrotta
Copy link
Contributor

@kakwok , since the PR development is going on in #35836, I close this one to clean up the queue.
Please reopen if I misunderstood your intentions

@perrotta perrotta closed this Nov 23, 2021
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

10 participants