CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCSegmentProducer.cc
Go to the documentation of this file.
1 
7 
12 
14 
17 
19 
20  m_token = consumes<CSCRecHit2DCollection>( pas.getParameter<edm::InputTag>("inputObjects") );
21  segmentBuilder_ = new CSCSegmentBuilder(pas); // pass on the PS
22 
23  // register what this produces
24  produces<CSCSegmentCollection>();
25 }
26 
28 
29  LogDebug("CSCSegment|CSC") << "deleting CSCSegmentBuilder after " << iev << " events w/csc data.";
30  delete segmentBuilder_;
31 }
32 
34 
35  LogDebug("CSCSegment|CSC") << "start producing segments for " << ++iev << "th event with csc data";
36 
37  // find the geometry (& conditions?) for this event & cache it in the builder
38 
40  setup.get<MuonGeometryRecord>().get(h);
41  const CSCGeometry* pgeom = &*h;
43 
44  // get the collection of CSCRecHit2D
46  ev.getByToken( m_token, cscRecHits);
47 
48  // create empty collection of Segments
49  std::auto_ptr<CSCSegmentCollection> oc( new CSCSegmentCollection );
50 
51  // fill the collection
52  segmentBuilder_->build(cscRecHits.product(), *oc); //@@ FILL oc
53 
54  // put collection in event
55  ev.put(oc);
56 }
#define LogDebug(id)
virtual void produce(edm::Event &, const edm::EventSetup &) override
Produce the CSCSegment collection.
T getParameter(std::string const &) const
void build(const CSCRecHit2DCollection *rechits, CSCSegmentCollection &oc)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
bool ev
edm::EDGetTokenT< CSCRecHit2DCollection > m_token
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
CSCSegmentBuilder * segmentBuilder_
T const * product() const
Definition: Handle.h:81
CSCSegmentProducer(const edm::ParameterSet &)
Constructor.
const T & get() const
Definition: EventSetup.h:56
~CSCSegmentProducer()
Destructor.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void setGeometry(const CSCGeometry *geom)