CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PFRecoTauDiscriminationByNProngs Class Reference
Inheritance diagram for PFRecoTauDiscriminationByNProngs:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::stream::EDProducer<>

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &) override
 
double discriminate (const reco::PFTauRef &) const override
 
 PFRecoTauDiscriminationByNProngs (const ParameterSet &)
 
 ~PFRecoTauDiscriminationByNProngs () override
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual double discriminate (const TauRef &tau) const =0
 
virtual void endEvent (edm::Event &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 TauDiscriminationProducerBase (const edm::ParameterSet &iConfig)
 
 TauDiscriminationProducerBase ()
 
 ~TauDiscriminationProducerBase () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Private Attributes

bool booleanOutput
 
uint32_t maxN
 
uint32_t minN
 
std::unique_ptr< tau::RecoTauQualityCutsqcuts_
 
edm::ParameterSet qualityCuts
 
std::unique_ptr< tau::RecoTauVertexAssociatorvertexAssociator_
 

Additional Inherited Members

- Public Types inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
typedef edm::RefProd< TauCollectionTauRefProd
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Protected Attributes inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
std::string moduleLabel_
 
double prediscriminantFailValue_
 
edm::EDGetTokenT< TauCollectionTau_token
 
size_t tauIndex_
 
edm::InputTag TauProducer_
 

Detailed Description

Definition at line 19 of file PFRecoTauDiscriminationByNProngs.cc.

Constructor & Destructor Documentation

PFRecoTauDiscriminationByNProngs::PFRecoTauDiscriminationByNProngs ( const ParameterSet iConfig)
explicit

Definition at line 36 of file PFRecoTauDiscriminationByNProngs.cc.

References booleanOutput, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), maxN, minN, qcuts_, qualityCuts, and vertexAssociator_.

36  :
38  qualityCuts(iConfig.getParameterSet("qualityCuts"))
39 {
40  minN = iConfig.getParameter<uint32_t>("MinN");
41  maxN = iConfig.getParameter<uint32_t>("MaxN");
42  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
43 
44  qcuts_.reset(new tau::RecoTauQualityCuts(qualityCuts.getParameterSet("signalQualityCuts")));
45  vertexAssociator_.reset(new tau::RecoTauVertexAssociator(qualityCuts,consumesCollector()));
46 }
T getParameter(std::string const &) const
std::unique_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
ParameterSet const & getParameterSet(std::string const &) const
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
std::unique_ptr< tau::RecoTauQualityCuts > qcuts_
PFRecoTauDiscriminationByNProngs::~PFRecoTauDiscriminationByNProngs ( )
inlineoverride

Definition at line 22 of file PFRecoTauDiscriminationByNProngs.cc.

22 {}

Member Function Documentation

void PFRecoTauDiscriminationByNProngs::beginEvent ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 48 of file PFRecoTauDiscriminationByNProngs.cc.

References vertexAssociator_.

48  {
49  vertexAssociator_->setEvent(iEvent);
50 }
std::unique_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
double PFRecoTauDiscriminationByNProngs::discriminate ( const reco::PFTauRef tau) const
override

Definition at line 52 of file PFRecoTauDiscriminationByNProngs.cc.

References booleanOutput, DEFINE_FWK_MODULE, edm::Ptr< T >::isNonnull(), edm::Ref< C, T, F >::isNonnull(), maxN, minN, np, MetAnalyzer::pv(), qcuts_, parallelization::uint(), and vertexAssociator_.

52  {
53 
54  reco::VertexRef pv = vertexAssociator_->associatedVertex(*tau);
55  const PFCandidatePtr leadingTrack = tau->leadPFChargedHadrCand();
56 
57  uint np = 0;
58  if(leadingTrack.isNonnull() && pv.isNonnull()){
59  qcuts_->setPV(pv);
60  qcuts_->setLeadTrack(tau->leadPFChargedHadrCand());
61 
62  BOOST_FOREACH( const reco::PFCandidatePtr& cand, tau->signalPFChargedHadrCands() ) {
63  if ( qcuts_->filterCandRef(cand) ) np++;
64  }
65  }
66 
67  bool accepted = false;
68  if(maxN == 0){
69  if(np == 1 || np == 3) accepted = true;
70  }else{
71  if(np >= minN && np <= maxN) accepted = true;
72  }
73 
74  if(!accepted) np = 0;
75  if(booleanOutput) return accepted;
76  return np;
77 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
std::unique_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
int np
Definition: AMPTWrapper.h:33
def pv(vc)
Definition: MetAnalyzer.py:7
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
def uint(string)
std::unique_ptr< tau::RecoTauQualityCuts > qcuts_

Member Data Documentation

bool PFRecoTauDiscriminationByNProngs::booleanOutput
private
uint32_t PFRecoTauDiscriminationByNProngs::maxN
private
uint32_t PFRecoTauDiscriminationByNProngs::minN
private
std::unique_ptr<tau::RecoTauQualityCuts> PFRecoTauDiscriminationByNProngs::qcuts_
private
edm::ParameterSet PFRecoTauDiscriminationByNProngs::qualityCuts
private
std::unique_ptr<tau::RecoTauVertexAssociator> PFRecoTauDiscriminationByNProngs::vertexAssociator_
private