CMS 3D CMS Logo

Public Member Functions | Private Attributes

HIMuonTrackingRegionProducer Class Reference

#include <HIMuonTrackingRegionProducer.h>

Inheritance diagram for HIMuonTrackingRegionProducer:
TrackingRegionProducer

List of all members.

Public Member Functions

 HIMuonTrackingRegionProducer (const edm::ParameterSet &cfg)
virtual std::vector
< TrackingRegion * > 
regions (const edm::Event &ev, const edm::EventSetup &es) const
virtual ~HIMuonTrackingRegionProducer ()

Private Attributes

edm::InputTag theMuonSource
MuonTrackingRegionBuildertheRegionBuilder
MuonServiceProxytheService

Detailed Description

Definition at line 17 of file HIMuonTrackingRegionProducer.h.


Constructor & Destructor Documentation

HIMuonTrackingRegionProducer::HIMuonTrackingRegionProducer ( const edm::ParameterSet cfg) [inline]

Definition at line 21 of file HIMuonTrackingRegionProducer.h.

References edm::ParameterSet::getParameter(), MuonServiceProxy_cff::MuonServiceProxy, theMuonSource, theRegionBuilder, and theService.

                                                           { 
        
    // get parameters from PSet
    theMuonSource                         = cfg.getParameter<edm::InputTag>("MuonSrc");
    
    // initialize region builder
    edm::ParameterSet regionBuilderPSet   = cfg.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder");
    theRegionBuilder                      = new MuonTrackingRegionBuilder(regionBuilderPSet);

    // initialize muon service proxy
    edm::ParameterSet servicePSet         = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
    theService                            = new MuonServiceProxy(servicePSet);

  }  
virtual HIMuonTrackingRegionProducer::~HIMuonTrackingRegionProducer ( ) [inline, virtual]

Definition at line 37 of file HIMuonTrackingRegionProducer.h.

{}

Member Function Documentation

virtual std::vector<TrackingRegion* > HIMuonTrackingRegionProducer::regions ( const edm::Event ev,
const edm::EventSetup es 
) const [inline, virtual]

Implements TrackingRegionProducer.

Definition at line 40 of file HIMuonTrackingRegionProducer.h.

References gather_cfg::cout, edm::Event::getByLabel(), MuonTrackingRegionBuilder::init(), MuonTrackingRegionBuilder::region(), query::result, MuonTrackingRegionBuilder::setEvent(), theMuonSource, theRegionBuilder, theService, and MuonServiceProxy::update().

                                                                                                 {
    
    // initialize output vector of tracking regions
    std::vector<TrackingRegion* > result;

    // initialize the region builder
    theService->update(es);
    theRegionBuilder->init(theService);
    theRegionBuilder->setEvent(ev);

    // get stand-alone muon collection
    edm::Handle<reco::TrackCollection> muonH;
    ev.getByLabel(theMuonSource ,muonH);
    
    // loop over all muons and add a tracking region for each
    // that passes the requirements specified to theRegionBuilder
    unsigned int nMuons = muonH->size();
    std::cout << "there are " << nMuons << " muon(s)" << std::endl;

    // TO DO: this can be extended further to a double-loop 
    // over all combinations of muons, returning tracking regions
    // for pairs that pass some loose invariant mass cuts
    for(unsigned int imu=0; imu<nMuons; imu++) {
      reco::TrackRef muRef(muonH, imu);
      std::cout << "muon #" << imu << ": pt=" << muRef->pt() << std::endl;
      RectangularEtaPhiTrackingRegion *etaphiRegion = theRegionBuilder->region(muRef);
      result.push_back(etaphiRegion);
    }

    return result;

  }

Member Data Documentation

Definition at line 76 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().

Definition at line 77 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().

Definition at line 78 of file HIMuonTrackingRegionProducer.h.

Referenced by HIMuonTrackingRegionProducer(), and regions().