Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-06 09:40:20

0001 // -*- C++ -*-
0002 //
0003 // Package:    PhysicsTools/PatAlgos
0004 // Class:      PATTriggerMatchSelector
0005 //
0006 /**
0007   \class    pat::PATTriggerMatchSelector PATTriggerMatchSelector.cc "PhysicsTools/PatAlgos/plugins/PATTriggerMatchSelector.cc"
0008   \brief
0009 
0010    .
0011 
0012   \author   Volker Adler
0013   \version  $Id: PATTriggerMatchSelector.h,v 1.5 2010/06/16 15:40:58 vadler Exp $
0014 */
0015 
0016 #include "CommonTools/UtilAlgos/interface/MatchByDEta.h"
0017 #include "CommonTools/UtilAlgos/interface/MatchByDR.h"
0018 #include "CommonTools/UtilAlgos/interface/MatchByDRDPt.h"
0019 #include "CommonTools/UtilAlgos/interface/MatchLessByDEta.h"
0020 #include "CommonTools/UtilAlgos/interface/MatchLessByDPt.h"
0021 #include "CommonTools/UtilAlgos/interface/PhysObjectMatcher.h"
0022 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
0023 #include "DataFormats/Candidate/interface/Candidate.h"
0024 #include "DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h"
0025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0026 
0027 #include <map>
0028 #include <string>
0029 #include <vector>
0030 
0031 namespace pat {
0032 
0033   template <typename T1, typename T2>
0034   class PATTriggerMatchSelector : public StringCutObjectSelector<T2> {
0035   public:
0036     PATTriggerMatchSelector(const edm::ParameterSet& iConfig)
0037         : StringCutObjectSelector<T2>(iConfig.getParameter<std::string>("matchedCuts")) {}
0038 
0039     bool operator()(const T1& patObj, const T2& trigObj) const {
0040       return StringCutObjectSelector<T2>::operator()(trigObj);
0041     }
0042   };
0043 
0044 }  // namespace pat
0045 
0046 /// Match by deltaR (default), ranking by deltaR (default)
0047 typedef reco::PhysObjectMatcher<
0048     reco::CandidateView,
0049     pat::TriggerObjectStandAloneCollection,
0050     pat::PATTriggerMatchSelector<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type> >
0051     PATTriggerMatcherDRLessByR;
0052 
0053 /// Match by deltaR and deltaPt, ranking by deltaR (default)
0054 typedef reco::PhysObjectMatcher<
0055     reco::CandidateView,
0056     pat::TriggerObjectStandAloneCollection,
0057     pat::PATTriggerMatchSelector<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type>,
0058     reco::MatchByDRDPt<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type> >
0059     PATTriggerMatcherDRDPtLessByR;
0060 
0061 /// Match by deltaR (default), ranking by deltaPt
0062 typedef reco::PhysObjectMatcher<
0063     reco::CandidateView,
0064     pat::TriggerObjectStandAloneCollection,
0065     pat::PATTriggerMatchSelector<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type>,
0066     reco::MatchByDR<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type>,
0067     reco::MatchLessByDPt<reco::CandidateView, pat::TriggerObjectStandAloneCollection> >
0068     PATTriggerMatcherDRLessByPt;
0069 
0070 /// Match by deltaR and deltaPt, ranking by deltaPt
0071 typedef reco::PhysObjectMatcher<
0072     reco::CandidateView,
0073     pat::TriggerObjectStandAloneCollection,
0074     pat::PATTriggerMatchSelector<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type>,
0075     reco::MatchByDRDPt<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type>,
0076     reco::MatchLessByDPt<reco::CandidateView, pat::TriggerObjectStandAloneCollection> >
0077     PATTriggerMatcherDRDPtLessByPt;
0078 
0079 /// Match by deltaEta, ranking by deltaR
0080 typedef reco::PhysObjectMatcher<
0081     reco::CandidateView,
0082     pat::TriggerObjectStandAloneCollection,
0083     pat::PATTriggerMatchSelector<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type>,
0084     reco::MatchByDEta<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type> >
0085     PATTriggerMatcherDEtaLessByDR;
0086 
0087 /// Match by deltaEta, ranking by deltaEta
0088 typedef reco::PhysObjectMatcher<
0089     reco::CandidateView,
0090     pat::TriggerObjectStandAloneCollection,
0091     pat::PATTriggerMatchSelector<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type>,
0092     reco::MatchByDEta<reco::CandidateView::value_type, pat::TriggerObjectStandAloneCollection::value_type>,
0093     reco::MatchLessByDEta<reco::CandidateView, pat::TriggerObjectStandAloneCollection> >
0094     PATTriggerMatcherDEtaLessByDEta;
0095 
0096 #include "FWCore/Framework/interface/MakerMacros.h"
0097 DEFINE_FWK_MODULE(PATTriggerMatcherDRLessByR);
0098 DEFINE_FWK_MODULE(PATTriggerMatcherDRDPtLessByR);
0099 DEFINE_FWK_MODULE(PATTriggerMatcherDRLessByPt);
0100 DEFINE_FWK_MODULE(PATTriggerMatcherDRDPtLessByPt);
0101 DEFINE_FWK_MODULE(PATTriggerMatcherDEtaLessByDR);
0102 DEFINE_FWK_MODULE(PATTriggerMatcherDEtaLessByDEta);