Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:59

0001 #ifndef CommonToolsParticleFlow_PDCandWithSuperCluster_H
0002 #define CommonToolsParticleFlow_PDCandWithSuperCluster_H
0003 
0004 #include <string>
0005 #include <vector>
0006 
0007 #include "FWCore/Framework/interface/ConsumesCollector.h"
0008 
0009 #include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
0010 #include "DataFormats/TrackReco/interface/Track.h"
0011 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0012 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0013 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0014 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0015 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0016 #include "DataFormats/TrackReco/interface/Track.h"
0017 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0018 #include "PhysicsTools/IsolationAlgos/interface/IsoDepositExtractor.h"
0019 
0020 class PFCandWithSuperClusterExtractor : public reco::isodeposit::IsoDepositExtractor {
0021 public:
0022   PFCandWithSuperClusterExtractor(){};
0023   PFCandWithSuperClusterExtractor(const edm::ParameterSet &par, edm::ConsumesCollector &&iC);
0024 
0025   ~PFCandWithSuperClusterExtractor() override {}
0026 
0027   void fillVetos(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &cand) override {}
0028 
0029   reco::IsoDeposit deposit(const edm::Event &ev,
0030                            const edm::EventSetup &evSetup,
0031                            const reco::Track &muon) const override {
0032     return depositFromObject(ev, evSetup, muon);
0033   }
0034 
0035   reco::IsoDeposit deposit(const edm::Event &ev,
0036                            const edm::EventSetup &evSetup,
0037                            const reco::Candidate &cand) const override {
0038     const reco::Photon *myPhoton = dynamic_cast<const reco::Photon *>(&cand);
0039     if (myPhoton)
0040       return depositFromObject(ev, evSetup, *myPhoton);
0041 
0042     const reco::GsfElectron *myElectron = dynamic_cast<const reco::GsfElectron *>(&cand);
0043     if (myElectron)
0044       return depositFromObject(ev, evSetup, *myElectron);
0045 
0046     const reco::PFCandidate *myPFCand = dynamic_cast<const reco::PFCandidate *>(&cand);
0047     return depositFromObject(ev, evSetup, *myPFCand);
0048   }
0049 
0050 private:
0051   reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const;
0052 
0053   reco::IsoDeposit depositFromObject(const edm::Event &ev,
0054                                      const edm::EventSetup &evSetup,
0055                                      const reco::Photon &cand) const;
0056 
0057   reco::IsoDeposit depositFromObject(const edm::Event &ev,
0058                                      const edm::EventSetup &evSetup,
0059                                      const reco::GsfElectron &cand) const;
0060 
0061   reco::IsoDeposit depositFromObject(const edm::Event &ev,
0062                                      const edm::EventSetup &evSetup,
0063                                      const reco::Track &cand) const;
0064 
0065   reco::IsoDeposit depositFromObject(const edm::Event &ev,
0066                                      const edm::EventSetup &evSetup,
0067                                      const reco::PFCandidate &cand) const;
0068 
0069   // Parameter set
0070   edm::EDGetTokenT<reco::PFCandidateCollection> thePFCandToken;  // Track Collection Label
0071   std::string theDepositLabel;                                   // name for deposit
0072   bool theVetoSuperClusterMatch;                                 //SuperClusterRef Check
0073   bool theMissHitVetoSuperClusterMatch;  // veto PF photons sharing SC with supercluster if misshits >0
0074   double theDiff_r;                      // transverse distance to vertex
0075   double theDiff_z;                      // z distance to vertex
0076   double theDR_Max;                      // Maximum cone angle for deposits
0077   double theDR_Veto;                     // Veto cone angle
0078 };
0079 
0080 #endif