CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
PFRecoTauDiscriminationByNProngs Class Reference
Inheritance diagram for PFRecoTauDiscriminationByNProngs:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &) override
 
double discriminate (const reco::PFTauRef &) const override
 
 PFRecoTauDiscriminationByNProngs (const ParameterSet &)
 
 ~PFRecoTauDiscriminationByNProngs ()
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual double discriminate (const TauRef &tau) const =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::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool booleanOutput
 
uint32_t maxN
 
uint32_t minN
 
std::auto_ptr
< tau::RecoTauQualityCuts
qcuts_
 
edm::ParameterSet qualityCuts
 
std::auto_ptr
< tau::RecoTauVertexAssociator
vertexAssociator_
 

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::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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::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::EDConsumerBase::consumesCollector(), 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")));
46 }
T getParameter(std::string const &) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::auto_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
ParameterSet const & getParameterSet(std::string const &) const
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
std::auto_ptr< tau::RecoTauQualityCuts > qcuts_
PFRecoTauDiscriminationByNProngs::~PFRecoTauDiscriminationByNProngs ( )
inline

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::auto_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
double PFRecoTauDiscriminationByNProngs::discriminate ( const reco::PFTauRef tau) const
override

Definition at line 52 of file PFRecoTauDiscriminationByNProngs.cc.

References booleanOutput, edm::Ptr< T >::isNonnull(), edm::Ref< C, T, F >::isNonnull(), maxN, minN, np, MetAnalyzer::pv(), qcuts_, 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:250
int np
Definition: AMPTWrapper.h:33
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:152
std::auto_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
std::auto_ptr< tau::RecoTauQualityCuts > qcuts_

Member Data Documentation

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