Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-10 02:54:06

0001 /*HLTTauRefProducer
0002   Producer that creates LorentzVector Collections
0003   from offline reconstructed quantities to be used
0004   in Offline Trigger DQM etc
0005 */
0006 
0007 #ifndef HLTTauRefProducer_h
0008 #define HLTTauRefProducer_h
0009 
0010 #include "FWCore/Common/interface/Provenance.h"
0011 #include "FWCore/Framework/interface/Frameworkfwd.h"
0012 #include "FWCore/Framework/interface/Event.h"
0013 #include "FWCore/Framework/interface/global/EDProducer.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "FWCore/Utilities/interface/InputTag.h"
0016 #include "DataFormats/Common/interface/Handle.h"
0017 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0018 #include "DataFormats/Math/interface/LorentzVector.h"
0019 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
0020 #include "DataFormats/Provenance/interface/ProductProvenance.h"
0021 
0022 #include "TLorentzVector.h"
0023 // TAU includes
0024 #include "DataFormats/TauReco/interface/PFTau.h"
0025 #include "DataFormats/TauReco/interface/PFTauDiscriminator.h"
0026 #include "DataFormats/TauReco/interface/TauDiscriminatorContainer.h"
0027 
0028 // ELECTRON includes
0029 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0030 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
0031 #include "DataFormats/EgammaCandidates/interface/Electron.h"
0032 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
0033 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
0034 #include "DataFormats/TrackReco/interface/Track.h"
0035 // MUON includes
0036 #include "DataFormats/MuonReco/interface/Muon.h"
0037 #include "DataFormats/JetReco/interface/CaloJet.h"
0038 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0039 #include "TLorentzVector.h"
0040 #include "DataFormats/Math/interface/deltaR.h"
0041 
0042 //Photon Includes
0043 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0044 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
0045 
0046 //MET Includes
0047 #include "DataFormats/METReco/interface/CaloMET.h"
0048 #include "DataFormats/METReco/interface/CaloMETCollection.h"
0049 
0050 #include <memory>
0051 
0052 #include <string>
0053 #include <vector>
0054 
0055 typedef std::pair<edm::ProcessHistoryID, std::vector<int>> TauIDConfigCache;
0056 
0057 class HLTTauRefProducer : public edm::global::EDProducer<edm::StreamCache<TauIDConfigCache>> {
0058 public:
0059   explicit HLTTauRefProducer(const edm::ParameterSet&);
0060 
0061   void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override;
0062 
0063   std::unique_ptr<TauIDConfigCache> beginStream(edm::StreamID) const override {
0064     return std::make_unique<TauIDConfigCache>();
0065   }
0066 
0067 private:
0068   using LorentzVector = math::XYZTLorentzVectorD;
0069   using LorentzVectorCollection = std::vector<LorentzVector>;
0070 
0071   edm::EDGetTokenT<reco::PFTauCollection> PFTaus_;
0072   std::vector<edm::EDGetTokenT<reco::PFTauDiscriminator>> PFTauDis_;
0073   std::vector<edm::EDGetTokenT<reco::TauDiscriminatorContainer>> PFTauDisCont_;
0074   std::vector<std::string> PFTauDisContWPs_;
0075   edm::ProcessHistoryID phID_;
0076   bool doPFTaus_;
0077   double ptMinPFTau_, etaMinPFTau_, etaMaxPFTau_, phiMinPFTau_, phiMaxPFTau_;
0078 
0079   edm::EDGetTokenT<reco::GsfElectronCollection> Electrons_;
0080   bool doElectrons_;
0081   edm::EDGetTokenT<reco::TrackCollection> e_ctfTrackCollection_;
0082   edm::InputTag e_ctfTrackCollectionSrc_;
0083   double ptMinElectron_;
0084   bool e_doID_;
0085   bool e_doTrackIso_;
0086   double e_trackMinPt_;
0087   double e_lipCut_;
0088   double e_minIsoDR_;
0089   double e_maxIsoDR_;
0090   double e_isoMaxSumPt_;
0091   bool doElecFromZ_;
0092   double e_zMmin_;
0093   double e_zMmax_;
0094   double e_FromZet_;
0095 
0096   edm::EDGetTokenT<reco::PhotonCollection> Photons_;
0097   bool doPhotons_;
0098   double photonEcalIso_;
0099   double ptMinPhoton_;
0100 
0101   edm::EDGetTokenT<reco::MuonCollection> Muons_;
0102   bool doMuons_;
0103   double ptMinMuon_;
0104 
0105   edm::EDGetTokenT<reco::CaloJetCollection> Jets_;
0106   bool doJets_;
0107   double ptMinJet_;
0108 
0109   edm::EDGetTokenT<CaloTowerCollection> Towers_;
0110   bool doTowers_;
0111   double ptMinTower_;
0112   double towerIsol_;
0113 
0114   edm::EDGetTokenT<reco::CaloMETCollection> MET_;
0115   bool doMET_;
0116   double ptMinMET_;
0117 
0118   double etaMin_, etaMax_, phiMin_, phiMax_;
0119 
0120   void doPFTaus(edm::StreamID, edm::Event&) const;
0121   void doMuons(edm::Event&) const;
0122   void doElectrons(edm::Event&) const;
0123   void doJets(edm::Event&) const;
0124   void doPhotons(edm::Event&) const;
0125   void doTowers(edm::Event&) const;
0126   void doMET(edm::Event&) const;
0127 };
0128 
0129 #endif