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, edm::ConsumesCollector &&iC)
 
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
 
edm::EDGetTokenT
< reco::TrackCollection
theMuonSourceToken
 
MuonTrackingRegionBuildertheRegionBuilder
 
MuonServiceProxytheService
 

Detailed Description

Definition at line 18 of file HIMuonTrackingRegionProducer.h.

Constructor & Destructor Documentation

HIMuonTrackingRegionProducer::HIMuonTrackingRegionProducer ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 22 of file HIMuonTrackingRegionProducer.h.

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

22  {
23 
24  // get parameters from PSet
25  theMuonSource = cfg.getParameter<edm::InputTag>("MuonSrc");
27 
28  // initialize region builder
29  edm::ParameterSet regionBuilderPSet = cfg.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder");
30  theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet,iC);
31 
32  // initialize muon service proxy
33  edm::ParameterSet servicePSet = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
34  theService = new MuonServiceProxy(servicePSet);
35 
36  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > theMuonSourceToken
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
MuonTrackingRegionBuilder * theRegionBuilder
virtual HIMuonTrackingRegionProducer::~HIMuonTrackingRegionProducer ( )
inlinevirtual

Definition at line 39 of file HIMuonTrackingRegionProducer.h.

39 {}

Member Function Documentation

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

Implements TrackingRegionProducer.

Definition at line 42 of file HIMuonTrackingRegionProducer.h.

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

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

Member Data Documentation

edm::InputTag HIMuonTrackingRegionProducer::theMuonSource
private

Definition at line 78 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer().

edm::EDGetTokenT<reco::TrackCollection> HIMuonTrackingRegionProducer::theMuonSourceToken
private

Definition at line 79 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().

MuonTrackingRegionBuilder* HIMuonTrackingRegionProducer::theRegionBuilder
private

Definition at line 80 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().

MuonServiceProxy* HIMuonTrackingRegionProducer::theService
private

Definition at line 81 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().