20 produces<nanoaod::FlatTable>();
26 auto npuTab = std::make_unique<nanoaod::FlatTable>(1,
"Pileup",
true);
30 const double refpvz = (*pvsIn)[0].position().z();
50 for (
unsigned int ibx = 0; ibx < npuProd.size(); ibx++) {
51 if (npuProd[ibx].getBunchCrossing() == 0) {
53 nt = npuProd[ibx].getTrueNumInteractions();
54 npu = npuProd[ibx].getPU_NumInteractions();
56 std::vector<float> zpositions;
57 unsigned int nzpositions = npuProd[ibx].getPU_zpositions().size();
58 for (
unsigned int j = 0;
j < nzpositions; ++
j) {
59 zpositions.push_back(npuProd[ibx].getPU_zpositions()[
j]);
60 if (
std::abs(zpositions.back() - refpvz) < 0.1)
66 gpudensity /= (20.0 * (*(zbin) - *(zbin - 1)));
69 unsigned int eoot = 0;
70 for (
unsigned int ipu = 0; ipu < bx0; ipu++) {
71 eoot += npuProd[ipu].getPU_NumInteractions();
73 unsigned int loot = 0;
74 for (
unsigned int ipu = npuProd.size() - 1; ipu > bx0; ipu--) {
75 loot += npuProd[ipu].getPU_NumInteractions();
77 out.addColumnValue<
float>(
"nTrueInt",
79 "the true mean number of the poisson distribution for this event from which the number "
80 "of interactions each bunch crossing has been sampled",
82 out.addColumnValue<
int>(
85 "the number of pileup interactions that have been added to the event in the current bunch crossing",
90 out.addColumnValue<
float>(
97 ->setComment(
"tag for the PU information (vector<PileupSummaryInfo>)");
99 desc.
add<std::vector<double>>(
"zbins", {})
100 ->setComment(
"Z bins to compute the generator-level number of PU vertices per mm");
101 descriptions.
add(
"puTable", desc);
108 const std::vector<double>
vz_;