48 : src_(consumes<std::vector<T1> >(iConfig.getParameter<edm::
InputTag>(
"src")))
50 produces<std::vector<T1> >();
66 std::auto_ptr<std::vector<T1> > theBestPV(
new std::vector<T1 >);
71 if( VertexHandle->size() == 0 )
73 iEvent.
put(theBestPV);
77 typename std::vector<T1>::const_iterator PVit ;
78 typename std::vector<T1>::const_iterator bestPV ;
81 double sumSquarePt = 0 ;
83 for (PVit = VertexHandle->begin(); PVit != VertexHandle->end(); ++PVit) {
84 sumSquarePt = (PVit ->
p4().pt())*(PVit ->
p4().pt()) ;
85 if( sumSquarePt > bestP4 ){
86 bestP4 = sumSquarePt ;
91 theBestPV->push_back( *bestPV );
92 iEvent.
put(theBestPV);
bestPVselector< reco::Vertex > HighestSumP4PrimaryVertexSelector
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bestPVselector(const edm::ParameterSet &iConfig)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
virtual ~bestPVselector()
edm::EDGetTokenT< std::vector< T1 > > src_