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 
22  iRun( 0 ),
23  useCalib( ps.getParameter<bool>("CSCUseCalibrations") ),
24  useStaticPedestals( ps.getParameter<bool>("CSCUseStaticPedestals") ),
25  useTimingCorrections(ps.getParameter<bool>("CSCUseTimingCorrections") ),
26  useGasGainCorrections(ps.getParameter<bool>("CSCUseGasGainCorrections") ),
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  // Dumps the message TWICE if both categories are set!
51  // LogTrace("CSCRecHitDProducer|CSCRecHit")<< "[CSCRecHitDProducer] starting event " << ev.id().event() << " of run " << ev.id().run();
52  LogTrace("CSCRecHit")<< "[CSCRecHitDProducer] starting event " << ev.id().event() << " of run " << ev.id().run();
53  // find the geometry for this event & cache it in the builder
55  setup.get<MuonGeometryRecord>().get( h );
56  const CSCGeometry* pgeom = &*h;
57  recHitBuilder_->setGeometry( pgeom );
58 
59  // access conditions data for this event
62  }
63 
64  // Get the collections of strip & wire digis from event
67  ev.getByLabel( stripDigiTag_, stripDigis);
68  ev.getByLabel( wireDigiTag_, wireDigis);
69 
70  // Create empty collection of rechits
71  std::auto_ptr<CSCRecHit2DCollection> oc( new CSCRecHit2DCollection );
72 
73  // Fill the CSCRecHit2DCollection
74  recHitBuilder_->build( stripDigis.product(), wireDigis.product(), *oc);
75 
76  // Put collection in event
77  LogTrace("CSCRecHit")<< "[CSCRecHitDProducer] putting collection of " << oc->size() << " rechits into event.";
78  ev.put( oc );
79 
80 }
81 
82 //define this as a plug-in
84 
virtual void produce(edm::Event &, const edm::EventSetup &)
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
#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:94
CSCRecHitDBuilder * recHitBuilder_
edm::InputTag stripDigiTag_
edm::InputTag wireDigiTag_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
#define LogTrace(id)
void setConditions(const CSCRecoConditions *reco)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: Handle.h:74
edm::EventID id() const
Definition: EventBase.h:56
CSCRecHitDProducer(const edm::ParameterSet &ps)
void setGeometry(const CSCGeometry *geom)
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="")