Skip to content

Commit

Permalink
Merge pull request #1 from mbluj/CMSSW_10_1_X_TauRecoMiniAODReviewMB
Browse files Browse the repository at this point in the history
Modifications to PFTauPVProducers as requested during review
  • Loading branch information
steggema authored Apr 17, 2018
2 parents 1814e22 + 962fe35 commit be005e9
Show file tree
Hide file tree
Showing 4 changed files with 376 additions and 566 deletions.
82 changes: 82 additions & 0 deletions RecoTauTag/RecoTau/interface/PFTauPrimaryVertexProducerBase.h
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
Loading

0 comments on commit be005e9

Please sign in to comment.