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 18 of file PFRecoTauDiscriminationByNProngs.cc.

Constructor & Destructor Documentation

PFRecoTauDiscriminationByNProngs::PFRecoTauDiscriminationByNProngs ( const ParameterSet iConfig)
explicit

Definition at line 35 of file PFRecoTauDiscriminationByNProngs.cc.

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

35  :
37  qualityCuts(iConfig.getParameterSet("qualityCuts"))
38 {
39  minN = iConfig.getParameter<uint32_t>("MinN");
40  maxN = iConfig.getParameter<uint32_t>("MaxN");
41  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
42 
43  qcuts_.reset(new tau::RecoTauQualityCuts(qualityCuts.getParameterSet("signalQualityCuts")));
44  vertexAssociator_.reset(new tau::RecoTauVertexAssociator(qualityCuts,consumesCollector()));
45 }
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 21 of file PFRecoTauDiscriminationByNProngs.cc.

21 {}

Member Function Documentation

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

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 47 of file PFRecoTauDiscriminationByNProngs.cc.

References vertexAssociator_.

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

Definition at line 51 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_.

51  {
52 
53  reco::VertexRef pv = vertexAssociator_->associatedVertex(*tau);
54  const PFCandidatePtr leadingTrack = tau->leadPFChargedHadrCand();
55 
56  uint np = 0;
57  if(leadingTrack.isNonnull() && pv.isNonnull()){
58  qcuts_->setPV(pv);
59  qcuts_->setLeadTrack(tau->leadPFChargedHadrCand());
60 
61  for(auto const& cand : tau->signalPFChargedHadrCands() ) {
62  if ( qcuts_->filterCandRef(cand) ) np++;
63  }
64  }
65 
66  bool accepted = false;
67  if(maxN == 0){
68  if(np == 1 || np == 3) accepted = true;
69  }else{
70  if(np >= minN && np <= maxN) accepted = true;
71  }
72 
73  if(!accepted) np = 0;
74  if(booleanOutput) return accepted;
75  return np;
76 }
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