CMS 3D CMS Logo

HIMuonTrackingRegionProducer.h
Go to the documentation of this file.
1 #ifndef RecoHI_HiTracking_HIMuonTrackingRegionProducer_H
2 #define RecoHI_HiTracking_HIMuonTrackingRegionProducer_H
3 
6 
10 
13 
16 
18 public:
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  }
31 
33 
34  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
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  }
49 
50  std::vector<std::unique_ptr<TrackingRegion> > regions(const edm::Event& ev,
51  const edm::EventSetup& es) const override {
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  }
78 
79 private:
83 };
84 
85 #endif
MuonTrackingRegionBuilder
Definition: MuonTrackingRegionBuilder.h:43
HIMuonTrackingRegionProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HIMuonTrackingRegionProducer.h:34
HIMuonTrackingRegionProducer::theRegionBuilder
MuonTrackingRegionBuilder * theRegionBuilder
Definition: HIMuonTrackingRegionProducer.h:82
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MessageLogger.h
HIMuonTrackingRegionProducer::~HIMuonTrackingRegionProducer
~HIMuonTrackingRegionProducer() override
Definition: HIMuonTrackingRegionProducer.h:32
edm::EDGetTokenT< reco::TrackCollection >
HIMuonTrackingRegionProducer::regions
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &ev, const edm::EventSetup &es) const override
Definition: HIMuonTrackingRegionProducer.h:50
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HIMuonTrackingRegionProducer::theMuonSource
edm::InputTag theMuonSource
Definition: HIMuonTrackingRegionProducer.h:80
MuonTrackingRegionBuilder::region
std::unique_ptr< RectangularEtaPhiTrackingRegion > region(const reco::TrackRef &) const
Define tracking region.
Definition: MuonTrackingRegionBuilder.cc:117
MuonTrackingRegionBuilder.h
edm::Handle< reco::TrackCollection >
edm::Ref< TrackCollection >
HIMuonTrackingRegionProducer
Definition: HIMuonTrackingRegionProducer.h:17
TrackingRegionProducer.h
MuonTrackingRegionBuilder::setEvent
virtual void setEvent(const edm::Event &)
Pass the Event to the algo at each event.
Definition: MuonTrackingRegionBuilder.cc:124
Track.h
TrackFwd.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HIMuonTrackingRegionProducer::theMuonSourceToken
edm::EDGetTokenT< reco::TrackCollection > theMuonSourceToken
Definition: HIMuonTrackingRegionProducer.h:81
jets_cff.nMuons
nMuons
Definition: jets_cff.py:209
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
RectangularEtaPhiTrackingRegion.h
edm::EventSetup
Definition: EventSetup.h:57
edm::ParameterSetDescription::setAllowAnything
void setAllowAnything()
allow any parameter label/value pairs
Definition: ParameterSetDescription.cc:37
HLT_2018_cff.MuonTrackingRegionBuilder
MuonTrackingRegionBuilder
Definition: HLT_2018_cff.py:8346
looper.cfg
cfg
Definition: looper.py:297
HIMuonTrackingRegionProducer::HIMuonTrackingRegionProducer
HIMuonTrackingRegionProducer(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: HIMuonTrackingRegionProducer.h:19
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
TrackingRegionProducer
Definition: TrackingRegionProducer.h:12
mps_fire.result
result
Definition: mps_fire.py:303
ConsumesCollector.h
ParameterSet.h
MuonTrackingRegionBuilder::fillDescriptionsOffline
static void fillDescriptionsOffline(edm::ParameterSetDescription &descriptions)
Definition: MuonTrackingRegionBuilder.cc:282
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ConsumesCollector
Definition: ConsumesCollector.h:39