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>
200 for(
unsigned int pfccoll_ite=0; pfccoll_ite<pfccoll.size(); pfccoll_ite++){
202 pfcandref = pfccoll[pfccoll_ite].first;
203 int quality = pfccoll[pfccoll_ite].second;
205 if ( (quality<=2) && (quality!=-1) )
continue;
207 double man_pT = pfcandref->pt();
208 if(man_pT>0.) ptsum+=man_pT*man_pT;
212 vertexptsumvector.push_back(make_pair(assomap_vertexref,ptsum));
216 while (vertexptsumvector.size()!=0){
219 float highestpT = 0.;
220 int highestpT_index = 0;
222 for(
unsigned int vtxptsumvec_ite=0; vtxptsumvec_ite<vertexptsumvector.size(); vtxptsumvec_ite++){
224 if(vertexptsumvector[vtxptsumvec_ite].
second>highestpT){
226 vertexref_highestpT = vertexptsumvector[vtxptsumvec_ite].first;
227 highestpT = vertexptsumvector[vtxptsumvec_ite].second;
228 highestpT_index = vtxptsumvec_ite;
242 if(assomap_vertexref==vertexref_highestpT)
243 for(
unsigned int pfccoll_ite=0; pfccoll_ite<pfccoll.size(); pfccoll_ite++)
244 pfcvertexassOutput->insert(assomap_vertexref,pfccoll[pfccoll_ite]);
248 vertexptsumvector.erase(vertexptsumvector.begin()+highestpT_index);
252 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
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::vector< VertexPtsumPair > VertexPtsumVector
bool isNull() const
Checks for null.
std::auto_ptr< VertexToPFCandAssMap > CreateVertexToPFCandMap(edm::Handle< reco::PFCandidateCollection >, const edm::EventSetup &)
std::auto_ptr< PFCandToVertexAssMap > CreatePFCandToVertexMap(edm::Handle< reco::PFCandidateCollection >, const edm::EventSetup &)
std::auto_ptr< PFCandToVertexAssMap > SortPFCandAssociationMap(PFCandToVertexAssMap *)
virtual void GetInputCollections(edm::Event &, const edm::EventSetup &)
std::vector< PFCandQualityPair > PFCandQualityPairVector
edm::Handle< reco::BeamSpot > beamspotH
void setES(const edm::EventSetup &es)
void GetInputCollections(edm::Event &, const edm::EventSetup &)
edm::ESHandle< MagneticField > bFieldH
key_type key() const
Accessor for product key.
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_