18 for (std::map<int, double>::iterator iter = esigma_.begin(); iter != esigma_.end(); ++iter) {
19 iter->second =
s * (iter->second);
25 dropZeroTowers_(iConfig.getUntrackedParameter<
bool>(
"dropZeroTowers",
true)),
33 std::string ifname =
"RecoHI/HiJetAlgos/data/PU_DATA.root";
38 hC = (TH1D*)
inf->Get(
"hC");
40 for (
int i = 0;
i < 40; ++
i) {
41 hEta.push_back((TH1D*)
inf->Get(Form(
"hEta_%d",
i)));
42 hEtaMean.push_back((TH1D*)
inf->Get(Form(
"hEtaMean_%d",
i)));
43 hEtaRMS.push_back((TH1D*)
inf->Get(Form(
"hEtaRMS_%d",
i)));
48 LogDebug(
"PileUpSubtractor") <<
"The subtractor setting up geometry...\n";
74 for (std::vector<DetId>::const_iterator did = alldid.begin(); did != alldid.end(); did++) {
79 if (hid.
ieta() != ietaold) {
106 LogDebug(
"PileUpSubtractor") <<
"The subtractor subtracting pedestals...\n";
109 vector<fastjet::PseudoJet> newcoll;
111 for (vector<fastjet::PseudoJet>::iterator input_object = coll.begin(), fjInputsEnd = coll.end();
112 input_object != fjInputsEnd;
119 double Original_Et = itow->et();
121 Original_Et =
getEt(itow);
124 double etnew = Original_Et -
getPU(it,
true,
true);
125 float mScale = etnew / input_object->Et();
130 input_object->py() * mScale,
131 input_object->pz() * mScale,
132 input_object->e() * mScale);
134 int index = input_object->user_index();
135 input_object->reset(towP4.px(), towP4.py(), towP4.pz(), towP4.energy());
136 input_object->set_user_index(
index);
138 newcoll.push_back(*input_object);
148 LogDebug(
"PileUpSubtractor") <<
"The subtractor correcting jets...\n";
151 using namespace reco;
161 (*fjClusterSeq_) = newseq;
164 (*fjClusterSeq_) = newseq;
172 vector<fastjet::PseudoJet>::iterator pseudojetTMP =
fjJets_->begin(), jetsEnd =
fjJets_->end();
173 for (; pseudojetTMP != jetsEnd; ++pseudojetTMP) {
174 int ijet = pseudojetTMP -
fjJets_->begin();
177 std::vector<fastjet::PseudoJet>
towers = sorted_by_pt(
fjClusterSeq_->constituents(*pseudojetTMP));
179 double newjetet = 0.;
180 for (vector<fastjet::PseudoJet>::const_iterator ito =
towers.begin(), towEnd =
towers.end(); ito != towEnd; ++ito) {
182 int it =
ieta(originalTower);
183 double Original_Et = originalTower->et();
186 Original_Et =
getEt(originalTower);
189 double etnew = Original_Et -
getPU(it,
true,
true);
192 newjetet = newjetet + etnew;
197 double mScale = newjetet / pseudojetTMP->Et();
198 int cshist = pseudojetTMP->cluster_hist_index();
199 pseudojetTMP->reset(pseudojetTMP->px() * mScale,
200 pseudojetTMP->py() * mScale,
201 pseudojetTMP->pz() * mScale,
202 pseudojetTMP->e() * mScale);
203 pseudojetTMP->set_cluster_hist_index(cshist);
209 const CaloTower* ctc = dynamic_cast<const CaloTower*>(
in.get());
216 for (
unsigned int i = 0;
i < hitids.size(); ++
i) {
225 const CaloTower* ctc = dynamic_cast<const CaloTower*>(
in.get());
233 return getPU(it,
true,
false);
238 return getPU(it,
false,
true);
243 return getPU(it,
true,
true);
258 int hbin = 40 -
bin_;
259 double centerweight = (
centrality_ -
hC->GetBinCenter(hbin));
260 double lowerweight = (
centrality_ -
hC->GetBinLowEdge(hbin));
261 double upperweight = (
centrality_ -
hC->GetBinLowEdge(hbin + 1));
263 em *= lowerweight * upperweight;
264 er *= lowerweight * upperweight;
265 n += lowerweight * upperweight;
270 n += upperweight * centerweight;
276 n += lowerweight * centerweight;
283 return addMean * em * cm + addSigma *
nSigmaPU_ * er * cr;