17 : minStatus_(
cfg.getParameter<uint32_t>(
"minStatus")),
18 dR2_(
std::
pow(
cfg.getParameter<double>(
"dR"), 2)),
19 extrapolateToECalEntrance_(
cfg.getParameter<
bool>(
"extrapolateToECalEntrance")),
20 verbosity_(
cfg.getParameter<
int>(
"verbosity")),
25 isFirstEvent_(
true) {}
36 void loopXtals(std::map<uint32_t, unsigned>& nBadCrystals,
37 std::map<uint32_t, unsigned>& maxStatus,
38 std::map<uint32_t, double>& sumEta,
39 std::map<uint32_t, double>& sumPhi,
44 const uint16_t statusMask) {
47 for (
int i = 0;
i < Id::kSizeForDenseIndexing; ++
i) {
48 Id
id = Id::unhashIndex(
i);
52 unsigned status = (it == channelStatus->
end()) ? 0 : (it->getStatusCode() & statusMask);
77 std::map<uint32_t, unsigned> nBadCrystals, maxStatus;
78 std::map<uint32_t, double> sumEta, sumPhi;
81 nBadCrystals, maxStatus, sumEta, sumPhi, &channelStatus, &caloGeometry, &ttMap,
minStatus_,
statusMask_);
83 nBadCrystals, maxStatus, sumEta, sumPhi, &channelStatus, &caloGeometry, &ttMap,
minStatus_,
statusMask_);
86 for (
auto it : nBadCrystals) {
87 uint32_t
key = it.first;
95 bool isNearBadTower =
false;
101 if (pfTau !=
nullptr) {
105 if (patTau !=
nullptr) {
110 if (leadChargedHadron !=
nullptr) {
114 tau_eta = positionAtECalEntrance.eta();
115 tau_phi = positionAtECalEntrance.phi();
119 edm::LogPrint(
"TauAgainstEleDeadECAL") <<
"<AntiElectronDeadECal::operator()>:";
121 if (leadChargedHadron !=
nullptr) {
123 <<
" leadChargedHadron (" << leadChargedHadron->
pdgId() <<
"): Pt = " << leadChargedHadron->
pt()
124 <<
", eta at ECAL (vtx) = " <<
tau_eta <<
" (" << leadChargedHadron->
eta() <<
")" 125 <<
", phi at ECAL (vtx) = " <<
tau_phi <<
" (" << leadChargedHadron->
phi() <<
")";
128 <<
" tau: Pt = " <<
tau->pt() <<
", eta at vtx = " <<
tau_eta <<
", phi at vtx = " <<
tau_phi;
135 <<
" matches badTower: eta = " << badTower.eta_ <<
", phi = " << badTower.phi_;
137 isNearBadTower =
true;
141 return isNearBadTower;
PositionAtECalEntranceComputer positionAtECalEntrance_
edm::ESWatcher< CaloGeometryRecord > caloGeometryWatcher_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
void beginEvent(const edm::EventSetup &)
const edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecord > ttMapToken_
virtual double pt() const =0
transverse momentum
const CandidatePtr & leadChargedHadrCand() const
uint32_t cc[maxCellsPerHit]
const bool extrapolateToECalEntrance_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
edm::ESWatcher< IdealGeometryRecord > idealGeometryWatcher_
const edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > channelStatusToken_
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_
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
bool operator()(const reco::Candidate *tau) const
bool isNonnull() const
Checks for non-null.
void updateBadTowers(const edm::EventSetup &)
key
prepare the HTCondor submission files and eventually submit them
const reco::CandidatePtr leadChargedHadrCand() const
Log< level::Warning, true > LogPrint
Analysis-level tau class.
T const * get() const
Returns C++ pointer to the item.
const_iterator find(uint32_t rawId) const
AntiElectronDeadECAL(const edm::ParameterSet &, edm::ConsumesCollector &&)
virtual int pdgId() const =0
PDG identifier.
std::vector< Item >::const_iterator const_iterator
bool check(const edm::EventSetup &iSetup)
static const uint16_t statusMask_
math::XYZPoint Point
point in the space
const self & getMap() const
const_iterator end() const
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
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity