CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PFRecoTauDiscriminationByNProngs Class Reference
Inheritance diagram for PFRecoTauDiscriminationByNProngs:
TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType > 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, TauDiscriminatorDataType, ConsumeType >
virtual TauDiscriminatorDataType discriminate (const TauRef &tau) const =0
 
virtual void endEvent (edm::Event &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 TauDiscriminationProducerBase ()
 
 TauDiscriminationProducerBase (const edm::ParameterSet &iConfig)
 
 ~TauDiscriminationProducerBase () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >
static void fillProducerDescriptions (edm::ParameterSetDescription &desc)
 
static std::string getTauTypeString ()
 helper method to retrieve tau type name, e.g. to build correct cfi getter More...
 

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, TauDiscriminatorDataType, ConsumeType >
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, TauDiscriminatorDataType, ConsumeType >
std::string moduleLabel_
 
double prediscriminantFailValue_
 
edm::EDGetTokenT< TauCollectionTau_token
 
size_t tauIndex_
 
edm::InputTag TauProducer_
 

Detailed Description

Definition at line 23 of file PFRecoTauDiscriminationByNProngs.cc.

Constructor & Destructor Documentation

◆ PFRecoTauDiscriminationByNProngs()

PFRecoTauDiscriminationByNProngs::PFRecoTauDiscriminationByNProngs ( const ParameterSet iConfig)
explicit

Definition at line 42 of file PFRecoTauDiscriminationByNProngs.cc.

43  : PFTauDiscriminationProducerBase(iConfig), qualityCuts(iConfig.getParameterSet("qualityCuts")) {
44  minN = iConfig.getParameter<uint32_t>("MinN");
45  maxN = iConfig.getParameter<uint32_t>("MaxN");
46  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
47 
48  qcuts_ = std::make_unique<tau::RecoTauQualityCuts>(qualityCuts.getParameterSet("signalQualityCuts"));
49  vertexAssociator_ = std::make_unique<tau::RecoTauVertexAssociator>(qualityCuts, consumesCollector());
50 }

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

◆ ~PFRecoTauDiscriminationByNProngs()

PFRecoTauDiscriminationByNProngs::~PFRecoTauDiscriminationByNProngs ( )
inlineoverride

Definition at line 26 of file PFRecoTauDiscriminationByNProngs.cc.

26 {}

Member Function Documentation

◆ beginEvent()

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

◆ discriminate()

double PFRecoTauDiscriminationByNProngs::discriminate ( const reco::PFTauRef tau) const
override

Definition at line 56 of file PFRecoTauDiscriminationByNProngs.cc.

56  {
57  reco::VertexRef pv = vertexAssociator_->associatedVertex(*tau);
58  const CandidatePtr leadingTrack = tau->leadChargedHadrCand();
59 
60  uint np = 0;
61  if (leadingTrack.isNonnull() && pv.isNonnull()) {
62  qcuts_->setPV(pv);
63  qcuts_->setLeadTrack(*tau->leadChargedHadrCand());
64 
65  for (auto const& cand : tau->signalChargedHadrCands()) {
66  if (qcuts_->filterCandRef(cand))
67  np++;
68  }
69  }
70 
71  bool accepted = false;
72  if (maxN == 0) {
73  if (np == 1 || np == 3)
74  accepted = true;
75  } else {
76  if (np >= minN && np <= maxN)
77  accepted = true;
78  }
79 
80  if (!accepted)
81  np = 0;
82  if (booleanOutput)
83  return accepted;
84  return np;
85 }

References booleanOutput, edm::Ptr< T >::isNonnull(), maxN, minN, np, MetAnalyzer::pv(), qcuts_, metsig::tau, parallelization::uint, and vertexAssociator_.

◆ fillDescriptions()

void PFRecoTauDiscriminationByNProngs::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 87 of file PFRecoTauDiscriminationByNProngs.cc.

87  {
88  // pfRecoTauDiscriminationByNProngs
90 
91  edm::ParameterSetDescription desc_qualityCuts;
93  desc.add<edm::ParameterSetDescription>("qualityCuts", desc_qualityCuts);
94 
95  {
97  psd0.add<std::string>("BooleanOperator", "and");
98  desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
99  }
100 
101  desc.add<bool>("BooleanOutput", true);
102  desc.add<edm::InputTag>("PFTauProducer", edm::InputTag("combinatoricRecoTaus"));
103  desc.add<unsigned int>("MinN", 1);
104  desc.add<unsigned int>("MaxN", 0);
105  descriptions.add("pfRecoTauDiscriminationByNProngs", desc);
106 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, reco::tau::RecoTauQualityCuts::fillDescriptions(), HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ booleanOutput

bool PFRecoTauDiscriminationByNProngs::booleanOutput
private

◆ maxN

uint32_t PFRecoTauDiscriminationByNProngs::maxN
private

◆ minN

uint32_t PFRecoTauDiscriminationByNProngs::minN
private

◆ qcuts_

std::unique_ptr<tau::RecoTauQualityCuts> PFRecoTauDiscriminationByNProngs::qcuts_
private

◆ qualityCuts

edm::ParameterSet PFRecoTauDiscriminationByNProngs::qualityCuts
private

◆ vertexAssociator_

std::unique_ptr<tau::RecoTauVertexAssociator> PFRecoTauDiscriminationByNProngs::vertexAssociator_
private
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
metsig::tau
Definition: SignAlgoResolutions.h:49
np
int np
Definition: AMPTWrapper.h:43
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
PFRecoTauDiscriminationByNProngs::qualityCuts
edm::ParameterSet qualityCuts
Definition: PFRecoTauDiscriminationByNProngs.cc:39
PFTauDiscriminationProducerBase
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
Definition: TauDiscriminationProducerBase.h:124
parallelization.uint
uint
Definition: parallelization.py:124
edm::Ref< VertexCollection >
PFRecoTauDiscriminationByNProngs::maxN
uint32_t maxN
Definition: PFRecoTauDiscriminationByNProngs.cc:37
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFRecoTauDiscriminationByNProngs::qcuts_
std::unique_ptr< tau::RecoTauQualityCuts > qcuts_
Definition: PFRecoTauDiscriminationByNProngs.cc:34
PFRecoTauDiscriminationByNProngs::booleanOutput
bool booleanOutput
Definition: PFRecoTauDiscriminationByNProngs.cc:38
cand
Definition: decayParser.h:32
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
iEvent
int iEvent
Definition: GenABIO.cc:224
reco::tau::RecoTauQualityCuts::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &descriptions)
Declare all parameters read from python config file.
Definition: RecoTauQualityCuts.cc:346
PFRecoTauDiscriminationByNProngs::vertexAssociator_
std::unique_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
Definition: PFRecoTauDiscriminationByNProngs.cc:35
edm::Ptr< Candidate >
PFRecoTauDiscriminationByNProngs::minN
uint32_t minN
Definition: PFRecoTauDiscriminationByNProngs.cc:37
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::Ptr::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag
Definition: InputTag.h:15
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128