CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HIMuonTrackingRegionProducer Class Reference

#include <HIMuonTrackingRegionProducer.h>

Inheritance diagram for HIMuonTrackingRegionProducer:
TrackingRegionProducer

Public Member Functions

 HIMuonTrackingRegionProducer (const edm::ParameterSet &cfg)
 
virtual std::vector
< TrackingRegion * > 
regions (const edm::Event &ev, const edm::EventSetup &es) const
 
virtual ~HIMuonTrackingRegionProducer ()
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Private Attributes

edm::InputTag theMuonSource
 
MuonTrackingRegionBuildertheRegionBuilder
 
MuonServiceProxytheService
 

Detailed Description

Definition at line 17 of file HIMuonTrackingRegionProducer.h.

Constructor & Destructor Documentation

HIMuonTrackingRegionProducer::HIMuonTrackingRegionProducer ( const edm::ParameterSet cfg)
inline

Definition at line 21 of file HIMuonTrackingRegionProducer.h.

References edm::ParameterSet::getParameter(), MuonServiceProxy_cff::MuonServiceProxy, theMuonSource, theRegionBuilder, and theService.

21  {
22 
23  // get parameters from PSet
24  theMuonSource = cfg.getParameter<edm::InputTag>("MuonSrc");
25 
26  // initialize region builder
27  edm::ParameterSet regionBuilderPSet = cfg.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder");
28  theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet);
29 
30  // initialize muon service proxy
31  edm::ParameterSet servicePSet = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
32  theService = new MuonServiceProxy(servicePSet);
33 
34  }
T getParameter(std::string const &) const
MuonTrackingRegionBuilder * theRegionBuilder
virtual HIMuonTrackingRegionProducer::~HIMuonTrackingRegionProducer ( )
inlinevirtual

Definition at line 37 of file HIMuonTrackingRegionProducer.h.

37 {}

Member Function Documentation

virtual std::vector<TrackingRegion* > HIMuonTrackingRegionProducer::regions ( const edm::Event ev,
const edm::EventSetup es 
) const
inlinevirtual

Implements TrackingRegionProducer.

Definition at line 40 of file HIMuonTrackingRegionProducer.h.

References edm::Event::getByLabel(), MuonTrackingRegionBuilder::init(), MuonTrackingRegionBuilder::region(), query::result, MuonTrackingRegionBuilder::setEvent(), theMuonSource, theRegionBuilder, theService, and MuonServiceProxy::update().

40  {
41 
42  // initialize output vector of tracking regions
43  std::vector<TrackingRegion* > result;
44 
45  // initialize the region builder
46  theService->update(es);
49 
50  // get stand-alone muon collection
52  ev.getByLabel(theMuonSource ,muonH);
53 
54  // loop over all muons and add a tracking region for each
55  // that passes the requirements specified to theRegionBuilder
56  unsigned int nMuons = muonH->size();
57  //std::cout << "there are " << nMuons << " muon(s)" << std::endl;
58 
59  // TO DO: this can be extended further to a double-loop
60  // over all combinations of muons, returning tracking regions
61  // for pairs that pass some loose invariant mass cuts
62  for(unsigned int imu=0; imu<nMuons; imu++) {
63  reco::TrackRef muRef(muonH, imu);
64  //std::cout << "muon #" << imu << ": pt=" << muRef->pt() << std::endl;
66  result.push_back(etaphiRegion);
67  }
68 
69  return result;
70 
71  }
void update(const edm::EventSetup &setup)
update the services each event
RectangularEtaPhiTrackingRegion * region(const reco::TrackRef &) const
define tracking region
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
MuonTrackingRegionBuilder * theRegionBuilder
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void init(const MuonServiceProxy *)

Member Data Documentation

edm::InputTag HIMuonTrackingRegionProducer::theMuonSource
private

Definition at line 76 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().

MuonTrackingRegionBuilder* HIMuonTrackingRegionProducer::theRegionBuilder
private

Definition at line 77 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().

MuonServiceProxy* HIMuonTrackingRegionProducer::theService
private

Definition at line 78 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().