Description: [one line class summary]
Implementation: [Notes on implementation]
Definition at line 26 of file HiFJRhoProducer.h.
Definition at line 85 of file HiFJRhoProducer.cc.
References jets_cff::area, calcMd(), calcMedian(), MillePedeFileConverter_cfg::e, PVValHelper::eta, ALCARECOTkAlBeamHalo_cff::etaMax, etaMaxExcl2_, etaMaxExcl_, ALCARECOTkAlBeamHalo_cff::etaMin, etaRanges, edm::Event::getByToken(), mps_fire::i, createfilelist::int, metsig::jet, fwrapper::jets, jetsToken_, eostools::move(), nExcl2_, nExcl_, EnergyCorrector::pt, ptMinExcl2_, ptMinExcl_, edm::Event::put(), and TCMET_cfi::radius.
92 auto mapEtaRangesOut = std::make_unique<std::vector<double>>(neta,-999.);
94 for(
int ieta = 0; ieta < neta; ieta++){
95 mapEtaRangesOut->at(ieta) =
etaRanges[ieta];
97 auto mapToRhoOut = std::make_unique<std::vector<double>>(neta-1,1
e-6);
98 auto mapToRhoMOut = std::make_unique<std::vector<double>>(neta-1,1
e-6);
100 int njets = jets->size();
102 auto ptJetsOut = std::make_unique<std::vector<double>>(njets,1
e-6);
103 auto areaJetsOut = std::make_unique<std::vector<double>>(njets,1
e-6);
104 auto etaJetsOut = std::make_unique<std::vector<double>>(njets,1
e-6);
112 unsigned int njetsEx = 0;
113 unsigned int njetsEx2 = 0;
114 for(
auto jet = jets->begin();
jet != jets->end(); ++
jet) {
123 float pt =
jet->pt();
127 if(eta<mapEtaRangesOut->at(0) || eta>mapEtaRangesOut->at(neta-1))
continue;
129 rhoVec[nacc] = pt/
area;
132 ptJetsOut->at(nacc) =
pt;
133 areaJetsOut->at(nacc) =
area;
134 etaJetsOut->at(nacc) =
eta;
139 ptJetsOut->resize(nacc);
140 areaJetsOut->resize(nacc);
141 etaJetsOut->resize(nacc);
144 for(
int ieta = 0; ieta<(neta-1); ieta++) {
145 std::vector<double> rhoVecCur;
146 std::vector<double> rhomVecCur;
152 double rhoCurSum = 0.;
153 double rhomCurSum = 0.;
154 for(
int i = 0;
i<nacc;
i++) {
155 if(etaVec[
i]>=etaMin && etaVec[
i]<etaMax) {
156 rhoVecCur.push_back(rhoVec[
i]);
157 rhomVecCur.push_back(rhomVec[i]);
159 rhoCurSum += rhoVec[
i];
160 rhomCurSum += rhomVec[
i];
168 mapToRhoOut->at(ieta) = rhoCur;
169 mapToRhoMOut->at(ieta) = rhomCur;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
double calcMedian(std::vector< double > &v)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< double > etaRanges
double calcMd(const reco::Jet *jet)
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_