Classes | |
struct | towerInfo |
Public Member Functions | |
void | beginEvent (const edm::Event &evt, const edm::EventSetup &es) |
double | discriminate (const PFTauRef &pfTau) |
PFRecoTauDiscriminationAgainstElectronDeadECAL (const edm::ParameterSet &cfg) | |
~PFRecoTauDiscriminationAgainstElectronDeadECAL () | |
Private Types | |
typedef ROOT::Math::LorentzVector < ROOT::Math::PtEtaPhiE4D < double > > | PolarLorentzVector |
Private Member Functions | |
template<class 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 |
void | updateBadTowers (const edm::EventSetup &es) |
Private Attributes | |
std::vector< towerInfo > | badTowers_ |
uint32_t | caloGeometryId_cache_ |
uint32_t | channelStatusId_cache_ |
double | dR_ |
uint32_t | idealGeometryId_cache_ |
bool | isFirstEvent_ |
unsigned | minStatus_ |
std::string | moduleLabel_ |
Static Private Attributes | |
static const uint16_t | statusMask_ = 0x1F |
Flag tau candidates reconstructed near dead ECAL channels, in order to reduce e -> tau fakes not rejected by anti-e MVA discriminator
The motivation for this flag is this presentation: https://indico.cern.ch/getFile.py/access?contribId=0&resId=0&materialId=slides&confId=177223
Definition at line 37 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
typedef ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiE4D<double> > PFRecoTauDiscriminationAgainstElectronDeadECAL::PolarLorentzVector [private] |
Definition at line 151 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
PFRecoTauDiscriminationAgainstElectronDeadECAL::PFRecoTauDiscriminationAgainstElectronDeadECAL | ( | const edm::ParameterSet & | cfg | ) | [inline, explicit] |
Definition at line 40 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
References edm::ParameterSet::getParameter().
: PFTauDiscriminationProducerBase(cfg), moduleLabel_(cfg.getParameter<std::string>("@module_label")), isFirstEvent_(true) { minStatus_ = cfg.getParameter<uint32_t>("minStatus"); dR_ = cfg.getParameter<double>("dR"); }
PFRecoTauDiscriminationAgainstElectronDeadECAL::~PFRecoTauDiscriminationAgainstElectronDeadECAL | ( | ) | [inline] |
Definition at line 48 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
{}
void PFRecoTauDiscriminationAgainstElectronDeadECAL::beginEvent | ( | const edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [inline, virtual] |
Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.
Definition at line 50 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
{ updateBadTowers(es); }
double PFRecoTauDiscriminationAgainstElectronDeadECAL::discriminate | ( | const PFTauRef & | pfTau | ) | [inline] |
Definition at line 55 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
References reco::deltaR().
{ //std::cout << "<PFRecoTauDiscriminationAgainstElectronDeadECAL::discriminate>:" << std::endl; //std::cout << " moduleLabel = " << moduleLabel_ << std::endl; //std::cout << " #badTowers = " << badTowers_.size() << std::endl; double discriminator = 1.; for ( std::vector<towerInfo>::const_iterator badTower = badTowers_.begin(); badTower != badTowers_.end(); ++badTower ) { if ( deltaR(badTower->eta_, badTower->phi_, pfTau->eta(), pfTau->phi()) < dR_ ) discriminator = 0.; } //std::cout << "--> discriminator = " << discriminator << std::endl; return discriminator; }
void PFRecoTauDiscriminationAgainstElectronDeadECAL::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 [inline, private] |
Definition at line 109 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
References EcalCondObjectContainer< T >::end(), PV3DBase< T, PVType, FrameType >::eta(), EcalCondObjectContainer< T >::getMap(), CaloGeometry::getPosition(), i, combine::key, siStripFEDMonitor_P5_cff::Max, PV3DBase< T, PVType, FrameType >::phi(), point, ntuplemaker::status, and EcalTrigTowerConstituentsMap::towerOf().
{ // NOTE: modified version of SUSY CAF code // UserCode/SusyCAF/plugins/SusyCAF_EcalDeadChannels.cc for ( int i = 0; i < Id::kSizeForDenseIndexing; ++i ) { Id id = Id::unhashIndex(i); if ( id == Id(0) ) continue; EcalChannelStatusMap::const_iterator it = channelStatus->getMap().find(id.rawId()); unsigned status = ( it == channelStatus->end() ) ? 0 : (it->getStatusCode() & statusMask_); if ( status >= minStatus_ ) { const GlobalPoint& point = caloGeometry->getPosition(id); uint32_t key = ttMap->towerOf(id); maxStatus[key] = TMath::Max(status, maxStatus[key]); ++nBadCrystals[key]; sumEta[key] += point.eta(); sumPhi[key] += point.phi(); } } }
void PFRecoTauDiscriminationAgainstElectronDeadECAL::updateBadTowers | ( | const edm::EventSetup & | es | ) | [inline, private] |
Definition at line 70 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
References edm::EventSetup::get(), combine::key, and edm::ESHandle< T >::product().
{ // NOTE: modified version of SUSY CAF code // UserCode/SusyCAF/plugins/SusyCAF_EcalDeadChannels.cc const uint32_t channelStatusId = es.get<EcalChannelStatusRcd>().cacheIdentifier(); const uint32_t caloGeometryId = es.get<CaloGeometryRecord>().cacheIdentifier(); const uint32_t idealGeometryId = es.get<IdealGeometryRecord>().cacheIdentifier(); if ( !isFirstEvent_ && channelStatusId == channelStatusId_cache_ && caloGeometryId == caloGeometryId_cache_ && idealGeometryId == idealGeometryId_cache_ ) return; edm::ESHandle<EcalChannelStatus> channelStatus; es.get<EcalChannelStatusRcd>().get(channelStatus); channelStatusId_cache_ = channelStatusId; edm::ESHandle<CaloGeometry> caloGeometry; es.get<CaloGeometryRecord>().get(caloGeometry); caloGeometryId_cache_ = caloGeometryId; edm::ESHandle<EcalTrigTowerConstituentsMap> ttMap; es.get<IdealGeometryRecord>().get(ttMap); idealGeometryId_cache_ = idealGeometryId; std::map<uint32_t,unsigned> nBadCrystals, maxStatus; std::map<uint32_t,double> sumEta, sumPhi; loopXtals<EBDetId>(nBadCrystals, maxStatus, sumEta, sumPhi, channelStatus.product(), caloGeometry.product(), ttMap.product()); loopXtals<EEDetId>(nBadCrystals, maxStatus, sumEta, sumPhi, channelStatus.product(), caloGeometry.product(), ttMap.product()); badTowers_.clear(); for ( std::map<uint32_t, unsigned>::const_iterator it = nBadCrystals.begin(); it != nBadCrystals.end(); ++it ) { uint32_t key = it->first; badTowers_.push_back(towerInfo(key, it->second, maxStatus[key], sumEta[key]/it->second, sumPhi[key]/it->second)); } isFirstEvent_ = false; }
std::vector<towerInfo> PFRecoTauDiscriminationAgainstElectronDeadECAL::badTowers_ [private] |
Definition at line 157 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
uint32_t PFRecoTauDiscriminationAgainstElectronDeadECAL::caloGeometryId_cache_ [private] |
Definition at line 161 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
uint32_t PFRecoTauDiscriminationAgainstElectronDeadECAL::channelStatusId_cache_ [private] |
Definition at line 160 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
double PFRecoTauDiscriminationAgainstElectronDeadECAL::dR_ [private] |
Definition at line 155 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
uint32_t PFRecoTauDiscriminationAgainstElectronDeadECAL::idealGeometryId_cache_ [private] |
Definition at line 162 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
Definition at line 163 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
unsigned PFRecoTauDiscriminationAgainstElectronDeadECAL::minStatus_ [private] |
Definition at line 154 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
std::string PFRecoTauDiscriminationAgainstElectronDeadECAL::moduleLabel_ [private] |
Definition at line 153 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.
const uint16_t PFRecoTauDiscriminationAgainstElectronDeadECAL::statusMask_ = 0x1F [static, private] |
Definition at line 158 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.