42 moduleLabel_(cfg.getParameter<std::
string>(
"@module_label")),
60 double discriminator = 1.;
61 for ( std::vector<towerInfo>::const_iterator badTower = badTowers_.begin();
62 badTower != badTowers_.end(); ++badTower ) {
63 if (
deltaR(badTower->eta_, badTower->phi_, pfTau->eta(), pfTau->phi()) < dR_ ) discriminator = 0.;
78 if ( !isFirstEvent_ && channelStatusId == channelStatusId_cache_ && caloGeometryId == caloGeometryId_cache_ && idealGeometryId == idealGeometryId_cache_ )
return;
82 channelStatusId_cache_ = channelStatusId;
86 caloGeometryId_cache_ = caloGeometryId;
90 idealGeometryId_cache_ = idealGeometryId;
92 std::map<uint32_t,unsigned> nBadCrystals, maxStatus;
93 std::map<uint32_t,double> sumEta, sumPhi;
95 loopXtals<EBDetId>(nBadCrystals, maxStatus, sumEta, sumPhi, channelStatus.
product(), caloGeometry.
product(), ttMap.
product());
96 loopXtals<EEDetId>(nBadCrystals, maxStatus, sumEta, sumPhi, channelStatus.
product(), caloGeometry.
product(), ttMap.
product());
99 for ( std::map<uint32_t, unsigned>::const_iterator it = nBadCrystals.begin();
100 it != nBadCrystals.end(); ++it ) {
101 uint32_t
key = it->first;
102 badTowers_.push_back(
towerInfo(key, it->second, maxStatus[key], sumEta[key]/it->second, sumPhi[key]/it->second));
105 isFirstEvent_ =
false;
109 void loopXtals(std::map<uint32_t, unsigned>& nBadCrystals,
110 std::map<uint32_t, unsigned>& maxStatus,
111 std::map<uint32_t, double>& sumEta,
112 std::map<uint32_t, double>& sumPhi ,
119 for (
int i = 0;
i < Id::kSizeForDenseIndexing; ++
i ) {
120 Id
id = Id::unhashIndex(
i);
121 if (
id == Id(0) )
continue;
123 unsigned status = ( it == channelStatus->
end() ) ?
124 0 : (it->getStatusCode() & statusMask_);
125 if ( status >= minStatus_ ) {
130 sumEta[
key] += point.
eta();
131 sumPhi[
key] += point.
phi();
141 maxStatus_(maxStatus),
158 static const uint16_t statusMask_ = 0x1F;
T getParameter(std::string const &) const
uint32_t caloGeometryId_cache_
const self & getMap() const
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiE4D< double > > PolarLorentzVector
Geom::Phi< T > phi() const
std::vector< towerInfo > badTowers_
PFRecoTauDiscriminationAgainstElectronDeadECAL(const edm::ParameterSet &cfg)
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
uint32_t channelStatusId_cache_
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
void loopXtals(std::map< uint32_t, unsigned > &nBadCrystals, std::map< uint32_t, unsigned > &maxStatus, std::map< uint32_t, double > &sumEta, std::map< uint32_t, double > &sumPhi, const EcalChannelStatus *channelStatus, const CaloGeometry *caloGeometry, const EcalTrigTowerConstituentsMap *ttMap) const
DEFINE_FWK_MODULE(CosmicTrackingParticleSelector)
uint32_t idealGeometryId_cache_
std::vector< Item >::const_iterator const_iterator
T const * product() const
void beginEvent(const edm::Event &evt, const edm::EventSetup &es)
double discriminate(const PFTauRef &pfTau)
const_iterator find(uint32_t rawId) const
const_iterator end() const
~PFRecoTauDiscriminationAgainstElectronDeadECAL()
void updateBadTowers(const edm::EventSetup &es)
towerInfo(uint32_t id, unsigned nBad, unsigned maxStatus, double eta, double phi)
*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