File indexing completed on 2023-10-25 10:02:00
0001 #ifndef RecoTauTag_RecoTau_AntiElectronDeadECAL_h
0002 #define RecoTauTag_RecoTau_AntiElectronDeadECAL_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "FWCore/Framework/interface/EventSetup.h"
0023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0024 #include "FWCore/Framework/interface/ESWatcher.h"
0025 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
0026 #include "DataFormats/Candidate/interface/Candidate.h"
0027 #include "RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h"
0028
0029 #include <vector>
0030 #include <string>
0031
0032 class EcalTrigTowerConstituentsMap;
0033 class EcalChannelStatusRcd;
0034 class CaloGeometryRecord;
0035 class IdealGeometryRecord;
0036
0037 class AntiElectronDeadECAL {
0038 public:
0039 explicit AntiElectronDeadECAL(const edm::ParameterSet&, edm::ConsumesCollector&&);
0040 ~AntiElectronDeadECAL();
0041
0042 void beginEvent(const edm::EventSetup&);
0043
0044 bool operator()(const reco::Candidate* tau) const;
0045
0046 private:
0047 const unsigned minStatus_;
0048 const double dR2_;
0049 const bool extrapolateToECalEntrance_;
0050 const int verbosity_;
0051 const edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> channelStatusToken_;
0052 const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeometryToken_;
0053 const edm::ESGetToken<EcalTrigTowerConstituentsMap, IdealGeometryRecord> ttMapToken_;
0054
0055 PositionAtECalEntranceComputer positionAtECalEntrance_;
0056
0057 void updateBadTowers(const edm::EventSetup&);
0058
0059 struct TowerInfo {
0060 TowerInfo(uint32_t id, unsigned nBad, unsigned maxStatus, double eta, double phi)
0061 : id_(id), nBad_(nBad), maxStatus_(maxStatus), eta_(eta), phi_(phi) {}
0062 uint32_t id_;
0063 unsigned nBad_;
0064 unsigned maxStatus_;
0065 double eta_;
0066 double phi_;
0067 };
0068
0069 std::vector<TowerInfo> badTowers_;
0070 static const uint16_t statusMask_ = 0x1F;
0071
0072 edm::ESWatcher<EcalChannelStatusRcd> channelStatusWatcher_;
0073 edm::ESWatcher<CaloGeometryRecord> caloGeometryWatcher_;
0074 edm::ESWatcher<IdealGeometryRecord> idealGeometryWatcher_;
0075
0076 bool isFirstEvent_;
0077 };
0078
0079 #endif