CMS 3D CMS Logo

SeedingRegionByHF.cc
Go to the documentation of this file.
1 #include <algorithm>
2 #include <set>
3 #include <vector>
4 
5 #include "SeedingRegionByHF.h"
6 
7 using namespace ticl;
8 
10  : SeedingRegionAlgoBase(conf, sumes),
11  hfhits_token_(sumes.consumes<HFRecHitCollection>(conf.getParameter<edm::InputTag>("hits"))),
12  minAbsEta_(conf.getParameter<double>("minAbsEta")),
13  maxAbsEta_(conf.getParameter<double>("maxAbsEta")),
14  minEt_(conf.getParameter<double>("minEt")) {
16 }
17 
19 
21 
23  const edm::EventSetup &es,
24  std::vector<TICLSeedingRegion> &result) {
25  const auto &recHits = ev.get(hfhits_token_);
26 
27  for (const auto &erh : recHits) {
28  const HcalDetId &detid = (HcalDetId)erh.detid();
29  if (erh.energy() < minEt_)
30  continue;
31 
32  const GlobalPoint &globalPosition =
34  auto eta = globalPosition.eta();
35 
37  continue;
38 
39  int iSide = int(eta > 0);
40  int idx = 0;
41  edm::ProductID hfSeedId = edm::ProductID(detid.rawId());
42 
43  auto phi = globalPosition.phi();
44  double theta = 2 * atan(exp(eta));
45  result.emplace_back(
46  globalPosition, GlobalVector(GlobalVector::Polar(theta, phi, erh.energy())), iSide, idx, hfSeedId);
47  }
48 
49  // sorting seeding region by descending momentum
50  std::sort(result.begin(), result.end(), [](const TICLSeedingRegion &a, const TICLSeedingRegion &b) {
51  return a.directionAtOrigin.perp2() > b.directionAtOrigin.perp2();
52  });
53 }
54 
56  desc.add<edm::InputTag>("hits", edm::InputTag("hfreco"));
57  desc.add<int>("algo_verbosity", 0);
58  desc.add<double>("minAbsEta", 3.0);
59  desc.add<double>("maxAbsEta", 4.0);
60  desc.add<double>("minEt", 5);
62 }
ticl::SeedingRegionByHF::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: SeedingRegionByHF.cc:55
ticl::SeedingRegionByHF::maxAbsEta_
double maxAbsEta_
Definition: SeedingRegionByHF.h:47
ticl::SeedingRegionByHF::initialize
void initialize(const edm::EventSetup &es) override
Definition: SeedingRegionByHF.cc:20
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
DetId::Hcal
Definition: DetId.h:28
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
ticl::SeedingRegionAlgoBase
Definition: SeedingRegionAlgoBase.h:22
edm::SortedCollection
Definition: SortedCollection.h:49
Geom::Spherical2Cartesian
Definition: CoordinateSets.h:58
ticl::SeedingRegionByHF::SeedingRegionByHF
SeedingRegionByHF(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
Definition: SeedingRegionByHF.cc:9
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
ticl
Definition: Common.h:8
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
CaloGeometry
Definition: CaloGeometry.h:21
SeedingRegionByHF.h
PVValHelper::eta
Definition: PVValidationHelpers.h:70
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
Point3DBase< float, GlobalTag >
b
double b
Definition: hdecay.h:118
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
ticl::SeedingRegionByHF::makeRegions
void makeRegions(const edm::Event &ev, const edm::EventSetup &es, std::vector< TICLSeedingRegion > &result) override
Definition: SeedingRegionByHF.cc:22
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
HcalDetId
Definition: HcalDetId.h:12
createfilelist.int
int
Definition: createfilelist.py:10
CaloSubdetectorGeometry::getGeometry
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Definition: CaloSubdetectorGeometry.cc:36
edm::EventSetup
Definition: EventSetup.h:58
TICLSeedingRegion
Definition: TICLSeedingRegion.h:14
ticl::SeedingRegionByHF::minAbsEta_
double minAbsEta_
Definition: SeedingRegionByHF.h:46
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
HcalForward
Definition: HcalAssistant.h:36
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ticl::SeedingRegionByHF::geometry_
const CaloGeometry * geometry_
Definition: SeedingRegionByHF.h:51
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
ticl::SeedingRegionAlgoBase::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: SeedingRegionAlgoBase.h:34
edm::Transition::BeginRun
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
ticl::SeedingRegionByHF::geo_token_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geo_token_
Definition: SeedingRegionByHF.h:50
ticl::SeedingRegionByHF::hfhits_token_
edm::EDGetTokenT< HFRecHitCollection > hfhits_token_
Definition: SeedingRegionByHF.h:42
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ticl::SeedingRegionByHF::minEt_
double minEt_
Definition: SeedingRegionByHF.h:48
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
edm::ProductID
Definition: ProductID.h:27
ticl::SeedingRegionByHF::~SeedingRegionByHF
~SeedingRegionByHF() override
Definition: SeedingRegionByHF.cc:18