forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mbluj/CMSSW_10_1_X_TauRecoMiniAODReviewMB
Modifications to PFTauPVProducers as requested during review
- Loading branch information
Showing
4 changed files
with
376 additions
and
566 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
RecoTauTag/RecoTau/interface/PFTauPrimaryVertexProducerBase.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#ifndef RecoTauTag_RecoTau_PFTauPrimaryVertexProducerBase_H_ | ||
#define RecoTauTag_RecoTau_PFTauPrimaryVertexProducerBase_H_ | ||
|
||
/* class PFTauPrimaryVertexProducerBase | ||
* EDProducer of the | ||
* authors: Ian M. Nugent | ||
* This work is based on the impact parameter work by Rosamaria Venditti and reconstructing the 3 prong taus. | ||
* The idea of the fully reconstructing the tau using a kinematic fit comes from | ||
* Lars Perchalla and Philip Sauerland Theses under Achim Stahl supervision. This | ||
* work was continued by Ian M. Nugent and Vladimir Cherepanov. | ||
* Thanks goes to Christian Veelken and Evan Klose Friis for their help and suggestions. | ||
*/ | ||
|
||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Framework/interface/stream/EDProducer.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include "DataFormats/TauReco/interface/PFTau.h" | ||
#include "DataFormats/TauReco/interface/PFTauFwd.h" | ||
#include "DataFormats/MuonReco/interface/Muon.h" | ||
#include "DataFormats/MuonReco/interface/MuonFwd.h" | ||
#include "DataFormats/EgammaCandidates/interface/Electron.h" | ||
#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" | ||
#include "DataFormats/VertexReco/interface/Vertex.h" | ||
#include "DataFormats/VertexReco/interface/VertexFwd.h" | ||
#include "DataFormats/BeamSpot/interface/BeamSpot.h" | ||
#include "DataFormats/TrackReco/interface/Track.h" | ||
#include "DataFormats/TrackReco/interface/TrackFwd.h" | ||
|
||
#include "DataFormats/TauReco/interface/PFTauDiscriminator.h" | ||
#include "CommonTools/Utils/interface/StringCutObjectSelector.h" | ||
#include "RecoTauTag/RecoTau/interface/RecoTauVertexAssociator.h" | ||
|
||
#include <TFormula.h> | ||
|
||
class PFTauPrimaryVertexProducerBase : public edm::stream::EDProducer<> { | ||
public: | ||
enum Alg{useInputPV=0, useFrontPV}; | ||
|
||
struct DiscCutPair{ | ||
DiscCutPair():discr_(nullptr),cutFormula_(nullptr){} | ||
~DiscCutPair(){delete cutFormula_;} | ||
const reco::PFTauDiscriminator* discr_; | ||
edm::EDGetTokenT<reco::PFTauDiscriminator> inputToken_; | ||
double cut_; | ||
TFormula* cutFormula_; | ||
}; | ||
typedef std::vector<DiscCutPair*> DiscCutPairVec; | ||
|
||
explicit PFTauPrimaryVertexProducerBase(const edm::ParameterSet& iConfig); | ||
~PFTauPrimaryVertexProducerBase() override; | ||
void produce(edm::Event&,const edm::EventSetup&) override; | ||
|
||
// called at the beginning of every event - override if necessary | ||
virtual void beginEvent(const edm::Event&, const edm::EventSetup&) {} | ||
|
||
protected: | ||
// abstract function implemented in derived classes | ||
virtual void nonTauTracksInPV(const reco::VertexRef&, | ||
const std::vector<edm::Ptr<reco::TrackBase> >&, | ||
std::vector<const reco::Track*>&) = 0; | ||
|
||
private: | ||
edm::EDGetTokenT<std::vector<reco::PFTau> > pftauToken_; | ||
edm::EDGetTokenT<edm::View<reco::Electron> > electronToken_; | ||
edm::EDGetTokenT<edm::View<reco::Muon> > muonToken_; | ||
edm::EDGetTokenT<reco::VertexCollection> pvToken_; | ||
edm::EDGetTokenT<reco::BeamSpot> beamSpotToken_; | ||
int algorithm_; | ||
edm::ParameterSet qualityCutsPSet_; | ||
bool useBeamSpot_; | ||
bool useSelectedTaus_; | ||
bool removeMuonTracks_; | ||
bool removeElectronTracks_; | ||
DiscCutPairVec discriminators_; | ||
std::auto_ptr<StringCutObjectSelector<reco::PFTau> > cut_; | ||
std::auto_ptr<reco::tau::RecoTauVertexAssociator> vertexAssociator_; | ||
}; | ||
|
||
#endif |
Oops, something went wrong.