CMS 3D CMS Logo

HiPuRhoProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: RecoHI/HiJetAlgos/plugins/HiPuRhoProducer
4 // Class: HiPuRhoProducer
5 //
11 //
12 // Original Author: Chris McGinn - in Style of HiFJRhoProducer
13 // Created: Mon, 29 May 2017
14 //
15 //
46 
47 #include "fastjet/ClusterSequence.hh"
48 #include "fastjet/JetDefinition.hh"
49 #include "fastjet/PseudoJet.hh"
50 
51 #include <cmath>
52 #include <cstdint>
53 #include <cstdlib>
54 #include <algorithm>
55 #include <limits>
56 #include <memory>
57 #include <sstream>
58 #include <string>
59 #include <utility>
60 #include <map>
61 #include <vector>
62 
63 struct EtaPhiTower {
64  int ieta, iphi;
65  float eta, phi;
66 };
67 
69 public:
70  explicit HiPuRhoProducer(const edm::ParameterSet&);
71 
72  using ClusterSequencePtr = std::shared_ptr<fastjet::ClusterSequence>;
73  using JetDefPtr = std::shared_ptr<fastjet::JetDefinition>;
74 
75  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
76  virtual void setupGeometryMap(edm::Event& iEvent, const edm::EventSetup& iSetup);
77  virtual void calculatePedestal(std::vector<fastjet::PseudoJet> const& coll);
78  virtual void subtractPedestal(std::vector<fastjet::PseudoJet>& coll);
79  virtual void calculateOrphanInput(std::vector<fastjet::PseudoJet>& orphanInput);
80  virtual void putRho(edm::Event& iEvent, const edm::EventSetup& iSetup);
81 
82 private:
83  void produce(edm::Event&, const edm::EventSetup&) override;
84 
85  // This checks if the tower is anomalous (if a calo tower).
86  virtual void inputTowers();
87 
88  bool postOrphan_ = false;
90 
91  const bool dropZeroTowers_;
92  const int medianWindowWidth_;
93  const double minimumTowersFraction_;
94  const double nSigmaPU_; // number of sigma for pileup
95  const double puPtMin_;
96  const double radiusPU_; // pileup radius
97  const double rParam_; // the R parameter to use
98  const double towSigmaCut_;
101  const int initialValue_ = -99;
102  constexpr static int nEtaTow_ = 82;
103 
104  std::array<int, nEtaTow_> vngeom_;
105  std::array<int, nEtaTow_> vntow_;
106  std::array<float, nEtaTow_> vmean0_;
107  std::array<float, nEtaTow_> vrms0_;
108  std::array<float, nEtaTow_> vrho0_;
109  std::array<float, nEtaTow_> vmean1_;
110  std::array<float, nEtaTow_> vrms1_;
111  std::array<float, nEtaTow_> vrho1_;
112 
113  std::vector<double> etaEdgeLow_;
114  std::vector<double> etaEdgeHi_;
115  std::vector<double> etaEdges_;
116 
117  std::vector<double> rho_;
118  std::vector<double> rhoExtra_;
119  std::vector<double> rhoM_;
120  std::vector<int> nTow_;
121 
122  std::vector<double> towExcludePt_;
123  std::vector<double> towExcludePhi_;
124  std::vector<double> towExcludeEta_;
125 
126  std::vector<const CaloTower*> inputs_;
127  ClusterSequencePtr fjClusterSeq_; // fastjet cluster sequence
128  JetDefPtr fjJetDefinition_; // fastjet jet definition
129 
130  std::vector<fastjet::PseudoJet> fjInputs_; // fastjet inputs
131  std::vector<fastjet::PseudoJet> fjJets_; // fastjet jets
132  std::vector<fastjet::PseudoJet> fjOriginalInputs_; // to back-up unsubtracted fastjet inputs
133 
134  CaloGeometry const* geo_ = nullptr; // geometry
135 
136  int ietamax_; // maximum eta in geometry
137  int ietamin_; // minimum eta in geometry
138  std::map<int, int> ntowersWithJets_; // number of towers with jets
139  std::map<int, int> geomtowers_; // map of geometry towers to det id
140  std::map<int, double> esigma_; // energy sigma
141  std::map<int, double> emean_; // energy mean
142  std::map<int, std::array<double, 4>> eTop4_; // energy mean
143 
144  typedef std::pair<double, double> EtaPhi;
145  std::vector<EtaPhiTower> towermap_;
146 };
147 
149  : dropZeroTowers_(iConfig.getParameter<bool>("dropZeroTowers")),
150  medianWindowWidth_(iConfig.getParameter<int>("medianWindowWidth")),
151  minimumTowersFraction_(iConfig.getParameter<double>("minimumTowersFraction")),
152  nSigmaPU_(iConfig.getParameter<double>("nSigmaPU")),
153  puPtMin_(iConfig.getParameter<double>("puPtMin")),
154  radiusPU_(iConfig.getParameter<double>("radiusPU")),
155  rParam_(iConfig.getParameter<double>("rParam")),
156  towSigmaCut_(iConfig.getParameter<double>("towSigmaCut")),
157  caloTowerToken_(consumes<CaloTowerCollection>(iConfig.getParameter<edm::InputTag>("src"))),
158  caloGeometryToken_(esConsumes<CaloGeometry, CaloGeometryRecord>(edm::ESInputTag{})) {
159  //register your products
160  produces<std::vector<double>>("mapEtaEdges");
161  produces<std::vector<double>>("mapToRho");
162  produces<std::vector<double>>("mapToRhoMedian");
163  produces<std::vector<double>>("mapToRhoExtra");
164  produces<std::vector<double>>("mapToRhoM");
165  produces<std::vector<int>>("mapToNTow");
166  produces<std::vector<double>>("mapToTowExcludePt");
167  produces<std::vector<double>>("mapToTowExcludePhi");
168  produces<std::vector<double>>("mapToTowExcludeEta");
169 }
170 
171 // ------------ method called to produce the data ------------
173  setupGeometryMap(iEvent, iSetup);
174 
175  for (int i = ietamin_; i < ietamax_ + 1; i++) {
176  ntowersWithJets_[i] = 0;
177  }
178 
179  auto const& inputView = iEvent.get(caloTowerToken_);
180  inputs_.reserve(inputView.size());
181  for (auto const& input : inputView)
182  inputs_.push_back(&input);
183 
184  fjInputs_.reserve(inputs_.size());
185  inputTowers();
187  setInitialValue_ = true;
190 
191  fjJetDefinition_ = std::make_shared<fastjet::JetDefinition>(fastjet::antikt_algorithm, rParam_);
192  fjClusterSeq_ = std::make_shared<fastjet::ClusterSequence>(fjInputs_, *fjJetDefinition_);
193  fjJets_ = fastjet::sorted_by_pt(fjClusterSeq_->inclusive_jets(puPtMin_));
194 
195  etaEdgeLow_.clear();
196  etaEdgeHi_.clear();
197  etaEdges_.clear();
198 
199  rho_.clear();
200  rhoExtra_.clear();
201  rhoM_.clear();
202  nTow_.clear();
203 
204  towExcludePt_.clear();
205  towExcludePhi_.clear();
206  towExcludeEta_.clear();
207 
208  setInitialValue_ = false;
209  std::vector<fastjet::PseudoJet> orphanInput;
210  calculateOrphanInput(orphanInput);
211  calculatePedestal(orphanInput);
212  putRho(iEvent, iSetup);
213 
214  inputs_.clear();
215  fjInputs_.clear();
216  fjJets_.clear();
217 }
218 
220  int index = -1;
221  for (auto const& input : inputs_) {
222  index++;
223 
224  if (edm::isNotFinite(input->pt()))
225  continue;
226  if (input->pt() < 100 * std::numeric_limits<double>::epsilon())
227  continue;
228 
229  fjInputs_.push_back(fastjet::PseudoJet(input->px(), input->py(), input->pz(), input->energy()));
230  fjInputs_.back().set_user_index(index);
231  }
232 }
233 
235  LogDebug("PileUpSubtractor") << "The subtractor setting up geometry...\n";
236  const auto& pG = iSetup.getData(caloGeometryToken_);
237  geo_ = &pG;
238  std::vector<DetId> alldid = geo_->getValidDetIds();
239  int ietaold = -10000;
240  ietamax_ = -10000;
241  ietamin_ = 10000;
242  towermap_.clear();
243 
244  for (auto const& did : alldid) {
245  if (did.det() == DetId::Hcal) {
246  HcalDetId hid = HcalDetId(did);
247  towermap_.push_back({hid.ieta(), hid.iphi(), geo_->getPosition(did).eta(), geo_->getPosition(did).phi()});
248  if (hid.ieta() != ietaold) {
249  ietaold = hid.ieta();
250  geomtowers_[hid.ieta()] = 1;
251  if (hid.ieta() > ietamax_)
252  ietamax_ = hid.ieta();
253  if (hid.ieta() < ietamin_)
254  ietamin_ = hid.ieta();
255  } else {
256  geomtowers_[hid.ieta()]++;
257  }
258  }
259  }
260 
261  for (auto const& gt : geomtowers_) {
262  int it = gt.first;
263  int vi = it - 1;
264 
265  if (it < 0)
266  vi = nEtaTow_ + it;
267 
268  if (vi < nEtaTow_)
269  vngeom_[vi] = gt.second;
270  }
271 }
272 
273 void HiPuRhoProducer::calculatePedestal(std::vector<fastjet::PseudoJet> const& coll) {
274  LogDebug("PileUpSubtractor") << "The subtractor calculating pedestals...\n";
275 
276  std::map<int, double> emean2;
277  std::map<int, int> ntowers;
278 
279  int ietaold = -10000;
280  // Initial values for emean_, emean2, esigma_, ntowers
281 
282  for (int vi = 0; vi < nEtaTow_; ++vi) {
283  vntow_[vi] = initialValue_;
284  vmean1_[vi] = initialValue_;
285  vrms1_[vi] = initialValue_;
286  vrho1_[vi] = initialValue_;
287 
288  if (setInitialValue_) {
289  vmean0_[vi] = initialValue_;
290  vrms0_[vi] = initialValue_;
291  vrho0_[vi] = initialValue_;
292  }
293  }
294 
295  for (int i = ietamin_; i < ietamax_ + 1; i++) {
296  emean_[i] = 0.;
297  emean2[i] = 0.;
298  esigma_[i] = 0.;
299  ntowers[i] = 0;
300 
301  eTop4_[i] = {{0., 0., 0., 0.}};
302  }
303 
304  for (auto const& input_object : coll) {
305  const CaloTower* originalTower = inputs_[input_object.user_index()];
306  double original_Et = originalTower->et();
307  int ieta0 = originalTower->ieta();
308 
309  if (original_Et > eTop4_[ieta0][0]) {
310  eTop4_[ieta0][3] = eTop4_[ieta0][2];
311  eTop4_[ieta0][2] = eTop4_[ieta0][1];
312  eTop4_[ieta0][1] = eTop4_[ieta0][0];
313  eTop4_[ieta0][0] = original_Et;
314  } else if (original_Et > eTop4_[ieta0][1]) {
315  eTop4_[ieta0][3] = eTop4_[ieta0][2];
316  eTop4_[ieta0][2] = eTop4_[ieta0][1];
317  eTop4_[ieta0][1] = original_Et;
318  } else if (original_Et > eTop4_[ieta0][2]) {
319  eTop4_[ieta0][3] = eTop4_[ieta0][2];
320  eTop4_[ieta0][2] = original_Et;
321  } else if (original_Et > eTop4_[ieta0][3]) {
322  eTop4_[ieta0][3] = original_Et;
323  }
324 
325  emean_[ieta0] = emean_[ieta0] + original_Et;
326  emean2[ieta0] = emean2[ieta0] + original_Et * original_Et;
327  if (ieta0 - ietaold != 0) {
328  ntowers[ieta0] = 1;
329  ietaold = ieta0;
330  } else {
331  ntowers[ieta0]++;
332  }
333  }
334 
335  for (auto const& gt : geomtowers_) {
336  int it = gt.first;
337 
338  int vi = it - 1;
339 
340  if (it < 0)
341  vi = nEtaTow_ + it;
342 
343  double e1 = emean_[it];
344  double e2 = emean2[it];
345  int nt = gt.second - ntowersWithJets_[it];
346 
347  if (vi < nEtaTow_) {
348  vntow_[vi] = nt;
349  }
350 
351  LogDebug("PileUpSubtractor") << " ieta: " << it << " number of towers: " << nt << " e1: " << e1 << " e2: " << e2
352  << "\n";
353 
354  if (nt > 0) {
355  if (postOrphan_) {
356  if (nt > (int)minimumTowersFraction_ * (gt.second)) {
357  emean_[it] = e1 / (double)nt;
358  double eee = e2 / (double)nt - e1 * e1 / (double)(nt * nt);
359  if (eee < 0.)
360  eee = 0.;
361  esigma_[it] = nSigmaPU_ * sqrt(eee);
362 
363  uint32_t numToCheck = std::min(int(eTop4_[it].size()), nt - (int)minimumTowersFraction_ * (gt.second));
364 
365  for (unsigned int lI = 0; lI < numToCheck; ++lI) {
366  if (eTop4_[it][lI] >= emean_[it] + towSigmaCut_ * esigma_[it] && towSigmaCut_ > 0) {
367  e1 -= eTop4_[it][lI];
368  nt -= 1;
369  } else
370  break;
371  }
372 
373  if (e1 < .000000001)
374  e1 = 0;
375  }
376  }
377 
378  emean_[it] = e1 / (double)nt;
379  double eee = e2 / nt - e1 * e1 / (nt * nt);
380  if (eee < 0.)
381  eee = 0.;
382  esigma_[it] = nSigmaPU_ * sqrt(eee);
383 
384  double etaWidth = std::abs(hi::etaedge[abs(it)] - hi::etaedge[abs(it) - 1]);
385 
386  int sign = (it < 0) ? -1 : 1;
387  auto absIt = std::abs(it);
388  if (it < 0) {
389  etaEdgeLow_.push_back(sign * hi::etaedge[absIt]);
390  etaEdgeHi_.push_back(sign * hi::etaedge[absIt - 1]);
391  } else {
392  etaEdgeHi_.push_back(sign * hi::etaedge[absIt]);
393  etaEdgeLow_.push_back(sign * hi::etaedge[absIt - 1]);
394  }
395 
396  if (vi < nEtaTow_) {
397  vmean1_[vi] = emean_[it];
398  vrho1_[vi] = emean_[it] / (etaWidth * (2. * M_PI / (double)vngeom_[vi]));
399  rho_.push_back(vrho1_[vi]);
400  rhoM_.push_back(0);
401  vrms1_[vi] = esigma_[it];
402  if (vngeom_[vi] == vntow_[vi]) {
403  vmean0_[vi] = emean_[it];
404  vrho0_[vi] = emean_[it] / (etaWidth * (2. * M_PI / (double)vngeom_[vi]));
405  vrms0_[vi] = esigma_[it];
406  }
407  rhoExtra_.push_back(vrho0_[vi]);
408  nTow_.push_back(vntow_[vi]);
409  }
410  } else {
411  emean_[it] = 0.;
412  esigma_[it] = 0.;
413  }
414  LogDebug("PileUpSubtractor") << " ieta: " << it << " Pedestals: " << emean_[it] << " " << esigma_[it] << "\n";
415  }
416 
417  postOrphan_ = false;
418 }
419 
420 void HiPuRhoProducer::subtractPedestal(std::vector<fastjet::PseudoJet>& coll) {
421  LogDebug("PileUpSubtractor") << "The subtractor subtracting pedestals...\n";
422 
423  std::vector<fastjet::PseudoJet> newcoll;
424  for (auto& input_object : coll) {
425  int index = input_object.user_index();
426  CaloTower const* itow = inputs_[index];
427  int it = itow->ieta();
428 
429  double original_Et = itow->et();
430  double etnew = original_Et - emean_.at(it) - esigma_.at(it);
431  float mScale = etnew / input_object.Et();
432  if (etnew < 0.)
433  mScale = 0.;
434 
436  input_object.px() * mScale, input_object.py() * mScale, input_object.pz() * mScale, input_object.e() * mScale);
437 
438  input_object.reset_momentum(towP4.px(), towP4.py(), towP4.pz(), towP4.energy());
439  input_object.set_user_index(index);
440 
441  if (etnew > 0. && dropZeroTowers_)
442  newcoll.push_back(input_object);
443  }
444 
445  if (dropZeroTowers_)
446  coll = newcoll;
447 }
448 
449 void HiPuRhoProducer::calculateOrphanInput(std::vector<fastjet::PseudoJet>& orphanInput) {
450  LogDebug("PileUpSubtractor") << "The subtractor calculating orphan input...\n";
451 
453 
454  std::vector<int> jettowers; // vector of towers indexed by "user_index"
455  std::map<std::pair<int, int>, int> excludedTowers; // map of excluded ieta, iphi values
456  for (auto const& pseudojetTMP : fjJets_) {
457  EtaPhi jet_etaphi(pseudojetTMP.eta(), pseudojetTMP.phi());
458 
459  if (pseudojetTMP.perp() < puPtMin_)
460  continue;
461 
462  for (auto const& im : towermap_) {
463  double dr2 = reco::deltaR2(im.eta, im.phi, jet_etaphi.first, jet_etaphi.second);
464  if (dr2 < radiusPU_ * radiusPU_ && !excludedTowers[std::pair(im.ieta, im.iphi)] &&
465  (geomtowers_[im.ieta] - ntowersWithJets_[im.ieta]) > minimumTowersFraction_ * geomtowers_[im.ieta]) {
466  ntowersWithJets_[im.ieta]++;
467  excludedTowers[std::pair(im.ieta, im.iphi)] = 1;
468  }
469  }
470 
471  for (auto const& input : fjInputs_) {
472  int index = input.user_index();
473  const CaloTower* originalTower = inputs_[index];
474  int ie = originalTower->ieta();
475  int ip = originalTower->iphi();
476 
477  if (excludedTowers[std::pair<int, int>(ie, ip)]) {
478  jettowers.push_back(index);
479  }
480  }
481  }
482  // Create a new collections from the towers not included in jets
483  for (auto const& input : fjInputs_) {
484  int index = input.user_index();
485  const CaloTower* originalTower = inputs_[index];
486  auto itjet = std::find(jettowers.begin(), jettowers.end(), index);
487  if (itjet == jettowers.end()) {
488  orphanInput.emplace_back(originalTower->px(), originalTower->py(), originalTower->pz(), originalTower->energy());
489  orphanInput.back().set_user_index(index);
490  } else {
491  towExcludePt_.push_back(originalTower->pt());
492  towExcludePhi_.push_back(originalTower->phi());
493  towExcludeEta_.push_back(originalTower->eta());
494  }
495  }
496 
497  postOrphan_ = true;
498 }
499 
501  std::size_t size = etaEdgeLow_.size();
502 
503  std::vector<std::pair<std::size_t, double>> order;
504  for (std::size_t i = 0; i < size; ++i) {
505  order.emplace_back(i, etaEdgeLow_[i]);
506  }
507 
508  std::sort(
509  order.begin(), order.end(), [](auto const& pair0, auto const& pair1) { return pair0.second < pair1.second; });
510 
511  std::vector<double> sortedEtaEdgeLow(size);
512  std::vector<double> sortedEtaEdgeHigh(size);
513 
514  auto mapToRhoOut = std::make_unique<std::vector<double>>(size);
515  auto mapToRhoExtraOut = std::make_unique<std::vector<double>>(size);
516  auto mapToRhoMOut = std::make_unique<std::vector<double>>(size);
517  auto mapToNTowOut = std::make_unique<std::vector<int>>(size);
518 
519  for (std::size_t i = 0; i < size; ++i) {
520  auto const& index = order[i].first;
521 
522  sortedEtaEdgeLow[i] = etaEdgeLow_[index];
523  sortedEtaEdgeHigh[i] = etaEdgeHi_[index];
524 
525  (*mapToRhoOut)[i] = rho_[index];
526  (*mapToRhoExtraOut)[i] = rhoExtra_[index];
527  (*mapToRhoMOut)[i] = rhoM_[index];
528  (*mapToNTowOut)[i] = nTow_[index];
529  }
530 
531  auto mapToRhoMedianOut = std::make_unique<std::vector<double>>(size);
532 
533  for (uint32_t index = medianWindowWidth_; index < size - medianWindowWidth_; ++index) {
534  auto centre = mapToRhoOut->begin() + index;
535  std::vector<float> rhoRange(centre - medianWindowWidth_, centre + medianWindowWidth_);
536  std::nth_element(rhoRange.begin(), rhoRange.begin() + medianWindowWidth_, rhoRange.end());
537  (*mapToRhoMedianOut)[index] = rhoRange[medianWindowWidth_];
538  }
539 
540  auto mapEtaRangesOut = std::make_unique<std::vector<double>>();
541 
542  mapEtaRangesOut->assign(sortedEtaEdgeLow.begin(), sortedEtaEdgeLow.end());
543  mapEtaRangesOut->push_back(sortedEtaEdgeHigh.back());
544 
545  auto mapToTowExcludePtOut = std::make_unique<std::vector<double>>(std::move(towExcludePt_));
546  auto mapToTowExcludePhiOut = std::make_unique<std::vector<double>>(std::move(towExcludePhi_));
547  auto mapToTowExcludeEtaOut = std::make_unique<std::vector<double>>(std::move(towExcludeEta_));
548 
549  iEvent.put(std::move(mapEtaRangesOut), "mapEtaEdges");
550  iEvent.put(std::move(mapToRhoOut), "mapToRho");
551  iEvent.put(std::move(mapToRhoMedianOut), "mapToRhoMedian");
552  iEvent.put(std::move(mapToRhoExtraOut), "mapToRhoExtra");
553  iEvent.put(std::move(mapToRhoMOut), "mapToRhoM");
554  iEvent.put(std::move(mapToNTowOut), "mapToNTow");
555  iEvent.put(std::move(mapToTowExcludePtOut), "mapToTowExcludePt");
556  iEvent.put(std::move(mapToTowExcludePhiOut), "mapToTowExcludePhi");
557  iEvent.put(std::move(mapToTowExcludeEtaOut), "mapToTowExcludeEta");
558 }
559 
560 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
563  desc.add<edm::InputTag>("src", edm::InputTag("PFTowers"));
564  desc.add<int>("medianWindowWidth", 2);
565  desc.add<double>("towSigmaCut", 5.0);
566  desc.add<double>("puPtMin", 15.0);
567  desc.add<double>("rParam", 0.3);
568  desc.add<double>("nSigmaPU", 1.0);
569  desc.add<double>("radiusPU", 0.5);
570  desc.add<double>("minimumTowersFraction", 0.7);
571  desc.add<bool>("dropZeroTowers", true);
572  descriptions.add("hiPuRhoProducer", desc);
573 }
574 
575 //define this as a plug-in
size
Write out results.
std::vector< double > towExcludePt_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const double radiusPU_
double pz() const final
z coordinate of momentum vector
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
void produce(edm::Event &, const edm::EventSetup &) override
const double nSigmaPU_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
double pt() const final
transverse momentum
std::vector< double > etaEdges_
std::vector< double > rhoExtra_
std::array< float, nEtaTow_ > vrms0_
virtual void inputTowers()
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
std::vector< EtaPhiTower > towermap_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
std::vector< double > towExcludeEta_
T eta() const
Definition: PV3DBase.h:73
const edm::EDGetTokenT< CaloTowerCollection > caloTowerToken_
std::array< float, nEtaTow_ > vrho1_
const double rParam_
std::vector< double > etaEdgeHi_
std::vector< fastjet::PseudoJet > fjInputs_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< double > rho_
std::vector< double > towExcludePhi_
std::map< int, std::array< double, 4 > > eTop4_
static std::string const input
Definition: EdmProvDump.cc:50
std::array< float, nEtaTow_ > vmean0_
std::array< float, nEtaTow_ > vmean1_
static constexpr int nEtaTow_
double et(double vtxZ) const
Definition: CaloTower.h:150
std::vector< double > etaEdgeLow_
virtual void subtractPedestal(std::vector< fastjet::PseudoJet > &coll)
double px() const final
x coordinate of momentum vector
std::array< float, nEtaTow_ > vrms1_
int iEvent
Definition: GenABIO.cc:224
std::vector< const CaloTower * > inputs_
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
const double towSigmaCut_
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
T sqrt(T t)
Definition: SSEVec.h:19
std::array< int, nEtaTow_ > vngeom_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CaloGeometry const * geo_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
virtual void calculateOrphanInput(std::vector< fastjet::PseudoJet > &orphanInput)
double py() const final
y coordinate of momentum vector
HiPuRhoProducer(const edm::ParameterSet &)
virtual void setupGeometryMap(edm::Event &iEvent, const edm::EventSetup &iSetup)
virtual void putRho(edm::Event &iEvent, const edm::EventSetup &iSetup)
int nt
Definition: AMPTWrapper.h:42
#define M_PI
std::shared_ptr< fastjet::JetDefinition > JetDefPtr
std::pair< double, double > EtaPhi
const double puPtMin_
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
const int initialValue_
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:75
ClusterSequencePtr fjClusterSeq_
int iphi() const
Definition: CaloTower.h:202
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::array< int, nEtaTow_ > vntow_
int ieta() const
Definition: CaloTower.h:200
std::vector< fastjet::PseudoJet > fjJets_
const bool dropZeroTowers_
std::map< int, int > geomtowers_
std::map< int, double > emean_
HLT enums.
std::vector< int > nTow_
std::vector< fastjet::PseudoJet > fjOriginalInputs_
std::vector< double > rhoM_
std::map< int, double > esigma_
const int medianWindowWidth_
std::shared_ptr< fastjet::ClusterSequence > ClusterSequencePtr
double phi() const final
momentum azimuthal angle
JetDefPtr fjJetDefinition_
std::map< int, int > ntowersWithJets_
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr std::array< double, 42 > etaedge
Definition: HITowerHelper.h:5
def move(src, dest)
Definition: eostools.py:511
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const double minimumTowersFraction_
virtual void calculatePedestal(std::vector< fastjet::PseudoJet > const &coll)
std::array< float, nEtaTow_ > vrho0_
#define LogDebug(id)
double energy() const final
energy
double eta() const final
momentum pseudorapidity