CMS 3D CMS Logo

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::TrackCollectiontheMuonSourceToken
 
MuonTrackingRegionBuildertheRegionBuilder
 

Detailed Description

Definition at line 17 of file HIMuonTrackingRegionProducer.h.

Constructor & Destructor Documentation

◆ HIMuonTrackingRegionProducer()

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

Definition at line 19 of file HIMuonTrackingRegionProducer.h.

References looper::cfg, HLT_2024v13_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

◆ ~HIMuonTrackingRegionProducer()

HIMuonTrackingRegionProducer::~HIMuonTrackingRegionProducer ( )
inlineoverride

Definition at line 32 of file HIMuonTrackingRegionProducer.h.

32 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 34 of file HIMuonTrackingRegionProducer.h.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, MuonTrackingRegionBuilder::fillDescriptionsOffline(), ProducerED_cfi::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
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptionsOffline(edm::ParameterSetDescription &descriptions)

◆ regions()

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 makeMEIFBenchmarkPlots::ev, custom_jme_cff::nMuons, 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
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  }
std::unique_ptr< RectangularEtaPhiTrackingRegion > region(const reco::TrackRef &) const
Define tracking region.
edm::EDGetTokenT< reco::TrackCollection > theMuonSourceToken
MuonTrackingRegionBuilder * theRegionBuilder
void setEvent(const edm::Event &, const edm::EventSetup &)
Pass the Event to the algo at each event.

Member Data Documentation

◆ theMuonSource

edm::InputTag HIMuonTrackingRegionProducer::theMuonSource
private

Definition at line 80 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer().

◆ theMuonSourceToken

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

Definition at line 81 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().

◆ theRegionBuilder

MuonTrackingRegionBuilder* HIMuonTrackingRegionProducer::theRegionBuilder
private

Definition at line 82 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().