52 if ( jetP4.pt() > 10. && jetP4.pt() < 20. ) ptBin = 1;
53 if ( jetP4.pt() > 20. && jetP4.pt() < 30. ) ptBin = 2;
54 if ( jetP4.pt() > 30. ) ptBin = 3;
57 if (
std::abs(jetP4.eta()) > 2.5 &&
std::abs(jetP4.eta()) < 2.75) etaBin = 1;
58 if (
std::abs(jetP4.eta()) > 2.75 &&
std::abs(jetP4.eta()) < 3.0 ) etaBin = 2;
59 if (
std::abs(jetP4.eta()) > 3.0 &&
std::abs(jetP4.eta()) < 5.0 ) etaBin = 3;
61 return ( mvaJetId >
mvaCut_[2][ptBin][etaBin] );
66 return jetP4(jets, 0);
71 return jetP4(jets, 1);
76 return jet1.
p4_.pt() > jet2.
p4_.pt();
82 if ( idx < jets.size() ) {
83 std::vector<JetInfo> jets_sorted =
jets;
84 std::sort(jets_sorted.begin(), jets_sorted.end());
85 retVal = jets_sorted[
idx].p4_;
92 for ( std::vector<JetInfo>::const_iterator
jet = jets.begin();
93 jet != jets.end(); ++
jet ) {
94 if (
jet->p4_.pt() > ptThreshold ) ++retVal;
99 const std::vector<leptonInfo>&
leptons,
100 double ptThreshold,
double dRmatch)
103 double dR2match = dRmatch*dRmatch;
104 std::vector<JetInfo> retVal;
105 for ( std::vector<JetInfo>::const_iterator
jet = jets.begin();
106 jet != jets.end(); ++
jet ) {
107 bool isOverlap =
false;
108 for ( std::vector<leptonInfo>::const_iterator lepton = leptons.begin();
109 lepton != leptons.end(); ++lepton ) {
110 if (
deltaR2(
jet->p4_, lepton->p4_) < dR2match ) isOverlap =
true;
112 if (
jet->p4_.pt() > ptThreshold && !isOverlap ) retVal.push_back(*
jet);
118 const std::vector<leptonInfo>&
leptons,
119 double dRmatch,
bool invert)
122 double dR2match = dRmatch*dRmatch;
123 std::vector<pfCandInfo> retVal;
124 for ( std::vector<pfCandInfo>::const_iterator pfCandidate = pfCandidates.begin();
125 pfCandidate != pfCandidates.end(); ++pfCandidate ) {
126 bool isOverlap =
false;
127 for ( std::vector<leptonInfo>::const_iterator lepton = leptons.begin();
128 lepton != leptons.end(); ++lepton ) {
129 if (
deltaR2(pfCandidate->p4_, lepton->p4_) < dR2match ) isOverlap =
true;
131 if ( (!isOverlap && !invert) || (isOverlap && invert) ) retVal.push_back(*pfCandidate);
139 metData.
phi = atan2(metData.
mey, metData.
mex);
154 for ( std::vector<pfCandInfo>::const_iterator pfCandidate = pfCandidates.begin();
155 pfCandidate != pfCandidates.end(); ++pfCandidate ) {
156 if ( pfCandidate->dZ_ < 0. && dZflag != 2 )
continue;
157 if ( pfCandidate->dZ_ > dZmax && dZflag == 0 )
continue;
158 if ( pfCandidate->dZ_ < dZmax && dZflag == 1 )
continue;
159 retVal.
mex += pfCandidate->p4_.px();
160 retVal.
mey += pfCandidate->p4_.py();
161 retVal.
sumet += pfCandidate->p4_.pt();
174 for ( std::vector<leptonInfo>::const_iterator lepton = leptons.begin();
175 lepton != leptons.end(); ++lepton ) {
176 double pChargedFrac = 1;
177 if(iCharged) pChargedFrac = lepton->chargedFrac_;
178 retVal.
mex += lepton->p4_.px()*pChargedFrac;
179 retVal.
mey += lepton->p4_.py()*pChargedFrac;
180 retVal.
sumet += lepton->p4_.pt()*pChargedFrac;
192 for ( std::vector<JetInfo>::const_iterator
jet = jets.begin();
193 jet != jets.end(); ++
jet ) {
195 if ( passesMVAjetId && !mvaPassFlag )
continue;
196 if ( !passesMVAjetId && mvaPassFlag )
continue;
197 retVal.
mex +=
jet->p4_.px()*
jet->neutralEnFrac_;
198 retVal.
mey +=
jet->p4_.py()*
jet->neutralEnFrac_;
206 const std::vector<JetInfo>&
jets,
double dZcut)
214 retVal.
mex = -(trackSumPU.
mex + jetSumPU_neutral.
mex);
215 retVal.
mey = -(trackSumPU.
mey + jetSumPU_neutral.
mey);
226 retVal.
mex = -pfCandSum.
mex + leptons.
mex;
227 retVal.
mey = -pfCandSum.
mey + leptons.
mey;
238 retVal.
mex = -trackSum.
mex + leptons.
mex;
239 retVal.
mey = -trackSum.
mey + leptons.
mey;
247 const std::vector<JetInfo>&
jets,
double dZcut)
255 retVal.
mex = -(trackSumNoPU.
mex + jetSumNoPU_neutral.
mex) + leptons.
mex;
256 retVal.
mey = -(trackSumNoPU.
mey + jetSumNoPU_neutral.
mey) + leptons.
mey;
264 const std::vector<JetInfo>&
jets,
double dZcut)
273 retVal.
mex = -(pfCandSum.
mex - (trackSumNoPU.
mex + jetSumPU_neutral.
mex)) + leptons.
mex;
274 retVal.
mey = -(pfCandSum.
mey - (trackSumNoPU.
mey + jetSumPU_neutral.
mey)) + leptons.
mey;
reco::Candidate::LorentzVector leadJetP4(const std::vector< JetInfo > &)
virtual ~mvaMEtUtilities()
CommonMETData computeJetSum_neutral(const std::vector< JetInfo > &, bool)
unsigned numJetsAboveThreshold(const std::vector< JetInfo > &, double)
std::vector< pfCandInfo > cleanPFCands(const std::vector< pfCandInfo > &, const std::vector< leptonInfo > &, double, bool)
reco::Candidate::LorentzVector jetP4(const std::vector< JetInfo > &, unsigned)
CommonMETData computeNegPFRecoil(const CommonMETData &, const std::vector< pfCandInfo > &, double)
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
reco::Candidate::LorentzVector p4_
mvaMEtUtilities(const edm::ParameterSet &cfg)
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
Abs< T >::type abs(const T &t)
double deltaR2(const T1 &t1, const T2 &t2)
Structure containing data common to all types of MET.
reco::Candidate::LorentzVector subleadJetP4(const std::vector< JetInfo > &)
void finalize(CommonMETData &metData)
CommonMETData computePFCandSum(const std::vector< pfCandInfo > &, double, int)
bool passesMVA(const reco::Candidate::LorentzVector &, double)
CommonMETData computeNegNoPURecoil(const CommonMETData &, const std::vector< pfCandInfo > &, const std::vector< JetInfo > &, double)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
CommonMETData computeSumLeptons(const std::vector< leptonInfo > &leptons, bool iCharged)
CommonMETData computeNegPUCRecoil(const CommonMETData &, const std::vector< pfCandInfo > &, const std::vector< JetInfo > &, double)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
CommonMETData computePUMEt(const std::vector< pfCandInfo > &, const std::vector< JetInfo > &, double)
CommonMETData computeNegTrackRecoil(const CommonMETData &, const std::vector< pfCandInfo > &, double)
std::vector< JetInfo > cleanJets(const std::vector< JetInfo > &, const std::vector< leptonInfo > &, double, double)