24 : srcSelectedMuons_(cfg.getParameter<edm::
InputTag>(
"selectedMuons")),
25 srcPFCandidates_(cfg.getParameter<edm::
InputTag>(
"pfCandidates")),
26 dRmatch_(cfg.getParameter<double>(
"dRmatch"))
29 produces<detIdToFloatMap>(
"energyDepositsMuPlus");
30 produces<detIdToFloatMap>(
"energyDepositsMuMinus");
38 std::auto_ptr<detIdToFloatMap> energyDepositMuPlus(
new detIdToFloatMap());
39 std::auto_ptr<detIdToFloatMap> energyDepositMuMinus(
new detIdToFloatMap());
52 evt.
put(energyDepositMuPlus,
"energyDepositsMuPlus");
53 evt.
put(energyDepositMuMinus,
"energyDepositsMuMinus");
80 pfCandidate != pfCandidates.
end(); ++pfCandidate ) {
82 double dR =
deltaR(pfCandidate->p4(), muon->
p4());
88 for ( reco::PFCandidate::ElementsInBlocks::const_iterator pfBlock = pfBlocks.begin();
89 pfBlock != pfBlocks.end(); ++pfBlock ) {
92 pfBlockElement != pfBlockElements.
end(); ++pfBlockElement ) {
93 if ( pfBlockElement->clusterRef().isNonnull() ) {
95 const std::vector<reco::PFRecHitFraction>& pfRecHitFractions = pfCluster->recHitFractions();
96 for ( std::vector<reco::PFRecHitFraction>::const_iterator pfRecHitFraction = pfRecHitFractions.begin();
97 pfRecHitFraction != pfRecHitFractions.end(); ++pfRecHitFraction ) {
99 energyDepositMap[pfRecHit->detId()] += pfRecHitFraction->fraction();
110 <<
"Failed to match Muon to PFCandidate: Pt = " << muon->
pt() <<
", eta = " << muon->
eta() <<
", phi = " << muon->
phi() <<
" !!" << std::endl;
114 pfCandidate != pfCandidates.
end(); ++pfCandidate ) {
115 std::cout <<
"PFCandidate #" << idx <<
" (" << getPFCandidateType(pfCandidate->particleId()) <<
"):"
116 <<
" Pt = " << pfCandidate->pt() <<
", eta = " << pfCandidate->eta() <<
", phi = " << pfCandidate->phi() << std::endl;
T getParameter(std::string const &) const
reco::CandidateBaseRef getTheMuMinus(const std::vector< reco::CandidateBaseRef > &)
ParticleType
particle types
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void fillEnergyDepositMap(const reco::Muon *, const edm::View< reco::PFCandidate > &, detIdToFloatMap &)
bool isNonnull() const
Checks for non-null.
edm::InputTag srcPFCandidates_
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
std::vector< ElementInBlock > ElementsInBlocks
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
const_iterator begin() const
virtual void produce(edm::Event &, const edm::EventSetup &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool isMatched(TrackingRecHit const &hit)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double deltaR(double eta1, double eta2, double phi1, double phi2)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
PFMuonCaloCleaner(const edm::ParameterSet &)
std::map< uint32_t, float > detIdToFloatMap
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const_iterator end() const
std::vector< reco::CandidateBaseRef > getSelMuons(const edm::Event &, const edm::InputTag &)
reco::CandidateBaseRef getTheMuPlus(const std::vector< reco::CandidateBaseRef > &)
virtual double phi() const
momentum azimuthal angle
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
edm::InputTag srcSelectedMuons_