6 #include "TLorentzVector.h" 17 pMin(cfg.getParameter<double>(
"pMin")),
18 pMax(cfg.getParameter<double>(
"pMax")),
19 ptMin(cfg.getParameter<double>(
"ptMin")),
20 ptMax(cfg.getParameter<double>(
"ptMax")),
21 etaMin(cfg.getParameter<double>(
"etaMin")),
22 etaMax(cfg.getParameter<double>(
"etaMax")),
23 phiMin(cfg.getParameter<double>(
"phiMin")),
24 phiMax(cfg.getParameter<double>(
"phiMax")),
25 nHitMinSA(cfg.getParameter<double>(
"nHitMinSA")),
26 nHitMaxSA(cfg.getParameter<double>(
"nHitMaxSA")),
27 chi2nMaxSA(cfg.getParameter<double>(
"chi2nMaxSA")),
28 nHitMinGB(cfg.getParameter<double>(
"nHitMinGB")),
29 nHitMaxGB(cfg.getParameter<double>(
"nHitMaxGB")),
30 chi2nMaxGB(cfg.getParameter<double>(
"chi2nMaxGB")),
31 nHitMinTO(cfg.getParameter<double>(
"nHitMinTO")),
32 nHitMaxTO(cfg.getParameter<double>(
"nHitMaxTO")),
33 chi2nMaxTO(cfg.getParameter<double>(
"chi2nMaxTO")),
34 minMassPair(cfg.getParameter<double>(
"minMassPair")),
35 maxMassPair(cfg.getParameter<double>(
"maxMassPair")) {
38 <<
"applying basic muon cuts ..." 39 <<
"\npmin,pmax: " <<
pMin <<
"," <<
pMax <<
"\nptmin,ptmax: " <<
ptMin <<
"," <<
ptMax 81 if (result.size() < 2)
87 edm::LogInfo(
"AlignmentMuonSelector") <<
"muons all,kept: " << muons.size() <<
"," << result.size();
97 for (Muons::const_iterator it = muons.begin(); it != muons.end(); ++it) {
100 float pt = muonp->
pt();
105 float chi2nSA = 9999.;
111 float chi2nGB = 9999.;
117 float chi2nTO = 9999.;
119 nhitTO = muonp->
track()->numberOfValidHits();
120 chi2nTO = muonp->
track()->normalizedChi2();
123 <<
" pt,eta,phi,nhitSA,chi2nSA,nhitGB,chi2nGB,nhitTO,chi2nTO: " << pt <<
"," << eta <<
"," << phi <<
"," 124 << nhitSA <<
"," << chi2nSA <<
"," << nhitGB <<
"," << chi2nGB <<
"," << nhitTO <<
"," << chi2nTO;
126 if (p >
pMin && p < pMax && pt >
ptMin && pt < ptMax && eta >
etaMin && eta < etaMax && phi >
phiMin &&
130 result.push_back(muonp);
144 std::sort(sortedMuons.begin(), sortedMuons.end(),
ptComparator);
148 for (Muons::const_iterator it = sortedMuons.begin(); it != sortedMuons.end(); ++it) {
150 result.push_back(*it);
163 TLorentzVector mu1, mu2, pair;
164 double mass = 0, minDiff = 999999.;
167 std::sort(sortedMuons.begin(), sortedMuons.end(),
ptComparator);
173 for (Muons::const_iterator it1 = sortedMuons.begin(); it1 != sortedMuons.end(); ++it1) {
174 for (Muons::const_iterator it2 = it1 + 1; it2 != sortedMuons.end(); ++it2) {
175 mu1 = TLorentzVector((*it1)->momentum().x(), (*it1)->momentum().y(), (*it1)->momentum().z(), (*it1)->p());
176 mu2 = TLorentzVector((*it2)->momentum().x(), (*it2)->momentum().y(), (*it2)->momentum().z(), (*it2)->p());
182 result.push_back(*it1);
183 result.push_back(*it2);
190 result.push_back(*it1);
191 result.push_back(*it2);
Muons theNHighestPtMuons(const Muons &muons) const
filter the n highest pt muons
std::vector< const reco::Muon * > Muons
TrackRef track() const override
reference to a Track
double eta() const final
momentum pseudorapidity
bool isStandAloneMuon() const override
double pt() const final
transverse momentum
bool isTrackerMuon() const override
AlignmentMuonSelector(const edm::ParameterSet &cfg)
constructor
bool isGlobalMuon() const override
Muons theBestMassPairCombinationMuons(const Muons &muons) const
filter only those muons giving best mass pair combination
bool applyBasicCuts
private data members
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
applyBasicCuts
do not store empty events
double p() const final
magnitude of momentum vector
TrackRef combinedMuon() const override
reference to a stand-alone muon Track
bool applyMultiplicityFilter
~AlignmentMuonSelector()
destructor
Muons basicCuts(const Muons &muons) const
apply basic cuts on pt,eta,phi,nhit
Muons select(const Muons &muons, const edm::Event &evt) const
select muons
double phi() const final
momentum azimuthal angle