#include <RecoLocalMuon/CSCSegment/src/CSCSegmentProducer.h>
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 |
CSCSegmentBuilder * | segmentBuilder_ |
Definition at line 20 of file CSCSegmentProducer.h.
CSCSegmentProducer::CSCSegmentProducer | ( | const edm::ParameterSet & | pas | ) | [explicit] |
Constructor.
Definition at line 21 of file CSCSegmentProducer.cc.
References edm::ParameterSet::getParameter(), inputObjectsTag, and segmentBuilder_.
00021 : iev(0) { 00022 00023 inputObjectsTag = pas.getParameter<edm::InputTag>("inputObjects"); 00024 segmentBuilder_ = new CSCSegmentBuilder(pas); // pass on the PS 00025 00026 // register what this produces 00027 produces<CSCSegmentCollection>(); 00028 }
CSCSegmentProducer::~CSCSegmentProducer | ( | ) |
Destructor.
Definition at line 30 of file CSCSegmentProducer.cc.
References iev, LogDebug, and segmentBuilder_.
00030 { 00031 00032 LogDebug("CSC") << "deleting segmentBuilder_ after " << iev << " events.\n"; 00033 delete segmentBuilder_; 00034 }
void CSCSegmentProducer::produce | ( | edm::Event & | ev, | |
const edm::EventSetup & | setup | |||
) | [virtual] |
Produce the CSCSegment collection.
Implements edm::EDProducer.
Definition at line 36 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().
00036 { 00037 00038 LogDebug("CSC") << "Start producing segments for event " << ++iev << "\n"; 00039 00040 // find the geometry (& conditions?) for this event & cache it in the builder 00041 00042 edm::ESHandle<CSCGeometry> h; 00043 setup.get<MuonGeometryRecord>().get(h); 00044 const CSCGeometry* pgeom = &*h; 00045 segmentBuilder_->setGeometry(pgeom); 00046 00047 // get the collection of CSCRecHit2D 00048 edm::Handle<CSCRecHit2DCollection> cscRecHits; 00049 ev.getByLabel(inputObjectsTag, cscRecHits); 00050 00051 // create empty collection of Segments 00052 std::auto_ptr<CSCSegmentCollection> oc( new CSCSegmentCollection ); 00053 00054 // fill the collection 00055 segmentBuilder_->build(cscRecHits.product(), *oc); //@@ FILL oc 00056 00057 // put collection in event 00058 ev.put(oc); 00059 }
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().