#include <L2MuonIsolationProducer.h>
Public Member Functions | |
virtual void | beginJob () |
setup the job | |
L2MuonIsolationProducer (const edm::ParameterSet &) | |
constructor with config | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Produce isolation maps. | |
virtual | ~L2MuonIsolationProducer () |
destructor | |
Private Attributes | |
bool | optOutputDecision |
muonisolation::MuIsoBaseIsolator * | theDepositIsolator |
reco::isodeposit::IsoDepositExtractor * | theExtractor |
edm::InputTag | theSACollectionLabel |
L2 HLT muon isolation producer
Definition at line 19 of file L2MuonIsolationProducer.h.
L2MuonIsolationProducer::L2MuonIsolationProducer | ( | const edm::ParameterSet & | par | ) |
constructor with config
Definition at line 34 of file L2MuonIsolationProducer.cc.
References edm::ParameterSet::empty(), reco::get(), edm::ParameterSet::getParameter(), LogDebug, optOutputDecision, theDepositIsolator, and theExtractor.
: theSACollectionLabel(par.getParameter<edm::InputTag>("StandAloneCollectionLabel")), theExtractor(0), theDepositIsolator(0) { LogDebug("Muon|RecoMuon|L2MuonIsolationProducer")<<" L2MuonIsolationProducer constructor called"; // // Extractor // edm::ParameterSet extractorPSet = par.getParameter<edm::ParameterSet>("ExtractorPSet"); std::string extractorName = extractorPSet.getParameter<std::string>("ComponentName"); theExtractor = IsoDepositExtractorFactory::get()->create( extractorName, extractorPSet); edm::ParameterSet isolatorPSet = par.getParameter<edm::ParameterSet>("IsolatorPSet"); optOutputDecision = !isolatorPSet.empty(); if (optOutputDecision){ std::string type = isolatorPSet.getParameter<std::string>("ComponentName"); theDepositIsolator = MuonIsolatorFactory::get()->create(type,isolatorPSet); } if (optOutputDecision) produces<edm::ValueMap<bool> >(); produces<reco::IsoDepositMap>(); }
L2MuonIsolationProducer::~L2MuonIsolationProducer | ( | ) | [virtual] |
destructor
Definition at line 61 of file L2MuonIsolationProducer.cc.
References LogDebug, and theExtractor.
{ LogDebug("Muon|RecoMuon|L2MuonIsolationProducer")<<" L2MuonIsolationProducer destructor called"; if (theExtractor) delete theExtractor; }
void L2MuonIsolationProducer::beginJob | ( | void | ) | [virtual] |
setup the job
beginJob
Reimplemented from edm::EDProducer.
Definition at line 67 of file L2MuonIsolationProducer.cc.
{ }
void L2MuonIsolationProducer::produce | ( | edm::Event & | event, |
const edm::EventSetup & | eventSetup | ||
) | [virtual] |
Produce isolation maps.
build deposits
do the business of filling iso map
annoying -- I will forget it at some point
Implements edm::EDProducer.
Definition at line 72 of file L2MuonIsolationProducer.cc.
References reco::isodeposit::IsoDepositExtractor::deposit(), edm::helper::Filler< Map >::fill(), reco::isodeposit::IsoDepositExtractor::fillVetos(), i, edm::helper::Filler< Map >::insert(), LogDebug, metname, optOutputDecision, muonisolation::MuIsoBaseIsolator::result(), theDepositIsolator, theExtractor, theSACollectionLabel, and testEve_cfg::tracks.
{ std::string metname = "Muon|RecoMuon|L2MuonIsolationProducer"; LogDebug(metname)<<" L2 Muon Isolation producing..."; // Take the SA container LogDebug(metname)<<" Taking the StandAlone muons: "<<theSACollectionLabel; Handle<TrackCollection> tracks; event.getByLabel(theSACollectionLabel,tracks); // Find deposits and load into event LogDebug(metname)<<" Get energy around"; std::auto_ptr<reco::IsoDepositMap> depMap( new reco::IsoDepositMap()); std::auto_ptr<edm::ValueMap<bool> > isoMap( new edm::ValueMap<bool> ()); theExtractor->fillVetos(event,eventSetup,*tracks); unsigned int nTracks = tracks->size(); std::vector<IsoDeposit> deps(nTracks); std::vector<bool> isos(nTracks, false); for (unsigned int i=0; i<nTracks; i++) { TrackRef tk(tracks,i); deps[i] = theExtractor->deposit(event, eventSetup, *tk); if (optOutputDecision){ muonisolation::MuIsoBaseIsolator::DepositContainer isoContainer(1,muonisolation::MuIsoBaseIsolator::DepositAndVetos(&deps[i])); isos[i] = theDepositIsolator->result( isoContainer, *tk ).valBool; } } reco::IsoDepositMap::Filler depFiller(*depMap); depFiller.insert(tracks, deps.begin(), deps.end()); depFiller.fill(); event.put(depMap); if (optOutputDecision){ edm::ValueMap<bool> ::Filler isoFiller(*isoMap); isoFiller.insert(tracks, isos.begin(), isos.end()); isoFiller.fill(); event.put(isoMap); } LogDebug(metname) <<" Event loaded" <<"================================"; }
bool L2MuonIsolationProducer::optOutputDecision [private] |
Definition at line 42 of file L2MuonIsolationProducer.h.
Referenced by L2MuonIsolationProducer(), and produce().
Definition at line 48 of file L2MuonIsolationProducer.h.
Referenced by L2MuonIsolationProducer(), and produce().
Definition at line 45 of file L2MuonIsolationProducer.h.
Referenced by L2MuonIsolationProducer(), produce(), and ~L2MuonIsolationProducer().
Definition at line 39 of file L2MuonIsolationProducer.h.
Referenced by produce().