87 pvs_(consumes<
std::vector<
reco::Vertex>>( params.getParameter<
edm::InputTag>(
"pvSrc") )),
89 svs_(consumes<
edm::
View<
reco::VertexCompositePtrCandidate> >( params.getParameter<
edm::InputTag>(
"svSrc") )),
96 dlenMin_(params.getParameter<double>(
"dlenMin") ),
97 dlenSigMin_(params.getParameter<double>(
"dlenSigMin") )
100 produces<nanoaod::FlatTable>(
"pv");
101 produces<nanoaod::FlatTable>(
"otherPVs");
102 produces<nanoaod::FlatTable>(
"svs");
103 produces<edm::PtrVector<reco::Candidate> >();
132 auto pvTable = std::make_unique<nanoaod::FlatTable>(1,
pvName_,
true);
142 pvTable->addColumnValue<
float>(
"score",(*pvsScoreIn).get(pvsIn.id(),0),
"main primary vertex score, i.e. sum pt2 of clustered objects",
nanoaod::FlatTable::FloatColumn,8);
144 auto otherPVsTable = std::make_unique<nanoaod::FlatTable>((*pvsIn).size() >4?3:(*pvsIn).size()-1,
"Other"+
pvName_,
false);
145 std::vector<float> pvsz;
146 for(
size_t i=1;
i < (*pvsIn).size() &&
i < 4;
i++) pvsz.push_back((*pvsIn)[
i-1].position().z());
152 auto selCandSv = std::make_unique<PtrVector<reco::Candidate>>();
153 std::vector<float> dlen,dlenSig,pAngle,
dxy,dxySig;
158 const auto & PV0 = pvsIn->front();
159 for (
const auto &
sv : *svsIn) {
163 dlen.push_back(dl.
value());
166 selCandSv->push_back(c);
167 double dx = (PV0.x() -
sv.vx()),
dy = (PV0.y() -
sv.vy()),
dz = (PV0.z() -
sv.vz());
169 pAngle.push_back(std::acos(pdotv));
171 dxy.push_back(d2d.
value());
179 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
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
reco::Vertex::Error convertError(const GlobalError &ge)
const edm::EDGetTokenT< edm::ValueMap< float > > pvsScore_
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
const std::string goodPvCutString_
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
#define DEFINE_FWK_MODULE(type)
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_