178 typedef std::vector<MyJet> MyCollection;
180 typedef typename Loader::data_type CorrectorSequence;
181 typedef typename CorrectorSequence::result_type CorrectorResult;
184 const unsigned nRecords =
records.size();
185 std::vector<edm::ESHandle<CorrectorSequence> > handles(nRecords);
186 for (
unsigned irec=0; irec<nRecords; ++irec)
195 for (
unsigned irec=0; irec<nRecords; ++irec)
198 const unsigned nLevels = handles[irec]->nLevels();
199 for (
unsigned i=0;
i<nLevels; ++
i)
201 const unsigned lev = (*handles[irec])[
i].
level();
207 const int mask = (1 << lev);
208 if (totalMask & mask)
210 <<
"Error in FFTJetCorrectionProducer::applyCorrections:"
211 <<
" jet correction at level " << lev
212 <<
" is applied more than once\n";
219 totalMask = (totalMask << 12);
229 const unsigned nJets = jets->size();
230 std::auto_ptr<MyCollection>
coll(
new MyCollection());
231 coll->reserve(nJets);
235 double previousPt = DBL_MAX;
236 for (
unsigned ijet=0; ijet<nJets; ++ijet)
238 const MyJet&
j((*jets)[ijet]);
241 const int initialStatus =
j.getFFTSpecific().f_status();
242 if (initialStatus & totalMask)
244 <<
"Error in FFTJetCorrectionProducer::applyCorrections: "
245 <<
"this jet collection is already corrected for some or all "
246 <<
"of the specified levels\n";
254 <<
": pt = " << corJ.pt()
255 <<
", eta = " << fj.
f_vec().eta()
257 <<
", s = 0x" << std::hex << fj.
f_status() << std::dec
269 <<
"Error in FFTJetCorrectionProducer::applyCorrections: "
270 <<
"this jet collection is already pileup-subtracted\n";
273 <<
"Error in FFTJetCorrectionProducer::applyCorrections: "
274 <<
"pileup was not calculated for this jet collection\n";
281 <<
": pt = " << corJ.pt()
282 <<
", eta = " << fj.
f_vec().eta()
284 <<
", s = 0x" << std::hex << fj.
f_status() << std::dec
290 double sigmaSquared = 0.0;
291 for (
unsigned irec=0; irec<nRecords; ++irec)
293 const CorrectorResult&
corr = handles[irec]->correct(corJ, isMC);
296 FFTJet<float>& fftJet(
const_cast<FFTJet<float>&
>(corJ.getFFTSpecific()));
297 corJ.setP4(corr.vec());
298 fftJet.setFourVec(corr.vec());
304 const double s = corr.sigma();
314 corJ.setPileup(
sqrt(sigmaSquared));
319 const double pt = corJ.pt();
328 <<
": pt = " << corJ.pt()
329 <<
", eta = " << fj.
f_vec().eta()
331 <<
", s = 0x" << std::hex << fj.
f_status() << std::dec
342 std::auto_ptr<std::vector<float> > unc(
new std::vector<float>());
344 for (
unsigned ijet=0; ijet<nJets; ++ijet)
346 MyJet&
j((*
coll)[ijet]);
347 unc->push_back(
j.pileup());
const std::string outputLabel
const edm::InputTag inputLabel
static PFTauRenderPlugin instance
void push_back(key_type i, value_type const &j, label_type const &flav="")
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