-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33001 from mariadalfonso/ticlNosefixes
HFNose: ticl updates
- Loading branch information
Showing
17 changed files
with
241 additions
and
26 deletions.
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.