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++) {
77 if ((hid).
depth() == 1) {
80 if ((hid).
ieta() != ietaold) {
81 ietaold = (hid).
ieta();
108 LogDebug(
"PileUpSubtractor") <<
"The subtractor subtracting pedestals...\n";
111 vector<fastjet::PseudoJet> newcoll;
113 for (vector<fastjet::PseudoJet>::iterator input_object = coll.begin(), fjInputsEnd = coll.end();
114 input_object != fjInputsEnd;
121 double Original_Et = itow->et();
123 Original_Et =
getEt(itow);
126 double etnew = Original_Et -
getPU(it,
true,
true);
127 float mScale = etnew / input_object->Et();
132 input_object->py() * mScale,
133 input_object->pz() * mScale,
134 input_object->e() * mScale);
136 int index = input_object->user_index();
137 input_object->reset(towP4.px(), towP4.py(), towP4.pz(), towP4.energy());
138 input_object->set_user_index(
index);
140 newcoll.push_back(*input_object);
150 LogDebug(
"PileUpSubtractor") <<
"The subtractor correcting jets...\n";
153 using namespace reco;
163 (*fjClusterSeq_) = newseq;
166 (*fjClusterSeq_) = newseq;
174 vector<fastjet::PseudoJet>::iterator pseudojetTMP =
fjJets_->begin(), jetsEnd =
fjJets_->end();
175 for (; pseudojetTMP != jetsEnd; ++pseudojetTMP) {
176 int ijet = pseudojetTMP -
fjJets_->begin();
179 std::vector<fastjet::PseudoJet>
towers = sorted_by_pt(
fjClusterSeq_->constituents(*pseudojetTMP));
181 double newjetet = 0.;
182 for (vector<fastjet::PseudoJet>::const_iterator ito =
towers.begin(), towEnd =
towers.end(); ito != towEnd; ++ito) {
184 int it =
ieta(originalTower);
185 double Original_Et = originalTower->et();
188 Original_Et =
getEt(originalTower);
191 double etnew = Original_Et -
getPU(it,
true,
true);
194 newjetet = newjetet + etnew;
199 double mScale = newjetet / pseudojetTMP->Et();
200 int cshist = pseudojetTMP->cluster_hist_index();
201 pseudojetTMP->reset(pseudojetTMP->px() * mScale,
202 pseudojetTMP->py() * mScale,
203 pseudojetTMP->pz() * mScale,
204 pseudojetTMP->e() * mScale);
205 pseudojetTMP->set_cluster_hist_index(cshist);
211 const CaloTower* ctc = dynamic_cast<const CaloTower*>(
in.get());
218 for (
unsigned int i = 0;
i < hitids.size(); ++
i) {
227 const CaloTower* ctc = dynamic_cast<const CaloTower*>(
in.get());
235 return getPU(it,
true,
false);
240 return getPU(it,
false,
true);
245 return getPU(it,
true,
true);
260 int hbin = 40 -
bin_;
261 double centerweight = (
centrality_ -
hC->GetBinCenter(hbin));
262 double lowerweight = (
centrality_ -
hC->GetBinLowEdge(hbin));
263 double upperweight = (
centrality_ -
hC->GetBinLowEdge(hbin + 1));
265 em *= lowerweight * upperweight;
266 er *= lowerweight * upperweight;
267 n += lowerweight * upperweight;
272 n += upperweight * centerweight;
278 n += lowerweight * centerweight;
285 return addMean * em * cm + addSigma *
nSigmaPU_ * er * cr;