-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
CMGMuonCleanerBySegmentsAlgo.h
37 lines (28 loc) · 1.3 KB
/
CMGMuonCleanerBySegmentsAlgo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef PhysicsTools_Heppy_CMGMuonCleanerBySegmentsAlgo_h
#define PhysicsTools_Heppy_CMGMuonCleanerBySegmentsAlgo_h
#include "DataFormats/PatCandidates/interface/Muon.h"
#include "CommonTools/Utils/interface/StringCutObjectSelector.h"
#include <vector>
namespace heppy {
class CMGMuonCleanerBySegmentsAlgo {
public:
CMGMuonCleanerBySegmentsAlgo(double sharedFraction=0.499, const std::string & preselection="track.isNonnull", const std::string & passthrough="isGlobalMuon && numberOfMatches >= 2") :
sharedFraction_(sharedFraction),
preselection_(preselection,true),
passthrough_(passthrough,true) {}
~CMGMuonCleanerBySegmentsAlgo() ;
/// Return a vector of boolean marking the muons to be considered clean
std::vector<bool> clean(const std::vector<pat::Muon> &muons) const ;
private:
/// Fraction of shared segments
double sharedFraction_;
/// Preselection cut
StringCutObjectSelector<pat::Muon> preselection_;
/// Always-accept cut
StringCutObjectSelector<pat::Muon> passthrough_;
/// Methods
bool isSameMuon(const pat::Muon &mu1, const pat::Muon &mu2) const ;
bool isBetterMuon(const pat::Muon &mu1, bool mu1PF, const pat::Muon &mu2, bool mu2PF) const ;
};
}
#endif