CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HIMuonTrackingRegionProducer.h
Go to the documentation of this file.
1 #ifndef RecoHI_HiTracking_HIMuonTrackingRegionProducer_H
2 #define RecoHI_HiTracking_HIMuonTrackingRegionProducer_H
3 
5 
10 
13 
16 
18 
19  public:
20 
22 
23  // get parameters from PSet
24  theMuonSource = cfg.getParameter<edm::InputTag>("MuonSrc");
25 
26  // initialize region builder
27  edm::ParameterSet regionBuilderPSet = cfg.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder");
28  theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet);
29 
30  // initialize muon service proxy
31  edm::ParameterSet servicePSet = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
32  theService = new MuonServiceProxy(servicePSet);
33 
34  }
35 
36 
38 
39 
40  virtual std::vector<TrackingRegion* > regions(const edm::Event& ev, const edm::EventSetup& es) const {
41 
42  // initialize output vector of tracking regions
43  std::vector<TrackingRegion* > result;
44 
45  // initialize the region builder
46  theService->update(es);
49 
50  // get stand-alone muon collection
52  ev.getByLabel(theMuonSource ,muonH);
53 
54  // loop over all muons and add a tracking region for each
55  // that passes the requirements specified to theRegionBuilder
56  unsigned int nMuons = muonH->size();
57  //std::cout << "there are " << nMuons << " muon(s)" << std::endl;
58 
59  // TO DO: this can be extended further to a double-loop
60  // over all combinations of muons, returning tracking regions
61  // for pairs that pass some loose invariant mass cuts
62  for(unsigned int imu=0; imu<nMuons; imu++) {
63  reco::TrackRef muRef(muonH, imu);
64  //std::cout << "muon #" << imu << ": pt=" << muRef->pt() << std::endl;
66  result.push_back(etaphiRegion);
67  }
68 
69  return result;
70 
71  }
72 
73 
74  private:
75 
79 
80 };
81 
82 #endif
void update(const edm::EventSetup &setup)
update the services each event
RectangularEtaPhiTrackingRegion * region(const reco::TrackRef &) const
define tracking region
T getParameter(std::string const &) const
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
MuonTrackingRegionBuilder * theRegionBuilder
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void init(const MuonServiceProxy *)
HIMuonTrackingRegionProducer(const edm::ParameterSet &cfg)