CMS 3D CMS Logo

L2MuonIsolationProducer Class Reference

Author:
J.
More...

#include <RecoMuon/L2MuonIsolationProducer/src/L2MuonIsolationProducer.h>

Inheritance diagram for L2MuonIsolationProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void beginJob (const edm::EventSetup &)
 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

double optOutputIsoDeposits
edm::ParameterSet theConfig
muonisolation::Cuts theCuts
reco::isodeposit::IsoDepositExtractortheExtractor
edm::InputTag theSACollectionLabel


Detailed Description

Author:
J.

L2 HLT muon isolation producer.

Alcaraz

Author:
J.Alcaraz

Definition at line 20 of file L2MuonIsolationProducer.h.


Constructor & Destructor Documentation

L2MuonIsolationProducer::L2MuonIsolationProducer ( const edm::ParameterSet par  ) 

constructor with config

Definition at line 33 of file L2MuonIsolationProducer.cc.

References LogDebug, and optOutputIsoDeposits.

00033                                                                         :
00034   theConfig(par),
00035   theSACollectionLabel(par.getParameter<edm::InputTag>("StandAloneCollectionLabel")), 
00036   theCuts(par.getParameter<std::vector<double> > ("EtaBounds"),
00037           par.getParameter<std::vector<double> > ("ConeSizes"),
00038           par.getParameter<std::vector<double> > ("Thresholds")),
00039   optOutputIsoDeposits(par.getParameter<bool>("OutputMuIsoDeposits")),
00040   theExtractor(0)
00041 {
00042   LogDebug("Muon|RecoMuon|L2MuonIsolationProducer")<<" L2MuonIsolationProducer constructor called";
00043 
00044   if (optOutputIsoDeposits) produces<reco::IsoDepositMap>();
00045   produces<edm::ValueMap<bool> >();
00046 }
  

L2MuonIsolationProducer::~L2MuonIsolationProducer (  )  [virtual]

destructor

Definition at line 49 of file L2MuonIsolationProducer.cc.

References LogDebug, and theExtractor.

00049                                                  {
00050   LogDebug("Muon|RecoMuon|L2MuonIsolationProducer")<<" L2MuonIsolationProducer destructor called";
00051   if (theExtractor) delete theExtractor;
00052 }


Member Function Documentation

void L2MuonIsolationProducer::beginJob ( const edm::EventSetup iSetup  )  [virtual]

setup the job

beginJob

Reimplemented from edm::EDProducer.

Definition at line 55 of file L2MuonIsolationProducer.cc.

References DBSPlugin::get(), edm::ParameterSet::getParameter(), theConfig, and theExtractor.

00055                                                                  {
00056   //
00057   // Extractor
00058   //
00059   edm::ParameterSet extractorPSet = theConfig.getParameter<edm::ParameterSet>("ExtractorPSet");
00060   std::string extractorName = extractorPSet.getParameter<std::string>("ComponentName");
00061   theExtractor = IsoDepositExtractorFactory::get()->create( extractorName, extractorPSet);  
00062 }

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 65 of file L2MuonIsolationProducer.cc.

References muonisolation::Cuts::CutSpec::conesize, reco::isodeposit::IsoDepositExtractor::deposit(), edm::helper::Filler< Map >::fill(), reco::isodeposit::IsoDepositExtractor::fillVetos(), i, edm::helper::Filler< Map >::insert(), LogDebug, optOutputIsoDeposits, theCuts, theExtractor, theSACollectionLabel, muonisolation::Cuts::CutSpec::threshold, and tracks.

00065                                                                                {
00066   std::string metname = "Muon|RecoMuon|L2MuonIsolationProducer";
00067   
00068   LogDebug(metname)<<" L2 Muon Isolation producing...";
00069 
00070   // Take the SA container
00071   LogDebug(metname)<<" Taking the StandAlone muons: "<<theSACollectionLabel;
00072   Handle<TrackCollection> tracks;
00073   event.getByLabel(theSACollectionLabel,tracks);
00074 
00075   // Find deposits and load into event
00076   LogDebug(metname)<<" Get energy around";
00077   std::auto_ptr<reco::IsoDepositMap> depMap( new reco::IsoDepositMap());
00078   std::auto_ptr<edm::ValueMap<bool> > isoMap( new edm::ValueMap<bool> ());
00079 
00080   theExtractor->fillVetos(event,eventSetup,*tracks);
00081 
00082   uint nTracks = tracks->size();
00083   std::vector<IsoDeposit> deps(nTracks);
00084   std::vector<bool> isos(nTracks, false);
00085 
00086   for (unsigned int i=0; i<nTracks; i++) {
00087       TrackRef tk(tracks,i);
00088 
00089       deps[i] = theExtractor->deposit(event, eventSetup, *tk);
00090 
00091       muonisolation::Cuts::CutSpec cuts_here = theCuts(tk->eta());
00092       
00093       double conesize = cuts_here.conesize;
00094       double dephlt = deps[i].depositWithin(conesize);
00095       if (dephlt<cuts_here.threshold) {
00096         isos[i] = true;
00097       } else {
00098         isos[i] = false;
00099       }
00100   }
00101 
00102   
00103 
00104   if (optOutputIsoDeposits){
00106     reco::IsoDepositMap::Filler depFiller(*depMap);
00107     depFiller.insert(tracks, deps.begin(), deps.end());
00108     depFiller.fill();
00109     event.put(depMap);
00110   }
00111 
00112   edm::ValueMap<bool> ::Filler isoFiller(*isoMap);
00113   isoFiller.insert(tracks, isos.begin(), isos.end());
00114   isoFiller.fill();
00115   event.put(isoMap);
00116   
00117   LogDebug(metname) <<" Event loaded"
00118                     <<"================================";
00119 }


Member Data Documentation

double L2MuonIsolationProducer::optOutputIsoDeposits [private]

Definition at line 49 of file L2MuonIsolationProducer.h.

Referenced by L2MuonIsolationProducer(), and produce().

edm::ParameterSet L2MuonIsolationProducer::theConfig [private]

Definition at line 40 of file L2MuonIsolationProducer.h.

Referenced by beginJob().

muonisolation::Cuts L2MuonIsolationProducer::theCuts [private]

Definition at line 46 of file L2MuonIsolationProducer.h.

Referenced by produce().

reco::isodeposit::IsoDepositExtractor* L2MuonIsolationProducer::theExtractor [private]

Definition at line 52 of file L2MuonIsolationProducer.h.

Referenced by beginJob(), produce(), and ~L2MuonIsolationProducer().

edm::InputTag L2MuonIsolationProducer::theSACollectionLabel [private]

Definition at line 43 of file L2MuonIsolationProducer.h.

Referenced by produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:09 2009 for CMSSW by  doxygen 1.5.4