CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

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 ()
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual double discriminate (const TauRef &tau)=0
 
virtual void endEvent (edm::Event &evt)
 
void produce (edm::Event &, const edm::EventSetup &)
 
 TauDiscriminationProducerBase (const edm::ParameterSet &iConfig)
 
 TauDiscriminationProducerBase ()
 
virtual ~TauDiscriminationProducerBase ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 

Additional Inherited Members

- Public Types inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
typedef edm::RefProd
< TauCollection
TauRefProd
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
std::string moduleLabel_
 
double prediscriminantFailValue_
 
edm::InputTag TauProducer_
 

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)
inlineexplicit
PFRecoTauDiscriminationAgainstElectronDeadECAL::~PFRecoTauDiscriminationAgainstElectronDeadECAL ( )
inline

Definition at line 48 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.

48 {}

Member Function Documentation

void PFRecoTauDiscriminationAgainstElectronDeadECAL::beginEvent ( const edm::Event evt,
const edm::EventSetup es 
)
inlinevirtual
double PFRecoTauDiscriminationAgainstElectronDeadECAL::discriminate ( const PFTauRef pfTau)
inline

Definition at line 55 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.

References reco::deltaR().

56  {
57  //std::cout << "<PFRecoTauDiscriminationAgainstElectronDeadECAL::discriminate>:" << std::endl;
58  //std::cout << " moduleLabel = " << moduleLabel_ << std::endl;
59  //std::cout << " #badTowers = " << badTowers_.size() << std::endl;
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.;
64  }
65  //std::cout << "--> discriminator = " << discriminator << std::endl;
66  return discriminator;
67  }
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
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
inlineprivate

Definition at line 109 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.

References EcalCondObjectContainer< T >::end(), PV3DBase< T, PVType, FrameType >::eta(), EcalCondObjectContainer< T >::find(), EcalCondObjectContainer< T >::getMap(), CaloGeometry::getPosition(), i, combine::key, siStripFEDMonitor_P5_cff::Max, PV3DBase< T, PVType, FrameType >::phi(), point, ntuplemaker::status, and EcalTrigTowerConstituentsMap::towerOf().

116  {
117  // NOTE: modified version of SUSY CAF code
118  // UserCode/SusyCAF/plugins/SusyCAF_EcalDeadChannels.cc
119  for ( int i = 0; i < Id::kSizeForDenseIndexing; ++i ) {
120  Id id = Id::unhashIndex(i);
121  if ( id == Id(0) ) continue;
122  EcalChannelStatusMap::const_iterator it = channelStatus->getMap().find(id.rawId());
123  unsigned status = ( it == channelStatus->end() ) ?
124  0 : (it->getStatusCode() & statusMask_);
125  if ( status >= minStatus_ ) {
126  const GlobalPoint& point = caloGeometry->getPosition(id);
127  uint32_t key = ttMap->towerOf(id);
128  maxStatus[key] = TMath::Max(status, maxStatus[key]);
129  ++nBadCrystals[key];
130  sumEta[key] += point.eta();
131  sumPhi[key] += point.phi();
132  }
133  }
134  }
int i
Definition: DBlmapReader.cc:9
const self & getMap() const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
std::vector< Item >::const_iterator const_iterator
T eta() const
Definition: PV3DBase.h:76
list key
Definition: combine.py:13
const_iterator find(uint32_t rawId) const
const_iterator end() const
tuple status
Definition: ntuplemaker.py:245
*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
Definition: invegas.h:5
void PFRecoTauDiscriminationAgainstElectronDeadECAL::updateBadTowers ( const edm::EventSetup es)
inlineprivate

Definition at line 70 of file PFRecoTauDiscriminationAgainstElectronDeadECAL.cc.

References edm::EventSetup::get(), combine::key, and edm::ESHandle< class >::product().

71  {
72  // NOTE: modified version of SUSY CAF code
73  // UserCode/SusyCAF/plugins/SusyCAF_EcalDeadChannels.cc
74  const uint32_t channelStatusId = es.get<EcalChannelStatusRcd>().cacheIdentifier();
75  const uint32_t caloGeometryId = es.get<CaloGeometryRecord>().cacheIdentifier();
76  const uint32_t idealGeometryId = es.get<IdealGeometryRecord>().cacheIdentifier();
77 
78  if ( !isFirstEvent_ && channelStatusId == channelStatusId_cache_ && caloGeometryId == caloGeometryId_cache_ && idealGeometryId == idealGeometryId_cache_ ) return;
79 
80  edm::ESHandle<EcalChannelStatus> channelStatus;
81  es.get<EcalChannelStatusRcd>().get(channelStatus);
82  channelStatusId_cache_ = channelStatusId;
83 
84  edm::ESHandle<CaloGeometry> caloGeometry;
85  es.get<CaloGeometryRecord>().get(caloGeometry);
86  caloGeometryId_cache_ = caloGeometryId;
87 
89  es.get<IdealGeometryRecord>().get(ttMap);
90  idealGeometryId_cache_ = idealGeometryId;
91 
92  std::map<uint32_t,unsigned> nBadCrystals, maxStatus;
93  std::map<uint32_t,double> sumEta, sumPhi;
94 
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());
97 
98  badTowers_.clear();
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));
103  }
104 
105  isFirstEvent_ = false;
106  }
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
list key
Definition: combine.py:13

Member Data Documentation

std::vector<towerInfo> PFRecoTauDiscriminationAgainstElectronDeadECAL::badTowers_
private
uint32_t PFRecoTauDiscriminationAgainstElectronDeadECAL::caloGeometryId_cache_
private
uint32_t PFRecoTauDiscriminationAgainstElectronDeadECAL::channelStatusId_cache_
private
double PFRecoTauDiscriminationAgainstElectronDeadECAL::dR_
private
uint32_t PFRecoTauDiscriminationAgainstElectronDeadECAL::idealGeometryId_cache_
private
bool PFRecoTauDiscriminationAgainstElectronDeadECAL::isFirstEvent_
private
unsigned PFRecoTauDiscriminationAgainstElectronDeadECAL::minStatus_
private
std::string PFRecoTauDiscriminationAgainstElectronDeadECAL::moduleLabel_
private
const uint16_t PFRecoTauDiscriminationAgainstElectronDeadECAL::statusMask_ = 0x1F
staticprivate