45 #define init_param(type, varname) varname (ps.getParameter< type >( #varname ))
63 void analyzePileup(
const std::vector<PileupSummaryInfo>& pInfo);
67 virtual void endJob()
override ;
172 const std::vector<PileupSummaryInfo>&
info)
174 const unsigned nBx = info.size();
176 ntupleData.push_back(static_cast<float>(nBx));
178 double sumpt_Lo = 0.0, sumpt_Hi = 0.0;
181 int npu_by_Bx[3] = {0,};
182 double sumpt_Lo_by_Bx[3] = {0.0,}, sumpt_Hi_by_Bx[3] = {0.0,};
185 std::cout <<
"\n**** Pileup info begin" << std::endl;
187 bool isCrazy =
false;
188 for (
unsigned ibx = 0; ibx < nBx; ++ibx)
196 const double losum = std::accumulate(lopt.begin(), lopt.end(), 0.0);
197 const double hisum = std::accumulate(hipt.begin(), hipt.end(), 0.0);
208 const unsigned idx = bx < 0 ? 0U : (bx == 0 ? 1U : 2U);
210 sumpt_Lo_by_Bx[
idx] += losum;
211 sumpt_Hi_by_Bx[
idx] += hisum;
214 std::cout <<
"ibx " << ibx <<
" bx " << bx
215 <<
" npu " << npu <<
" losum " << losum
216 <<
" hisum " << hisum
221 std::cout <<
"**** Pileup info end\n" << std::endl;
228 for (
unsigned ibx = 0; ibx < 3; ++ibx)
231 sumpt_Lo_by_Bx[ibx] = 0.0;
232 sumpt_Hi_by_Bx[ibx] = 0.0;
244 for (
unsigned ibx = 0; ibx < 3; ++ibx)
259 vars +=
":nbx:npu:sumptLowCut:sumptHiCut";
262 vars +=
":npu_negbx:sumptLowCut_negbx:sumptHiCut_negbx";
263 vars +=
":npu_0bx:sumptLowCut_0bx:sumptHiCut_0bx";
264 vars +=
":npu_posbx:sumptLowCut_posbx:sumptHiCut_posbx";
267 vars +=
":estimate:pileup:uncert:uncertCode";
269 vars +=
":fjrho:fjsigma";
271 vars +=
":gridEtDensity:gridEtDensityMixed";
293 const long eventnumber = iEvent.
id().
event();
313 for (
unsigned ibx = 0; ibx < 3; ++ibx)
328 TH2D*
copy =
new TH2D(*input);
330 std::ostringstream os;
331 os << copy->GetName() <<
'_' <<
counter <<
'_'
332 <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
334 copy->SetNameTitle(newname.c_str(), newname.c_str());
344 ntupleData.push_back(summary->uncalibratedQuantile());
346 ntupleData.push_back(summary->pileupRhoUncertainty());
347 ntupleData.push_back(summary->uncertaintyCode());
366 const double*
data = input->data();
368 assert(input->phiBin0Edge() == 0.0);
369 const unsigned nEta = input->nEtaBins();
370 const unsigned nPhi = input->nPhiBins();
373 std::ostringstream os;
374 os <<
"FFTJetGrid_" <<
counter <<
'_'
375 <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
380 TH2F*
h = fs->make<TH2F>(newname.c_str(), newname.c_str(),
381 nEta, input->etaMin(), input->etaMax(),
382 nPhi, 0.0, 2.0*
M_PI);
383 h->GetXaxis()->SetTitle(
"Eta");
384 h->GetYaxis()->SetTitle(
"Phi");
385 h->GetZaxis()->SetTitle(
"Transverse Energy");
387 for (
unsigned ieta=0; ieta<nEta; ++ieta)
388 for (
unsigned iphi=0; iphi<nPhi; ++iphi)
389 h->SetBinContent(ieta+1U, iphi+1U, data[ieta*nPhi + iphi]);
406 if (!pvCollection->empty())
407 for (reco::VertexCollection::const_iterator pv = pvCollection->begin();
408 pv != pvCollection->end(); ++pv)
410 const double ndof = pv->ndof();
417 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
#define DEFINE_FWK_MODULE(type)
virtual void endJob() override
edm::EDGetTokenT< reco::VertexCollection > srcPVsToken
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupToken
virtual void beginJob() override
T * make(const Args &...args) const
make new ROOT object
const int getBunchCrossing() const
edm::EDGetTokenT< std::pair< double, double > > etSumToken
void analyzePileup(const std::vector< PileupSummaryInfo > &pInfo)
static std::string const input
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
edm::EDGetTokenT< double > fastJetSigmaToken
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
edm::EDGetTokenT< double > fastJetRhoToken
edm::EDGetTokenT< reco::DiscretizedEnergyFlow > gridToken
std::vector< float > ntupleData
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
const std::vector< float > & getPU_sumpT_lowpT() const