161 std::unique_ptr<CorrMETData> type1Correction(
new CorrMETData());
162 for (
typename std::vector<type2BinningEntryType*>::iterator type2BinningEntry =
type2Binning_.begin();
163 type2BinningEntry !=
type2Binning_.end(); ++type2BinningEntry ) {
164 (*type2BinningEntry)->binUnclEnergySum_ =
CorrMETData();
165 (*type2BinningEntry)->binOffsetEnergySum_ =
CorrMETData();
181 int numJets = jets->size();
182 for (
int jetIndex = 0; jetIndex < numJets; ++jetIndex ) {
183 const T&
jet = jets->at(jetIndex);
188 double emEnergyFraction = jet.chargedEmEnergyFraction() + jet.neutralEmEnergyFraction();
195 const std::vector<reco::CandidatePtr> & cands = jet.daughterPtrVector();
196 for ( std::vector<reco::CandidatePtr>::const_iterator
cand = cands.begin();
208 if ( checkInputType.isPatJet(jet) )
219 if ( checkInputType.isPatJet(jet) )
224 for (
typename std::vector<type2BinningEntryType*>::iterator type2BinningEntry =
type2Binning_.begin();
225 type2BinningEntry !=
type2Binning_.end(); ++type2BinningEntry ) {
226 if ( !(*type2BinningEntry)->binSelection_ || (*(*type2BinningEntry)->binSelection_)(corrJetP4) ) {
227 (*type2BinningEntry)->binOffsetEnergySum_.mex += (rawJetP4.px() - rawJetP4offsetCorr.px());
228 (*type2BinningEntry)->binOffsetEnergySum_.mey += (rawJetP4.py() - rawJetP4offsetCorr.py());
229 (*type2BinningEntry)->binOffsetEnergySum_.sumet += (rawJetP4.Et() - rawJetP4offsetCorr.Et());
236 type1Correction->mex -= (corrJetP4.px() - rawJetP4offsetCorr.px());
237 type1Correction->mey -= (corrJetP4.py() - rawJetP4offsetCorr.py());
238 type1Correction->sumet += (corrJetP4.Et() - rawJetP4offsetCorr.Et());
240 for (
typename std::vector<type2BinningEntryType*>::iterator type2BinningEntry =
type2Binning_.begin();
241 type2BinningEntry !=
type2Binning_.end(); ++type2BinningEntry ) {
242 if ( !(*type2BinningEntry)->binSelection_ || (*(*type2BinningEntry)->binSelection_)(corrJetP4) ) {
243 (*type2BinningEntry)->binUnclEnergySum_.mex += rawJetP4.px();
244 (*type2BinningEntry)->binUnclEnergySum_.mey += rawJetP4.py();
245 (*type2BinningEntry)->binUnclEnergySum_.sumet += rawJetP4.Et();
257 for (
typename std::vector<type2BinningEntryType*>::const_iterator type2BinningEntry =
type2Binning_.begin();
258 type2BinningEntry !=
type2Binning_.end(); ++type2BinningEntry ) {
259 evt.
put(std::unique_ptr<CorrMETData>(
new CorrMETData((*type2BinningEntry)->binUnclEnergySum_)), (*type2BinningEntry)->getInstanceLabel_full(
"type2"));
260 evt.
put(std::unique_ptr<CorrMETData>(
new CorrMETData((*type2BinningEntry)->binOffsetEnergySum_)), (*type2BinningEntry)->getInstanceLabel_full(
"offset"));
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isNonnull() const
Checks for non-null.
std::vector< Jet > JetCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
T const * get() const
Returns C++ pointer to the item.
reco::MuonRef muonRef() const
T const * product() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Particle reconstructed by the particle flow algorithm.