77 : inputCollectionTag_(edm::EDGetTokenT<std::
vector<
reco::CaloJet>>(
78 consumes<std::
vector<
reco::CaloJet>>(iConfig.getParameter<edm::
InputTag>(
"inputCollectionTag")))),
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();
131 auto ptBin =
upper_bound(l1tPtBins.begin(), l1tPtBins.end(),
pt);
132 int ptBinIndex = ptBin - l1tPtBins.begin() - 1;
135 const double& l1tCalibrationFactor = l1tCalibrationFactors[ptBinIndex];
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);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
Jets made from CaloTowers.
void produce(edm::Event &, const edm::EventSetup &) override
double pt() const final
transverse momentum
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::string outputCollectionName_
#define DEFINE_FWK_MODULE(type)
~Phase1L1TJetCalibrator() override
__host__ __device__ constexpr RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< edm::ParameterSet > calibration_
std::vector< std::vector< double > > _jetCalibrationFactorsPtBins
Phase1L1TJetCalibrator(const edm::ParameterSet &)
std::vector< double > absEtaBinning_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< std::vector< double > > jetCalibrationFactorsBinnedInEta_
edm::EDGetTokenT< std::vector< reco::CaloJet > > inputCollectionTag_
int etaBin(const l1t::HGCalMulticluster *cl)
tuple size
Write out results.
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.