118 auto pvTable = std::make_unique<nanoaod::FlatTable>(1,
pvName_,
true);
119 pvTable->addColumnValue<
float>(
"ndof", (*pvsIn)[0].ndof(),
"main primary vertex number of degree of freedom", 8);
120 pvTable->addColumnValue<
float>(
"x", (*pvsIn)[0].position().x(),
"main primary vertex position x coordinate", 10);
121 pvTable->addColumnValue<
float>(
"y", (*pvsIn)[0].position().y(),
"main primary vertex position y coordinate", 10);
122 pvTable->addColumnValue<
float>(
"z", (*pvsIn)[0].position().z(),
"main primary vertex position z coordinate", 16);
123 pvTable->addColumnValue<
float>(
"chi2", (*pvsIn)[0].normalizedChi2(),
"main primary vertex reduced chi2", 8);
125 for (
const auto&
pv : *pvsIn)
128 pvTable->addColumnValue<
int>(
"npvs", pvsIn->size(),
"total number of reconstructed primary vertices");
129 pvTable->addColumnValue<
int>(
131 pvTable->addColumnValue<
float>(
132 "score", pvsScoreProd.get(pvsIn.id(), 0),
"main primary vertex score, i.e. sum pt2 of clustered objects", 8);
135 std::make_unique<nanoaod::FlatTable>((*pvsIn).size() > 4 ? 3 : (*pvsIn).size() - 1,
"Other" +
pvName_,
false);
136 std::vector<float> pvsz;
137 std::vector<float> pvscores;
138 for (
size_t i = 1;
i < (*pvsIn).size() &&
i < 4;
i++) {
140 pvscores.push_back(pvsScoreProd.get(pvsIn.id(),
i));
142 otherPVsTable->addColumn<
float>(
"z", pvsz,
"Z position of other primary vertices, excluding the main PV", 8);
143 otherPVsTable->addColumn<
float>(
"score", pvscores,
"scores of other primary vertices, excluding the main PV", 8);
146 auto selCandSv = std::make_unique<PtrVector<reco::Candidate>>();
147 std::vector<float> dlen, dlenSig, pAngle,
dxy, dxySig;
153 const auto& PV0 = pvsIn->front();
154 for (
const auto&
sv : svsProd) {
159 dlen.push_back(dl.
value());
162 selCandSv->push_back(
c);
163 double dx = (PV0.x() -
sv.vx()),
dy = (PV0.y() -
sv.vy()),
dz = (PV0.z() -
sv.vz());
165 pAngle.push_back(std::acos(pdotv));
172 for (
unsigned int id = 0;
id <
sv.numberOfDaughters(); ++
id) {
174 sum_charge += daughter->
charge();
176 charge.push_back(sum_charge);
182 auto svsTable = std::make_unique<nanoaod::FlatTable>(selCandSv->size(),
svName_,
false);
185 svsTable->addColumn<
float>(
"dlen", dlen,
"decay length in cm", 10);
186 svsTable->addColumn<
float>(
"dlenSig", dlenSig,
"decay length significance", 10);
187 svsTable->addColumn<
float>(
"dxy",
dxy,
"2D decay length in cm", 10);
188 svsTable->addColumn<
float>(
"dxySig", dxySig,
"2D decay length significance", 10);
189 svsTable->addColumn<
float>(
"pAngle", pAngle,
"pointing angle, i.e. acos(p_SV * (SV - PV)) ", 10);
190 svsTable->addColumn<
int>(
"charge",
charge,
"sum of the charge of the SV tracks", 10);
reco::Vertex::Point convertPos(const GlobalPoint &p)
const edm::EDGetTokenT< std::vector< reco::Vertex > > pvs_
const std::string pvName_
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
reco::Vertex::Error convertError(const GlobalError &ge)
const edm::EDGetTokenT< edm::ValueMap< float > > pvsScore_
const std::string goodPvCutString_
goodPVs
Good Primary Vertex Selection.
const edm::EDGetTokenT< edm::View< reco::VertexCompositePtrCandidate > > svs_
virtual int charge() const =0
electric charge
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
double significance() const
const std::string svName_
static int position[264][3]
const StringCutObjectSelector< reco::Vertex > goodPvCut_
const StringCutObjectSelector< reco::Candidate > svCut_