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::EDConsumerBase 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 &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

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)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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_, AlCaHLTBitMon_QueryRunRegistry::string, 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 ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 76 of file EcalRawToRecHitFacility.cc.

References edm::EventSetup::get(), 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 }
const T & get() const
Definition: EventSetup.h:55
void EcalRawToRecHitFacility::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 27 of file EcalRawToRecHitFacility.cc.

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

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

28 {
29 // MyWatcher watcher("Facility");
30 // LogDebug("EcalRawToRecHit|Facility")<<watcher.lap();
31 //std::cout << watcher.lap() << std::endl;
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:94
edm::LazyGetter< EcalRecHit > EcalRecHitLazyGetter
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
const T & get() const
Definition: EventSetup.h:55

Member Data Documentation

edm::InputTag EcalRawToRecHitFacility::sourceTag_
private

Definition at line 62 of file EcalRawToRecHitFacility.h.

Referenced by EcalRawToRecHitFacility(), and produce().

std::string EcalRawToRecHitFacility::workerName_
private

Definition at line 65 of file EcalRawToRecHitFacility.h.

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