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 
6 
11 
14 
17 
19 
20  public:
21 
23 
24  // get parameters from PSet
25  theMuonSource = cfg.getParameter<edm::InputTag>("MuonSrc");
27 
28  // initialize region builder
29  edm::ParameterSet regionBuilderPSet = cfg.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder");
30  theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet,iC);
31 
32  // initialize muon service proxy
33  edm::ParameterSet servicePSet = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
34  theService = new MuonServiceProxy(servicePSet);
35 
36  }
37 
38 
40 
41 
42  virtual std::vector<TrackingRegion* > regions(const edm::Event& ev, const edm::EventSetup& es) const {
43 
44  // initialize output vector of tracking regions
45  std::vector<TrackingRegion* > result;
46 
47  // initialize the region builder
48  theService->update(es);
51 
52  // get stand-alone muon collection
54  ev.getByToken(theMuonSourceToken ,muonH);
55 
56  // loop over all muons and add a tracking region for each
57  // that passes the requirements specified to theRegionBuilder
58  unsigned int nMuons = muonH->size();
59  //std::cout << "there are " << nMuons << " muon(s)" << std::endl;
60 
61  // TO DO: this can be extended further to a double-loop
62  // over all combinations of muons, returning tracking regions
63  // for pairs that pass some loose invariant mass cuts
64  for(unsigned int imu=0; imu<nMuons; imu++) {
65  reco::TrackRef muRef(muonH, imu);
66  //std::cout << "muon #" << imu << ": pt=" << muRef->pt() << std::endl;
68  result.push_back(etaphiRegion);
69  }
70 
71  return result;
72 
73  }
74 
75 
76  private:
77 
82 
83 };
84 
85 #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
edm::EDGetTokenT< reco::TrackCollection > theMuonSourceToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
MuonTrackingRegionBuilder * theRegionBuilder
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const
tuple result
Definition: query.py:137
void init(const MuonServiceProxy *)
HIMuonTrackingRegionProducer(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)