CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

PF_PU_AssoMap Class Reference

#include <CommonTools/RecoUtils/plugins/PFCand_NoPU_WithAM.cc>

Inheritance diagram for PF_PU_AssoMap:
edm::EDProducer PF_PU_AssoMapAlgos edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 PF_PU_AssoMap (const edm::ParameterSet &)
 ~PF_PU_AssoMap ()

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)

Private Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

edm::InputTag input_TrackCollection_

Detailed Description

Description: Produces a map with association between tracks and their particular most probable vertex with a quality of this association

Description: Produces a collection of PFCandidates associated to the first vertex based on the association map

Description: Algorithms for the producer a collection of PFCandidates associated to the first vertex based on the association map

Definition at line 27 of file PF_PU_AssoMap.h.


Constructor & Destructor Documentation

PF_PU_AssoMap::PF_PU_AssoMap ( const edm::ParameterSet iConfig) [explicit]

Definition at line 84 of file PF_PU_AssoMap.cc.

References edm::ParameterSet::getParameter(), and input_TrackCollection_.

                                                          :PF_PU_AssoMapAlgos(iConfig)
{ 
   //register your products

        produces<TrackVertexAssMap>();

   //now do what ever other initialization is needed

        input_TrackCollection_ = iConfig.getParameter<InputTag>("TrackCollection");
  
}
PF_PU_AssoMap::~PF_PU_AssoMap ( )

Definition at line 97 of file PF_PU_AssoMap.cc.

{
// nothing to be done yet...
}

Member Function Documentation

void PF_PU_AssoMap::fillDescriptions ( edm::ConfigurationDescriptions descriptions) [static]

Reimplemented from edm::EDProducer.

Definition at line 148 of file PF_PU_AssoMap.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

{
  // The following says we do not know what parameters are allowed so do no validation.
  // Please change this to state exactly what you do use, even if it is no parameters
  edm::ParameterSetDescription desc;
  desc.setUnknown();
  descriptions.addDefault(desc);
}
void PF_PU_AssoMap::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 108 of file PF_PU_AssoMap.cc.

References PF_PU_AssoMapAlgos::DoTrackAssociation(), edm::Event::getByLabel(), PF_PU_AssoMapAlgos::GetInputCollections(), input_TrackCollection_, edm::Event::put(), and PF_PU_AssoMapAlgos::SortAssociationMap().

{

        //std::cout << "<PF_PU_AssoMap::produce>:" << std::endl;

        auto_ptr<TrackVertexAssMap> trackvertexass(new TrackVertexAssMap());
    
        //get the input track collection     
        Handle<TrackCollection> trkcollH;
        iEvent.getByLabel(input_TrackCollection_, trkcollH);

        if ( !PF_PU_AssoMapAlgos::GetInputCollections(iEvent,iSetup) ){

          iEvent.put( trackvertexass );
          return;

        }
            
        //loop over all tracks of the track collection  
        for ( size_t idxTrack = 0; idxTrack < trkcollH->size(); ++idxTrack ) {

          TrackRef trackref = TrackRef(trkcollH, idxTrack);

          VertexTrackQuality VtxTrkQual_tmp = PF_PU_AssoMapAlgos::DoTrackAssociation(trackref, iSetup);

          //std::cout << "associating track: Pt = " << VtxTrkQual_tmp.second.first->pt() << "," 
          //            << " eta = " << VtxTrkQual_tmp.second.first->eta() << ", phi = " << VtxTrkQual_tmp.second.first->phi() 
          //            << " to vertex: z = " << VtxTrkQual_tmp.first->position().z() << " with quality q = " << VtxTrkQual_tmp.second.second << std::endl;
    
          // Insert the best vertex and the pair of track and the quality of this association in the map
          trackvertexass->insert(VtxTrkQual_tmp.first, VtxTrkQual_tmp.second);

        }

        iEvent.put( PF_PU_AssoMapAlgos::SortAssociationMap( &(*trackvertexass) ) );
        
}

Member Data Documentation

Definition at line 39 of file PF_PU_AssoMap.h.

Referenced by PF_PU_AssoMap(), and produce().