CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCSegmentProducer Class Reference

#include <CSCSegmentProducer.h>

Inheritance diagram for CSCSegmentProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 CSCSegmentProducer (const edm::ParameterSet &)
 Constructor.
virtual void produce (edm::Event &, const edm::EventSetup &)
 Produce the CSCSegment collection.
 ~CSCSegmentProducer ()
 Destructor.

Private Attributes

int iev
edm::InputTag inputObjectsTag
CSCSegmentBuildersegmentBuilder_

Detailed Description

Produces a collection of CSCSegment's in endcap muon CSCs.

Date:
2010/03/11 23:48:11
Revision:
1.7
Author:
M. Sani

Definition at line 20 of file CSCSegmentProducer.h.


Constructor & Destructor Documentation

CSCSegmentProducer::CSCSegmentProducer ( const edm::ParameterSet pas) [explicit]

Constructor.

Definition at line 18 of file CSCSegmentProducer.cc.

References edm::ParameterSet::getParameter(), inputObjectsTag, and segmentBuilder_.

                                                                 : iev(0) {
        
    inputObjectsTag = pas.getParameter<edm::InputTag>("inputObjects");
    segmentBuilder_ = new CSCSegmentBuilder(pas); // pass on the PS

        // register what this produces
    produces<CSCSegmentCollection>();
}
CSCSegmentProducer::~CSCSegmentProducer ( )

Destructor.

Definition at line 27 of file CSCSegmentProducer.cc.

References iev, LogDebug, and segmentBuilder_.

                                        {

    LogDebug("CSCSegment|CSC") << "deleting CSCSegmentBuilder after " << iev << " events w/csc data.";
    delete segmentBuilder_;
}

Member Function Documentation

void CSCSegmentProducer::produce ( edm::Event ev,
const edm::EventSetup setup 
) [virtual]

Produce the CSCSegment collection.

Implements edm::EDProducer.

Definition at line 33 of file CSCSegmentProducer.cc.

References CSCSegmentBuilder::build(), edm::EventSetup::get(), edm::Event::getByLabel(), h, iev, inputObjectsTag, LogDebug, edm::Handle< T >::product(), edm::Event::put(), segmentBuilder_, and CSCSegmentBuilder::setGeometry().

                                                                         {

    LogDebug("CSCSegment|CSC") << "start producing segments for " << ++iev << "th event with csc data";
        
    // find the geometry (& conditions?) for this event & cache it in the builder
  
    edm::ESHandle<CSCGeometry> h;
    setup.get<MuonGeometryRecord>().get(h);
    const CSCGeometry* pgeom = &*h;
    segmentBuilder_->setGeometry(pgeom);
        
    // get the collection of CSCRecHit2D
    edm::Handle<CSCRecHit2DCollection> cscRecHits;
    ev.getByLabel(inputObjectsTag, cscRecHits);  

    // create empty collection of Segments
    std::auto_ptr<CSCSegmentCollection> oc( new CSCSegmentCollection );

        // fill the collection
    segmentBuilder_->build(cscRecHits.product(), *oc); //@@ FILL oc

    // put collection in event
    ev.put(oc);
}

Member Data Documentation

int CSCSegmentProducer::iev [private]

Definition at line 30 of file CSCSegmentProducer.h.

Referenced by produce(), and ~CSCSegmentProducer().

Definition at line 31 of file CSCSegmentProducer.h.

Referenced by CSCSegmentProducer(), and produce().

Definition at line 32 of file CSCSegmentProducer.h.

Referenced by CSCSegmentProducer(), produce(), and ~CSCSegmentProducer().