-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
HFNose: ticl updates #33001
Merged
Merged
HFNose: ticl updates #33001
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
06a85eb
initial version
mariadalfonso f8110fd
use min_cluster_size = 2
mariadalfonso ad064cd
fix getPositionLayer for HFnose
mariadalfonso 7dcd854
set min_layers_per_trackster to 5 for EM object (5/6 EM layers)
mariadalfonso 5aba3a1
re-add caloParticles for HFNose
mariadalfonso 6cc9558
add Had (HGCAL standalone) iteration
mariadalfonso c424110
code-format
mariadalfonso 2d832b0
remove HF Seeding
mariadalfonso 732848a
add SeedingRegionByHF
mariadalfonso 73811dc
fix SeedingRegionByTracks
mariadalfonso 9563b8e
improve SeedingRegionByHF
mariadalfonso cf964a2
code-format
mariadalfonso f1dfd44
restrict caloParticle to HFnose; customize the associations
mariadalfonso b1df50f
fix code style
mariadalfonso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#include <algorithm> | ||
#include <set> | ||
#include <vector> | ||
|
||
#include "SeedingRegionByHF.h" | ||
|
||
using namespace ticl; | ||
|
||
SeedingRegionByHF::SeedingRegionByHF(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes) | ||
: SeedingRegionAlgoBase(conf, sumes), | ||
hfhits_token_(sumes.consumes<HFRecHitCollection>(conf.getParameter<edm::InputTag>("hits"))), | ||
minAbsEta_(conf.getParameter<double>("minAbsEta")), | ||
maxAbsEta_(conf.getParameter<double>("maxAbsEta")), | ||
minEt_(conf.getParameter<double>("minEt")) { | ||
geo_token_ = sumes.esConsumes<CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun>(); | ||
} | ||
|
||
SeedingRegionByHF::~SeedingRegionByHF() {} | ||
|
||
void SeedingRegionByHF::initialize(const edm::EventSetup &es) { geometry_ = &es.getData(geo_token_); } | ||
|
||
void SeedingRegionByHF::makeRegions(const edm::Event &ev, | ||
const edm::EventSetup &es, | ||
std::vector<TICLSeedingRegion> &result) { | ||
const auto &recHits = ev.get(hfhits_token_); | ||
|
||
for (const auto &erh : recHits) { | ||
const HcalDetId &detid = (HcalDetId)erh.detid(); | ||
if (erh.energy() < minEt_) | ||
continue; | ||
|
||
const GlobalPoint &globalPosition = | ||
geometry_->getSubdetectorGeometry(DetId::Hcal, HcalForward)->getGeometry(detid)->getPosition(detid); | ||
auto eta = globalPosition.eta(); | ||
|
||
if (std::abs(eta) < minAbsEta_ || std::abs(eta) > maxAbsEta_) | ||
continue; | ||
|
||
int iSide = int(eta > 0); | ||
int idx = 0; | ||
edm::ProductID hfSeedId = edm::ProductID(detid.rawId()); | ||
|
||
auto phi = globalPosition.phi(); | ||
double theta = 2 * atan(exp(eta)); | ||
result.emplace_back( | ||
globalPosition, GlobalVector(GlobalVector::Polar(theta, phi, erh.energy())), iSide, idx, hfSeedId); | ||
} | ||
|
||
// sorting seeding region by descending momentum | ||
std::sort(result.begin(), result.end(), [](const TICLSeedingRegion &a, const TICLSeedingRegion &b) { | ||
return a.directionAtOrigin.perp2() > b.directionAtOrigin.perp2(); | ||
}); | ||
} | ||
|
||
void SeedingRegionByHF::fillPSetDescription(edm::ParameterSetDescription &desc) { | ||
desc.add<edm::InputTag>("hits", edm::InputTag("hfreco")); | ||
desc.add<int>("algo_verbosity", 0); | ||
desc.add<double>("minAbsEta", 3.0); | ||
desc.add<double>("maxAbsEta", 4.0); | ||
desc.add<double>("minEt", 5); | ||
SeedingRegionAlgoBase::fillPSetDescription(desc); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Author: [email protected] | ||
// Date: 02/2021 | ||
|
||
#ifndef RecoHGCal_TICL_SeedingRegionByHF_h | ||
#define RecoHGCal_TICL_SeedingRegionByHF_h | ||
#include <memory> // unique_ptr | ||
#include <string> | ||
#include "RecoHGCal/TICL/plugins/SeedingRegionAlgoBase.h" | ||
|
||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
#include "FWCore/Framework/interface/ConsumesCollector.h" | ||
#include "CommonTools/Utils/interface/StringCutObjectSelector.h" | ||
#include "FWCore/Utilities/interface/ESGetToken.h" | ||
|
||
#include "DataFormats/HcalRecHit/interface/HFRecHit.h" | ||
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" | ||
#include "Geometry/CaloGeometry/interface/CaloGeometry.h" | ||
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" | ||
#include "Geometry/Records/interface/CaloGeometryRecord.h" | ||
|
||
namespace ticl { | ||
class SeedingRegionByHF final : public SeedingRegionAlgoBase { | ||
public: | ||
SeedingRegionByHF(const edm::ParameterSet& conf, edm::ConsumesCollector& sumes); | ||
~SeedingRegionByHF() override; | ||
|
||
void initialize(const edm::EventSetup& es) override; | ||
|
||
void makeRegions(const edm::Event& ev, const edm::EventSetup& es, std::vector<TICLSeedingRegion>& result) override; | ||
static void fillPSetDescription(edm::ParameterSetDescription& desc); | ||
static edm::ParameterSetDescription makePSetDescription(); | ||
|
||
private: | ||
void buildFirstLayers(); | ||
|
||
edm::EDGetTokenT<HFRecHitCollection> hfhits_token_; | ||
|
||
int algoVerbosity_ = 0; | ||
|
||
double minAbsEta_; | ||
double maxAbsEta_; | ||
double minEt_; | ||
|
||
edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geo_token_; | ||
const CaloGeometry* geometry_; | ||
}; | ||
} // namespace ticl | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you use a more expressive name? Also for the downstream
HADn
andTrkEMn
.