92 dlenMin_(
params.getParameter<double>(
"dlenMin")),
93 dlenSigMin_(
params.getParameter<double>(
"dlenSigMin"))
96 produces<nanoaod::FlatTable>(
"pv");
97 produces<nanoaod::FlatTable>(
"otherPVs");
98 produces<nanoaod::FlatTable>(
"svs");
99 produces<edm::PtrVector<reco::Candidate>>();
119 auto pvTable = std::make_unique<nanoaod::FlatTable>(1,
pvName_,
true);
120 pvTable->addColumnValue<
float>(
"ndof", (*pvsIn)[0].ndof(),
"main primary vertex number of degree of freedom", 8);
121 pvTable->addColumnValue<
float>(
"x", (*pvsIn)[0].position().x(),
"main primary vertex position x coordinate", 10);
122 pvTable->addColumnValue<
float>(
"y", (*pvsIn)[0].position().y(),
"main primary vertex position y coordinate", 10);
123 pvTable->addColumnValue<
float>(
"z", (*pvsIn)[0].position().z(),
"main primary vertex position z coordinate", 16);
124 pvTable->addColumnValue<
float>(
"chi2", (*pvsIn)[0].normalizedChi2(),
"main primary vertex reduced chi2", 8);
126 for (
const auto&
pv : *pvsIn)
129 pvTable->addColumnValue<
int>(
"npvs", pvsIn->size(),
"total number of reconstructed primary vertices");
130 pvTable->addColumnValue<
int>(
132 pvTable->addColumnValue<
float>(
133 "score", pvsScoreIn->get(pvsIn.id(), 0),
"main primary vertex score, i.e. sum pt2 of clustered objects", 8);
136 std::make_unique<nanoaod::FlatTable>((*pvsIn).size() > 4 ? 3 : (*pvsIn).size() - 1,
"Other" +
pvName_,
false);
137 std::vector<float> pvsz;
138 for (
size_t i = 1;
i < (*pvsIn).size() &&
i < 4;
i++)
139 pvsz.push_back((*pvsIn)[
i - 1].position().z());
140 otherPVsTable->addColumn<
float>(
"z", pvsz,
"Z position of other primary vertices, excluding the main PV", 8);
144 auto selCandSv = std::make_unique<PtrVector<reco::Candidate>>();
145 std::vector<float> dlen, dlenSig, pAngle,
dxy, dxySig;
150 const auto& PV0 = pvsIn->front();
151 for (
const auto&
sv : *svsIn) {
156 dlen.push_back(dl.
value());
159 selCandSv->push_back(
c);
160 double dx = (PV0.x() -
sv.vx()),
dy = (PV0.y() -
sv.vy()),
dz = (PV0.z() -
sv.vz());
162 pAngle.push_back(std::acos(pdotv));
172 auto svsTable = std::make_unique<nanoaod::FlatTable>(selCandSv->size(),
svName_,
false);
174 svsTable->addColumn<
float>(
"dlen", dlen,
"decay length in cm", 10);
175 svsTable->addColumn<
float>(
"dlenSig", dlenSig,
"decay length significance", 10);
176 svsTable->addColumn<
float>(
"dxy",
dxy,
"2D decay length in cm", 10);
177 svsTable->addColumn<
float>(
"dxySig", dxySig,
"2D decay length significance", 10);
178 svsTable->addColumn<
float>(
"pAngle", pAngle,
"pointing angle, i.e. acos(p_SV * (SV - PV)) ", 10);