|
|
Go to the documentation of this file.
66 : enabled_(ps.getParameter<
bool>(
"enable")),
67 debug_(ps.getUntrackedParameter<
bool>(
"debug",
false)),
72 produces<std::vector<reco::PFCluster>>();
73 produces<std::vector<reco::PFRecHit>>(
"hits");
93 std::map<std::pair<int, int>,
int>
good, bads;
94 std::map<std::pair<int, int>, std::pair<int, HcalSubdetector>> minDepths;
103 if (
status & statusMask) {
106 std::cout <<
"Channel " <<
i() <<
" (subdet " <<
id.subdet() <<
", zside " <<
id.zside() <<
", ieta "
107 <<
id.ieta() <<
", iphi " <<
id.iphi() <<
" depth " <<
id.depth() <<
" has status " <<
status
108 <<
" masked " << (
status & statusMask) << std::endl;
112 auto& minD = minDepths[
tower];
113 if (minD.second ==
HcalEmpty || minD.first >
id.depth()) {
114 minD.first =
id.depth();
115 minD.second =
id.subdet();
119 const float dummyEnergy = 1
e-5;
120 for (
const auto& rec : bads) {
121 int ieta = rec.first.first,
iphi = rec.first.second, nbad = rec.second, ngood =
good[rec.first];
122 auto minDepth = minDepths[rec.first];
125 bool isBad = (nbad > 0 && nbad >= ngood);
127 std::cout <<
"At ieta " <<
id.ieta() <<
", iphi " <<
id.iphi() <<
" I have " << nbad <<
" bad depths, " << ngood
128 <<
" good depths. First depth is in " << (
barrel ?
"HB" :
"HE") <<
" depth " << minDepth.first <<
"; "
129 << (isBad ?
" MARK BAD" :
" ignore") << std::endl;
134 std::shared_ptr<const CaloCellGeometry> thisCell = (
barrel ? hbGeom : heGeom)->getGeometry(
id);
155 auto outRH = std::make_unique<std::vector<reco::PFRecHit>>(
badAreasRH_);
158 auto outC = std::make_unique<std::vector<reco::PFCluster>>(
badAreasC_);
161 for (
unsigned int i = 0,
n = rhHandle->size();
i <
n; ++
i) {
170 desc.add<
bool>(
"enable",
true)
171 ->setComment(
"activate the module (if false, it doesn't check the DB and produces an empty collection)");
172 desc.addUntracked<
bool>(
"debug",
false);
173 descriptions.
add(
"particleFlowBadHcalPseudoCluster",
desc);
const auto good
min quality of good
edm::ESHandle< HcalChannelQuality > hQuality_
void produce(edm::Event &, const edm::EventSetup &) override
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
std::vector< reco::PFRecHit > badAreasRH_
const Item * getValues(DetId fId, bool throwOnFail=true) const
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > hQualityToken_
unsigned long long cacheId_quality_
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void init(const EventSetup &c)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
unsigned long long cacheId_geom_
edm::ESHandle< CaloGeometry > hGeom_
constexpr std::array< uint8_t, layerIndexSize > layer
uint32_t getValue() const
std::vector< DetId > getAllChannels() const
std::vector< reco::PFCluster > badAreasC_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
~PFBadHcalPseudoClusterProducer() override
PFBadHcalPseudoClusterProducer(const edm::ParameterSet &)
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > hGeomToken_
unsigned long long cacheIdentifier() const