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 > 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 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 >
static void fillProducerDescriptions (edm::ParameterSetDescription &desc)
 

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

Constructor & Destructor Documentation

PFRecoTauDiscriminationByNProngs::PFRecoTauDiscriminationByNProngs ( const ParameterSet iConfig)
explicit

Definition at line 39 of file PFRecoTauDiscriminationByNProngs.cc.

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

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

References fillDescriptions().

23 {}

Member Function Documentation

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

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 49 of file PFRecoTauDiscriminationByNProngs.cc.

References vertexAssociator_.

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

Definition at line 53 of file PFRecoTauDiscriminationByNProngs.cc.

References cms::dd::accepted(), booleanOutput, edm::Ptr< T >::isNonnull(), edm::Ref< C, T, F >::isNonnull(), maxN, minN, np, MetAnalyzer::pv(), qcuts_, parallelization::uint, and vertexAssociator_.

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 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
std::unique_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
int np
Definition: AMPTWrapper.h:43
def pv(vc)
Definition: MetAnalyzer.py:7
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
bool accepted(std::vector< std::string_view > const &, std::string_view)
std::unique_ptr< tau::RecoTauQualityCuts > qcuts_
void PFRecoTauDiscriminationByNProngs::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 84 of file PFRecoTauDiscriminationByNProngs.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), DEFINE_FWK_MODULE, HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

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 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

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