19 : minStatus_(cfg.getParameter<uint32_t>(
"minStatus")),
20 dR2_(
std::
pow(cfg.getParameter<double>(
"dR"), 2)),
21 extrapolateToECalEntrance_(cfg.getParameter<
bool>(
"extrapolateToECalEntrance")),
22 verbosity_(cfg.getParameter<
int>(
"verbosity")),
23 isFirstEvent_(
true) {}
34 void loopXtals(std::map<uint32_t, unsigned>& nBadCrystals,
35 std::map<uint32_t, unsigned>& maxStatus,
36 std::map<uint32_t, double>& sumEta,
37 std::map<uint32_t, double>& sumPhi,
42 const uint16_t statusMask) {
45 for (
int i = 0;
i < Id::kSizeForDenseIndexing; ++
i) {
46 Id
id = Id::unhashIndex(
i);
50 unsigned status = (it == channelStatus->
end()) ? 0 : (it->getStatusCode() & statusMask);
51 if (status >= minStatus) {
56 sumEta[
key] += point.
eta();
57 sumPhi[
key] += point.
phi();
80 std::map<uint32_t, unsigned> nBadCrystals, maxStatus;
81 std::map<uint32_t, double> sumEta, sumPhi;
83 loopXtals<EBDetId>(nBadCrystals,
92 loopXtals<EEDetId>(nBadCrystals,
103 for (
auto it : nBadCrystals) {
104 uint32_t
key = it.first;
105 badTowers_.push_back(
TowerInfo(key, it.second, maxStatus[key], sumEta[key] / it.second, sumPhi[key] / it.second));
112 bool isNearBadTower =
false;
118 if (pfTau !=
nullptr) {
122 if (patTau !=
nullptr) {
127 if (leadChargedHadron !=
nullptr) {
131 tau_eta = positionAtECalEntrance.eta();
132 tau_phi = positionAtECalEntrance.phi();
136 edm::LogPrint(
"TauAgainstEleDeadECAL") <<
"<AntiElectronDeadECal::operator()>:";
138 if (leadChargedHadron !=
nullptr) {
140 <<
" leadChargedHadron (" << leadChargedHadron->
pdgId() <<
"): Pt = " << leadChargedHadron->
pt()
141 <<
", eta at ECAL (vtx) = " << tau_eta <<
" (" << leadChargedHadron->
eta() <<
")" 142 <<
", phi at ECAL (vtx) = " << tau_phi <<
" (" << leadChargedHadron->
phi() <<
")";
145 <<
" tau: Pt = " << tau->
pt() <<
", eta at vtx = " << tau_eta <<
", phi at vtx = " <<
tau_phi;
149 if (
deltaR2(badTower.eta_, badTower.phi_, tau_eta, tau_phi) <
dR2_) {
152 <<
" matches badTower: eta = " << badTower.eta_ <<
", phi = " << badTower.phi_;
154 isNearBadTower =
true;
158 return isNearBadTower;
PositionAtECalEntranceComputer positionAtECalEntrance_
edm::ESWatcher< CaloGeometryRecord > caloGeometryWatcher_
void beginEvent(const edm::EventSetup &)
const self & getMap() const
T const * get() const
Returns C++ pointer to the item.
const bool extrapolateToECalEntrance_
Geom::Phi< T > phi() const
bool operator()(const reco::Candidate *tau) const
edm::ESWatcher< IdealGeometryRecord > idealGeometryWatcher_
void beginEvent(const edm::EventSetup &)
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
const unsigned minStatus_
std::vector< TowerInfo > badTowers_
edm::ESWatcher< EcalChannelStatusRcd > channelStatusWatcher_
const CandidatePtr & leadChargedHadrCand() const
virtual int pdgId() const =0
PDG identifier.
void updateBadTowers(const edm::EventSetup &)
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
const reco::CandidatePtr leadChargedHadrCand() const
Analysis-level tau class.
bool isNonnull() const
Checks for non-null.
AntiElectronDeadECAL(const edm::ParameterSet &)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
virtual double eta() const =0
momentum pseudorapidity
virtual double pt() const =0
transverse momentum
std::vector< Item >::const_iterator const_iterator
bool check(const edm::EventSetup &iSetup)
static const uint16_t statusMask_
const_iterator find(uint32_t rawId) const
math::XYZPoint Point
point in the space
const_iterator end() const
T const * product() const
virtual double phi() const =0
momentum azimuthal angle
Power< A, B >::type pow(const A &a, const B &b)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point