47 #define init_param(type, varname) varname (ps.getParameter< type >( #varname ))
65 void analyzePileup(
const std::vector<PileupSummaryInfo>& pInfo);
69 virtual void endJob()
override ;
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 ? 0U : (bx == 0 ? 1U : 2U);
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());
346 ntupleData.push_back(summary->uncalibratedQuantile());
348 ntupleData.push_back(summary->pileupRhoUncertainty());
349 ntupleData.push_back(summary->uncertaintyCode());
368 const double*
data = input->data();
370 assert(input->phiBin0Edge() == 0.0);
371 const unsigned nEta = input->nEtaBins();
372 const unsigned nPhi = input->nPhiBins();
375 std::ostringstream os;
376 os <<
"FFTJetGrid_" <<
counter <<
'_'
377 <<
totalNpu <<
'_' << runnumber <<
'_' << eventnumber;
382 TH2F*
h = fs->make<TH2F>(newname.c_str(), newname.c_str(),
383 nEta, input->etaMin(), input->etaMax(),
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+1U, iphi+1U, 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();
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
unsigned long long EventNumber_t
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