50 bsToken_ = consumes<reco::BeamSpot>(
edm::InputTag(
"offlineBeamSpot"));
51 conversionsToken_ = consumes<reco::ConversionCollection>(
edm::InputTag(
"allConversions"));
54 produces<std::vector<Conversion> >();
75 iEvent.
getByToken(conversionsToken_, hConversions);
77 std::vector<Conversion> * patConversions =
new std::vector<Conversion>();
79 for (reco::ConversionCollection::const_iterator
conv = hConversions->begin();
conv!= hConversions->end(); ++
conv) {
89 double vtxProb = TMath::Prob( vtx.
chi2(), vtx.
ndof());
91 double dbsx = vtx.
x() - beamspot.
position().x();
92 double dbsy = vtx.
y() - beamspot.
position().y();
93 double lxy = (mom.x()*dbsx + mom.y()*dbsy)/mom.rho();
96 for (std::vector<uint8_t>::const_iterator it =
conv->nHitsBeforeVtx().begin(); it!=
conv->nHitsBeforeVtx().end(); ++it) {
97 if ((*it) > nHitsMax) nHitsMax = (*it);
102 anConversion.
setLxy( lxy );
105 patConversions->push_back(anConversion);
114 std::auto_ptr<std::vector<Conversion> > ptr(patConversions);
double lxy(const math::XYZPoint &myBeamSpot, const Conversion &conv)
T getParameter(std::string const &) const
static HepMC::IO_HEPEVT conv
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
double y() const
y coordinate
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
double chi2() const
chi-squares
double x() const
x coordinate
PATConversionProducer(const edm::ParameterSet &iConfig)
void setNHitsMax(int nHitsMax)
T const * product() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const Point & position() const
position
void setVtxProb(double vtxProb)