47 electronToken_(consumes<
edm::
View<
reco::GsfElectron> >(iConfig.getParameter<
edm::InputTag>(
"electronSource" ))),
51 produces<std::vector<Conversion> >();
73 std::vector<Conversion> * patConversions =
new std::vector<Conversion>();
75 for (reco::ConversionCollection::const_iterator
conv = hConversions->begin();
conv!= hConversions->end(); ++
conv) {
85 double vtxProb = TMath::Prob( vtx.
chi2(), vtx.
ndof());
87 double dbsx = vtx.
x() - beamspot.
position().x();
88 double dbsy = vtx.
y() - beamspot.
position().y();
89 double lxy = (mom.x()*dbsx + mom.y()*dbsy)/mom.rho();
92 for (std::vector<uint8_t>::const_iterator it =
conv->nHitsBeforeVtx().begin(); it!=
conv->nHitsBeforeVtx().end(); ++it) {
93 if ((*it) > nHitsMax) nHitsMax = (*it);
98 anConversion.
setLxy( lxy );
101 patConversions->push_back(anConversion);
110 std::unique_ptr<std::vector<Conversion> > ptr(patConversions);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< reco::ConversionCollection > conversionsToken_
static HepMC::IO_HEPEVT conv
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double y() const
y coordinate
const edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronToken_
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
#define DEFINE_FWK_MODULE(type)
double chi2() const
chi-squares
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
std::vector< Conversion > ConversionCollection
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)
~PATConversionProducer() override