86 pvs_(consumes<
std::vector<
reco::Vertex>>( params.getParameter<
edm::InputTag>(
"pvSrc") )),
88 svs_(consumes<
edm::
View<
reco::VertexCompositePtrCandidate> >( params.getParameter<
edm::InputTag>(
"svSrc") )),
95 dlenMin_(params.getParameter<double>(
"dlenMin") ),
96 dlenSigMin_(params.getParameter<double>(
"dlenSigMin") )
99 produces<nanoaod::FlatTable>(
"pv");
100 produces<nanoaod::FlatTable>(
"otherPVs");
101 produces<nanoaod::FlatTable>(
"svs");
102 produces<edm::PtrVector<reco::Candidate> >();
131 auto pvTable = std::make_unique<nanoaod::FlatTable>(1,
pvName_,
true);
141 pvTable->addColumnValue<
float>(
"score",(*pvsScoreIn).get(pvsIn.id(),0),
"main primary vertex score, i.e. sum pt2 of clustered objects",
nanoaod::FlatTable::FloatColumn,8);
143 auto otherPVsTable = std::make_unique<nanoaod::FlatTable>((*pvsIn).size() >4?3:(*pvsIn).size()-1,
"Other"+
pvName_,
false);
144 std::vector<float> pvsz;
145 for(
size_t i=1;
i < (*pvsIn).size() &&
i < 4;
i++) pvsz.push_back((*pvsIn)[
i-1].position().z());
151 auto selCandSv = std::make_unique<PtrVector<reco::Candidate>>();
152 std::vector<float> dlen,dlenSig,pAngle;
156 const auto & PV0 = pvsIn->front();
157 for (
const auto & sv : *svsIn) {
161 dlen.push_back(dl.
value());
164 selCandSv->push_back(c);
165 double dx = (PV0.x() - sv.vx()),
dy = (PV0.y() - sv.vy()),
dz = (PV0.z() - sv.vz());
166 double pdotv = (dx * sv.px() +
dy*sv.py() +
dz*sv.pz())/sv.p();
167 pAngle.push_back(std::acos(pdotv));
174 auto svsTable = std::make_unique<nanoaod::FlatTable>(selCandSv->size(),
svName_,
false);
void endStream() override
reco::Vertex::Point convertPos(const GlobalPoint &p)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< std::vector< reco::Vertex > > pvs_
const std::string pvName_
~VertexTableProducer() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
reco::Vertex::Error convertError(const GlobalError &ge)
const edm::EDGetTokenT< edm::ValueMap< float > > pvsScore_
const std::string goodPvCutString_
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
goodPVs
Good Primary Vertex Selection.
void addDefault(ParameterSetDescription const &psetDescription)
VertexTableProducer(const edm::ParameterSet &)
const edm::EDGetTokenT< edm::View< reco::VertexCompositePtrCandidate > > svs_
double significance() const
void produce(edm::Event &, const edm::EventSetup &) override
const std::string svName_
void beginStream(edm::StreamID) override
const StringCutObjectSelector< reco::Vertex > goodPvCut_
const StringCutObjectSelector< reco::Candidate > svCut_