177 typedef std::vector<MyJet> MyCollection;
179 typedef typename Loader::data_type CorrectorSequence;
180 typedef typename CorrectorSequence::result_type CorrectorResult;
183 const unsigned nRecords =
records.size();
184 std::vector<edm::ESHandle<CorrectorSequence> > handles(nRecords);
185 for (
unsigned irec=0; irec<nRecords; ++irec)
194 for (
unsigned irec=0; irec<nRecords; ++irec)
197 const unsigned nLevels = handles[irec]->nLevels();
198 for (
unsigned i=0;
i<nLevels; ++
i)
200 const unsigned lev = (*handles[irec])[
i].
level();
206 const int mask = (1 << lev);
207 if (totalMask & mask)
209 <<
"Error in FFTJetCorrectionProducer::applyCorrections:"
210 <<
" jet correction at level " << lev
211 <<
" is applied more than once\n";
218 totalMask = (totalMask << 12);
228 const unsigned nJets = jets->size();
229 std::auto_ptr<MyCollection> coll(
new MyCollection());
230 coll->reserve(nJets);
234 double previousPt = DBL_MAX;
235 for (
unsigned ijet=0; ijet<nJets; ++ijet)
237 const MyJet&
j((*jets)[ijet]);
240 const int initialStatus =
j.getFFTSpecific().f_status();
241 if (initialStatus & totalMask)
243 <<
"Error in FFTJetCorrectionProducer::applyCorrections: "
244 <<
"this jet collection is already corrected for some or all "
245 <<
"of the specified levels\n";
253 <<
": pt = " << corJ.pt()
254 <<
", eta = " << fj.
f_vec().eta()
256 <<
", s = 0x" << std::hex << fj.
f_status() << std::dec
268 <<
"Error in FFTJetCorrectionProducer::applyCorrections: "
269 <<
"this jet collection is already pileup-subtracted\n";
272 <<
"Error in FFTJetCorrectionProducer::applyCorrections: "
273 <<
"pileup was not calculated for this jet collection\n";
280 <<
": pt = " << corJ.pt()
281 <<
", eta = " << fj.
f_vec().eta()
283 <<
", s = 0x" << std::hex << fj.
f_status() << std::dec
289 double sigmaSquared = 0.0;
290 for (
unsigned irec=0; irec<nRecords; ++irec)
292 const CorrectorResult&
corr = handles[irec]->correct(corJ, isMC);
295 FFTJet<float>& fftJet(
const_cast<FFTJet<float>&
>(corJ.getFFTSpecific()));
296 corJ.setP4(corr.vec());
297 fftJet.setFourVec(corr.vec());
303 const double s = corr.sigma();
313 corJ.setPileup(
sqrt(sigmaSquared));
315 coll->push_back(corJ);
318 const double pt = corJ.pt();
327 <<
": pt = " << corJ.pt()
328 <<
", eta = " << fj.
f_vec().eta()
330 <<
", s = 0x" << std::hex << fj.
f_status() << std::dec
336 std::sort(coll->begin(), coll->end(), LocalSortByPt());
341 std::auto_ptr<std::vector<float> > unc(
new std::vector<float>());
343 for (
unsigned ijet=0; ijet<nJets; ++ijet)
345 MyJet&
j((*coll)[ijet]);
346 unc->push_back(
j.pileup());
const std::string outputLabel
const edm::InputTag inputLabel
static PFTauRenderPlugin instance
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Implements inheritance relationships for FFTJet jets.
const math::XYZTLorentzVector & f_vec() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void performPileupSubtraction(Jet &)
#define PILEUP_SUBTRACTION_MASK_ANY
Storage class for jets reconstructed by FFTJet package.
const bool subtractPileup
#define PILEUP_CALCULATION_MASK
const std::vector< std::string > records
const bool writeUncertainties
std::vector< int > sequenceMasks