CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
EcalRawToRecHitFacility Class Reference

#include <EventFilter/EcalRawToDigi/src/EcalRawToRecHitFacility.cc>

Inheritance diagram for EcalRawToRecHitFacility:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Types

typedef edm::LazyGetter
< EcalRecHit
EcalRecHitLazyGetter
 
typedef edm::RefGetter
< EcalRecHit
EcalRecHitRefGetter
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

 EcalRawToRecHitFacility (const edm::ParameterSet &)
 
 ~EcalRawToRecHitFacility ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

virtual void beginRun (edm::Run &, const edm::EventSetup &)
 
virtual void endRun (const edm::Run &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag sourceTag_
 
std::string workerName_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 49 of file EcalRawToRecHitFacility.h.

Member Typedef Documentation

Definition at line 54 of file EcalRawToRecHitFacility.h.

Definition at line 55 of file EcalRawToRecHitFacility.h.

Constructor & Destructor Documentation

EcalRawToRecHitFacility::EcalRawToRecHitFacility ( const edm::ParameterSet iConfig)
explicit

Definition at line 3 of file EcalRawToRecHitFacility.cc.

References edm::ParameterSet::getParameter(), LogDebug, sourceTag_, and workerName_.

4 {
5  sourceTag_=iConfig.getParameter<edm::InputTag>("sourceTag");
6  workerName_=iConfig.getParameter<std::string>("workerName");
7 
8  //the lazy getter
9  produces<EcalRecHitLazyGetter>();
10 
11  LogDebug("EcalRawToRecHit|Facility")<<"{ctor} ready to read raw data from: "<<sourceTag_
12  <<"\n using unpacker worker: "<<workerName_
13  <<"\n producing a lazy getter.";
14 }
#define LogDebug(id)
T getParameter(std::string const &) const
EcalRawToRecHitFacility::~EcalRawToRecHitFacility ( )

Definition at line 16 of file EcalRawToRecHitFacility.cc.

17 {
18 }

Member Function Documentation

void EcalRawToRecHitFacility::beginRun ( edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 76 of file EcalRawToRecHitFacility.cc.

References edm::EventSetup::get(), MyWatcher::lap(), LogDebug, and workerName_.

77 {
78  //put this here to access the worker before anything starts.
79  //there is no mis-use of the beginJob. This does not impact the rest of the processing.
80  MyWatcher watcher("Facility");
81  LogDebug("EcalRawToRecHit|Facility")<<watcher.lap();
82 
84  iSetup.get<EcalUnpackerWorkerRecord>().get(workerName_, worker);
85 
86 }
#define LogDebug(id)
const T & get() const
Definition: EventSetup.h:55
void EcalRawToRecHitFacility::endRun ( const edm::Run iRun)
privatevirtual

Definition at line 90 of file EcalRawToRecHitFacility.cc.

90  {
91 }
void EcalRawToRecHitFacility::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 27 of file EcalRawToRecHitFacility.cc.

References runEdmFileComparison::collection, edm::EventSetup::get(), edm::Event::getByLabel(), MyWatcher::lap(), LogDebug, edm::Event::put(), sourceTag_, and workerName_.

Referenced by python.JSONExport.JsonExport::export(), and python.HTMLExport.HTMLExport::export().

28 {
29  MyWatcher watcher("Facility");
30  LogDebug("EcalRawToRecHit|Facility")<<watcher.lap();
31 
32  // get raw data
34  iEvent.getByLabel(sourceTag_, buffers);
35  LogDebug("EcalRawToRecHit|Facility")<<"raw data from: "<<sourceTag_<<" retrieved."
36  << watcher.lap();
37 
38  // retreive cabling
40  iSetup.get<EcalRegionCablingRecord>().get(cabling);
41  LogDebug("EcalRawToRecHit|Facility")<<"cabling retrieved."
42  << watcher.lap();
43 
44  //retreive worker
46  iSetup.get<EcalUnpackerWorkerRecord>().get(workerName_, worker);
47  LogDebug("EcalRawToRecHit|Facility")<<"worker retrieved."
48  << watcher.lap();
49  //need to set the event because the worker will be accessing data from the event
50  worker->set(iSetup);
51  LogDebug("EcalRawToRecHit|Facility")<<"worker set."
52  << watcher.lap();
53  worker->update(iEvent);
54  LogDebug("EcalRawToRecHit|Facility")<<"worker updated."
55  << watcher.lap();
56 
57  //construct a lazy unpacker
58  boost::shared_ptr<EcalRawToRecHitLazyUnpacker> unpacker(new EcalRawToRecHitLazyUnpacker(*cabling, *worker, *buffers));
59  LogDebug("EcalRawToRecHit|Facility")<<"lazy unpacker created."
60  << watcher.lap();
61 
62  //store the lazy getter
63  //should change EcalRegionCabling::maxElementIndex() to something depending on the worker itself to be able to have Ecal and Es worker separately
64  // std::auto_ptr<EcalRecHitLazyGetter> collection(new EcalRecHitLazyGetter(EcalRegionCabling::maxElementIndex(),unpacker));
65  std::auto_ptr<EcalRecHitLazyGetter> collection(new EcalRecHitLazyGetter(worker->maxElementIndex(),unpacker));
66  LogDebug("EcalRawToRecHit|Facility")<<"lazy getter created."
67  << watcher.lap();
68 
70  LogDebug("EcalRawToRecHit|Facility")<<"lazy getter put in the event."
71  << watcher.lap();
72 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
edm::LazyGetter< EcalRecHit > EcalRecHitLazyGetter
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
const T & get() const
Definition: EventSetup.h:55

Member Data Documentation

edm::InputTag EcalRawToRecHitFacility::sourceTag_
private

Definition at line 63 of file EcalRawToRecHitFacility.h.

Referenced by EcalRawToRecHitFacility(), and produce().

std::string EcalRawToRecHitFacility::workerName_
private

Definition at line 66 of file EcalRawToRecHitFacility.h.

Referenced by beginRun(), EcalRawToRecHitFacility(), and produce().