CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Phase1L1TJetProducer Class Reference

#include <L1Trigger/L1CaloTrigger/plugin/Phase1L1TJetProducer.cc>

Inheritance diagram for Phase1L1TJetProducer:
edm::one::EDProducer<> edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 Phase1L1TJetProducer (const edm::ParameterSet &)
 
 ~Phase1L1TJetProducer () override
 
- Public Member Functions inherited from edm::one::EDProducer<>
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

std::vector< reco::CaloJet_buildJetsFromSeeds (const std::vector< std::tuple< int, int >> &seeds) const
 
std::vector< reco::CaloJet_buildJetsFromSeedsWithPUSubtraction (const std::vector< std::tuple< int, int >> &seeds, bool killZeroPt) const
 
reco::CaloJet buildJetFromSeed (const std::tuple< int, int > &seed) const
 
template<class Container >
void fillCaloGrid (TH2F &caloGrid, const Container &triggerPrimitives)
 
std::vector< std::tuple< int, int > > findSeeds (float seedThreshold) const
 Finds the seeds in the caloGrid, seeds are saved in a vector that contain the index in the TH2F of each seed. More...
 
float getTowerEnergy (int iEta, int iPhi) const
 Get the energy of a certain tower while correctly handling phi periodicity in case of overflow. More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 
void subtract9x9Pileup (reco::CaloJet &jet) const
 

Private Attributes

std::unique_ptr< TH2F > caloGrid_
 
std::vector< double > etaBinning_
 
edm::EDGetTokenT< edm::View< reco::Candidate > > inputCollectionTag_
 
unsigned int jetIEtaSize_
 
unsigned int jetIPhiSize_
 
size_t nBinsEta_
 
unsigned int nBinsPhi_
 
std::string outputCollectionName_
 
double phiLow_
 
double phiUp_
 
bool puSubtraction_
 
double seedPtThreshold_
 
bool vetoZeroPt_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: Produces jets with a phase-1 like sliding window algorithm using a collection of reco::Candidates in input.

INPUT PARAMETERS ***
etaBinning: vdouble with eta binning (allows non-homogeneous binning in eta)
nBinsPhi: uint32, number of bins in phi
phiLow: double, min phi (typically -pi)
phiUp: double, max phi (typically +pi)
jetIEtaSize: uint32, jet cluster size in ieta
jetIPhiSize: uint32, jet cluster size in iphi
seedPtThreshold: double, threshold of the seed tower
puSubtraction: bool, runs chunky doughnut pile-up subtraction, 9x9 jet only
outputCollectionName: string, tag for the output collection
vetoZeroPt: bool, controls whether jets with 0 pt should be save. 
It matters if PU is ON, as you can get negative or zero pt jets after it.
inputCollectionTag: inputtag, collection of reco::candidates used as input to the algo

Definition at line 56 of file Phase1L1TJetProducer.cc.

Constructor & Destructor Documentation

◆ Phase1L1TJetProducer()

Phase1L1TJetProducer::Phase1L1TJetProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 102 of file Phase1L1TJetProducer.cc.

103  : // getting configuration settings
105  consumes<edm::View<reco::Candidate>>(iConfig.getParameter<edm::InputTag>("inputCollectionTag"))},
106  etaBinning_(iConfig.getParameter<std::vector<double>>("etaBinning")),
107  nBinsEta_(etaBinning_.size() - 1),
108  nBinsPhi_(iConfig.getParameter<unsigned int>("nBinsPhi")),
109  phiLow_(iConfig.getParameter<double>("phiLow")),
110  phiUp_(iConfig.getParameter<double>("phiUp")),
111  jetIEtaSize_(iConfig.getParameter<unsigned int>("jetIEtaSize")),
112  jetIPhiSize_(iConfig.getParameter<unsigned int>("jetIPhiSize")),
113  seedPtThreshold_(iConfig.getParameter<double>("seedPtThreshold")),
114  puSubtraction_(iConfig.getParameter<bool>("puSubtraction")),
115  vetoZeroPt_(iConfig.getParameter<bool>("vetoZeroPt")),
116  outputCollectionName_(iConfig.getParameter<std::string>("outputCollectionName")) {
117  caloGrid_ =
118  std::make_unique<TH2F>("caloGrid", "Calorimeter grid", nBinsEta_, etaBinning_.data(), nBinsPhi_, phiLow_, phiUp_);
119  caloGrid_->GetXaxis()->SetTitle("#eta");
120  caloGrid_->GetYaxis()->SetTitle("#phi");
121  produces<std::vector<reco::CaloJet>>(outputCollectionName_).setBranchAlias(outputCollectionName_);
122 }

References edm::ParameterSet::getParameter().

◆ ~Phase1L1TJetProducer()

Phase1L1TJetProducer::~Phase1L1TJetProducer ( )
override

Definition at line 124 of file Phase1L1TJetProducer.cc.

124 {}

Member Function Documentation

◆ _buildJetsFromSeeds()

std::vector< reco::CaloJet > Phase1L1TJetProducer::_buildJetsFromSeeds ( const std::vector< std::tuple< int, int >> &  seeds) const
private

Definition at line 306 of file Phase1L1TJetProducer.cc.

307  {
308  // For each seed take a grid centered on the seed of the size specified by the user
309  // Sum the pf in the grid, that will be the pt of the l1t jet. Eta and phi of the jet is taken from the seed.
310  std::vector<reco::CaloJet> jets;
311  for (const auto& seed : seeds) {
313  jets.push_back(jet);
314  }
315  return jets;
316 }

References buildJetFromSeed(), metsig::jet, singleTopDQM_cfi::jets, fileCollector::seed, and InitialStep_cff::seeds.

Referenced by produce().

◆ _buildJetsFromSeedsWithPUSubtraction()

std::vector< reco::CaloJet > Phase1L1TJetProducer::_buildJetsFromSeedsWithPUSubtraction ( const std::vector< std::tuple< int, int >> &  seeds,
bool  killZeroPt 
) const
private

Definition at line 290 of file Phase1L1TJetProducer.cc.

291  {
292  // For each seed take a grid centered on the seed of the size specified by the user
293  // Sum the pf in the grid, that will be the pt of the l1t jet. Eta and phi of the jet is taken from the seed.
294  std::vector<reco::CaloJet> jets;
295  for (const auto& seed : seeds) {
298  //killing jets with 0 pt
299  if ((vetoZeroPt_) && (jet.pt() <= 0))
300  continue;
301  jets.push_back(jet);
302  }
303  return jets;
304 }

References buildJetFromSeed(), metsig::jet, singleTopDQM_cfi::jets, fileCollector::seed, InitialStep_cff::seeds, subtract9x9Pileup(), and vetoZeroPt_.

Referenced by produce().

◆ buildJetFromSeed()

reco::CaloJet Phase1L1TJetProducer::buildJetFromSeed ( const std::tuple< int, int > &  seed) const
private

Definition at line 265 of file Phase1L1TJetProducer.cc.

265  {
266  int iEta = std::get<0>(seed);
267  int iPhi = std::get<1>(seed);
268 
269  int etaHalfSize = (int)jetIEtaSize_ / 2;
270  int phiHalfSize = (int)jetIPhiSize_ / 2;
271 
272  float ptSum = 0;
273  // Scanning through the grid centered on the seed
274  for (int etaIndex = -etaHalfSize; etaIndex <= etaHalfSize; etaIndex++) {
275  for (int phiIndex = -phiHalfSize; phiIndex <= phiHalfSize; phiIndex++) {
276  ptSum += getTowerEnergy(iEta + etaIndex, iPhi + phiIndex);
277  }
278  }
279 
280  // Creating a jet with eta phi centered on the seed and momentum equal to the sum of the pt of the components
282  ptVector.SetPt(ptSum);
283  ptVector.SetEta(caloGrid_->GetXaxis()->GetBinCenter(iEta));
284  ptVector.SetPhi(caloGrid_->GetYaxis()->GetBinCenter(iPhi));
286  jet.setP4(ptVector);
287  return jet;
288 }

References caloGrid_, getTowerEnergy(), L1TowerCalibrationProducer_cfi::iEta, createfilelist::int, metsig::jet, jetIEtaSize_, jetIPhiSize_, and fileCollector::seed.

Referenced by _buildJetsFromSeeds(), and _buildJetsFromSeedsWithPUSubtraction().

◆ fillCaloGrid()

template<class Container >
void Phase1L1TJetProducer::fillCaloGrid ( TH2F &  caloGrid,
const Container &  triggerPrimitives 
)
private

Definition at line 319 of file Phase1L1TJetProducer.cc.

319  {
320  //Filling the calo grid with the primitives
321  for (const auto& primitiveIterator : triggerPrimitives) {
322  caloGrid.Fill(static_cast<float>(primitiveIterator.eta()),
323  static_cast<float>(primitiveIterator.phi()),
324  static_cast<float>(primitiveIterator.pt()));
325  }
326 }

◆ fillDescriptions()

void Phase1L1TJetProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 328 of file Phase1L1TJetProducer.cc.

328  {
330  desc.add<edm::InputTag>("inputCollectionTag", edm::InputTag("l1pfCandidates", "Puppi"));
331  desc.add<std::vector<double>>("etaBinning");
332  desc.add<unsigned int>("nBinsPhi", 72);
333  desc.add<double>("phiLow", -M_PI);
334  desc.add<double>("phiUp", M_PI);
335  desc.add<unsigned int>("jetIEtaSize", 7);
336  desc.add<unsigned int>("jetIPhiSize", 7);
337  desc.add<double>("seedPtThreshold", 5);
338  desc.add<bool>("puSubtraction", false);
339  desc.add<string>("outputCollectionName", "UncalibratedPhase1L1TJetFromPfCandidates");
340  desc.add<bool>("vetoZeroPt", true);
341  descriptions.add("Phase1L1TJetProducer", desc);
342 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and M_PI.

◆ findSeeds()

std::vector< std::tuple< int, int > > Phase1L1TJetProducer::findSeeds ( float  seedThreshold) const
private

Finds the seeds in the caloGrid, seeds are saved in a vector that contain the index in the TH2F of each seed.

Definition at line 215 of file Phase1L1TJetProducer.cc.

215  {
216  int nBinsX = caloGrid_->GetNbinsX();
217  int nBinsY = caloGrid_->GetNbinsY();
218 
219  std::vector<std::tuple<int, int>> seeds;
220 
221  int etaHalfSize = (int)jetIEtaSize_ / 2;
222  int phiHalfSize = (int)jetIPhiSize_ / 2;
223 
224  // for each point of the grid check if it is a local maximum
225  // to do so I take a point, and look if is greater than the points around it (in the 9x9 neighborhood)
226  // to prevent mutual exclusion, I check greater or equal for points above and right to the one I am considering (including the top-left point)
227  // to prevent mutual exclusion, I check greater for points below and left to the one I am considering (including the bottom-right point)
228 
229  for (int iPhi = 1; iPhi <= nBinsY; iPhi++) {
230  for (int iEta = 1; iEta <= nBinsX; iEta++) {
231  float centralPt = caloGrid_->GetBinContent(iEta, iPhi);
232  if (centralPt < seedThreshold)
233  continue;
234  bool isLocalMaximum = true;
235 
236  // Scanning through the grid centered on the seed
237  for (int etaIndex = -etaHalfSize; etaIndex <= etaHalfSize; etaIndex++) {
238  for (int phiIndex = -phiHalfSize; phiIndex <= phiHalfSize; phiIndex++) {
239  if ((etaIndex == 0) && (phiIndex == 0))
240  continue;
241  if (phiIndex > 0) {
242  if (phiIndex > -etaIndex) {
243  isLocalMaximum = ((isLocalMaximum) && (centralPt > getTowerEnergy(iEta + etaIndex, iPhi + phiIndex)));
244  } else {
245  isLocalMaximum = ((isLocalMaximum) && (centralPt >= getTowerEnergy(iEta + etaIndex, iPhi + phiIndex)));
246  }
247  } else {
248  if (phiIndex >= -etaIndex) {
249  isLocalMaximum = ((isLocalMaximum) && (centralPt > getTowerEnergy(iEta + etaIndex, iPhi + phiIndex)));
250  } else {
251  isLocalMaximum = ((isLocalMaximum) && (centralPt >= getTowerEnergy(iEta + etaIndex, iPhi + phiIndex)));
252  }
253  }
254  }
255  }
256  if (isLocalMaximum) {
257  seeds.emplace_back(iEta, iPhi);
258  }
259  }
260  }
261 
262  return seeds;
263 }

References caloGrid_, getTowerEnergy(), L1TowerCalibrationProducer_cfi::iEta, createfilelist::int, jetIEtaSize_, jetIPhiSize_, InitialStep_cff::seeds, and UEAnalysisJets_cfi::seedThreshold.

Referenced by produce().

◆ getTowerEnergy()

float Phase1L1TJetProducer::getTowerEnergy ( int  iEta,
int  iPhi 
) const
private

Get the energy of a certain tower while correctly handling phi periodicity in case of overflow.

Definition at line 126 of file Phase1L1TJetProducer.cc.

126  {
127  // We return the pt of a certain bin in the calo grid, taking account of the phi periodicity when overflowing (e.g. phi > phiSize), and returning 0 for the eta out of bounds
128 
129  int nBinsEta = caloGrid_->GetNbinsX();
130  int nBinsPhi = caloGrid_->GetNbinsY();
131  while (iPhi < 1) {
132  iPhi += nBinsPhi;
133  }
134  while (iPhi > nBinsPhi) {
135  iPhi -= nBinsPhi;
136  }
137  if (iEta < 1) {
138  return 0;
139  }
140  if (iEta > nBinsEta) {
141  return 0;
142  }
143  return caloGrid_->GetBinContent(iEta, iPhi);
144 }

References caloGrid_, L1TowerCalibrationProducer_cfi::iEta, hgcalTowerMapProducer_cfi::nBinsEta, and Phase1L1TJetProducer_cfi::nBinsPhi.

Referenced by buildJetFromSeed(), findSeeds(), and subtract9x9Pileup().

◆ produce()

void Phase1L1TJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDProducerBase.

Definition at line 146 of file Phase1L1TJetProducer.cc.

146  {
147  edm::Handle<edm::View<reco::Candidate>> inputCollectionHandle;
148  iEvent.getByToken(inputCollectionTag_, inputCollectionHandle);
149  // dumping the data
150  caloGrid_->Reset();
151  fillCaloGrid<>(*(caloGrid_), *inputCollectionHandle);
152 
153  const auto& seedsVector = findSeeds(seedPtThreshold_); // seedPtThreshold = 6
154  auto l1jetVector = puSubtraction_ ? _buildJetsFromSeedsWithPUSubtraction(seedsVector, vetoZeroPt_)
155  : _buildJetsFromSeeds(seedsVector);
156 
157  // sort by pt
158  std::sort(l1jetVector.begin(), l1jetVector.end(), [](const reco::CaloJet& jet1, const reco::CaloJet& jet2) {
159  return jet1.pt() > jet2.pt();
160  });
161 
162  auto l1jetVectorPtr = std::make_unique<std::vector<reco::CaloJet>>(l1jetVector);
163  iEvent.put(std::move(l1jetVectorPtr), outputCollectionName_);
164 
165  return;
166 }

References _buildJetsFromSeeds(), _buildJetsFromSeedsWithPUSubtraction(), caloGrid_, findSeeds(), iEvent, inputCollectionTag_, eostools::move(), outputCollectionName_, reco::LeafCandidate::pt(), puSubtraction_, seedPtThreshold_, and vetoZeroPt_.

◆ subtract9x9Pileup()

void Phase1L1TJetProducer::subtract9x9Pileup ( reco::CaloJet jet) const
private

Definition at line 168 of file Phase1L1TJetProducer.cc.

168  {
169  // these variables host the total pt in each sideband and the total pileup contribution
170  float topBandPt = 0;
171  float leftBandPt = 0;
172  float rightBandPt = 0;
173  float bottomBandPt = 0;
174  float pileUpEnergy;
175 
176  // hold the jet's x-y (and z, as I have to use it, even if 2D) location in the histo
177  int xCenter, yCenter, zCenter;
178  // Retrieving histo-coords for seed
179  caloGrid_->GetBinXYZ(caloGrid_->FindFixBin(jet.eta(), jet.phi()), xCenter, yCenter, zCenter);
180 
181  // Computing pileup
182  for (int x = x_scroll_min; x <= x_scroll_max; x++) {
183  for (int y = y_scroll_min; y < y_scroll_max; y++) {
184  // top band, I go up 5 squares to reach the bottom of the top band
185  // +x scrolls from left to right, +y scrolls up
186  topBandPt += getTowerEnergy(xCenter + x, yCenter + (5 + y));
187  // left band, I go left 5 squares (-5) to reach the bottom of the top band
188  // +x scrolls from bottom to top, +y scrolls left
189  leftBandPt += getTowerEnergy(xCenter - (5 + y), yCenter + x);
190  // right band, I go right 5 squares (+5) to reach the bottom of the top band
191  // +x scrolls from bottom to top, +y scrolls right
192  rightBandPt += getTowerEnergy(xCenter + (5 + y), yCenter + x);
193  // right band, I go right 5 squares (+5) to reach the bottom of the top band
194  // +x scrolls from bottom to top, +y scrolls right
195  bottomBandPt += getTowerEnergy(xCenter + x, yCenter - (5 + y));
196  }
197  }
198  // adding bands and removing the maximum band (equivalent to adding the three minimum bands)
199  pileUpEnergy = topBandPt + leftBandPt + rightBandPt + bottomBandPt -
200  std::max(topBandPt, std::max(leftBandPt, std::max(rightBandPt, bottomBandPt)));
201 
202  //preparing the new 4-momentum vector
204  // removing pu contribution
205  float ptAfterPUSubtraction = jet.pt() - pileUpEnergy;
206  ptVector.SetPt((ptAfterPUSubtraction > 0) ? ptAfterPUSubtraction : 0);
207  ptVector.SetEta(jet.eta());
208  ptVector.SetPhi(jet.phi());
209  //updating the jet
210  jet.setP4(ptVector);
211  jet.setPileup(pileUpEnergy);
212  return;
213 }

References caloGrid_, getTowerEnergy(), metsig::jet, SiStripPI::max, x, x_scroll_max, x_scroll_min, y, y_scroll_max, and y_scroll_min.

Referenced by _buildJetsFromSeedsWithPUSubtraction().

Member Data Documentation

◆ caloGrid_

std::unique_ptr<TH2F> Phase1L1TJetProducer::caloGrid_
private

◆ etaBinning_

std::vector<double> Phase1L1TJetProducer::etaBinning_
private

Definition at line 88 of file Phase1L1TJetProducer.cc.

◆ inputCollectionTag_

edm::EDGetTokenT<edm::View<reco::Candidate> > Phase1L1TJetProducer::inputCollectionTag_
private

Definition at line 84 of file Phase1L1TJetProducer.cc.

Referenced by produce().

◆ jetIEtaSize_

unsigned int Phase1L1TJetProducer::jetIEtaSize_
private

Definition at line 93 of file Phase1L1TJetProducer.cc.

Referenced by buildJetFromSeed(), and findSeeds().

◆ jetIPhiSize_

unsigned int Phase1L1TJetProducer::jetIPhiSize_
private

Definition at line 94 of file Phase1L1TJetProducer.cc.

Referenced by buildJetFromSeed(), and findSeeds().

◆ nBinsEta_

size_t Phase1L1TJetProducer::nBinsEta_
private

Definition at line 89 of file Phase1L1TJetProducer.cc.

◆ nBinsPhi_

unsigned int Phase1L1TJetProducer::nBinsPhi_
private

Definition at line 90 of file Phase1L1TJetProducer.cc.

◆ outputCollectionName_

std::string Phase1L1TJetProducer::outputCollectionName_
private

Definition at line 99 of file Phase1L1TJetProducer.cc.

Referenced by produce().

◆ phiLow_

double Phase1L1TJetProducer::phiLow_
private

Definition at line 91 of file Phase1L1TJetProducer.cc.

◆ phiUp_

double Phase1L1TJetProducer::phiUp_
private

Definition at line 92 of file Phase1L1TJetProducer.cc.

◆ puSubtraction_

bool Phase1L1TJetProducer::puSubtraction_
private

Definition at line 96 of file Phase1L1TJetProducer.cc.

Referenced by produce().

◆ seedPtThreshold_

double Phase1L1TJetProducer::seedPtThreshold_
private

Definition at line 95 of file Phase1L1TJetProducer.cc.

Referenced by produce().

◆ vetoZeroPt_

bool Phase1L1TJetProducer::vetoZeroPt_
private

Definition at line 97 of file Phase1L1TJetProducer.cc.

Referenced by _buildJetsFromSeedsWithPUSubtraction(), and produce().

Phase1L1TJetProducer::vetoZeroPt_
bool vetoZeroPt_
Definition: Phase1L1TJetProducer.cc:97
reco::CaloJet
Jets made from CaloTowers.
Definition: CaloJet.h:27
DDAxes::y
Phase1L1TJetProducer::buildJetFromSeed
reco::CaloJet buildJetFromSeed(const std::tuple< int, int > &seed) const
Definition: Phase1L1TJetProducer.cc:265
y_scroll_max
constexpr int y_scroll_max
Definition: Phase1L1TJetProducer.cc:54
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
x_scroll_min
constexpr int x_scroll_min
Definition: Phase1L1TJetProducer.cc:51
y_scroll_min
constexpr int y_scroll_min
Definition: Phase1L1TJetProducer.cc:53
Phase1L1TJetProducer::seedPtThreshold_
double seedPtThreshold_
Definition: Phase1L1TJetProducer.cc:95
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
DDAxes::x
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
edm::Handle
Definition: AssociativeIterator.h:50
Phase1L1TJetProducer::findSeeds
std::vector< std::tuple< int, int > > findSeeds(float seedThreshold) const
Finds the seeds in the caloGrid, seeds are saved in a vector that contain the index in the TH2F of ea...
Definition: Phase1L1TJetProducer.cc:215
Phase1L1TJetProducer::phiUp_
double phiUp_
Definition: Phase1L1TJetProducer.cc:92
Phase1L1TJetProducer::puSubtraction_
bool puSubtraction_
Definition: Phase1L1TJetProducer.cc:96
fileCollector.seed
seed
Definition: fileCollector.py:127
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
Phase1L1TJetProducer::nBinsPhi_
unsigned int nBinsPhi_
Definition: Phase1L1TJetProducer.cc:90
Phase1L1TJetProducer::getTowerEnergy
float getTowerEnergy(int iEta, int iPhi) const
Get the energy of a certain tower while correctly handling phi periodicity in case of overflow.
Definition: Phase1L1TJetProducer.cc:126
hgcalTowerMapProducer_cfi.nBinsEta
nBinsEta
Definition: hgcalTowerMapProducer_cfi.py:9
Phase1L1TJetProducer::jetIEtaSize_
unsigned int jetIEtaSize_
Definition: Phase1L1TJetProducer.cc:93
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Phase1L1TJetProducer::jetIPhiSize_
unsigned int jetIPhiSize_
Definition: Phase1L1TJetProducer.cc:94
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:230
Phase1L1TJetProducer::_buildJetsFromSeedsWithPUSubtraction
std::vector< reco::CaloJet > _buildJetsFromSeedsWithPUSubtraction(const std::vector< std::tuple< int, int >> &seeds, bool killZeroPt) const
Definition: Phase1L1TJetProducer.cc:290
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
Phase1L1TJetProducer::caloGrid_
std::unique_ptr< TH2F > caloGrid_
Definition: Phase1L1TJetProducer.cc:86
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
Phase1L1TJetProducer::_buildJetsFromSeeds
std::vector< reco::CaloJet > _buildJetsFromSeeds(const std::vector< std::tuple< int, int >> &seeds) const
Definition: Phase1L1TJetProducer.cc:306
Phase1L1TJetProducer::etaBinning_
std::vector< double > etaBinning_
Definition: Phase1L1TJetProducer.cc:88
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Phase1L1TJetProducer_cfi.nBinsPhi
nBinsPhi
Definition: Phase1L1TJetProducer_cfi.py:20
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
Phase1L1TJetProducer::phiLow_
double phiLow_
Definition: Phase1L1TJetProducer.cc:91
Phase1L1TJetProducer::subtract9x9Pileup
void subtract9x9Pileup(reco::CaloJet &jet) const
Definition: Phase1L1TJetProducer.cc:168
x_scroll_max
constexpr int x_scroll_max
Definition: Phase1L1TJetProducer.cc:52
Phase1L1TJetProducer::inputCollectionTag_
edm::EDGetTokenT< edm::View< reco::Candidate > > inputCollectionTag_
Definition: Phase1L1TJetProducer.cc:84
edm::InputTag
Definition: InputTag.h:15
UEAnalysisJets_cfi.seedThreshold
seedThreshold
Definition: UEAnalysisJets_cfi.py:8
Phase1L1TJetProducer::outputCollectionName_
std::string outputCollectionName_
Definition: Phase1L1TJetProducer.cc:99
Phase1L1TJetProducer::nBinsEta_
size_t nBinsEta_
Definition: Phase1L1TJetProducer.cc:89