CMS 3D CMS Logo

Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes

PFRecoTauDiscriminationAgainstElectronDeadECAL Class Reference

Inheritance diagram for PFRecoTauDiscriminationAgainstElectronDeadECAL:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

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< towerInfobadTowers_
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

Detailed Description

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

Authors:
Lauri Andreas Wendland, Christian Veelken
Version:
Revision:
1.2
Id:
PFRecoTauDiscriminationAgainstElectronDeadECAL.cc,v 1.2 2012/12/07 12:24:06 speer Exp

Definition at line 37 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.


Member Typedef Documentation


Constructor & Destructor Documentation

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.

{}

Member Function Documentation

void PFRecoTauDiscriminationAgainstElectronDeadECAL::beginEvent ( const edm::Event evt,
const edm::EventSetup es 
) [inline, virtual]
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;
  }
template<class Id >
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;
  }

Member Data Documentation

const uint16_t PFRecoTauDiscriminationAgainstElectronDeadECAL::statusMask_ = 0x1F [static, private]