Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:59

0001 /**
0002  *  \package: MuonIdentification
0003  *  \class: MuonCosmicCompatibilityFiller
0004  *
0005  *  Description: class for cosmic muon identification
0006  *
0007  *
0008  *  \author: A. Everett, Purdue University
0009  *  \author: A. Svyatkovskiy, Purdue University
0010  *  \author: H.D. Yoo, Purdue University
0011  *
0012  **/
0013 
0014 #ifndef MuonIdentification_MuonCosmicCompatibilityFiller_h
0015 #define MuonIdentification_MuonCosmicCompatibilityFiller_h
0016 
0017 #include <vector>
0018 
0019 #include "FWCore/Framework/interface/Frameworkfwd.h"
0020 #include "DataFormats/Common/interface/ValueMap.h"
0021 
0022 #include "DataFormats/MuonReco/interface/Muon.h"
0023 #include "DataFormats/MuonReco/interface/MuonCosmicCompatibility.h"
0024 #include "FWCore/Framework/interface/ConsumesCollector.h"
0025 #include "FWCore/Utilities/interface/ESGetToken.h"
0026 
0027 #include "DataFormats/TrackReco/interface/Track.h"
0028 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0029 #include "DataFormats/MuonReco/interface/Muon.h"
0030 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0031 #include "DataFormats/VertexReco/interface/Vertex.h"
0032 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0033 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
0034 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
0035 
0036 namespace edm {
0037   class ParameterSet;
0038   class Event;
0039   class EventSetup;
0040 }  // namespace edm
0041 class GlobalMuonRefitter;
0042 
0043 class MuonCosmicCompatibilityFiller {
0044 public:
0045   MuonCosmicCompatibilityFiller(const edm::ParameterSet&, edm::ConsumesCollector&);
0046   ~MuonCosmicCompatibilityFiller();
0047 
0048   /// fill cosmic compatibility variables
0049   reco::MuonCosmicCompatibility fillCompatibility(const reco::Muon& muon, edm::Event&, const edm::EventSetup&);
0050 
0051 private:
0052   /// check muon time (DT and CSC) information: 0 == prompt-like
0053   float muonTiming(const edm::Event& iEvent, const reco::Muon& muon, bool isLoose) const;
0054 
0055   ///return cosmic-likeness based on presence of a track in opp side: 0 == no matching opp tracks
0056   unsigned int backToBack2LegCosmic(const edm::Event&, const reco::Muon&) const;
0057 
0058   /// return cosmic-likeness based on the 2D impact parameters (dxy, dz wrt to PV). 0 == cosmic-like
0059   unsigned int pvMatches(const edm::Event&, const reco::Muon&, bool) const;
0060 
0061   /// returns cosmic-likeness based on overlap with traversing cosmic muon (only muon/STA hits are used)
0062   bool isOverlappingMuon(const edm::Event&, const edm::EventSetup& iSetup, const reco::Muon&) const;
0063 
0064   /// get number of muons in the vent
0065   unsigned int nMuons(const edm::Event&) const;
0066 
0067   /// returns cosmic-likeness based on the event activity information: tracker track multiplicity and vertex quality. 0 == cosmic-like
0068   unsigned int eventActivity(const edm::Event&, const reco::Muon&) const;
0069 
0070   /// combined cosmic-likeness: 0 == not cosmic-like
0071   float combinedCosmicID(
0072       const edm::Event&, const edm::EventSetup& iSetup, const reco::Muon&, bool CheckMuonID, bool checkVertex) const;
0073 
0074   /// tag a muon as cosmic based on the muonID information
0075   bool checkMuonID(const reco::Muon&) const;
0076 
0077   /// tag a muon as cosmic based on segment compatibility and the number of segment matches
0078   bool checkMuonSegments(const reco::Muon& muon) const;
0079 
0080 private:
0081   std::vector<edm::InputTag> inputMuonCollections_;
0082   std::vector<edm::InputTag> inputTrackCollections_;
0083   edm::InputTag inputCosmicMuonCollection_;
0084   edm::InputTag inputVertexCollection_;
0085 
0086   std::vector<edm::EDGetTokenT<reco::MuonCollection> > muonTokens_;
0087   std::vector<edm::EDGetTokenT<reco::TrackCollection> > trackTokens_;
0088   edm::EDGetTokenT<reco::MuonCollection> cosmicToken_;
0089   edm::EDGetTokenT<reco::VertexCollection> vertexToken_;
0090   edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> geometryToken_;
0091 
0092   double maxdxyLoose_;
0093   double maxdzLoose_;
0094   double maxdxyTight_;
0095   double maxdzTight_;
0096   double maxdxyLooseMult_;
0097   double maxdzLooseMult_;
0098   double maxdxyTightMult_;
0099   double maxdzTightMult_;
0100   double largedxyMult_;
0101   double largedxy_;
0102   double hIpTrdxy_;
0103   double hIpTrvProb_;
0104   double minvProb_;
0105   double maxvertZ_;
0106   double maxvertRho_;
0107   unsigned int nTrackThreshold_;
0108   double offTimePosLoose_;
0109   double offTimeNegLoose_;
0110   double offTimePosTight_;
0111   double offTimeNegTight_;
0112   double offTimePosLooseMult_;
0113   double offTimeNegLooseMult_;
0114   double offTimePosTightMult_;
0115   double offTimeNegTightMult_;
0116   double corrTimePos_;
0117   double corrTimeNeg_;
0118   double deltaPt_;
0119   double angleThreshold_;
0120   int sharedHits_;
0121   double sharedFrac_;
0122   double ipThreshold_;
0123   int nChamberMatches_;
0124   double segmentComp_;
0125 };
0126 #endif