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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () 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 20 of file PFRecoTauDiscriminationByNProngs.cc.

Constructor & Destructor Documentation

◆ PFRecoTauDiscriminationByNProngs()

PFRecoTauDiscriminationByNProngs::PFRecoTauDiscriminationByNProngs ( const ParameterSet iConfig)
explicit

Definition at line 39 of file PFRecoTauDiscriminationByNProngs.cc.

40  : PFTauDiscriminationProducerBase(iConfig), qualityCuts(iConfig.getParameterSet("qualityCuts")) {
41  minN = iConfig.getParameter<uint32_t>("MinN");
42  maxN = iConfig.getParameter<uint32_t>("MaxN");
43  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
44 
45  qcuts_.reset(new tau::RecoTauQualityCuts(qualityCuts.getParameterSet("signalQualityCuts")));
46  vertexAssociator_.reset(new tau::RecoTauVertexAssociator(qualityCuts, consumesCollector()));
47 }

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

◆ ~PFRecoTauDiscriminationByNProngs()

PFRecoTauDiscriminationByNProngs::~PFRecoTauDiscriminationByNProngs ( )
inlineoverride

Definition at line 23 of file PFRecoTauDiscriminationByNProngs.cc.

23 {}

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

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

References cms::dd::accepted(), 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 84 of file PFRecoTauDiscriminationByNProngs.cc.

84  {
85  // pfRecoTauDiscriminationByNProngs
87 
88  {
89  edm::ParameterSetDescription pset_signalQualityCuts;
90  pset_signalQualityCuts.add<double>("maxDeltaZ", 0.4);
91  pset_signalQualityCuts.add<double>("minTrackPt", 0.5);
92  pset_signalQualityCuts.add<double>("minTrackVertexWeight", -1.0);
93  pset_signalQualityCuts.add<double>("maxTrackChi2", 100.0);
94  pset_signalQualityCuts.add<unsigned int>("minTrackPixelHits", 0);
95  pset_signalQualityCuts.add<double>("minGammaEt", 1.0);
96  pset_signalQualityCuts.add<unsigned int>("minTrackHits", 3);
97  pset_signalQualityCuts.add<double>("minNeutralHadronEt", 30.0);
98  pset_signalQualityCuts.add<double>("maxTransverseImpactParameter", 0.1);
99  pset_signalQualityCuts.addOptional<bool>("useTracksInsteadOfPFHadrons");
100 
101  edm::ParameterSetDescription pset_vxAssocQualityCuts;
102  pset_vxAssocQualityCuts.add<double>("minTrackPt", 0.5);
103  pset_vxAssocQualityCuts.add<double>("minTrackVertexWeight", -1.0);
104  pset_vxAssocQualityCuts.add<double>("maxTrackChi2", 100.0);
105  pset_vxAssocQualityCuts.add<unsigned int>("minTrackPixelHits", 0);
106  pset_vxAssocQualityCuts.add<double>("minGammaEt", 1.0);
107  pset_vxAssocQualityCuts.add<unsigned int>("minTrackHits", 3);
108  pset_vxAssocQualityCuts.add<double>("maxTransverseImpactParameter", 0.1);
109  pset_vxAssocQualityCuts.addOptional<bool>("useTracksInsteadOfPFHadrons");
110 
111  edm::ParameterSetDescription pset_isolationQualityCuts;
112  pset_isolationQualityCuts.add<double>("maxDeltaZ", 0.2);
113  pset_isolationQualityCuts.add<double>("minTrackPt", 1.0);
114  pset_isolationQualityCuts.add<double>("minTrackVertexWeight", -1.0);
115  pset_isolationQualityCuts.add<double>("maxTrackChi2", 100.0);
116  pset_isolationQualityCuts.add<unsigned int>("minTrackPixelHits", 0);
117  pset_isolationQualityCuts.add<double>("minGammaEt", 1.5);
118  pset_isolationQualityCuts.add<unsigned int>("minTrackHits", 8);
119  pset_isolationQualityCuts.add<double>("maxTransverseImpactParameter", 0.03);
120  pset_isolationQualityCuts.addOptional<bool>("useTracksInsteadOfPFHadrons");
121 
122  edm::ParameterSetDescription pset_qualityCuts;
123  pset_qualityCuts.add<edm::ParameterSetDescription>("signalQualityCuts", pset_signalQualityCuts);
124  pset_qualityCuts.add<edm::ParameterSetDescription>("vxAssocQualityCuts", pset_vxAssocQualityCuts);
125  pset_qualityCuts.add<edm::ParameterSetDescription>("isolationQualityCuts", pset_isolationQualityCuts);
126  pset_qualityCuts.add<std::string>("leadingTrkOrPFCandOption", "leadPFCand");
127  pset_qualityCuts.add<std::string>("pvFindingAlgo", "closestInDeltaZ");
128  pset_qualityCuts.add<edm::InputTag>("primaryVertexSrc", edm::InputTag("offlinePrimaryVertices"));
129  pset_qualityCuts.add<bool>("vertexTrackFiltering", false);
130  pset_qualityCuts.add<bool>("recoverLeadingTrk", false);
131 
132  desc.add<edm::ParameterSetDescription>("qualityCuts", pset_qualityCuts);
133  }
134 
135  {
137  psd0.add<std::string>("BooleanOperator", "and");
138  desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
139  }
140 
141  desc.add<bool>("BooleanOutput", true);
142  desc.add<edm::InputTag>("PFTauProducer", edm::InputTag("combinatoricRecoTaus"));
143  desc.add<unsigned int>("MinN", 1);
144  desc.add<unsigned int>("MaxN", 0);
145  descriptions.add("pfRecoTauDiscriminationByNProngs", desc);
146 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), HLT_2018_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
reco::tau::RecoTauQualityCuts
Definition: RecoTauQualityCuts.h:34
metsig::tau
Definition: SignAlgoResolutions.h:49
np
int np
Definition: AMPTWrapper.h:43
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
PFRecoTauDiscriminationByNProngs::qualityCuts
edm::ParameterSet qualityCuts
Definition: PFRecoTauDiscriminationByNProngs.cc:36
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:34
reco::tau::RecoTauVertexAssociator
Definition: RecoTauVertexAssociator.h:50
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
cms::dd::accepted
bool accepted(std::vector< std::regex > const &, std::string_view)
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
PFRecoTauDiscriminationByNProngs::qcuts_
std::unique_ptr< tau::RecoTauQualityCuts > qcuts_
Definition: PFRecoTauDiscriminationByNProngs.cc:31
PFRecoTauDiscriminationByNProngs::booleanOutput
bool booleanOutput
Definition: PFRecoTauDiscriminationByNProngs.cc:35
cand
Definition: decayParser.h:34
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
iEvent
int iEvent
Definition: GenABIO.cc:224
PFRecoTauDiscriminationByNProngs::vertexAssociator_
std::unique_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
Definition: PFRecoTauDiscriminationByNProngs.cc:32
edm::Ptr< Candidate >
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
PFRecoTauDiscriminationByNProngs::minN
uint32_t minN
Definition: PFRecoTauDiscriminationByNProngs.cc:34
edm::Ptr::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
edm::InputTag
Definition: InputTag.h:15
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2121