28 #include "fastjet/tools/GridMedianBackgroundEstimator.hh"
43 fastjet::GridMedianBackgroundEstimator
bge_;
61 : bge_(iConfig.getParameter<double>(
"maxRapidity"), iConfig.getParameter<double>(
"gridSpacing")),
62 hbheRecHitsTag_(consumes(iConfig.getParameter<edm::
InputTag>(
"hbheRecHitsTag"))),
63 ebRecHitsTag_(consumes(iConfig.getParameter<edm::
InputTag>(
"ebRecHitsTag"))),
64 eeRecHitsTag_(consumes(iConfig.getParameter<edm::
InputTag>(
"eeRecHitsTag"))),
67 skipHCAL_(iConfig.getParameter<bool>(
"skipHCAL")),
68 skipECAL_(iConfig.getParameter<bool>(
"skipECAL")),
71 if (skipHCAL_ && skipECAL_) {
73 <<
"skipHCAL and skipECAL both can't be True. Please make at least one of them False.";
85 desc.
add<
bool>(
"skipHCAL",
false);
86 desc.
add<
bool>(
"skipECAL",
false);
88 desc.
add<std::vector<double> >(
"eThresHB", {0.1, 0.2, 0.3, 0.3});
89 desc.
add<std::vector<double> >(
"eThresHE", {0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2});
90 desc.
add<
double>(
"maxRapidity", 2.5);
91 desc.
add<
double>(
"gridSpacing", 0.55);
98 std::vector<fastjet::PseudoJet>
inputs;
104 inputs.reserve(inputs.size() +
hbheRecHits.size());
108 inputs.emplace_back(fastjet::PseudoJet(hitp4[0], hitp4[1], hitp4[2], hitp4[3]));
115 inputs.reserve(inputs.size() + ebRecHits.size());
116 for (
const auto &
hit : ebRecHits) {
119 inputs.emplace_back(fastjet::PseudoJet(hitp4[0], hitp4[1], hitp4[2], hitp4[3]));
124 inputs.reserve(inputs.size() + eeRecHits.size());
125 for (
const auto &
hit : eeRecHits) {
128 inputs.emplace_back(fastjet::PseudoJet(hitp4[0], hitp4[1], hitp4[2], hitp4[3]));
133 bge_.set_particles(inputs);
134 iEvent.
put(std::make_unique<double>(
bge_.rho()));
141 const auto &gpPos = subDetGeom->
getGeometry(detId)->repPos();
142 const double thispt = hitE / cosh(gpPos.eta());
143 const double thispx = thispt *
cos(gpPos.phi());
144 const double thispy = thispt *
sin(gpPos.phi());
145 const double thispz = thispt * sinh(gpPos.eta());
146 return std::array<double, 4>{{thispx, thispy, thispz, hitE}};
151 const auto thisDetId = hit.
id();
152 const auto thisDepth = thisDetId.
depth();
constexpr float energy() const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< EcalRecHitCollection > ebRecHitsTag_
constexpr SubDetector subDetGeom[21]
std::array< double, 4 > getHitP4(const DetId &detId, const double hitE, const CaloGeometry &caloGeometry) const
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
Sin< T >::type sin(const T &t)
const DetId & detid() const
const edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > ecalPFRecHitThresholdsToken_
bool passedHcalNoiseCut(const HBHERecHit &hit) const
bool getData(T &iHolder) const
fastjet::GridMedianBackgroundEstimator bge_
constexpr HcalDetId id() const
get the id
Cos< T >::type cos(const T &t)
bool get(ProductID const &oid, Handle< PROD > &result) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const EgammaHcalIsolation::arrayHB eThresHB_
const edm::EDGetTokenT< HBHERecHitCollection > hbheRecHitsTag_
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.
const edm::EDGetTokenT< EcalRecHitCollection > eeRecHitsTag_
FixedGridRhoProducerFastjetFromRecHit(const edm::ParameterSet &iConfig)
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
bool passedEcalNoiseCut(const EcalRecHit &hit, const EcalPFRecHitThresholds &thresholds) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~FixedGridRhoProducerFastjetFromRecHit() override
constexpr int depth() const
get the tower depth
const EgammaHcalIsolation::arrayHE eThresHE_
std::array< double, 4 > arrayHB
std::array< double, 7 > arrayHE