Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:05

0001 #ifndef CommonTools_ParticleFlow_PFIsoDepositAlgo_
0002 #define CommonTools_ParticleFlow_PFIsoDepositAlgo_
0003 
0004 // system include files
0005 #include <memory>
0006 #include <string>
0007 
0008 // user include files
0009 #include "FWCore/Framework/interface/Frameworkfwd.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 
0012 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0013 
0014 //not a fwd declaration, to save the pain to the user to include the necessary DF header as well
0015 #include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
0016 
0017 /**\class PFIsoDepositAlgo 
0018 \brief Computes the iso deposits for a collection of PFCandidates. 
0019 
0020 \author Colin Bernet
0021 \date   february 2008
0022 */
0023 
0024 namespace pf2pat {
0025 
0026   class PFIsoDepositAlgo {
0027   public:
0028     // can be a template parameter (IsoDeposits from GenParticles? )
0029     typedef reco::PFCandidate Particle;
0030     typedef std::vector<Particle> ParticleCollection;
0031 
0032     // random access to the IsoDeposit corresponding to a given particle
0033     typedef std::vector<reco::IsoDeposit> IsoDeposits;
0034 
0035     explicit PFIsoDepositAlgo(const edm::ParameterSet&);
0036 
0037     ~PFIsoDepositAlgo();
0038 
0039     /// all the filtering is done before
0040     /// could gain in performance by having a single loop, and
0041     /// by producing all isodeposits at the same time?
0042     /// however, would not gain in ease of maintenance, and in flexibility.
0043     const IsoDeposits& produce(const ParticleCollection& toBeIsolated, const ParticleCollection& forIsolation);
0044 
0045   private:
0046     /// build the IsoDeposit for "particle"
0047     reco::IsoDeposit buildIsoDeposit(const Particle& particle, const ParticleCollection& forIsolation) const;
0048 
0049     /// checks if the 2 particles are in fact the same
0050     bool sameParticle(const Particle& particle1, const Particle& particle2) const;
0051 
0052     /// IsoDeposits computed in the produce function
0053     IsoDeposits isoDeposits_;
0054 
0055     bool verbose_;
0056   };
0057 }  // namespace pf2pat
0058 
0059 #endif