Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:25:34

0001 // -*- C++ -*-
0002 //
0003 // Package:    METProducers
0004 // Class:      MuonTCMETValueMapProducer
0005 //
0006 
0007 /**\class MuonTCMETValueMapProducer
0008 
0009 */
0010 //
0011 // Original Author:  Frank Golf
0012 //         Created:  Sun Mar 15 11:33:20 CDT 2009
0013 //
0014 //
0015 
0016 //____________________________________________________________________________||
0017 #ifndef RecoMET_MuonTCMETValueMapProducer_h
0018 #define RecoMET_MuonTCMETValueMapProducer_h
0019 
0020 //____________________________________________________________________________||
0021 #include "FWCore/Framework/interface/Frameworkfwd.h"
0022 #include "FWCore/Framework/interface/stream/EDProducer.h"
0023 #include "FWCore/Framework/interface/Event.h"
0024 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0025 #include "FWCore/Utilities/interface/ESGetToken.h"
0026 #include "DataFormats/Common/interface/Handle.h"
0027 #include "DataFormats/MuonReco/interface/Muon.h"
0028 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0029 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0030 #include "DataFormats/VertexReco/interface/Vertex.h"
0031 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0032 #include "MagneticField/Engine/interface/MagneticField.h"
0033 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0034 #include "TH2.h"
0035 #include "TVector3.h"
0036 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0037 
0038 //____________________________________________________________________________||
0039 class TCMETAlgo;
0040 
0041 namespace cms {
0042 
0043   class MuonTCMETValueMapProducer : public edm::stream::EDProducer<> {
0044   public:
0045     explicit MuonTCMETValueMapProducer(const edm::ParameterSet&);
0046     ~MuonTCMETValueMapProducer() override;
0047 
0048   private:
0049     void produce(edm::Event&, const edm::EventSetup&) override;
0050 
0051     edm::Handle<reco::MuonCollection> muons_;
0052     edm::Handle<reco::BeamSpot> beamSpot_;
0053     edm::Handle<reco::VertexCollection> vertexHandle_;
0054 
0055     edm::EDGetTokenT<reco::MuonCollection> muonToken_;
0056     edm::EDGetTokenT<reco::BeamSpot> beamSpotToken_;
0057     edm::EDGetTokenT<reco::VertexCollection> vertexToken_;
0058     edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_;
0059 
0060     const class MagneticField* bField;
0061 
0062     const reco::VertexCollection* vertices_;
0063 
0064     class TH2D* response_function;
0065 
0066     bool muonGlobal_;
0067     bool muonTracker_;
0068     bool useCaloMuons_;
0069     bool hasValidVertex;
0070 
0071     int rfType_;
0072     int nLayers_;
0073     int nLayersTight_;
0074     int vertexNdof_;
0075     double vertexZ_;
0076     double vertexRho_;
0077     double vertexMaxDZ_;
0078     double maxpt_eta25_;
0079     double maxpt_eta20_;
0080     std::vector<reco::TrackBase::TrackAlgorithm> trackAlgos_;
0081     double minpt_;
0082     double maxpt_;
0083     double maxeta_;
0084     double maxchi2_;
0085     double minhits_;
0086     double maxPtErr_;
0087     double maxd0cut_;
0088     double maxchi2_tight_;
0089     double minhits_tight_;
0090     double maxPtErr_tight_;
0091     double d0cuta_;
0092     double d0cutb_;
0093     bool usePvtxd0_;
0094     std::vector<int> trkQuality_;
0095     std::vector<reco::TrackBase::TrackAlgorithm> trkAlgos_;
0096 
0097     int muonMinValidStaHits_;
0098     double muonpt_;
0099     double muoneta_;
0100     double muonchi2_;
0101     double muonhits_;
0102     double muond0_;
0103     double muonDeltaR_;
0104     double muon_dptrel_;
0105     TCMETAlgo* tcmetAlgo_;
0106 
0107     bool isGoodMuon(const reco::Muon*);
0108     bool isGoodCaloMuon(const reco::Muon*, const unsigned int);
0109     bool isGoodTrack(const reco::Muon*);
0110     class TVector3 propagateTrack(const reco::Muon*);
0111     int nLayers(const reco::TrackRef);
0112     bool isValidVertex();
0113   };
0114 
0115 }  // namespace cms
0116 
0117 //____________________________________________________________________________||
0118 #endif /* RecoMET_MuonTCMETValueMapProducer_h */