Skip to content

Commit

Permalink
Adding Some consumes that I forgot before by looking at the Message L…
Browse files Browse the repository at this point in the history
…ogger
  • Loading branch information
bachtis committed Dec 10, 2013
1 parent 0abdcbe commit d383dcb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
20 changes: 8 additions & 12 deletions RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/MuonReco/interface/CaloMuon.h"
#include "DataFormats/MuonReco/interface/MuonCocktails.h"
#include "DataFormats/MuonReco/interface/MuonTime.h"
#include "DataFormats/MuonReco/interface/MuonTimeExtra.h"
Expand All @@ -38,9 +36,6 @@

#include <boost/regex.hpp>
#include "RecoMuon/MuonIdentification/plugins/MuonIdProducer.h"
#include "RecoMuon/MuonIdentification/interface/MuonIdTruthInfo.h"
#include "RecoMuon/MuonIdentification/interface/MuonArbitrationMethods.h"
#include "RecoMuon/MuonIdentification/interface/MuonMesh.h"

#include "PhysicsTools/IsolationAlgos/interface/IsoDepositExtractorFactory.h"
#include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
Expand All @@ -52,12 +47,8 @@
#include "DataFormats/MuonDetId/interface/CSCDetId.h"
#include "DataFormats/MuonDetId/interface/RPCDetId.h"

// RPC-Muon stuffs
#include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"
#include "DataFormats/MuonReco/interface/MuonRPCHitMatch.h"
#include "RecoMuon/MuonIdentification/interface/MuonMesh.h"

#include "DataFormats/Common/interface/ValueMap.h"

#include "RecoMuon/MuonIdentification/interface/MuonKinkFinder.h"

Expand Down Expand Up @@ -163,6 +154,11 @@ muIsoExtractorCalo_(0),muIsoExtractorTrack_(0),muIsoExtractorJet_(0)
meshAlgo_ = new MuonMesh(iConfig.getParameter<edm::ParameterSet>("arbitrationCleanerOptions"));


edm::InputTag rpcHitTag("rpcRecHits");
rpcHitToken_ = consumes<RPCRecHitCollection>(rpcHitTag);
glbQualToken_ = consumes<edm::ValueMap<reco::MuonQuality> >(globalTrackQualityInputTag_);


//Consumes... UGH
for ( unsigned int i = 0; i < inputCollectionLabels_.size(); ++i ) {
if ( inputCollectionTypes_[i] == "inner tracks" ) {
Expand Down Expand Up @@ -875,7 +871,7 @@ void MuonIdProducer::fillMuonId(edm::Event& iEvent, const edm::EventSetup& iSetu
if ( ! fillMatching_ && ! aMuon.isTrackerMuon() && ! aMuon.isRPCMuon() ) return;

edm::Handle<RPCRecHitCollection> rpcRecHits;
iEvent.getByLabel(edm::InputTag("rpcRecHits"), rpcRecHits);
iEvent.getByToken(rpcHitToken_, rpcRecHits);

// fill muon match info
std::vector<reco::MuonChamberMatch> muonChamberMatches;
Expand Down Expand Up @@ -1283,7 +1279,7 @@ double MuonIdProducer::phiOfMuonIneteractionRegion( const reco::Muon& muon ) con
void MuonIdProducer::fillGlbQuality(edm::Event& iEvent, const edm::EventSetup& iSetup, reco::Muon& aMuon)
{
edm::Handle<edm::ValueMap<reco::MuonQuality> > glbQualH;
iEvent.getByLabel(globalTrackQualityInputTag_, glbQualH);
iEvent.getByToken(glbQualToken_, glbQualH);

if(aMuon.isGlobalMuon() && glbQualH.isValid() && !glbQualH.failedToGet()) {
aMuon.setCombinedQuality((*glbQualH)[aMuon.combinedMuon()]);
Expand Down
17 changes: 17 additions & 0 deletions RecoMuon/MuonIdentification/plugins/MuonIdProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@
#include "RecoMuon/MuonIdentification/interface/MuonTimingFiller.h"
#include "RecoMuon/MuonIdentification/interface/MuonCaloCompatibility.h"
#include "PhysicsTools/IsolationAlgos/interface/IsoDepositExtractor.h"
// RPC-Muon stuffs

#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"
#include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
#include "DataFormats/MuonReco/interface/MuonRPCHitMatch.h"

#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/MuonReco/interface/CaloMuon.h"

#include "RecoMuon/MuonIdentification/interface/MuonIdTruthInfo.h"
#include "RecoMuon/MuonIdentification/interface/MuonArbitrationMethods.h"
#include "DataFormats/Common/interface/ValueMap.h"


class MuonMesh;
class MuonKinkFinder;
Expand Down Expand Up @@ -151,6 +164,10 @@ class MuonIdProducer : public edm::EDProducer {
edm::EDGetTokenT<reco::TrackToTrackMap> pickyCollectionToken_;
edm::EDGetTokenT<reco::TrackToTrackMap> dytCollectionToken_;

edm::EDGetTokenT<RPCRecHitCollection> rpcHitToken_;
edm::EDGetTokenT<edm::ValueMap<reco::MuonQuality> > glbQualToken_;



MuonCaloCompatibility muonCaloCompatibility_;
reco::isodeposit::IsoDepositExtractor* muIsoExtractorCalo_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

#include "FWCore/Framework/interface/ESHandle.h"

#include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
#include "DataFormats/RecoCandidate/interface/IsoDepositFwd.h"
#include "DataFormats/Common/interface/ValueMap.h"


#include "FWCore/Utilities/interface/Exception.h"
Expand Down Expand Up @@ -40,6 +37,9 @@ MuIsoDepositCopyProducer::MuIsoDepositCopyProducer(const ParameterSet& par) :
if (theDepositNames[i] != "") alias += "_" + theDepositNames[i];
produces<reco::IsoDepositMap>(theDepositNames[i]).setBranchAlias(alias);
}
for (unsigned int iDep = 0; iDep < theInputTags.size(); ++iDep)
theInputTokens.push_back(consumes<reco::IsoDepositMap>(theInputTags.at(iDep)));

}

//! destructor
Expand All @@ -56,9 +56,9 @@ void MuIsoDepositCopyProducer::produce(Event& event, const EventSetup& eventSetu

LogTrace(metname)<<" Taking the inputs: ";

for (unsigned int iDep = 0; iDep < theInputTags.size(); ++iDep){
for (unsigned int iDep = 0; iDep < theInputTokens.size(); ++iDep){
Handle<reco::IsoDepositMap > inDep;
event.getByLabel(theInputTags[iDep], inDep);
event.getByToken(theInputTokens[iDep], inDep);

std::auto_ptr<reco::IsoDepositMap> outDep(new reco::IsoDepositMap(*inDep));
event.put(outDep, theDepositNames[iDep]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
#include "DataFormats/RecoCandidate/interface/IsoDepositFwd.h"
#include "DataFormats/Common/interface/ValueMap.h"

#include "PhysicsTools/IsolationAlgos/interface/IsoDepositExtractor.h"
#include <string>
Expand All @@ -29,6 +32,7 @@ class MuIsoDepositCopyProducer : public edm::EDProducer {

//! for backward compatibility: take one input module and
std::vector<edm::InputTag> theInputTags;
std::vector<edm::EDGetTokenT<reco::IsoDepositMap> > theInputTokens;
std::vector<std::string> theDepositNames;

};
Expand Down

0 comments on commit d383dcb

Please sign in to comment.