CMS 3D CMS Logo

Public Member Functions | Private Attributes

metsig::SignPFSpecificAlgo Class Reference

#include <SignPFSpecificAlgo.h>

List of all members.

Public Member Functions

void addPFCandidate (reco::PFCandidatePtr pf)
void addPFJets (edm::Handle< edm::View< reco::PFJet > > PFJets)
TMatrixD getSignifMatrix () const
void setResolutions (metsig::SignAlgoResolutions *resolutions)
 SignPFSpecificAlgo ()
void useOriginalPtrs (const edm::ProductID &productID)
 ~SignPFSpecificAlgo ()

Private Attributes

metsig::significanceAlgo algo_
std::set< reco::CandidatePtrclusteredParticlePtrs_
metsig::SignAlgoResolutionsresolutions_

Detailed Description

Definition at line 17 of file SignPFSpecificAlgo.h.


Constructor & Destructor Documentation

metsig::SignPFSpecificAlgo::SignPFSpecificAlgo ( )

Definition at line 10 of file SignPFSpecificAlgo.cc.

References clusteredParticlePtrs_.

metsig::SignPFSpecificAlgo::~SignPFSpecificAlgo ( )

Definition at line 15 of file SignPFSpecificAlgo.cc.

{}

Member Function Documentation

void metsig::SignPFSpecificAlgo::addPFCandidate ( reco::PFCandidatePtr  pf)

Definition at line 57 of file SignPFSpecificAlgo.cc.

                                                             {
    if(clusteredParticlePtrs_.find(pf) != clusteredParticlePtrs_.end()) {
        return; //pf candidate already added in jet collection
    }
    std::vector<metsig::SigInputObj> vobj;
    vobj.push_back(resolutions_->evalPF(&(*pf)));
    algo_.addObjects(vobj);
}
void metsig::SignPFSpecificAlgo::addPFJets ( edm::Handle< edm::View< reco::PFJet > >  PFJets)

Definition at line 24 of file SignPFSpecificAlgo.cc.

References metsig::jet.

                                                                        {
    std::vector<metsig::SigInputObj> vobj;
    for(edm::View<reco::PFJet>::const_iterator jet = PFJets->begin(); jet != PFJets->end(); ++jet){
        vobj.push_back(resolutions_->evalPFJet(&(*jet)));
        std::vector<reco::PFCandidatePtr> pfs = jet->getPFConstituents();
        for(std::vector<reco::PFCandidatePtr>::const_iterator it=pfs.begin(); it!=pfs.end(); ++it){
            reco::CandidatePtr ptr(*it);
            clusteredParticlePtrs_.insert(ptr);
        }
    }
    algo_.addObjects(vobj);
}
TMatrixD metsig::SignPFSpecificAlgo::getSignifMatrix ( ) const [inline]

Definition at line 28 of file SignPFSpecificAlgo.h.

References algo_, and metsig::significanceAlgo::getSignifMatrix().

{return algo_.getSignifMatrix();}
void metsig::SignPFSpecificAlgo::setResolutions ( metsig::SignAlgoResolutions resolutions)

Definition at line 18 of file SignPFSpecificAlgo.cc.

                                                                                {
  resolutions_ = resolutions;
}
void metsig::SignPFSpecificAlgo::useOriginalPtrs ( const edm::ProductID productID)

Definition at line 38 of file SignPFSpecificAlgo.cc.

References edm::Ptr< T >::id(), edm::Ptr< T >::isNull(), and cond::rpcobtemp::temp.

                                                                      {
    std::set<reco::CandidatePtr>::const_iterator it=clusteredParticlePtrs_.begin();
    reco::CandidatePtr ptr(*it);
    if(ptr.id()==productID) return; //If the first element is from the right product, return

    std::set<reco::CandidatePtr> temp;
    for(; it!=clusteredParticlePtrs_.end(); ++it){
        reco::CandidatePtr ptr(*it);
        while(ptr.id()!=productID){
            ptr = ptr->sourceCandidatePtr(0);
            if(ptr.isNull()) return; //if it does not get to the correct product, return
        }
        temp.insert(ptr);
    }
    clusteredParticlePtrs_.clear();
    clusteredParticlePtrs_ = temp;
}

Member Data Documentation

Definition at line 34 of file SignPFSpecificAlgo.h.

Referenced by getSignifMatrix().

Definition at line 33 of file SignPFSpecificAlgo.h.

Referenced by SignPFSpecificAlgo().

Definition at line 32 of file SignPFSpecificAlgo.h.