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
MessageLogger.h
HIMuonTrackingRegionProducer::~HIMuonTrackingRegionProducer
~HIMuonTrackingRegionProducer() override
Definition: HIMuonTrackingRegionProducer.h:32
custom_jme_cff.nMuons
nMuons
Definition: custom_jme_cff.py:148
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
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
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
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
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
looper.cfg
cfg
Definition: looper.py:297
HIMuonTrackingRegionProducer::HIMuonTrackingRegionProducer
HIMuonTrackingRegionProducer(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: HIMuonTrackingRegionProducer.h:19
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
TrackingRegionProducer
Definition: TrackingRegionProducer.h:12
mps_fire.result
result
Definition: mps_fire.py:311
ConsumesCollector.h
ParameterSet.h
HLT_FULL_cff.MuonTrackingRegionBuilder
MuonTrackingRegionBuilder
Definition: HLT_FULL_cff.py:9667
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:45