CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
PFRecoTauDiscriminationByIsolation Class Reference
Inheritance diagram for PFRecoTauDiscriminationByIsolation:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginEvent (const edm::Event &evt, const edm::EventSetup &evtSetup) override
 
double discriminate (const PFTauRef &pfTau) override
 
 PFRecoTauDiscriminationByIsolation (const edm::ParameterSet &pset)
 
 ~PFRecoTauDiscriminationByIsolation ()
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual double discriminate (const TauRef &tau)=0
 
virtual void endEvent (edm::Event &evt)
 
void produce (edm::Event &, const edm::EventSetup &)
 
 TauDiscriminationProducerBase (const edm::ParameterSet &iConfig)
 
 TauDiscriminationProducerBase ()
 
virtual ~TauDiscriminationProducerBase ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool applyDeltaBeta_
 
bool applyOccupancyCut_
 
bool applyRelativeSumPtCut_
 
bool applyRhoCorrection_
 
bool applySumPtCut_
 
std::vector< reco::PFCandidatePtrchargedPFCandidatesInEvent_
 
double customIsoCone_
 
double deltaBetaCollectionCone_
 
double deltaBetaFactorThisEvent_
 
std::auto_ptr< TFormula > deltaBetaFormula_
 
bool includeGammas_
 
bool includeTracks_
 
std::vector< PFCandidatePtrisoCharged_
 
std::vector< PFCandidatePtrisoNeutral_
 
std::vector< PFCandidatePtrisoPU_
 
uint32_t maximumOccupancy_
 
double maximumRelativeSumPt_
 
double maximumSumPt_
 
std::string moduleLabel_
 
double offsetRelativeSumPt_
 
edm::EDGetTokenT
< reco::PFCandidateCollection
pfCand_token
 
edm::InputTag pfCandSrc_
 
std::auto_ptr
< tau::RecoTauQualityCuts
pileupQcutsGeneralQCuts_
 
std::auto_ptr
< tau::RecoTauQualityCuts
pileupQcutsPUTrackSelection_
 
std::auto_ptr
< tau::RecoTauQualityCuts
qcuts_
 
edm::ParameterSet qualityCutsPSet_
 
edm::EDGetTokenT< double > rho_token
 
double rhoConeSize_
 
double rhoCorrectionThisEvent_
 
edm::InputTag rhoProducer_
 
double rhoThisEvent_
 
double rhoUEOffsetCorrection_
 
bool storeRawOccupancy_
 
bool storeRawPUsumPt_
 
bool storeRawSumPt_
 
int verbosity_
 
edm::EDGetTokenT
< reco::VertexCollection
vertex_token
 
std::auto_ptr
< tau::RecoTauVertexAssociator
vertexAssociator_
 
edm::InputTag vertexSrc_
 

Additional Inherited Members

- Public Types inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
typedef edm::RefProd
< TauCollection
TauRefProd
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
std::string moduleLabel_
 
double prediscriminantFailValue_
 
edm::EDGetTokenT< TauCollectionTau_token
 
edm::InputTag TauProducer_
 

Detailed Description

Definition at line 25 of file PFRecoTauDiscriminationByIsolation.cc.

Constructor & Destructor Documentation

PFRecoTauDiscriminationByIsolation::PFRecoTauDiscriminationByIsolation ( const edm::ParameterSet pset)
inlineexplicit

Definition at line 28 of file PFRecoTauDiscriminationByIsolation.cc.

References edm::hlt::Exception, edm::ParameterSet::exists(), reco::tau::factorizePUQCuts(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), and AlCaHLTBitMon_QueryRunRegistry::string.

30  moduleLabel_(pset.getParameter<std::string>("@module_label")),
31  qualityCutsPSet_(pset.getParameter<edm::ParameterSet>("qualityCuts"))
32  {
33  includeTracks_ = pset.getParameter<bool>(
34  "ApplyDiscriminationByTrackerIsolation");
35  includeGammas_ = pset.getParameter<bool>(
36  "ApplyDiscriminationByECALIsolation");
37 
38  applyOccupancyCut_ = pset.getParameter<bool>("applyOccupancyCut");
39  maximumOccupancy_ = pset.getParameter<uint32_t>("maximumOccupancy");
40 
41  applySumPtCut_ = pset.getParameter<bool>("applySumPtCut");
42  maximumSumPt_ = pset.getParameter<double>("maximumSumPtCut");
43 
45  "applyRelativeSumPtCut");
46  maximumRelativeSumPt_ = pset.getParameter<double>(
47  "relativeSumPtCut");
48  offsetRelativeSumPt_ = pset.exists("relativeSumPtOffset") ?
49  pset.getParameter<double>("relativeSumPtOffset") : 0.0;
50 
51  storeRawOccupancy_ = pset.exists("storeRawOccupancy") ?
52  pset.getParameter<bool>("storeRawOccupancy") : false;
53  storeRawSumPt_ = pset.exists("storeRawSumPt") ?
54  pset.getParameter<bool>("storeRawSumPt") : false;
55  storeRawPUsumPt_ = pset.exists("storeRawPUsumPt") ?
56  pset.getParameter<bool>("storeRawPUsumPt") : false;
57 
58  // Sanity check on requested options. We can't apply cuts and store the
59  // raw output at the same time
60  if ( applySumPtCut_ || applyOccupancyCut_ || applyRelativeSumPtCut_ ) {
61  if ( storeRawSumPt_ || storeRawOccupancy_ || storeRawPUsumPt_ ) {
62  throw cms::Exception("BadIsoConfig")
63  << "A 'store raw' and a 'apply cut' option have been set to true "
64  << "simultaneously. These options are mutually exclusive.";
65  }
66  }
67 
68  // Can only store one type
69  int numStoreOptions = 0;
70  if ( storeRawSumPt_ ) ++numStoreOptions;
71  if ( storeRawOccupancy_ ) ++numStoreOptions;
72  if ( storeRawPUsumPt_ ) ++numStoreOptions;
73  if ( numStoreOptions > 1 ) {
74  throw cms::Exception("BadIsoConfig")
75  << "Both 'store sum pt' and 'store occupancy' options are set."
76  << " These options are mutually exclusive.";
77  }
78 
79  if ( pset.exists("customOuterCone") ) {
80  customIsoCone_ = pset.getParameter<double>("customOuterCone");
81  } else {
82  customIsoCone_ = -1;
83  }
84 
85  // Get the quality cuts specific to the isolation region
87  "isolationQualityCuts");
88 
89  qcuts_.reset(new tau::RecoTauQualityCuts(isolationQCuts));
90 
91  vertexAssociator_.reset(
93 
94  applyDeltaBeta_ = pset.exists("applyDeltaBetaCorrection") ?
95  pset.getParameter<bool>("applyDeltaBetaCorrection") : false;
96 
97  if ( applyDeltaBeta_ ) {
98  // Factorize the isolation QCuts into those that are used to
99  // select PU and those that are not.
100  std::pair<edm::ParameterSet, edm::ParameterSet> puFactorizedIsoQCuts =
101  reco::tau::factorizePUQCuts(isolationQCuts);
102 
103  // Determine the pt threshold for the PU tracks
104  // First check if the user specifies explicitly the cut.
105  if ( pset.exists("deltaBetaPUTrackPtCutOverride") ) {
106  puFactorizedIsoQCuts.second.addParameter<double>(
107  "minTrackPt",
108  pset.getParameter<double>("deltaBetaPUTrackPtCutOverride"));
109  } else {
110  // Secondly take it from the minGammaEt
111  puFactorizedIsoQCuts.second.addParameter<double>(
112  "minTrackPt",
113  isolationQCuts.getParameter<double>("minGammaEt"));
114  }
115 
117  puFactorizedIsoQCuts.first));
118 
120  puFactorizedIsoQCuts.second));
121 
122  pfCandSrc_ = pset.getParameter<edm::InputTag>("particleFlowSrc");
123  pfCand_token=consumes<reco::PFCandidateCollection>(pfCandSrc_);
124  vertexSrc_ = pset.getParameter<edm::InputTag>("vertexSrc");
125  vertex_token=consumes<reco::VertexCollection>(vertexSrc_);
126  deltaBetaCollectionCone_ = pset.getParameter<double>(
127  "isoConeSizeForDeltaBeta");
128  std::string deltaBetaFactorFormula =
129  pset.getParameter<string>("deltaBetaFactor");
130  deltaBetaFormula_.reset(
131  new TFormula("DB_corr", deltaBetaFactorFormula.c_str()));
132  }
133 
134  applyRhoCorrection_ = pset.exists("applyRhoCorrection") ?
135  pset.getParameter<bool>("applyRhoCorrection") : false;
136  if ( applyRhoCorrection_ ) {
137  rhoProducer_ = pset.getParameter<edm::InputTag>("rhoProducer");
138  rho_token=consumes<double>(rhoProducer_);
139  rhoConeSize_ = pset.getParameter<double>("rhoConeSize");
141  pset.getParameter<double>("rhoUEOffsetCorrection");
142  }
143 
144  verbosity_ = ( pset.exists("verbosity") ) ?
145  pset.getParameter<int>("verbosity") : 0;
146  }
T getParameter(std::string const &) const
std::auto_ptr< tau::RecoTauQualityCuts > pileupQcutsGeneralQCuts_
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< reco::PFCandidateCollection > pfCand_token
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::pair< edm::ParameterSet, edm::ParameterSet > factorizePUQCuts(const edm::ParameterSet &inputSet)
std::auto_ptr< tau::RecoTauQualityCuts > qcuts_
std::auto_ptr< tau::RecoTauQualityCuts > pileupQcutsPUTrackSelection_
ParameterSet const & getParameterSet(std::string const &) const
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
std::auto_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
edm::EDGetTokenT< reco::VertexCollection > vertex_token
PFRecoTauDiscriminationByIsolation::~PFRecoTauDiscriminationByIsolation ( )
inline

Definition at line 148 of file PFRecoTauDiscriminationByIsolation.cc.

148 {}

Member Function Documentation

void PFRecoTauDiscriminationByIsolation::beginEvent ( const edm::Event evt,
const edm::EventSetup evtSetup 
)
overridevirtual

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 214 of file PFRecoTauDiscriminationByIsolation.cc.

References i, and reco::tau::pfCandidates().

215 {
216  // NB: The use of the PV in this context is necessitated by its use in
217  // applying quality cuts to the different objects in the isolation cone
218  // The vertex associator contains the logic to select the appropriate vertex
219  // We need to pass it the event so it can load the vertices.
220  vertexAssociator_->setEvent(event);
221 
222  // If we are applying the delta beta correction, we need to get the PF
223  // candidates from the event so we can find the PU tracks.
224  if ( applyDeltaBeta_ ) {
225  // Collect all the PF pile up tracks
227  event.getByToken(pfCand_token, pfCandidates);
229  chargedPFCandidatesInEvent_.reserve(pfCandidates->size());
230  size_t numPFCandidates = pfCandidates->size();
231  for ( size_t i = 0; i < numPFCandidates; ++i ) {
232  reco::PFCandidatePtr pfCandidate(pfCandidates, i);
233  if ( pfCandidate->charge() != 0 ) {
234  chargedPFCandidatesInEvent_.push_back(pfCandidate);
235  }
236  }
237  // Count all the vertices in the event, to parameterize the DB
238  // correction factor
240  event.getByToken(vertex_token, vertices);
241  size_t nVtxThisEvent = vertices->size();
242  deltaBetaFactorThisEvent_ = deltaBetaFormula_->Eval(nVtxThisEvent);
243  }
244 
245  if ( applyRhoCorrection_ ) {
246  edm::Handle<double> rhoHandle_;
247  event.getByToken(rho_token, rhoHandle_);
248  rhoThisEvent_ = (*rhoHandle_ - rhoUEOffsetCorrection_)*
249  (3.14159)*rhoConeSize_*rhoConeSize_;
250  }
251 }
int i
Definition: DBlmapReader.cc:9
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
edm::EDGetTokenT< reco::PFCandidateCollection > pfCand_token
std::vector< reco::PFCandidatePtr > chargedPFCandidatesInEvent_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::auto_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
edm::EDGetTokenT< reco::VertexCollection > vertex_token
double PFRecoTauDiscriminationByIsolation::discriminate ( const PFTauRef pfTau)
override

Definition at line 254 of file PFRecoTauDiscriminationByIsolation.cc.

References gather_cfg::cout, alcazmumu_cfi::filter, edm::Ref< C, T, F >::isNonnull(), and moduleLabel_().

255 {
256  if ( verbosity_ ) {
257  std::cout << "<PFRecoTauDiscriminationByIsolation::discriminate (moduleLabel = " << moduleLabel_ <<")>:" << std::endl;
258  std::cout << " tau: Pt = " << pfTau->pt() << ", eta = " << pfTau->eta() << ", phi = " << pfTau->phi() << std::endl;
259  }
260 
261  // collect the objects we are working with (ie tracks, tracks+gammas, etc)
262  isoCharged_.clear();
263  isoCharged_.reserve(pfTau->isolationPFChargedHadrCands().size());
264  isoNeutral_.clear();
265  isoNeutral_.reserve(pfTau->isolationPFGammaCands().size());
266  isoPU_.clear();
267  isoPU_.reserve(chargedPFCandidatesInEvent_.size());
268 
269  // Get the primary vertex associated to this tau
270  reco::VertexRef pv = vertexAssociator_->associatedVertex(*pfTau);
271  // Let the quality cuts know which the vertex to use when applying selections
272  // on dz, etc.
273  if ( verbosity_ ) {
274  if ( pv.isNonnull() ) {
275  std::cout << "pv: x = " << pv->position().x() << ", y = " << pv->position().y() << ", z = " << pv->position().z() << std::endl;
276  } else {
277  std::cout << "pv: N/A" << std::endl;
278  }
279  if ( pfTau->leadPFChargedHadrCand().isNonnull() ) {
280  std::cout << "leadPFChargedHadron:"
281  << " Pt = " << pfTau->leadPFChargedHadrCand()->pt() << ","
282  << " eta = " << pfTau->leadPFChargedHadrCand()->eta() << ","
283  << " phi = " << pfTau->leadPFChargedHadrCand()->phi() << std::endl;
284  } else {
285  std::cout << "leadPFChargedHadron: N/A" << std::endl;
286  }
287  }
288 
289  // CV: isolation is not well defined in case primary vertex or leading charged hadron do not exist
290  if ( !(pv.isNonnull() && pfTau->leadPFChargedHadrCand().isNonnull()) ) return 0.;
291 
292  qcuts_->setPV(pv);
293  qcuts_->setLeadTrack(pfTau->leadPFChargedHadrCand());
294 
295  if ( applyDeltaBeta_ ) {
296  pileupQcutsGeneralQCuts_->setPV(pv);
297  pileupQcutsGeneralQCuts_->setLeadTrack(pfTau->leadPFChargedHadrCand());
298  pileupQcutsPUTrackSelection_->setPV(pv);
299  pileupQcutsPUTrackSelection_->setLeadTrack(pfTau->leadPFChargedHadrCand());
300  }
301 
302  // Load the tracks if they are being used.
303  if ( includeTracks_ ) {
304  BOOST_FOREACH( const reco::PFCandidatePtr& cand, pfTau->isolationPFChargedHadrCands() ) {
305  if ( qcuts_->filterCandRef(cand) ) {
306  isoCharged_.push_back(cand);
307  }
308  }
309  }
310  if ( includeGammas_ ) {
311  BOOST_FOREACH( const reco::PFCandidatePtr& cand, pfTau->isolationPFGammaCands() ) {
312  if ( qcuts_->filterCandRef(cand) ) {
313  isoNeutral_.push_back(cand);
314  }
315  }
316  }
317 
319 
320  // If desired, get PU tracks.
321  if ( applyDeltaBeta_ ) {
322  // First select by inverted the DZ/track weight cuts. True = invert
323  //if ( verbosity_ ) {
324  // std::cout << "Initial PFCands: " << chargedPFCandidatesInEvent_.size() << std::endl;
325  //}
326 
327  std::vector<PFCandidatePtr> allPU =
328  pileupQcutsPUTrackSelection_->filterCandRefs(
330  //if ( verbosity_ ) {
331  // std::cout << "After track cuts: " << allPU.size() << std::endl;
332  //}
333 
334  // Now apply the rest of the cuts, like pt, and TIP, tracker hits, etc
335  std::vector<PFCandidatePtr> cleanPU =
336  pileupQcutsGeneralQCuts_->filterCandRefs(allPU);
337  //if ( verbosity_ ) {
338  // std::cout << "After cleaning cuts: " << cleanPU.size() << std::endl;
339  //}
340 
341  // Only select PU tracks inside the isolation cone.
342  DRFilter deltaBetaFilter(pfTau->p4(), 0, deltaBetaCollectionCone_);
343  BOOST_FOREACH(const reco::PFCandidatePtr& cand, cleanPU) {
344  if ( deltaBetaFilter(cand) ) {
345  isoPU_.push_back(cand);
346  }
347  }
348  //if ( verbosity_ ) {
349  // std::cout << "After cone cuts: " << isoPU.size() << std::endl;
350  //}
351  }
352 
353  // Check if we want a custom iso cone
354  if ( customIsoCone_ >= 0. ) {
355  //std::cout << "<PFRecoTauDiscriminationByIsolation::discriminate (moduleLabel = " << moduleLabel_ <<")>:" << std::endl;
356  //std::cout << " customIsoCone = " << customIsoCone_ << std::endl;
357  DRFilter filter(pfTau->p4(), 0, customIsoCone_);
358  std::vector<PFCandidatePtr> isoCharged_filter;
359  std::vector<PFCandidatePtr> isoNeutral_filter;
360  // Remove all the objects not in our iso cone
361  BOOST_FOREACH( const PFCandidatePtr& isoObject, isoCharged_ ) {
362  if ( filter(isoObject) ) isoCharged_filter.push_back(isoObject);
363  }
364  BOOST_FOREACH( const PFCandidatePtr& isoObject, isoNeutral_ ) {
365  if ( filter(isoObject) ) isoNeutral_filter.push_back(isoObject);
366  }
367  isoCharged_ = isoCharged_filter;
368  isoNeutral_ = isoNeutral_filter;
369  }
370 
371  bool failsOccupancyCut = false;
372  bool failsSumPtCut = false;
373  bool failsRelativeSumPtCut = false;
374 
375 //--- nObjects requirement
376  int neutrals = isoNeutral_.size();
377 
378  if ( applyDeltaBeta_ ) {
379  neutrals -= TMath::Nint(deltaBetaFactorThisEvent_*isoPU_.size());
380  }
381  if ( neutrals < 0 ) {
382  neutrals = 0;
383  }
384 
385  size_t nOccupants = isoCharged_.size() + neutrals;
386 
387  failsOccupancyCut = ( nOccupants > maximumOccupancy_ );
388 
389  double totalPt = 0.0;
390  double puPt = 0.0;
391 //--- Sum PT requirement
393  double chargedPt = 0.0;
394  double neutralPt = 0.0;
395  BOOST_FOREACH ( const PFCandidatePtr& isoObject, isoCharged_ ) {
396  chargedPt += isoObject->pt();
397  }
398  BOOST_FOREACH ( const PFCandidatePtr& isoObject, isoNeutral_ ) {
399  neutralPt += isoObject->pt();
400  }
401  BOOST_FOREACH ( const PFCandidatePtr& isoObject, isoPU_ ) {
402  puPt += isoObject->pt();
403  }
404  if ( verbosity_ ) {
405  std::cout << "chargedPt = " << chargedPt << std::endl;
406  std::cout << "neutralPt = " << neutralPt << std::endl;
407  std::cout << "puPt = " << puPt << " (delta-beta corr. = " << (deltaBetaFactorThisEvent_*puPt) << ")" << std::endl;
408  }
409 
410  if ( applyDeltaBeta_ ) {
411  neutralPt -= deltaBetaFactorThisEvent_*puPt;
412  }
413 
414  if ( applyRhoCorrection_ ) {
415  neutralPt -= rhoThisEvent_;
416  }
417 
418  if ( neutralPt < 0.0 ) {
419  neutralPt = 0.0;
420  }
421 
422  totalPt = chargedPt + neutralPt;
423  if ( verbosity_ ) {
424  std::cout << "totalPt = " << totalPt << " (cut = " << maximumSumPt_ << ")" << std::endl;
425  }
426 
427  failsSumPtCut = (totalPt > maximumSumPt_);
428 
429 //--- Relative Sum PT requirement
430  failsRelativeSumPtCut = (totalPt > ((pfTau->pt() - offsetRelativeSumPt_)*maximumRelativeSumPt_));
431  }
432 
433  bool fails = (applyOccupancyCut_ && failsOccupancyCut) ||
434  (applySumPtCut_ && failsSumPtCut) ||
435  (applyRelativeSumPtCut_ && failsRelativeSumPtCut);
436 
437  // We did error checking in the constructor, so this is safe.
438  if ( storeRawSumPt_ ) {
439  return totalPt;
440  } else if ( storeRawPUsumPt_ ) {
441  if ( applyDeltaBeta_ ) return puPt;
442  else if ( applyRhoCorrection_ ) return rhoThisEvent_;
443  else return 0.;
444  } else if ( storeRawOccupancy_ ) {
445  return nOccupants;
446  } else {
447  return (fails ? 0. : 1.);
448  }
449 }
std::auto_ptr< tau::RecoTauQualityCuts > pileupQcutsGeneralQCuts_
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
std::vector< reco::PFCandidatePtr > chargedPFCandidatesInEvent_
std::auto_ptr< tau::RecoTauQualityCuts > qcuts_
std::auto_ptr< tau::RecoTauQualityCuts > pileupQcutsPUTrackSelection_
std::auto_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

bool PFRecoTauDiscriminationByIsolation::applyDeltaBeta_
private

Definition at line 186 of file PFRecoTauDiscriminationByIsolation.cc.

bool PFRecoTauDiscriminationByIsolation::applyOccupancyCut_
private

Definition at line 167 of file PFRecoTauDiscriminationByIsolation.cc.

bool PFRecoTauDiscriminationByIsolation::applyRelativeSumPtCut_
private

Definition at line 171 of file PFRecoTauDiscriminationByIsolation.cc.

bool PFRecoTauDiscriminationByIsolation::applyRhoCorrection_
private

Definition at line 202 of file PFRecoTauDiscriminationByIsolation.cc.

bool PFRecoTauDiscriminationByIsolation::applySumPtCut_
private

Definition at line 169 of file PFRecoTauDiscriminationByIsolation.cc.

std::vector<reco::PFCandidatePtr> PFRecoTauDiscriminationByIsolation::chargedPFCandidatesInEvent_
private

Definition at line 192 of file PFRecoTauDiscriminationByIsolation.cc.

double PFRecoTauDiscriminationByIsolation::customIsoCone_
private

Definition at line 174 of file PFRecoTauDiscriminationByIsolation.cc.

double PFRecoTauDiscriminationByIsolation::deltaBetaCollectionCone_
private

Definition at line 197 of file PFRecoTauDiscriminationByIsolation.cc.

double PFRecoTauDiscriminationByIsolation::deltaBetaFactorThisEvent_
private

Definition at line 199 of file PFRecoTauDiscriminationByIsolation.cc.

std::auto_ptr<TFormula> PFRecoTauDiscriminationByIsolation::deltaBetaFormula_
private

Definition at line 198 of file PFRecoTauDiscriminationByIsolation.cc.

bool PFRecoTauDiscriminationByIsolation::includeGammas_
private

Definition at line 166 of file PFRecoTauDiscriminationByIsolation.cc.

bool PFRecoTauDiscriminationByIsolation::includeTracks_
private

Definition at line 165 of file PFRecoTauDiscriminationByIsolation.cc.

std::vector<PFCandidatePtr> PFRecoTauDiscriminationByIsolation::isoCharged_
private

Definition at line 193 of file PFRecoTauDiscriminationByIsolation.cc.

std::vector<PFCandidatePtr> PFRecoTauDiscriminationByIsolation::isoNeutral_
private

Definition at line 194 of file PFRecoTauDiscriminationByIsolation.cc.

std::vector<PFCandidatePtr> PFRecoTauDiscriminationByIsolation::isoPU_
private

Definition at line 195 of file PFRecoTauDiscriminationByIsolation.cc.

uint32_t PFRecoTauDiscriminationByIsolation::maximumOccupancy_
private

Definition at line 168 of file PFRecoTauDiscriminationByIsolation.cc.

double PFRecoTauDiscriminationByIsolation::maximumRelativeSumPt_
private

Definition at line 172 of file PFRecoTauDiscriminationByIsolation.cc.

double PFRecoTauDiscriminationByIsolation::maximumSumPt_
private

Definition at line 170 of file PFRecoTauDiscriminationByIsolation.cc.

std::string PFRecoTauDiscriminationByIsolation::moduleLabel_
private
double PFRecoTauDiscriminationByIsolation::offsetRelativeSumPt_
private

Definition at line 173 of file PFRecoTauDiscriminationByIsolation.cc.

edm::EDGetTokenT<reco::PFCandidateCollection> PFRecoTauDiscriminationByIsolation::pfCand_token
private

Definition at line 188 of file PFRecoTauDiscriminationByIsolation.cc.

edm::InputTag PFRecoTauDiscriminationByIsolation::pfCandSrc_
private

Definition at line 187 of file PFRecoTauDiscriminationByIsolation.cc.

std::auto_ptr<tau::RecoTauQualityCuts> PFRecoTauDiscriminationByIsolation::pileupQcutsGeneralQCuts_
private

Definition at line 161 of file PFRecoTauDiscriminationByIsolation.cc.

std::auto_ptr<tau::RecoTauQualityCuts> PFRecoTauDiscriminationByIsolation::pileupQcutsPUTrackSelection_
private

Definition at line 160 of file PFRecoTauDiscriminationByIsolation.cc.

std::auto_ptr<tau::RecoTauQualityCuts> PFRecoTauDiscriminationByIsolation::qcuts_
private

Definition at line 157 of file PFRecoTauDiscriminationByIsolation.cc.

edm::ParameterSet PFRecoTauDiscriminationByIsolation::qualityCutsPSet_
private

Definition at line 156 of file PFRecoTauDiscriminationByIsolation.cc.

edm::EDGetTokenT<double> PFRecoTauDiscriminationByIsolation::rho_token
private

Definition at line 204 of file PFRecoTauDiscriminationByIsolation.cc.

double PFRecoTauDiscriminationByIsolation::rhoConeSize_
private

Definition at line 205 of file PFRecoTauDiscriminationByIsolation.cc.

double PFRecoTauDiscriminationByIsolation::rhoCorrectionThisEvent_
private

Definition at line 207 of file PFRecoTauDiscriminationByIsolation.cc.

edm::InputTag PFRecoTauDiscriminationByIsolation::rhoProducer_
private

Definition at line 203 of file PFRecoTauDiscriminationByIsolation.cc.

double PFRecoTauDiscriminationByIsolation::rhoThisEvent_
private

Definition at line 208 of file PFRecoTauDiscriminationByIsolation.cc.

double PFRecoTauDiscriminationByIsolation::rhoUEOffsetCorrection_
private

Definition at line 206 of file PFRecoTauDiscriminationByIsolation.cc.

bool PFRecoTauDiscriminationByIsolation::storeRawOccupancy_
private

Definition at line 177 of file PFRecoTauDiscriminationByIsolation.cc.

bool PFRecoTauDiscriminationByIsolation::storeRawPUsumPt_
private

Definition at line 179 of file PFRecoTauDiscriminationByIsolation.cc.

bool PFRecoTauDiscriminationByIsolation::storeRawSumPt_
private

Definition at line 178 of file PFRecoTauDiscriminationByIsolation.cc.

int PFRecoTauDiscriminationByIsolation::verbosity_
private

Definition at line 211 of file PFRecoTauDiscriminationByIsolation.cc.

edm::EDGetTokenT<reco::VertexCollection> PFRecoTauDiscriminationByIsolation::vertex_token
private

Definition at line 191 of file PFRecoTauDiscriminationByIsolation.cc.

std::auto_ptr<tau::RecoTauVertexAssociator> PFRecoTauDiscriminationByIsolation::vertexAssociator_
private

Definition at line 163 of file PFRecoTauDiscriminationByIsolation.cc.

edm::InputTag PFRecoTauDiscriminationByIsolation::vertexSrc_
private

Definition at line 190 of file PFRecoTauDiscriminationByIsolation.cc.