79 absEtaBinning_(iConfig.getParameter<
std::vector<double>>(
"absEtaBinning")),
80 nBinsEta_(absEtaBinning_.
size() - 1),
82 outputCollectionName_(iConfig.getParameter<
std::
string>(
"outputCollectionName"))
104 auto calibratedCollectionPtr = std::make_unique<std::vector<reco::CaloJet>>();
115 calibratedCollectionPtr->reserve(inputCollectionHandle->size());
117 for (
const auto& candidate : *inputCollectionHandle) {
119 float pt = candidate.pt();
120 float eta = candidate.eta();
139 candidateP4.SetPt(candidateP4.pt() * l1tCalibrationFactor);
140 calibratedCollectionPtr->emplace_back(candidate);
141 calibratedCollectionPtr->back().setP4(candidateP4);
144 if (newCandidate->pt() < 0) {
145 LogDebug(
"Phase1L1TJetCalibrator") <<
"######################" << std::endl;
146 LogDebug(
"Phase1L1TJetCalibrator") <<
"PRE-CALIBRATION " << std::endl;
147 LogDebug(
"Phase1L1TJetCalibrator") <<
"\t Jet properties (pt, eta, phi, pile-up): " << candidate.pt() <<
"\t"
148 << candidate.eta() <<
"\t" LogDebug(
"Phase1L1TJetCalibrator")
149 << candidate.phi() <<
"\t" << candidate.pileup() << std::endl;
150 LogDebug(
"Phase1L1TJetCalibrator") <<
"CALIBRATION " << std::endl;
151 LogDebug(
"Phase1L1TJetCalibrator") <<
"\t Using eta - pt - factor " << *
etaBin <<
" - " << *
ptBin <<
" - "
152 << l1tCalibrationFactor
LogDebug(
"Phase1L1TJetCalibrator") << std::endl;
153 LogDebug(
"Phase1L1TJetCalibrator") <<
"POST-CALIBRATION " << std::endl;
154 LogDebug(
"Phase1L1TJetCalibrator") <<
"\t Jet properties (pt, eta, phi, pile-up): " << newCandidate->pt() <<
"\t"
155 << newCandidate->eta() <<
"\t" << newCandidate->phi() <<
"\t"
156 << newCandidate->pileup() << std::endl;
162 std::sort(calibratedCollectionPtr->begin(),
163 calibratedCollectionPtr->end(),
172 edm::InputTag(
"Phase1L1TJetProducer",
"UncalibratedPhase1L1TJetFromPfCandidates"));
173 desc.
add<std::vector<double>>(
"absEtaBinning");
174 std::vector<edm::ParameterSet> vDefaults;
176 validator.
add<
double>(
"etaMax");
177 validator.
add<
double>(
"etaMin");
178 validator.
add<std::vector<double>>(
"l1tCalibrationFactors");
179 validator.
add<std::vector<double>>(
"l1tPtBins");
180 desc.
addVPSet(
"calibration", validator, vDefaults);
181 desc.
add<
std::string>(
"outputCollectionName",
"Phase1L1TJetFromPfCandidates");
182 descriptions.
add(
"Phase1L1TJetCalibrator", desc);