Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:19

0001 #ifndef HeavyFlavorAnalysis_Onia2MuMu_Onia2MuMuPAT_h
0002 #define HeavyFlavorAnalysis_Onia2MuMu_Onia2MuMuPAT_h
0003 
0004 // system include files
0005 #include <memory>
0006 
0007 // FW include files
0008 #include "FWCore/Framework/interface/Frameworkfwd.h"
0009 #include "FWCore/Framework/interface/stream/EDProducer.h"
0010 #include "FWCore/Framework/interface/Event.h"
0011 #include "FWCore/Framework/interface/MakerMacros.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/Utilities/interface/ESGetToken.h"
0014 #include "CommonTools/Utils/interface/PtComparator.h"
0015 
0016 // DataFormat includes
0017 #include <DataFormats/PatCandidates/interface/CompositeCandidate.h>
0018 #include <DataFormats/PatCandidates/interface/Muon.h>
0019 
0020 #include <CommonTools/UtilAlgos/interface/StringCutObjectSelector.h>
0021 #include "RecoVertex/VertexTools/interface/InvariantMassFromVertex.h"
0022 
0023 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0024 
0025 #include "MagneticField/Engine/interface/MagneticField.h"
0026 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0027 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
0028 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
0029 
0030 template <typename T>
0031 struct GreaterByVProb {
0032   bool operator()(const T& t1, const T& t2) const { return t1.userFloat("vProb") > t2.userFloat("vProb"); }
0033 };
0034 
0035 //
0036 // class decleration
0037 //
0038 
0039 class Onia2MuMuPAT : public edm::stream::EDProducer<> {
0040 public:
0041   explicit Onia2MuMuPAT(const edm::ParameterSet&);
0042 
0043   static void fillDescriptions(edm::ConfigurationDescriptions&);
0044 
0045 private:
0046   void produce(edm::Event&, const edm::EventSetup&) override;
0047   // ----------member data ---------------------------
0048 private:
0049   bool isAbHadron(int pdgID) const;
0050   bool isAMixedbHadron(int pdgID, int momPdgID) const;
0051   std::pair<int, float> findJpsiMCInfo(reco::GenParticleRef genJpsi) const;
0052 
0053   edm::EDGetTokenT<edm::View<pat::Muon>> muons_;
0054   edm::EDGetTokenT<reco::BeamSpot> thebeamspot_;
0055   edm::EDGetTokenT<reco::VertexCollection> thePVs_;
0056   edm::EDGetTokenT<reco::TrackCollection> revtxtrks_;
0057   edm::EDGetTokenT<reco::BeamSpot> revtxbs_;
0058   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magneticFieldToken_;
0059   edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> theTTBuilderToken_;
0060   StringCutObjectSelector<pat::Muon> higherPuritySelection_;
0061   StringCutObjectSelector<pat::Muon> lowerPuritySelection_;
0062   StringCutObjectSelector<reco::Candidate, true> dimuonSelection_;
0063   bool addCommonVertex_, addMuonlessPrimaryVertex_;
0064   bool resolveAmbiguity_;
0065   bool addMCTruth_;
0066   GreaterByVProb<pat::CompositeCandidate> vPComparator_;
0067 
0068   InvariantMassFromVertex massCalculator;
0069 };
0070 
0071 //
0072 // constants, enums and typedefs
0073 //
0074 
0075 //
0076 // static data member definitions
0077 //
0078 
0079 //
0080 // constructors and destructor
0081 //
0082 
0083 #endif