CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ticl::SeedingRegionByL1 Class Referencefinal

#include <SeedingRegionByL1.h>

Inheritance diagram for ticl::SeedingRegionByL1:
ticl::SeedingRegionAlgoBase

Public Member Functions

void initialize (const edm::EventSetup &es) override
 
void makeRegions (const edm::Event &ev, const edm::EventSetup &es, std::vector< TICLSeedingRegion > &result) override
 
 SeedingRegionByL1 (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
- Public Member Functions inherited from ticl::SeedingRegionAlgoBase
 SeedingRegionAlgoBase (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
virtual ~SeedingRegionAlgoBase ()
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from ticl::SeedingRegionAlgoBase
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 

Private Attributes

int algoVerbosity_ = 0
 
bool applyQuality_
 
edm::EDGetTokenT< l1t::P2GTCandidateCollectionl1GTCandsToken_
 
double maxAbsEta_
 
double minAbsEta_
 
double minPt_
 
int quality_
 
bool qualityIsMask_
 

Additional Inherited Members

- Protected Attributes inherited from ticl::SeedingRegionAlgoBase
int algo_verbosity_
 
int algoId_
 

Detailed Description

Definition at line 23 of file SeedingRegionByL1.h.

Constructor & Destructor Documentation

◆ SeedingRegionByL1()

ticl::SeedingRegionByL1::SeedingRegionByL1 ( const edm::ParameterSet conf,
edm::ConsumesCollector sumes 
)

Definition at line 19 of file SeedingRegionByL1.cc.

20  : SeedingRegionAlgoBase(conf, sumes),
22  algoVerbosity_(conf.getParameter<int>("algo_verbosity")),
23  minPt_(conf.getParameter<double>("minPt")),
24  minAbsEta_(conf.getParameter<double>("minAbsEta")),
25  maxAbsEta_(conf.getParameter<double>("maxAbsEta")),
26  quality_(conf.getParameter<int>("quality")),
27  qualityIsMask_(conf.getParameter<bool>("qualityIsMask")),
28  applyQuality_(conf.getParameter<bool>("applyQuality")) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
SeedingRegionAlgoBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
std::vector< P2GTCandidate > P2GTCandidateCollection
Definition: P2GTCandidate.h:16
edm::EDGetTokenT< l1t::P2GTCandidateCollection > l1GTCandsToken_

Member Function Documentation

◆ fillPSetDescription()

void ticl::SeedingRegionByL1::fillPSetDescription ( edm::ParameterSetDescription desc)
static

Definition at line 69 of file SeedingRegionByL1.cc.

References submitPVResolutionJobs::desc, ticl::SeedingRegionAlgoBase::fillPSetDescription(), and ProducerED_cfi::InputTag.

69  {
70  desc.add<edm::InputTag>("l1GTCandColl", edm::InputTag("L1TkPhotonsHGC", "EG"));
71  desc.add<double>("minPt", 10);
72  desc.add<double>("minAbsEta", 1.479);
73  desc.add<double>("maxAbsEta", 4.0);
74  desc.add<int>("quality", 5);
75  desc.add<bool>("qualityIsMask", false);
76  desc.add<bool>("applyQuality", false);
78 }
static void fillPSetDescription(edm::ParameterSetDescription &desc)

◆ initialize()

void ticl::SeedingRegionByL1::initialize ( const edm::EventSetup es)
inlineoverridevirtual

Implements ticl::SeedingRegionAlgoBase.

Definition at line 27 of file SeedingRegionByL1.h.

27 {};

◆ makeRegions()

void ticl::SeedingRegionByL1::makeRegions ( const edm::Event ev,
const edm::EventSetup es,
std::vector< TICLSeedingRegion > &  result 
)
overridevirtual

Implements ticl::SeedingRegionAlgoBase.

Definition at line 30 of file SeedingRegionByL1.cc.

References a, funct::abs(), b, makeMEIFBenchmarkPlots::ev, edm::ProductID::id(), createfilelist::int, mps_fire::result, and jetUpdater_cfi::sort.

32  {
33  auto l1GTCands = ev.getHandle(l1GTCandsToken_);
34  edm::ProductID l1gtcandsId = l1GTCands.id();
35 
36  for (size_t indx = 0; indx < (*l1GTCands).size(); indx++) {
37  const auto &l1GTCand = (*l1GTCands)[indx];
38  double offlinePt = l1GTCand.pt();
39  bool passQuality(false);
40 
41  if (applyQuality_) {
42  if (qualityIsMask_) {
43  passQuality = (l1GTCand.hwQualityFlags() & quality_);
44  } else {
45  passQuality = (l1GTCand.hwQualityFlags() == quality_);
46  }
47  } else {
48  passQuality = true;
49  }
50 
51  if ((offlinePt < minPt_) || (std::abs(l1GTCand.eta()) < minAbsEta_) || (std::abs(l1GTCand.eta()) > maxAbsEta_) ||
52  !passQuality) {
53  continue;
54  }
55 
56  int iSide = int(l1GTCand.eta() > 0);
57  result.emplace_back(GlobalPoint(l1GTCand.p4().X(), l1GTCand.p4().Y(), l1GTCand.p4().Z()),
58  GlobalVector(l1GTCand.px(), l1GTCand.py(), l1GTCand.pz()),
59  iSide,
60  indx,
61  l1gtcandsId);
62  }
63 
64  std::sort(result.begin(), result.end(), [](const TICLSeedingRegion &a, const TICLSeedingRegion &b) {
65  return a.directionAtOrigin.perp2() > b.directionAtOrigin.perp2();
66  });
67 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ProductIndex id() const
Definition: ProductID.h:35
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
edm::EDGetTokenT< l1t::P2GTCandidateCollection > l1GTCandsToken_
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Data Documentation

◆ algoVerbosity_

int ticl::SeedingRegionByL1::algoVerbosity_ = 0
private

Definition at line 33 of file SeedingRegionByL1.h.

◆ applyQuality_

bool ticl::SeedingRegionByL1::applyQuality_
private

Definition at line 39 of file SeedingRegionByL1.h.

◆ l1GTCandsToken_

edm::EDGetTokenT<l1t::P2GTCandidateCollection> ticl::SeedingRegionByL1::l1GTCandsToken_
private

Definition at line 32 of file SeedingRegionByL1.h.

◆ maxAbsEta_

double ticl::SeedingRegionByL1::maxAbsEta_
private

Definition at line 36 of file SeedingRegionByL1.h.

◆ minAbsEta_

double ticl::SeedingRegionByL1::minAbsEta_
private

Definition at line 35 of file SeedingRegionByL1.h.

◆ minPt_

double ticl::SeedingRegionByL1::minPt_
private

Definition at line 34 of file SeedingRegionByL1.h.

◆ quality_

int ticl::SeedingRegionByL1::quality_
private

Definition at line 37 of file SeedingRegionByL1.h.

◆ qualityIsMask_

bool ticl::SeedingRegionByL1::qualityIsMask_
private

Definition at line 38 of file SeedingRegionByL1.h.