46 #define init_param(type, varname) varname (ps.getParameter< type >( #varname ))
64 void analyzePileup(
const std::vector<PileupSummaryInfo>& pInfo);
140 const std::vector<PileupSummaryInfo>&
info)
142 const unsigned nBx = info.size();
144 ntupleData.push_back(static_cast<float>(nBx));
146 double sumpt_Lo = 0.0, sumpt_Hi = 0.0;
149 int npu_by_Bx[3] = {0,};
150 double sumpt_Lo_by_Bx[3] = {0.0,}, sumpt_Hi_by_Bx[3] = {0.0,};
153 std::cout <<
"\n**** Pileup info begin" << std::endl;
155 bool isCrazy =
false;
156 for (
unsigned ibx = 0; ibx < nBx; ++ibx)
164 const double losum = std::accumulate(lopt.begin(), lopt.end(), 0.0);
165 const double hisum = std::accumulate(hipt.begin(), hipt.end(), 0.0);
176 const unsigned idx = bx < 0 ? 0U : (bx == 0 ? 1U : 2U);
177 npu_by_Bx[idx] += npu;
178 sumpt_Lo_by_Bx[idx] += losum;
179 sumpt_Hi_by_Bx[idx] += hisum;
182 std::cout <<
"ibx " << ibx <<
" bx " << bx
183 <<
" npu " << npu <<
" losum " << losum
184 <<
" hisum " << hisum
189 std::cout <<
"**** Pileup info end\n" << std::endl;
196 for (
unsigned ibx = 0; ibx < 3; ++ibx)
199 sumpt_Lo_by_Bx[ibx] = 0.0;
200 sumpt_Hi_by_Bx[ibx] = 0.0;
212 for (
unsigned ibx = 0; ibx < 3; ++ibx)
225 std::string vars =
"cnt:run:event";
227 vars +=
":nbx:npu:sumptLowCut:sumptHiCut";
230 vars +=
":npu_negbx:sumptLowCut_negbx:sumptHiCut_negbx";
231 vars +=
":npu_0bx:sumptLowCut_0bx:sumptHiCut_0bx";
232 vars +=
":npu_posbx:sumptLowCut_posbx:sumptHiCut_posbx";
235 vars +=
":estimate:pileup:uncert:uncertCode";
237 vars +=
":fjrho:fjsigma";
239 vars +=
":gridEtDensity:gridEtDensityMixed";
261 const long eventnumber = iEvent.
id().
event();
281 for (
unsigned ibx = 0; ibx < 3; ++ibx)
296 TH2D*
copy =
new TH2D(*input);
298 std::ostringstream os;
299 os << copy->GetName() <<
'_' <<
counter <<
'_'
300 <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
301 const std::string& newname(os.str());
302 copy->SetNameTitle(newname.c_str(), newname.c_str());
312 ntupleData.push_back(summary->uncalibratedQuantile());
314 ntupleData.push_back(summary->pileupRhoUncertainty());
315 ntupleData.push_back(summary->uncertaintyCode());
334 const double*
data = input->data();
336 assert(input->phiBin0Edge() == 0.0);
337 const unsigned nEta = input->nEtaBins();
338 const unsigned nPhi = input->nPhiBins();
341 std::ostringstream os;
342 os <<
"FFTJetGrid_" <<
counter <<
'_'
343 <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
344 const std::string& newname(os.str());
348 TH2F*
h = fs->make<TH2F>(newname.c_str(), newname.c_str(),
349 nEta, input->etaMin(), input->etaMax(),
350 nPhi, 0.0, 2.0*
M_PI);
351 h->GetXaxis()->SetTitle(
"Eta");
352 h->GetYaxis()->SetTitle(
"Phi");
353 h->GetZaxis()->SetTitle(
"Transverse Energy");
355 for (
unsigned ieta=0; ieta<nEta; ++ieta)
356 for (
unsigned iphi=0; iphi<nPhi; ++iphi)
357 h->SetBinContent(ieta+1U, iphi+1U, data[ieta*nPhi + iphi]);
374 if (!pvCollection->empty())
375 for (reco::VertexCollection::const_iterator pv = pvCollection->begin();
376 pv != pvCollection->end(); ++pv)
378 const double ndof = pv->ndof();
385 assert(
ntupleData.size() ==
static_cast<unsigned>(
nt->GetNvar()));
EventNumber_t event() const
TDirectory * getBareDirectory(const std::string &subdir="") const
#define init_param(type, varname)
#define DEFINE_FWK_MODULE(type)
const int getBunchCrossing() const
void analyzePileup(const std::vector< PileupSummaryInfo > &pInfo)
edm::InputTag fastJetRhoLabel
const std::vector< float > & getPU_sumpT_highpT() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::InputTag summaryLabel
edm::InputTag fastJetSigmaLabel
const int getPU_NumInteractions() const
FFTJetPileupAnalyzer & operator=(const FFTJetPileupAnalyzer &)
char data[epos_bytes_allocation]
T * make() const
make new ROOT object
std::vector< float > ntupleData
const std::vector< float > & getPU_sumpT_lowpT() const