CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static 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)
 
std::vector< std::unique_ptr
< TrackingRegion > > 
regions (const edm::Event &ev, const edm::EventSetup &es) const override
 
 ~HIMuonTrackingRegionProducer () override
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::InputTag theMuonSource
 
edm::EDGetTokenT
< reco::TrackCollection
theMuonSourceToken
 
MuonTrackingRegionBuildertheRegionBuilder
 

Detailed Description

Definition at line 17 of file HIMuonTrackingRegionProducer.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file HIMuonTrackingRegionProducer.h.

References edm::ParameterSet::getParameter(), HLT_FULL_cff::MuonTrackingRegionBuilder, theMuonSource, theMuonSourceToken, and theRegionBuilder.

19  {
20  // get parameters from PSet
21  theMuonSource = cfg.getParameter<edm::InputTag>("MuonSrc");
23 
24  // initialize region builder
25  edm::ParameterSet regionBuilderPSet = cfg.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder");
26  theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet, iC);
27 
28  // initialize muon service proxy
29  edm::ParameterSet servicePSet = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
30  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::TrackCollection > theMuonSourceToken
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
MuonTrackingRegionBuilder * theRegionBuilder
tuple MuonTrackingRegionBuilder
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HIMuonTrackingRegionProducer::~HIMuonTrackingRegionProducer ( )
inlineoverride

Definition at line 32 of file HIMuonTrackingRegionProducer.h.

32 {}

Member Function Documentation

static void HIMuonTrackingRegionProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 34 of file HIMuonTrackingRegionProducer.h.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, MuonTrackingRegionBuilder::fillDescriptionsOffline(), HLT_FULL_cff::InputTag, and edm::ParameterSetDescription::setAllowAnything().

34  {
36 
37  desc.add<edm::InputTag>("MuonSrc", edm::InputTag(""));
38 
41  desc.add("MuonTrackingRegionBuilder", descRegion);
42 
43  edm::ParameterSetDescription descService;
44  descService.setAllowAnything();
45  desc.add<edm::ParameterSetDescription>("ServiceParameters", descService);
46 
47  descriptions.add("HiTrackingRegionEDProducer", desc);
48  }
void setAllowAnything()
allow any parameter label/value pairs
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptionsOffline(edm::ParameterSetDescription &descriptions)
std::vector<std::unique_ptr<TrackingRegion> > HIMuonTrackingRegionProducer::regions ( const edm::Event ev,
const edm::EventSetup es 
) const
inlineoverridevirtual

Implements TrackingRegionProducer.

Definition at line 50 of file HIMuonTrackingRegionProducer.h.

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

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

Member Data Documentation

edm::InputTag HIMuonTrackingRegionProducer::theMuonSource
private

Definition at line 80 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer().

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

Definition at line 81 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().

MuonTrackingRegionBuilder* HIMuonTrackingRegionProducer::theRegionBuilder
private

Definition at line 82 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().