test
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
< std::unique_ptr
< TrackingRegion > > 
regions (const edm::Event &ev, const edm::EventSetup &es) const override
 
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_25ns10e33_v2_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:14
MuonTrackingRegionBuilder * theRegionBuilder
virtual HIMuonTrackingRegionProducer::~HIMuonTrackingRegionProducer ( )
inlinevirtual

Definition at line 39 of file HIMuonTrackingRegionProducer.h.

39 {}

Member Function Documentation

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

Implements TrackingRegionProducer.

Definition at line 42 of file HIMuonTrackingRegionProducer.h.

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

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

Member Data Documentation

edm::InputTag HIMuonTrackingRegionProducer::theMuonSource
private

Definition at line 76 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer().

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

Definition at line 77 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().

MuonTrackingRegionBuilder* HIMuonTrackingRegionProducer::theRegionBuilder
private

Definition at line 78 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().

MuonServiceProxy* HIMuonTrackingRegionProducer::theService
private

Definition at line 79 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().