47 #define init_param(type, varname) varname (ps.getParameter< type >( #varname )) 65 void analyzePileup(
const std::vector<PileupSummaryInfo>& pInfo);
174 const std::vector<PileupSummaryInfo>&
info)
176 const unsigned nBx = info.size();
178 ntupleData.push_back(static_cast<float>(nBx));
180 double sumpt_Lo = 0.0, sumpt_Hi = 0.0;
183 int npu_by_Bx[3] = {0,};
184 double sumpt_Lo_by_Bx[3] = {0.0,}, sumpt_Hi_by_Bx[3] = {0.0,};
187 std::cout <<
"\n**** Pileup info begin" << std::endl;
189 bool isCrazy =
false;
190 for (
unsigned ibx = 0; ibx < nBx; ++ibx)
198 const double losum = std::accumulate(lopt.begin(), lopt.end(), 0.0);
199 const double hisum = std::accumulate(hipt.begin(), hipt.end(), 0.0);
210 const unsigned idx = bx < 0 ? 0
U : (bx == 0 ? 1
U : 2
U);
211 npu_by_Bx[
idx] += npu;
212 sumpt_Lo_by_Bx[
idx] += losum;
213 sumpt_Hi_by_Bx[
idx] += hisum;
216 std::cout <<
"ibx " << ibx <<
" bx " << bx
217 <<
" npu " << npu <<
" losum " << losum
218 <<
" hisum " << hisum
223 std::cout <<
"**** Pileup info end\n" << std::endl;
230 for (
unsigned ibx = 0; ibx < 3; ++ibx)
233 sumpt_Lo_by_Bx[ibx] = 0.0;
234 sumpt_Hi_by_Bx[ibx] = 0.0;
246 for (
unsigned ibx = 0; ibx < 3; ++ibx)
261 vars +=
":nbx:npu:sumptLowCut:sumptHiCut";
264 vars +=
":npu_negbx:sumptLowCut_negbx:sumptHiCut_negbx";
265 vars +=
":npu_0bx:sumptLowCut_0bx:sumptHiCut_0bx";
266 vars +=
":npu_posbx:sumptLowCut_posbx:sumptHiCut_posbx";
269 vars +=
":estimate:pileup:uncert:uncertCode";
271 vars +=
":fjrho:fjsigma";
273 vars +=
":gridEtDensity:gridEtDensityMixed";
315 for (
unsigned ibx = 0; ibx < 3; ++ibx)
330 TH2D*
copy =
new TH2D(*input);
332 std::ostringstream os;
333 os << copy->GetName() <<
'_' <<
counter <<
'_' 334 <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
336 copy->SetNameTitle(newname.c_str(), newname.c_str());
375 std::ostringstream os;
376 os <<
"FFTJetGrid_" <<
counter <<
'_' 377 <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
382 TH2F*
h = fs->make<TH2F>(newname.c_str(), newname.c_str(),
385 h->GetXaxis()->SetTitle(
"Eta");
386 h->GetYaxis()->SetTitle(
"Phi");
387 h->GetZaxis()->SetTitle(
"Transverse Energy");
389 for (
unsigned ieta=0; ieta<
nEta; ++ieta)
390 for (
unsigned iphi=0; iphi<
nPhi; ++iphi)
391 h->SetBinContent(ieta+1
U, iphi+1
U, data[ieta*nPhi + iphi]);
408 if (!pvCollection->empty())
409 for (reco::VertexCollection::const_iterator
pv = pvCollection->begin();
410 pv != pvCollection->end(); ++
pv)
412 const double ndof =
pv->ndof();
419 assert(
ntupleData.size() ==
static_cast<unsigned>(
nt->GetNvar()));
EventNumber_t event() const
#define init_param(type, varname)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int uncertaintyCode() 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
unsigned nEtaBins() const
const int getBunchCrossing() const
edm::EDGetTokenT< std::pair< double, double > > etSumToken
void analyzePileup(const std::vector< PileupSummaryInfo > &pInfo)
static std::string const input
FFTJetPileupAnalyzer & operator=(const FFTJetPileupAnalyzer &)=delete
const double * data() const
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
unsigned nPhiBins() const
float pileupRhoUncertainty() const
edm::EDGetTokenT< double > fastJetSigmaToken
edm::InputTag summaryLabel
edm::InputTag fastJetSigmaLabel
const int getPU_NumInteractions() const
char data[epos_bytes_allocation]
float uncalibratedQuantile() const
edm::EDGetTokenT< double > fastJetRhoToken
edm::EDGetTokenT< reco::DiscretizedEnergyFlow > gridToken
std::vector< float > ntupleData
~FFTJetPileupAnalyzer() override
void analyze(const edm::Event &, const edm::EventSetup &) override
const std::vector< float > & getPU_sumpT_lowpT() const
double phiBin0Edge() const