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 
18 
20  iRun( 0 ),
21  useCalib( ps.getParameter<bool>("CSCUseCalibrations") ),
22  useStaticPedestals( ps.getParameter<bool>("CSCUseStaticPedestals") ),
23  useTimingCorrections(ps.getParameter<bool>("CSCUseTimingCorrections") ),
24  useGasGainCorrections(ps.getParameter<bool>("CSCUseGasGainCorrections") )
25 
26 {
27  s_token = consumes<CSCStripDigiCollection>( ps.getParameter<edm::InputTag>("stripDigiTag") );
28  w_token = consumes<CSCWireDigiCollection>( ps.getParameter<edm::InputTag>("wireDigiTag") );
29 
30  recHitBuilder_ = new CSCRecHitDBuilder( ps ); // pass on the parameter sets
31  recoConditions_ = new CSCRecoConditions( ps ); // access to conditions data
32 
33  recHitBuilder_->setConditions( recoConditions_ ); // pass down to who needs access
34 
35  // register what this produces
36  produces<CSCRecHit2DCollection>();
37 
38 }
39 
41 {
42  delete recHitBuilder_;
43  delete recoConditions_;
44 }
45 
46 
48 {
49  // Dumps the message TWICE if both categories are set!
50  // LogTrace("CSCRecHitDProducer|CSCRecHit")<< "[CSCRecHitDProducer] starting event " << ev.id().event() << " of run " << ev.id().run();
51  LogTrace("CSCRecHit")<< "[CSCRecHitDProducer] starting event " << ev.id().event() << " of run " << ev.id().run();
52  // find the geometry for this event & cache it in the builder
54  setup.get<MuonGeometryRecord>().get( h );
55  const CSCGeometry* pgeom = &*h;
56  recHitBuilder_->setGeometry( pgeom );
57 
58  // access conditions data for this event
61  }
62 
63  // Get the collections of strip & wire digis from event
66 
67  ev.getByToken( s_token, stripDigis);
68  ev.getByToken( w_token, 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:39
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void setConditions(CSCRecoConditions *reco)
bool ev
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:121
CSCRecHitDBuilder * recHitBuilder_
#define LogTrace(id)
edm::EDGetTokenT< CSCStripDigiCollection > s_token
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
edm::EventID id() const
Definition: EventBase.h:59
edm::EDGetTokenT< CSCWireDigiCollection > w_token
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="")