28 #include "fastjet/tools/GridMedianBackgroundEstimator.hh" 45 fastjet::GridMedianBackgroundEstimator
bge_;
68 : bge_(iConfig.getParameter<double>(
"maxRapidity"), iConfig.getParameter<double>(
"gridSpacing")),
69 hbheRecHitsTag_(consumes(iConfig.getParameter<
edm::
InputTag>(
"hbheRecHitsTag"))),
70 ebRecHitsTag_(consumes(iConfig.getParameter<
edm::
InputTag>(
"ebRecHitsTag"))),
71 eeRecHitsTag_(consumes(iConfig.getParameter<
edm::
InputTag>(
"eeRecHitsTag"))),
74 skipHCAL_(iConfig.getParameter<
bool>(
"skipHCAL")),
75 skipECAL_(iConfig.getParameter<
bool>(
"skipECAL")),
78 cutsFromDB_(iConfig.getParameter<
bool>(
"usePFThresholdsFromDB")) {
79 if (skipHCAL_ && skipECAL_) {
81 <<
"skipHCAL and skipECAL both can't be True. Please make at least one of them False.";
84 hcalCutsToken_ = esConsumes<HcalPFCuts, HcalPFCutsRcd>(
edm::ESInputTag(
"",
"withTopo"));
96 desc.add<
bool>(
"skipHCAL",
false);
97 desc.add<
bool>(
"skipECAL",
false);
99 desc.add<std::vector<double> >(
"eThresHB", {0.1, 0.2, 0.3, 0.3});
100 desc.add<std::vector<double> >(
"eThresHE", {0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2});
101 desc.add<
double>(
"maxRapidity", 2.5);
102 desc.add<
double>(
"gridSpacing", 0.55);
103 desc.add<
bool>(
"usePFThresholdsFromDB",
true);
114 std::vector<fastjet::PseudoJet>
inputs;
124 inputs.emplace_back(fastjet::PseudoJet(hitp4[0], hitp4[1], hitp4[2], hitp4[3]));
132 for (
const auto &
hit : ebRecHits) {
135 inputs.emplace_back(fastjet::PseudoJet(hitp4[0], hitp4[1], hitp4[2], hitp4[3]));
141 for (
const auto &
hit : eeRecHits) {
144 inputs.emplace_back(fastjet::PseudoJet(hitp4[0], hitp4[1], hitp4[2], hitp4[3]));
150 iEvent.put(std::make_unique<double>(
bge_.rho()));
158 const double thispt = hitE / cosh(gpPos.eta());
159 const double thispx = thispt *
cos(gpPos.phi());
160 const double thispy = thispt *
sin(gpPos.phi());
161 const double thispz = thispt * sinh(gpPos.eta());
162 return std::array<double, 4>{{thispx, thispy, thispz, hitE}};
168 if (hcalcuts !=
nullptr) {
170 return (
hit.energy() >
item->noiseThreshold());
172 const auto thisDetId =
hit.
id();
173 const auto thisDepth = thisDetId.depth();
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< EcalRecHitCollection > ebRecHitsTag_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
HcalPFCuts const * paramPF_
constexpr SubDetector subDetGeom[21]
void produce(edm::Event &, const edm::EventSetup &) override
Sin< T >::type sin(const T &t)
bool passedHcalNoiseCut(const HBHERecHit &hit, const HcalPFCuts *) const
const edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > ecalPFRecHitThresholdsToken_
const Item * getValues(DetId fId, bool throwOnFail=true) const
fastjet::GridMedianBackgroundEstimator bge_
Cos< T >::type cos(const T &t)
#define DEFINE_FWK_MODULE(type)
const EgammaHcalIsolation::arrayHB eThresHB_
std::array< double, 4 > getHitP4(const DetId &detId, const double hitE, const CaloGeometry &caloGeometry) const
const edm::EDGetTokenT< HBHERecHitCollection > hbheRecHitsTag_
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
const edm::EDGetTokenT< EcalRecHitCollection > eeRecHitsTag_
FixedGridRhoProducerFastjetFromRecHit(const edm::ParameterSet &iConfig)
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~FixedGridRhoProducerFastjetFromRecHit() override
const EgammaHcalIsolation::arrayHE eThresHE_
std::array< double, 4 > arrayHB
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
bool passedEcalNoiseCut(const EcalRecHit &hit, const EcalPFRecHitThresholds &thresholds) const
std::array< double, 7 > arrayHE