126 ,
debug_ (iConfig.getParameter<
bool>(
"debug"))
135 edm::LogInfo(
"EcalDeadCellBoundaryEnergyFilter") <<
"Constructor EcalAnomalousEvent";
142 produces<AnomalousECALVariables> (
"anomalousECALVariables");
154 std::vector<BoundaryInformation> v_enNeighboursGap_EB;
155 std::vector<BoundaryInformation> v_enNeighboursGap_EE;
156 v_enNeighboursGap_EB.reserve(50);
157 v_enNeighboursGap_EE.reserve(50);
159 std::vector<BoundaryInformation> v_boundaryInfoDeadCells_EB;
160 std::vector<BoundaryInformation> v_boundaryInfoDeadCells_EE;
161 v_boundaryInfoDeadCells_EB.reserve(50);
162 v_boundaryInfoDeadCells_EE.reserve(50);
187 std::vector<DetId> sameFlagDetIds;
194 edm::LogInfo(
"EcalDeadCellBoundaryEnergyFilter") <<
"process EB";
198 bool detIdAlreadyChecked =
false;
202 int status = (chit != ecalStatus->
end()) ? chit->getStatusCode() & 0x1F : -1;
205 bool passChannelLimitation =
false;
208 std::vector<int> deadNeighbourStati;
214 for (std::vector<int>::iterator sit = deadNeighbourStati.begin(); sit != deadNeighbourStati.end(); ++sit) {
215 if (channelAllowed == *sit || (channelAllowed < 0 &&
std::abs(channelAllowed) <= *sit)) {
216 passChannelLimitation =
true;
222 for (std::vector<DetId>::iterator it = sameFlagDetIds.begin(); it != sameFlagDetIds.end(); it++) {
223 if (currDetId == *it)
224 detIdAlreadyChecked =
true;
233 ecalStatus, geometry);
236 for (std::vector<DetId>::iterator it = gapinfo.
detIds.begin(); it != gapinfo.
detIds.end(); it++) {
237 sameFlagDetIds.push_back(*it);
243 v_enNeighboursGap_EB.push_back(gapinfo);
253 && !deadNeighbourStati.empty()))) {
257 ecalStatus, geometry);
260 for (std::vector<DetId>::iterator it = boundinfo.
detIds.begin(); it != boundinfo.
detIds.end(); it++) {
261 sameFlagDetIds.push_back(*it);
267 v_boundaryInfoDeadCells_EB.push_back(boundinfo);
270 edm::LogInfo(
"EcalDeadCellBoundaryEnergyFilter") <<
"EB: boundary Energy dead RecHit: " << boundinfo.
boundaryEnergy <<
" ET: " 279 sameFlagDetIds.clear();
284 edm::LogInfo(
"EcalDeadCellBoundaryEnergyFilter") <<
"process EE";
288 bool detIdAlreadyChecked =
false;
292 int status = (chit != ecalStatus->
end()) ? chit->getStatusCode() & 0x1F : -1;
295 bool passChannelLimitation =
false;
298 std::vector<int> deadNeighbourStati;
304 for (std::vector<int>::iterator sit = deadNeighbourStati.begin(); sit != deadNeighbourStati.end(); ++sit) {
305 if (channelAllowed == *sit || (channelAllowed < 0 &&
std::abs(channelAllowed) <= *sit)) {
306 passChannelLimitation =
true;
312 for (std::vector<DetId>::iterator it = sameFlagDetIds.begin(); it != sameFlagDetIds.end(); it++) {
313 if (currDetId == *it)
314 detIdAlreadyChecked =
true;
320 double eta = cellGeom->getPosition().eta();
327 ecalStatus, geometry);
330 for (std::vector<DetId>::iterator it = gapinfo.
detIds.begin(); it != gapinfo.
detIds.end(); it++) {
331 sameFlagDetIds.push_back(*it);
337 v_enNeighboursGap_EE.push_back(gapinfo);
347 && !deadNeighbourStati.empty()))) {
351 ecalStatus, geometry);
354 for (std::vector<DetId>::iterator it = boundinfo.
detIds.begin(); it != boundinfo.
detIds.end(); it++) {
355 sameFlagDetIds.push_back(*it);
361 v_boundaryInfoDeadCells_EE.push_back(boundinfo);
364 edm::LogInfo(
"EcalDeadCellBoundaryEnergyFilter") <<
"EE: boundary Energy dead RecHit: " << boundinfo.
boundaryEnergy <<
" ET: " 374 sameFlagDetIds.clear();
376 auto pAnomalousECALVariables = std::make_unique<AnomalousECALVariables>(v_enNeighboursGap_EB,
377 v_enNeighboursGap_EE, v_boundaryInfoDeadCells_EB, v_boundaryInfoDeadCells_EE);
385 iEvent.
put(
std::move(pAnomalousECALVariables),
"anomalousECALVariables");
387 iEvent.
put(std::make_unique<bool>(pass));
390 if (
skimDead_ && (i_EBDead >= 1 || i_EEDead >= 1)) {
392 }
else if (
skimGap_ && (i_EBGap >= 1 || i_EEGap >= 1)) {
EcalBoundaryInfoCalculator< EBDetId > ebBoundaryCalc
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
bool checkRecHitHasInvalidNeighbour(const EcalRecHit &hit, const edm::ESHandle< EcalChannelStatus > ecalStatus) const
double maxBoundaryEnergy_
BoundaryInformation gapRecHits(const edm::Handle< EcalRecHitCollection > &, const EcalRecHit *, const edm::ESHandle< CaloTopology > theCaloTopology, const edm::ESHandle< EcalChannelStatus > ecalStatus, const edm::ESHandle< CaloGeometry > geometry) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const double cutBoundEnergyDeadCellsEB
const double cutBoundEnergyDeadCellsEE
~EcalDeadCellBoundaryEnergyFilter() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< EcalRecHitCollection > EERecHitsToken_
unique_ptr< ClusterSequence > cs
std::vector< EcalRecHit >::const_iterator const_iterator
const double cutBoundEnergyGapEE
EcalBoundaryInfoCalculator< EEDetId > eeBoundaryCalc
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const bool limitFilterToEB_
const double cutBoundEnergyGapEB
EcalDeadCellBoundaryEnergyFilter(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
BoundaryInformation boundaryRecHits(const edm::Handle< EcalRecHitCollection > &, const EcalRecHit *, const edm::ESHandle< CaloTopology > theCaloTopology, const edm::ESHandle< EcalChannelStatus > ecalStatus, const edm::ESHandle< CaloGeometry > geometry) const
const std::vector< int > limitDeadCellToChannelStatusEE_
Abs< T >::type abs(const T &t)
const_iterator end() const
const std::string FilterAlgo_
bool filter(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
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.
std::vector< Item >::const_iterator const_iterator
ESHandle< TrackerGeometry > geometry
const std::vector< int > limitDeadCellToChannelStatusEB_
edm::EDGetTokenT< EcalRecHitCollection > EBRecHitsToken_
const_iterator find(uint32_t rawId) const
const_iterator end() const
const bool limitFilterToEE_
const_iterator begin() const
bool checkRecHitHasDeadNeighbour(const EcalRecHit &hit, const edm::ESHandle< EcalChannelStatus > ecalStatus, std::vector< int > &stati) const