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
HGCAL trigger: EM cluster identification #23024
Conversation
Implement EM cluster identification
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-23024/4427 |
A new Pull Request was created by @jbsauvan (Jean-Baptiste Sauvan) for master. It involves the following packages: L1Trigger/L1THGCal @nsmith-, @rekovic, @cmsbuild, @thomreis, @kpedro88 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
|
||
}; | ||
|
||
DEFINE_EDM_PLUGIN(HGCalTriggerClusterIdentificationFactory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could define your own macro with the first argument (factory type) fixed, to simplify the definitions
(assuming this factory will be used more in the future)
std::vector<double> categories_ptmin = conf.getParameter<std::vector<double>>("CategoriesPtMin"); | ||
std::vector<double> categories_ptmax = conf.getParameter<std::vector<double>>("CategoriesPtMax"); | ||
working_points_ = conf.getParameter<std::vector<double>>("WorkingPoints"); | ||
for(unsigned cat=0; cat<categories_etamin.size(); cat++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be a check that these four vectors have the same size
HGCalTriggerClusterIdentificationBDT:: | ||
initialize(const edm::ParameterSet& conf) | ||
{ | ||
categories_.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the idea here that an instance of this object could be re-initialized? Would it make sense just to do the initialization once and then use another object for another set of parameters?
std::vector<double> categories_etamax = conf.getParameter<std::vector<double>>("CategoriesEtaMax"); | ||
std::vector<double> categories_ptmin = conf.getParameter<std::vector<double>>("CategoriesPtMin"); | ||
std::vector<double> categories_ptmax = conf.getParameter<std::vector<double>>("CategoriesPtMax"); | ||
working_points_ = conf.getParameter<std::vector<double>>("WorkingPoints"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before the loop, you can do categories_.reserve()
since the number of categories is known from the input
categories_etamax[cat]); | ||
} | ||
std::vector<std::string> spectators = {}; | ||
for (const auto& file : bdt_files) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can also reserve()
before this loop
HGCalTriggerClusterIdentificationBDT:: | ||
clusterVariable(const std::string& variable, const l1t::HGCalMulticluster& cluster) const | ||
{ | ||
if(variable=="cl3d_showerlength") return cluster.showerLength(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think about defining enums for these known quantities to limit repeated string comparisons
float pt = cluster.pt(); | ||
float eta = cluster.eta(); | ||
int cat = category(pt, eta); | ||
return (cat!=-1 ? bdts_.at(cat)->evaluate(inputs) : -999.); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to consider adding/modifying interfaces for TMVAEvaluator
, creating a map is probably more work than necessary. (outside the scope of this PR, but just so I remember later)
The code-checks are being triggered in jenkins. |
Thanks @kpedro88 I have implemented your suggestions. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-23024/4437 |
1 similar comment
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2) |
please test |
The tests are being triggered in jenkins. |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1 |
Add identification of electromagnetic clusters based on BDTs.
Depends on external cms-data/L1Trigger-L1THGCal#7