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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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)
 
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 >
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 38 of file PFRecoTauDiscriminationByNProngs.cc.

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

38  :
40  qualityCuts(iConfig.getParameterSet("qualityCuts"))
41 {
42  minN = iConfig.getParameter<uint32_t>("MinN");
43  maxN = iConfig.getParameter<uint32_t>("MaxN");
44  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
45 
46  qcuts_.reset(new tau::RecoTauQualityCuts(qualityCuts.getParameterSet("signalQualityCuts")));
47  vertexAssociator_.reset(new tau::RecoTauVertexAssociator(qualityCuts,consumesCollector()));
48 }
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 50 of file PFRecoTauDiscriminationByNProngs.cc.

References vertexAssociator_.

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

Definition at line 54 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_.

54  {
55 
56  reco::VertexRef pv = vertexAssociator_->associatedVertex(*tau);
57  const CandidatePtr leadingTrack = tau->leadChargedHadrCand();
58 
59  uint np = 0;
60  if(leadingTrack.isNonnull() && pv.isNonnull()){
61  qcuts_->setPV(pv);
62  qcuts_->setLeadTrack(*tau->leadChargedHadrCand());
63 
64  for(auto const& cand : tau->signalChargedHadrCands() ) {
65  if ( qcuts_->filterCandRef(cand) ) np++;
66  }
67  }
68 
69  bool accepted = false;
70  if(maxN == 0){
71  if(np == 1 || np == 3) accepted = true;
72  }else{
73  if(np >= minN && np <= maxN) accepted = true;
74  }
75 
76  if(!accepted) np = 0;
77  if(booleanOutput) return accepted;
78  return np;
79 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
std::unique_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
int np
Definition: AMPTWrapper.h:33
def pv(vc)
Definition: MetAnalyzer.py:7
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
bool accepted(std::vector< std::string_view > const &, std::string_view)
def uint(string)
std::unique_ptr< tau::RecoTauQualityCuts > qcuts_
void PFRecoTauDiscriminationByNProngs::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 82 of file PFRecoTauDiscriminationByNProngs.cc.

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

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