Description: Applies calibrations to reco::calojets
INPUT PARAMETERS ***
inputCollectionTag, InputTag, collection of reco calojet to calibrate
absEtaBinning, vdouble with eta bins, allows for non-homogeneous binning
calibration, VPSet with calibration factors
outputCollectionName, string, output collection tag name
Definition at line 43 of file Phase1L1TJetCalibrator.cc.
Definition at line 100 of file Phase1L1TJetCalibrator.cc.
References _jetCalibrationFactorsPtBins, absEtaBinning_, PVValHelper::eta, etaBin(), edm::Event::getByToken(), inputCollectionTag_, jetCalibrationFactorsBinnedInEta_, LogDebug, eostools::move(), outputCollectionName_, DiDispStaMuonMonitor_cfi::pt, reco::LeafCandidate::pt(), edm::Event::put(), and cuda_std::upper_bound().
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(),
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Jets made from CaloTowers.
double pt() const final
transverse momentum
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::string outputCollectionName_
__host__ __device__ constexpr RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
std::vector< std::vector< double > > _jetCalibrationFactorsPtBins
std::vector< double > absEtaBinning_
std::vector< std::vector< double > > jetCalibrationFactorsBinnedInEta_
edm::EDGetTokenT< std::vector< reco::CaloJet > > inputCollectionTag_
int etaBin(const l1t::HGCalMulticluster *cl)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.