47 #define init_param(type, varname) varname(ps.getParameter<type>(#varname))
63 void analyzePileup(
const std::vector<PileupSummaryInfo>& pInfo);
166 const unsigned nBx = info.size();
168 ntupleData.push_back(static_cast<float>(nBx));
170 double sumpt_Lo = 0.0, sumpt_Hi = 0.0;
176 double sumpt_Lo_by_Bx[3] =
180 sumpt_Hi_by_Bx[3] = {
185 std::cout <<
"\n**** Pileup info begin" << std::endl;
187 bool isCrazy =
false;
188 for (
unsigned ibx = 0; ibx < nBx; ++ibx) {
195 const double losum = std::accumulate(lopt.begin(), lopt.end(), 0.0);
196 const double hisum = std::accumulate(hipt.begin(), hipt.end(), 0.0);
207 const unsigned idx = bx < 0 ? 0U : (bx == 0 ? 1U : 2U);
208 npu_by_Bx[idx] += npu;
209 sumpt_Lo_by_Bx[idx] += losum;
210 sumpt_Hi_by_Bx[idx] += hisum;
213 std::cout <<
"ibx " << ibx <<
" bx " << bx <<
" npu " << npu <<
" losum " << losum <<
" hisum " << hisum
218 std::cout <<
"**** Pileup info end\n" << std::endl;
224 for (
unsigned ibx = 0; ibx < 3; ++ibx) {
226 sumpt_Lo_by_Bx[ibx] = 0.0;
227 sumpt_Hi_by_Bx[ibx] = 0.0;
238 for (
unsigned ibx = 0; ibx < 3; ++ibx) {
250 vars +=
":nbx:npu:sumptLowCut:sumptHiCut";
252 vars +=
":npu_negbx:sumptLowCut_negbx:sumptHiCut_negbx";
253 vars +=
":npu_0bx:sumptLowCut_0bx:sumptHiCut_0bx";
254 vars +=
":npu_posbx:sumptLowCut_posbx:sumptHiCut_posbx";
257 vars +=
":estimate:pileup:uncert:uncertCode";
259 vars +=
":fjrho:fjsigma";
261 vars +=
":gridEtDensity:gridEtDensityMixed";
296 for (
unsigned ibx = 0; ibx < 3; ++ibx) {
309 TH2D*
copy =
new TH2D(*input);
311 std::ostringstream os;
312 os << copy->GetName() <<
'_' <<
counter <<
'_' <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
314 copy->SetNameTitle(newname.c_str(), newname.c_str());
323 ntupleData.push_back(summary->uncalibratedQuantile());
325 ntupleData.push_back(summary->pileupRhoUncertainty());
326 ntupleData.push_back(summary->uncertaintyCode());
343 const double*
data = input->data();
345 assert(input->phiBin0Edge() == 0.0);
346 const unsigned nEta = input->nEtaBins();
347 const unsigned nPhi = input->nPhiBins();
350 std::ostringstream os;
351 os <<
"FFTJetGrid_" <<
counter <<
'_' <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
357 fs->make<TH2F>(newname.c_str(), newname.c_str(),
nEta, input->etaMin(), input->etaMax(),
nPhi, 0.0, 2.0 *
M_PI);
358 h->GetXaxis()->SetTitle(
"Eta");
359 h->GetYaxis()->SetTitle(
"Phi");
360 h->GetZaxis()->SetTitle(
"Transverse Energy");
362 for (
unsigned ieta = 0; ieta <
nEta; ++ieta)
363 for (
unsigned iphi = 0; iphi <
nPhi; ++iphi)
364 h->SetBinContent(ieta + 1U, iphi + 1U, data[ieta * nPhi + iphi]);
379 if (!pvCollection->empty())
380 for (reco::VertexCollection::const_iterator
pv = pvCollection->begin();
pv != pvCollection->end(); ++
pv) {
381 const double ndof =
pv->ndof();
EventNumber_t event() const
#define init_param(type, varname)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::VertexCollection > srcPVsToken
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupToken
unsigned long long EventNumber_t
FFTJetPileupAnalyzer()=delete
T * make(const Args &...args) const
make new ROOT object
const int getBunchCrossing() const
void analyzePileup(const std::vector< PileupSummaryInfo > &pInfo)
static std::string const input
FFTJetPileupAnalyzer & operator=(const FFTJetPileupAnalyzer &)=delete
edm::EDGetTokenT< TH2D > histoToken
edm::InputTag fastJetRhoLabel
const std::vector< float > & getPU_sumpT_highpT() const
TDirectory * getBareDirectory(const std::string &subdir="") const
edm::EDGetTokenT< reco::FFTJetPileupSummary > summaryToken
edm::EDGetTokenT< double > fastJetSigmaToken
edm::InputTag summaryLabel
edm::InputTag fastJetSigmaLabel
const int getPU_NumInteractions() const
char data[epos_bytes_allocation]
static std::atomic< unsigned int > counter
edm::EDGetTokenT< double > fastJetRhoToken
edm::EDGetTokenT< reco::DiscretizedEnergyFlow > gridToken
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
std::vector< float > ntupleData
edm::EDGetTokenT< std::pair< double, double > > etSumToken
~FFTJetPileupAnalyzer() override
void analyze(const edm::Event &, const edm::EventSetup &) override
const std::vector< float > & getPU_sumpT_lowpT() const