53 produces<std::vector<Conversion> >();
69 iEvent.
getByLabel(
"offlineBeamSpot", bsHandle);
74 iEvent.
getByLabel(
"allConversions", hConversions);
76 std::vector<Conversion> * patConversions =
new std::vector<Conversion>();
78 for (reco::ConversionCollection::const_iterator
conv = hConversions->begin();
conv!= hConversions->end(); ++
conv) {
88 double vtxProb = TMath::Prob( vtx.
chi2(), vtx.
ndof());
90 double dbsx = vtx.
x() - beamspot.
position().x();
91 double dbsy = vtx.
y() - beamspot.
position().y();
92 double lxy = (mom.x()*dbsx + mom.y()*dbsy)/mom.rho();
95 for (std::vector<uint8_t>::const_iterator it =
conv->nHitsBeforeVtx().begin(); it!=
conv->nHitsBeforeVtx().end(); ++it) {
96 if ((*it) >
nHitsMax) nHitsMax = (*it);
101 anConversion.
setLxy( lxy );
104 patConversions->push_back(anConversion);
113 std::auto_ptr<std::vector<Conversion> > ptr(patConversions);
T getParameter(std::string const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
static HepMC::IO_HEPEVT conv
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
#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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double x() const
x coordinate
PATConversionProducer(const edm::ParameterSet &iConfig)
void setNHitsMax(int nHitsMax)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
T const * product() const
const Point & position() const
position
void setVtxProb(double vtxProb)