49 std::auto_ptr<PFCandToVertexAssMap>
58 for(
unsigned i=0;
i<pfCandH->size();
i++ ) {
66 TrackRef PFCtrackref = candref->trackRef();
68 if ( PFCtrackref.
isNull() ){
75 pfcand2vertex->insert( vtxColl_help->at(0), make_pair(candref, quality) );
85 transtrk.
setES(iSetup);
90 int step = assocVtx.second;
96 pfcand2vertex->insert( assocVtx.first, make_pair(candref, quality) );
107 return pfcand2vertex;
115 std::auto_ptr<VertexToPFCandAssMap>
121 int num_vertices =
vtxcollH->size();
124 for(
unsigned i=0;
i<pfCandH->size();
i++ ) {
132 TrackRef PFCtrackref = candref->trackRef();
134 if ( PFCtrackref.
isNull() ){
141 vertex2pfcand->insert( candref, make_pair(vtxColl_help->at(0),
quality) );
151 transtrk.
setES(iSetup);
156 int step = assocVtx.second;
162 vertex2pfcand->insert( candref, make_pair(assocVtx.first, quality) );
173 return vertex2pfcand;
180 std::auto_ptr<PFCandToVertexAssMap>
201 for(
unsigned int pfccoll_ite=0; pfccoll_ite<pfccoll.size(); pfccoll_ite++){
203 pfcandref = pfccoll[pfccoll_ite].first;
204 int quality = pfccoll[pfccoll_ite].second;
206 if ( (quality<=2) && (quality!=-1) )
continue;
208 double man_pT = pfcandref->pt();
209 if(man_pT>0.) ptsum+=man_pT*man_pT;
213 vertexptsumvector.push_back(make_pair(assomap_vertexref,ptsum));
217 while (vertexptsumvector.size()!=0){
220 float highestpT = 0.;
221 int highestpT_index = 0;
223 for(
unsigned int vtxptsumvec_ite=0; vtxptsumvec_ite<vertexptsumvector.size(); vtxptsumvec_ite++){
225 if(vertexptsumvector[vtxptsumvec_ite].
second>highestpT){
227 vertexref_highestpT = vertexptsumvector[vtxptsumvec_ite].first;
228 highestpT = vertexptsumvector[vtxptsumvec_ite].second;
229 highestpT_index = vtxptsumvec_ite;
243 if(assomap_vertexref==vertexref_highestpT)
244 for(
unsigned int pfccoll_ite=0; pfccoll_ite<pfccoll.size(); pfccoll_ite++)
245 pfcvertexassOutput->insert(assomap_vertexref,pfccoll[pfccoll_ite]);
249 vertexptsumvector.erase(vertexptsumvector.begin()+highestpT_index);
253 return pfcvertexassOutput;
VertexStepPair FindAssociation(const reco::TrackRef &, std::vector< reco::VertexRef > *, edm::ESHandle< MagneticField >, const edm::EventSetup &, edm::Handle< reco::BeamSpot >, int)
T getParameter(std::string const &) const
int input_MaxNumAssociations_
const_iterator end() const
last iterator over the map (read only)
void setBeamSpot(const reco::BeamSpot &beamSpot)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::AssociationMap< edm::OneToManyWithQuality< reco::PFCandidateCollection, reco::VertexCollection, int > > VertexToPFCandAssMap
int DefineQuality(int, int, double)
std::pair< reco::VertexRef, PFCandQualityPair > VertexPfcQuality
void EraseVertex(std::vector< reco::VertexRef > *, reco::VertexRef)
std::vector< Vertex > VertexCollection
collection of Vertex objects
key_type key() const
Accessor for product key.
edm::AssociationMap< edm::OneToManyWithQuality< reco::VertexCollection, reco::PFCandidateCollection, int > > PFCandToVertexAssMap
std::pair< reco::VertexRef, int > VertexStepPair
U second(std::pair< T, U > const &p)
std::auto_ptr< PFCandToVertexAssMap > SortPFCandAssociationMap(PFCandToVertexAssMap *, edm::EDProductGetter const *getter)
std::vector< VertexPtsumPair > VertexPtsumVector
std::auto_ptr< VertexToPFCandAssMap > CreateVertexToPFCandMap(edm::Handle< reco::PFCandidateCollection >, const edm::EventSetup &)
std::auto_ptr< PFCandToVertexAssMap > CreatePFCandToVertexMap(edm::Handle< reco::PFCandidateCollection >, const edm::EventSetup &)
virtual void GetInputCollections(edm::Event &, const edm::EventSetup &)
std::vector< PFCandQualityPair > PFCandQualityPairVector
edm::Handle< reco::BeamSpot > beamspotH
bool isNull() const
Checks for null.
void setES(const edm::EventSetup &es)
void GetInputCollections(edm::Event &, const edm::EventSetup &)
edm::ESHandle< MagneticField > bFieldH
std::vector< reco::VertexRef > * CreateVertexVector(edm::Handle< reco::VertexCollection >)
edm::EDGetTokenT< reco::VertexCollection > token_VertexCollection_
edm::Handle< reco::VertexCollection > vtxcollH
PFCand_AssoMapAlgos(const edm::ParameterSet &, edm::ConsumesCollector &&)
const_iterator begin() const
first iterator over the map (read only)
edm::EDGetTokenT< reco::BeamSpot > token_BeamSpot_