Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-23 12:04:25

0001 #ifndef HLTMuonDimuonL3Filter_h
0002 #define HLTMuonDimuonL3Filter_h
0003 
0004 /** \class HLTMuonDimuonL3Filter
0005  *
0006  *
0007  *  This class is an HLTFilter (-> EDFilter) implementing a muon pair
0008  *  filter for HLT muons
0009  *
0010  *  \author J. Alcaraz
0011  *
0012  */
0013 
0014 #include "HLTrigger/HLTcore/interface/HLTFilter.h"
0015 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0016 #include "DataFormats/MuonReco/interface/MuonTrackLinks.h"
0017 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0018 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
0019 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
0020 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0021 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0022 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0023 #include "DataFormats/Common/interface/Handle.h"
0024 #include "FWCore/Framework/interface/ESHandle.h"
0025 #include "MagneticField/Engine/interface/MagneticField.h"
0026 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0027 #include "MuonAnalysis/MuonAssociators/interface/PropagateToMuonSetup.h"
0028 
0029 namespace edm {
0030   class ConfigurationDescriptions;
0031 }
0032 
0033 class HLTMuonDimuonL3Filter : public HLTFilter {
0034 public:
0035   explicit HLTMuonDimuonL3Filter(const edm::ParameterSet&);
0036   ~HLTMuonDimuonL3Filter() override;
0037   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0038   bool hltFilter(edm::Event&,
0039                  const edm::EventSetup&,
0040                  trigger::TriggerFilterObjectWithRefs& filterproduct) const override;
0041 
0042 private:
0043   static bool triggeredByLevel2(reco::TrackRef const& track, std::vector<reco::RecoChargedCandidateRef> const& vcands);
0044   bool applyMuonSelection(const reco::RecoChargedCandidateRef&, const reco::BeamSpot&) const;
0045   bool applyDiMuonSelection(const reco::RecoChargedCandidateRef&,
0046                             const reco::RecoChargedCandidateRef&,
0047                             const reco::BeamSpot&,
0048                             const edm::ESHandle<MagneticField>&) const;
0049 
0050   const PropagateToMuonSetup propSetup_;
0051   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> idealMagneticFieldRecordToken_;
0052   const edm::InputTag beamspotTag_;
0053   const edm::EDGetTokenT<reco::BeamSpot> beamspotToken_;
0054   const edm::InputTag candTag_;  // input tag identifying product contains muons
0055   const edm::EDGetTokenT<reco::RecoChargedCandidateCollection> candToken_;  // token identifying product contains muons
0056   const edm::InputTag previousCandTag_;  // input tag identifying product contains muons passing the previous level
0057   const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs>
0058       previousCandToken_;          // tokenidentifying product contains muons passing the previous level
0059   const edm::InputTag l1CandTag_;  // input tag identifying product contains muons passing the L1 level
0060   const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs>
0061       l1CandToken_;                // token identifying product contains muons passing the L1 level
0062   const edm::InputTag recoMuTag_;  // input tag identifying reco muons
0063   const edm::EDGetTokenT<reco::MuonCollection> recoMuToken_;  // token identifying product contains reco muons
0064   bool previousCandIsL2_;
0065   const bool fast_Accept_;  // flag to save time: stop processing after identification of the first valid pair
0066   const int min_N_;         // minimum number of muons to fire the trigger
0067   const double max_Eta_;    // Eta cut
0068   const int min_Nhits_;     // threshold on number of hits on muon
0069   const double max_Dr_;     // impact parameter cut
0070   const double max_Dz_;     // dz cut
0071   const int chargeOpt_;     // Charge option (0:nothing; +1:same charge, -1:opposite charge)
0072   const std::vector<double> min_PtPair_;   // minimum Pt for the dimuon system
0073   const std::vector<double> max_PtPair_;   // miaximum Pt for the dimuon system
0074   const std::vector<double> min_PtMax_;    // minimum Pt for muon with max Pt in pair
0075   const std::vector<double> min_PtMin_;    // minimum Pt for muon with min Pt in pair
0076   const std::vector<double> max_PtMin_;    // maximum Pt for muon with min Pt in pair
0077   const std::vector<double> min_InvMass_;  // minimum invariant mass of pair
0078   const std::vector<double> max_InvMass_;  // maximum invariant mass of pair
0079   const bool applyMinDiMuonDeltaR2Cut_;    // apply cut on minimum Delta-R^2 distance between the muons
0080   const double min_DiMuonDeltaR2_;         // minimum Delta-R^2 distance between the muons
0081   const double min_Acop_;                  // minimum acoplanarity
0082   const double max_Acop_;                  // maximum acoplanarity
0083   const double min_PtBalance_;             // minimum Pt difference
0084   const double max_PtBalance_;             // maximum Pt difference
0085   const double nsigma_Pt_;                 // pt uncertainty margin (in number of sigmas)
0086   const double max_DCAMuMu_;               // DCA between the two muons
0087   const double max_YPair_;                 // |rapidity| of pair
0088   const bool cutCowboys_;                  ///< if true, reject muon-track pairs that bend towards each other
0089   const edm::InputTag theL3LinksLabel;     //Needed to iterL3
0090   const edm::EDGetTokenT<reco::MuonTrackLinksCollection> linkToken_;  //Needed to iterL3
0091   const double L1MatchingdR_;
0092   const double L1MatchingdR2_;
0093   const bool matchPreviousCand_;
0094   const double MuMass2_;
0095 };
0096 
0097 #endif  //HLTMuonDimuonFilter_h