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 (const edm::ParameterSet &iConfig)
 
 TauDiscriminationProducerBase ()
 
 ~TauDiscriminationProducerBase () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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.

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

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ParameterSet const & getParameterSet(std::string const &) const
std::unique_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
std::unique_ptr< tau::RecoTauQualityCuts > qcuts_

◆ ~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

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >.

Definition at line 52 of file PFRecoTauDiscriminationByNProngs.cc.

References iEvent, and vertexAssociator_.

52  {
53  vertexAssociator_->setEvent(iEvent);
54 }
std::unique_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
int iEvent
Definition: GenABIO.cc:224

◆ discriminate()

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

Definition at line 56 of file PFRecoTauDiscriminationByNProngs.cc.

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

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 }
std::unique_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
int np
Definition: AMPTWrapper.h:43
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
def pv(vc)
Definition: MetAnalyzer.py:7
std::unique_ptr< tau::RecoTauQualityCuts > qcuts_

◆ fillDescriptions()

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

Definition at line 87 of file PFRecoTauDiscriminationByNProngs.cc.

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

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 }
static void fillDescriptions(edm::ParameterSetDescription &descriptions)
Declare all parameters read from python config file.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

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