diff --git a/AnalysisDataFormats/EWK/interface/WMuNuCandidate.h b/AnalysisDataFormats/EWK/interface/WMuNuCandidate.h deleted file mode 100644 index c9b18a91073d3..0000000000000 --- a/AnalysisDataFormats/EWK/interface/WMuNuCandidate.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef AnalysisDataFormats_EWK_WMuNu_h -#define AnalysisDataFormats_EWK_WMuNu_h - -#include -#include - -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/METReco/interface/MET.h" -#include "DataFormats/METReco/interface/METFwd.h" -#include "DataFormats/Candidate/interface/CompositeCandidate.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" -#include "DataFormats/Candidate/interface/ShallowClonePtrCandidate.h" -namespace reco { - - class WMuNuCandidate : public reco::CompositeCandidate { - public: - WMuNuCandidate(); - WMuNuCandidate(edm::Ptr, edm::Ptr); - ~WMuNuCandidate() override; - - //WARNING: W Candidates combine the information from a Muon with the (px,py) information of the MET as the Neutrino - // --> There is no Pz information!!!! - // Be very careful when using the default Candidate functions (.mass, .mt, .et, etc). They may not be what you are looking for :-). - - // Example: Candidates have a mt() function which computes the tranverse mass from E & pz. - // As MET does not have pz information... WMuNuCandidates have an alternative function used in the WMuNu Inclusive Analysis - // to compute mt just from px, py: - // Transverse Mass from px, py: - double massT() const; - // Transverse Energy from px, py: - double eT() const; - - // Acoplanarity between the muon and the MET - double acop() const; - - const reco::Muon& getMuon() const { return *muon_; }; - const reco::MET& getNeutrino() const { return *neutrino_; }; - - private: - edm::Ptr muon_; - edm::Ptr neutrino_; - }; - - typedef std::vector WMuNuCandidateCollection; -} // namespace reco - -#endif diff --git a/AnalysisDataFormats/EWK/interface/WMuNuCandidatePtr.h b/AnalysisDataFormats/EWK/interface/WMuNuCandidatePtr.h deleted file mode 100644 index c70cf5cc8d41e..0000000000000 --- a/AnalysisDataFormats/EWK/interface/WMuNuCandidatePtr.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef AnalysisDataFormat_EWK_WMuNuCandidatePtr_h -#define AnalysisDataFormat_EWK_WMuNuCandidatePtr_h - -#include -#include - -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/METReco/interface/MET.h" -#include "DataFormats/METReco/interface/METFwd.h" -#include "DataFormats/Candidate/interface/CompositePtrCandidate.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" -#include "DataFormats/Candidate/interface/ShallowClonePtrCandidate.h" -namespace reco { - - class WMuNuCandidatePtr : public reco::CompositePtrCandidate { - public: - WMuNuCandidatePtr(); - WMuNuCandidatePtr(const reco::CandidatePtr, const reco::CandidatePtr); - ~WMuNuCandidatePtr() override; - - //WARNING: W Candidates combine the information from a Muon with the (px,py) information of the MET as the Neutrino - // --> There is no Pz information!!!! - // Be very careful when using the default Candidate functions (.mass, .mt, .et, etc). They may not be what you are looking for :-). - - // Example: Candidates have a mt() function which computes the tranverse mass from E & pz. - // As MET does not have pz information... WMuNuCandidatePtrs have an alternative function used in the WMuNu Inclusive Analysis - // to compute mt just from px, py: - // Transverse Mass from px, py: - double massT() const; - // Transverse Energy from px, py: - double eT() const; - - // Acoplanarity between the muon and the MET - double acop() const; - - const reco::Muon& getMuon() const { return *muon_; }; - const reco::MET& getNeutrino() const { return *neutrino_; }; - - private: - edm::Ptr muon_; - edm::Ptr neutrino_; - }; - - typedef std::vector WMuNuCandidatePtrCollection; -} // namespace reco - -#endif diff --git a/AnalysisDataFormats/EWK/src/WMuNuCandidate.cc b/AnalysisDataFormats/EWK/src/WMuNuCandidate.cc deleted file mode 100644 index 2c0e21173be3f..0000000000000 --- a/AnalysisDataFormats/EWK/src/WMuNuCandidate.cc +++ /dev/null @@ -1,50 +0,0 @@ -#include "AnalysisDataFormats/EWK/interface/WMuNuCandidate.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "CommonTools/CandUtils/interface/CandCombiner.h" -#include "CommonTools/CandUtils/interface/AddFourMomenta.h" - -using namespace edm; -using namespace std; -using namespace reco; - -WMuNuCandidate::WMuNuCandidate() {} - -WMuNuCandidate::WMuNuCandidate(edm::Ptr muon, edm::Ptr met) : muon_(muon), neutrino_(met) { - addDaughter(*muon, "Muon"); - addDaughter(*met, "Met"); - AddFourMomenta addP4; - addP4.set(*this); - - //WARNING: W Candidates combine the information from a Muon with the (px,py) information of the MET as the Neutrino - // --> There is no Pz information!!!! - // Be very careful when using the default Candidate functions (.mass, .mt, .et, etc). They may not be what you are looking for :-). -} - -WMuNuCandidate::~WMuNuCandidate() {} - -double WMuNuCandidate::eT() const { - double e_t = 0; - e_t = muon_->pt() + neutrino_->pt(); - return e_t; -} - -double WMuNuCandidate::massT() const { - // Candidates have a mt() function which computes the tranverse mass from E & pz. - // As MET does not have pz information... WMuNuCandidates have an alternative function to compute the mt quantity - // used in the WMuNu Inclusive analysis just from px, py - double wpx = px(); - double wpy = py(); - double mt = eT() * eT() - wpx * wpx - wpy * wpy; - mt = (mt > 0) ? sqrt(mt) : 0; - return mt; -} - -double WMuNuCandidate::acop() const { - // Acoplanarity between the muon and the MET - Geom::Phi deltaphi(daughter(0)->phi() - daughter(1)->phi()); - double acop = deltaphi.value(); - if (acop < 0) - acop = -acop; - acop = M_PI - acop; - return acop; -} diff --git a/AnalysisDataFormats/EWK/src/WMuNuCandidatePtr.cc b/AnalysisDataFormats/EWK/src/WMuNuCandidatePtr.cc deleted file mode 100644 index a277ec81ce98a..0000000000000 --- a/AnalysisDataFormats/EWK/src/WMuNuCandidatePtr.cc +++ /dev/null @@ -1,51 +0,0 @@ -#include "AnalysisDataFormats/EWK/interface/WMuNuCandidatePtr.h" -#include "CommonTools/CandUtils/interface/CandCombiner.h" -#include "CommonTools/CandUtils/interface/AddFourMomenta.h" -#include "DataFormats/TrackReco/interface/Track.h" - -using namespace edm; -using namespace std; -using namespace reco; - -WMuNuCandidatePtr::WMuNuCandidatePtr() {} - -WMuNuCandidatePtr::WMuNuCandidatePtr(const reco::CandidatePtr muon, const reco::CandidatePtr met) - : muon_(muon), neutrino_(met) { - addDaughter(muon_); - addDaughter(neutrino_); - AddFourMomenta addP4; - addP4.set(*this); - cout << "WCandidatePtr Created Wpx=" << muon_->px() << " + " << neutrino_->px() << " ?= " << this->px() << endl; - //WARNING: W CandidatePtrs combine the information from a Muon with the (px,py) information of the MET as the Neutrino - // --> There is no Pz information!!!! - // Be very careful when using the default CandidatePtr functions (.mass, .mt, .et, etc). They may not be what you are looking for :-). -} - -WMuNuCandidatePtr::~WMuNuCandidatePtr() {} - -double WMuNuCandidatePtr::eT() const { - double e_t = 0; - e_t = muon_->pt() + neutrino_->pt(); - return e_t; -} - -double WMuNuCandidatePtr::massT() const { - // CandidatePtrs have a mt() function which computes the tranverse mass from E & pz. - // As MET does not have pz information... WMuNuCandidatePtrs have an alternative function to compute the mt quantity - // used in the WMuNu Inclusive analysis just from px, py - double wpx = muon_->px() + neutrino_->px(); - double wpy = muon_->py() + neutrino_->py(); - double mt = eT() * eT() - wpx * wpx - wpy * wpy; - mt = (mt > 0) ? sqrt(mt) : 0; - return mt; -} - -double WMuNuCandidatePtr::acop() const { - // Acoplanarity between the muon and the MET - Geom::Phi deltaphi(muon_->phi() - neutrino_->phi()); - double acop = deltaphi.value(); - if (acop < 0) - acop = -acop; - acop = M_PI - acop; - return acop; -} diff --git a/AnalysisDataFormats/EWK/src/classes.h b/AnalysisDataFormats/EWK/src/classes.h index fefaa2f0b8a16..43ab4f53cb4d4 100644 --- a/AnalysisDataFormats/EWK/src/classes.h +++ b/AnalysisDataFormats/EWK/src/classes.h @@ -3,8 +3,6 @@ #include "DataFormats/Common/interface/AssociationMap.h" #include "DataFormats/Common/interface/Association.h" #include "DataFormats/Candidate/interface/CompositeCandidate.h" -#include "AnalysisDataFormats/EWK/interface/WMuNuCandidatePtr.h" -#include "AnalysisDataFormats/EWK/interface/WMuNuCandidate.h" #include "DataFormats/Candidate/interface/ShallowCloneCandidate.h" #include "DataFormats/Candidate/interface/ShallowClonePtrCandidate.h" #include "DataFormats/Candidate/interface/NamedCompositeCandidate.h" diff --git a/AnalysisDataFormats/EWK/src/classes_def.xml b/AnalysisDataFormats/EWK/src/classes_def.xml deleted file mode 100644 index 7c677c8f8086d..0000000000000 --- a/AnalysisDataFormats/EWK/src/classes_def.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CommonTools/RecoAlgos/plugins/CaloRecHitCandidateProducer.cc b/CommonTools/RecoAlgos/plugins/CaloRecHitCandidateProducer.cc index 2ffd9274ac5bc..b8948dfc2f05b 100644 --- a/CommonTools/RecoAlgos/plugins/CaloRecHitCandidateProducer.cc +++ b/CommonTools/RecoAlgos/plugins/CaloRecHitCandidateProducer.cc @@ -49,7 +49,7 @@ namespace reco { math::RhoEtaPhiVector p(1, eta, phi); p *= (energy / p.r()); CaloRecHitCandidate *c = new CaloRecHitCandidate(Candidate::LorentzVector(p.x(), p.y(), p.z(), energy)); - c->setCaloRecHit(RefToBase(Ref(hits, idx))); + c->setCaloRecHit(Ptr(hits, idx)); cands->push_back(c); } evt.put(std::move(cands)); diff --git a/DataFormats/CaloRecHit/src/classes_def.xml b/DataFormats/CaloRecHit/src/classes_def.xml index 4fa609e193186..fa250a91eb62d 100644 --- a/DataFormats/CaloRecHit/src/classes_def.xml +++ b/DataFormats/CaloRecHit/src/classes_def.xml @@ -11,7 +11,7 @@ - + diff --git a/DataFormats/RecoCandidate/interface/CaloRecHitCandidate.h b/DataFormats/RecoCandidate/interface/CaloRecHitCandidate.h index 6b92962a7e5fc..362519f0103f3 100644 --- a/DataFormats/RecoCandidate/interface/CaloRecHitCandidate.h +++ b/DataFormats/RecoCandidate/interface/CaloRecHitCandidate.h @@ -10,13 +10,13 @@ */ #include "DataFormats/RecoCandidate/interface/RecoCandidate.h" #include "DataFormats/CaloRecHit/interface/CaloRecHit.h" -#include "DataFormats/Common/interface/RefToBase.h" +#include "DataFormats/Common/interface/Ptr.h" namespace reco { class CaloRecHitCandidate : public LeafCandidate { public: - typedef edm::RefToBase CaloRecHitRef; + typedef edm::Ptr CaloRecHitRef; /// default constructor CaloRecHitCandidate() : LeafCandidate() {} /// constructor from values @@ -41,7 +41,7 @@ namespace reco { CaloRecHitRef caloRecHit_; }; /// get default Track component - GET_DEFAULT_CANDIDATE_COMPONENT(CaloRecHitCandidate, edm::RefToBase, caloRecHit); + GET_DEFAULT_CANDIDATE_COMPONENT(CaloRecHitCandidate, edm::Ptr, caloRecHit); } // namespace reco diff --git a/DataFormats/RecoCandidate/src/classes_def.xml b/DataFormats/RecoCandidate/src/classes_def.xml index 9c04472e5ccfb..4583ab537c2ad 100644 --- a/DataFormats/RecoCandidate/src/classes_def.xml +++ b/DataFormats/RecoCandidate/src/classes_def.xml @@ -25,7 +25,8 @@ - + + @@ -113,7 +114,6 @@ -