45 #define init_param(type, varname) varname (ps.getParameter< type >( #varname ))
63 void analyzePileup(
const std::vector<PileupSummaryInfo>& pInfo);
67 virtual void endJob()
override ;
139 const std::vector<PileupSummaryInfo>&
info)
141 const unsigned nBx = info.size();
143 ntupleData.push_back(static_cast<float>(nBx));
145 double sumpt_Lo = 0.0, sumpt_Hi = 0.0;
148 int npu_by_Bx[3] = {0,};
149 double sumpt_Lo_by_Bx[3] = {0.0,}, sumpt_Hi_by_Bx[3] = {0.0,};
152 std::cout <<
"\n**** Pileup info begin" << std::endl;
154 bool isCrazy =
false;
155 for (
unsigned ibx = 0; ibx < nBx; ++ibx)
163 const double losum = std::accumulate(lopt.begin(), lopt.end(), 0.0);
164 const double hisum = std::accumulate(hipt.begin(), hipt.end(), 0.0);
175 const unsigned idx = bx < 0 ? 0U : (bx == 0 ? 1U : 2U);
177 sumpt_Lo_by_Bx[
idx] += losum;
178 sumpt_Hi_by_Bx[
idx] += hisum;
181 std::cout <<
"ibx " << ibx <<
" bx " << bx
182 <<
" npu " << npu <<
" losum " << losum
183 <<
" hisum " << hisum
188 std::cout <<
"**** Pileup info end\n" << std::endl;
195 for (
unsigned ibx = 0; ibx < 3; ++ibx)
198 sumpt_Lo_by_Bx[ibx] = 0.0;
199 sumpt_Hi_by_Bx[ibx] = 0.0;
211 for (
unsigned ibx = 0; ibx < 3; ++ibx)
226 vars +=
":nbx:npu:sumptLowCut:sumptHiCut";
229 vars +=
":npu_negbx:sumptLowCut_negbx:sumptHiCut_negbx";
230 vars +=
":npu_0bx:sumptLowCut_0bx:sumptHiCut_0bx";
231 vars +=
":npu_posbx:sumptLowCut_posbx:sumptHiCut_posbx";
234 vars +=
":estimate:pileup:uncert:uncertCode";
236 vars +=
":fjrho:fjsigma";
238 vars +=
":gridEtDensity:gridEtDensityMixed";
260 const long eventnumber = iEvent.
id().
event();
280 for (
unsigned ibx = 0; ibx < 3; ++ibx)
295 TH2D*
copy =
new TH2D(*input);
297 std::ostringstream os;
298 os << copy->GetName() <<
'_' <<
counter <<
'_'
299 <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
301 copy->SetNameTitle(newname.c_str(), newname.c_str());
311 ntupleData.push_back(summary->uncalibratedQuantile());
313 ntupleData.push_back(summary->pileupRhoUncertainty());
314 ntupleData.push_back(summary->uncertaintyCode());
333 const double*
data = input->data();
335 assert(input->phiBin0Edge() == 0.0);
336 const unsigned nEta = input->nEtaBins();
337 const unsigned nPhi = input->nPhiBins();
340 std::ostringstream os;
341 os <<
"FFTJetGrid_" <<
counter <<
'_'
342 <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
347 TH2F*
h = fs->make<TH2F>(newname.c_str(), newname.c_str(),
348 nEta, input->etaMin(), input->etaMax(),
349 nPhi, 0.0, 2.0*
M_PI);
350 h->GetXaxis()->SetTitle(
"Eta");
351 h->GetYaxis()->SetTitle(
"Phi");
352 h->GetZaxis()->SetTitle(
"Transverse Energy");
354 for (
unsigned ieta=0; ieta<nEta; ++ieta)
355 for (
unsigned iphi=0; iphi<nPhi; ++iphi)
356 h->SetBinContent(ieta+1U, iphi+1U, data[ieta*nPhi + iphi]);
373 if (!pvCollection->empty())
374 for (reco::VertexCollection::const_iterator pv = pvCollection->begin();
375 pv != pvCollection->end(); ++pv)
377 const double ndof = pv->ndof();
384 assert(
ntupleData.size() ==
static_cast<unsigned>(
nt->GetNvar()));
EventNumber_t event() const
#define init_param(type, varname)
#define DEFINE_FWK_MODULE(type)
virtual void endJob() override
virtual void beginJob() override
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
edm::InputTag fastJetRhoLabel
const std::vector< float > & getPU_sumpT_highpT() const
TDirectory * getBareDirectory(const std::string &subdir="") 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.
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
edm::InputTag summaryLabel
edm::InputTag fastJetSigmaLabel
const int getPU_NumInteractions() const
FFTJetPileupAnalyzer & operator=(const FFTJetPileupAnalyzer &)
char data[epos_bytes_allocation]
static std::atomic< unsigned int > counter
std::vector< float > ntupleData
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
const std::vector< float > & getPU_sumpT_lowpT() const