CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCRecHitDProducer.cc
Go to the documentation of this file.
4 
14 
16 
20 
21 
23  iRun( 0 ),
24  useCalib( ps.getParameter<bool>("CSCUseCalibrations") ),
25  useStaticPedestals( ps.getParameter<bool>("CSCUseStaticPedestals") ),
26  useTimingCorrections(ps.getParameter<bool>("CSCUseTimingCorrections") ),
27  stripDigiTag_( ps.getParameter<edm::InputTag>("stripDigiTag") ),
28  wireDigiTag_( ps.getParameter<edm::InputTag>("wireDigiTag") )
29 
30 {
31  recHitBuilder_ = new CSCRecHitDBuilder( ps ); // pass on the parameter sets
32  recoConditions_ = new CSCRecoConditions( ps ); // access to conditions data
33 
34  recHitBuilder_->setConditions( recoConditions_ ); // pass down to who needs access
35 
36  // register what this produces
37  produces<CSCRecHit2DCollection>();
38 
39 }
40 
42 {
43  delete recHitBuilder_;
44  delete recoConditions_;
45 }
46 
47 
49 {
50  // find the geometry for this event & cache it in the builder
52  setup.get<MuonGeometryRecord>().get( h );
53  const CSCGeometry* pgeom = &*h;
54  recHitBuilder_->setGeometry( pgeom );
55 
56  // access conditions data for this event
59  }
60 
61  // Get the collections of strip & wire digis from event
64  ev.getByLabel( stripDigiTag_, stripDigis);
65  ev.getByLabel( wireDigiTag_, wireDigis);
66 
67  // Create empty collection of rechits
68  std::auto_ptr<CSCRecHit2DCollection> oc( new CSCRecHit2DCollection );
69 
70 
71  // Fill the CSCRecHit2DCollection
72  recHitBuilder_->build( stripDigis.product(), wireDigis.product(),*oc);
73 
74 
75  // Put collection in event
76  LogTrace("CSCRecHit")<< "CSCRecHitDProducer: putting rechit collection in event.";
77  ev.put( oc );
78 
79 }
80 
81 //define this as a plug-in
83 
virtual void produce(edm::Event &, const edm::EventSetup &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
CSCRecoConditions * recoConditions_
void build(const CSCStripDigiCollection *stripds, const CSCWireDigiCollection *wireds, CSCRecHit2DCollection &oc)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
CSCRecHitDBuilder * recHitBuilder_
edm::InputTag stripDigiTag_
edm::InputTag wireDigiTag_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
#define LogTrace(id)
void setConditions(const CSCRecoConditions *reco)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: Handle.h:74
CSCRecHitDProducer(const edm::ParameterSet &ps)
void setGeometry(const CSCGeometry *geom)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void initializeEvent(const edm::EventSetup &es)
fetch the cond data from the database
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")