CMS 3D CMS Logo

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

#include <AlCaEcalHcalReadoutsProducer.h>

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

Public Member Functions

 AlCaEcalHcalReadoutsProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~AlCaEcalHcalReadoutsProducer ()
 
- 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 Attributes

edm::InputTag hbheLabel_
 
edm::InputTag hfLabel_
 
edm::InputTag hoLabel_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 37 of file AlCaEcalHcalReadoutsProducer.h.

Constructor & Destructor Documentation

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

Definition at line 5 of file AlCaEcalHcalReadoutsProducer.cc.

References edm::ParameterSet::getParameter(), hbheLabel_, hfLabel_, and hoLabel_.

6 {
7 
8  hoLabel_ = iConfig.getParameter<edm::InputTag>("hoInput");
9  hfLabel_ = iConfig.getParameter<edm::InputTag>("hfInput");
10  hbheLabel_ = iConfig.getParameter<edm::InputTag>("hbheInput");
11 
12  //register your products
13  produces<HBHERecHitCollection>("HBHERecHitCollection");
14  produces<HORecHitCollection>("HORecHitCollection");
15  produces<HFRecHitCollection>("HFRecHitCollection");
16 }
T getParameter(std::string const &) const
AlCaEcalHcalReadoutsProducer::~AlCaEcalHcalReadoutsProducer ( )

Definition at line 19 of file AlCaEcalHcalReadoutsProducer.cc.

20 {
21 
22 
23 }

Member Function Documentation

void AlCaEcalHcalReadoutsProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 28 of file AlCaEcalHcalReadoutsProducer.cc.

References edm::Event::getByLabel(), hbheLabel_, hfLabel_, hoLabel_, LogDebug, edm::SortedCollection< T, SORT >::push_back(), edm::Event::put(), and hitfit::return.

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

29 {
30  using namespace edm;
31  using namespace std;
32 
36 
37  iEvent.getByLabel(hbheLabel_,hbhe);
38  if(!hbhe.isValid()){
39  LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get hbhe product!" << std::endl;
40  return ;
41  }
42 
43  iEvent.getByLabel(hoLabel_,ho);
44  if(!ho.isValid()) {
45  LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get ho product!" << std::endl;
46  }
47 
48  iEvent.getByLabel(hfLabel_,hf);
49  if(!hf.isValid()) {
50  LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get hf product!" << std::endl;
51  }
52  //Create empty output collections
53 
54  std::auto_ptr<HBHERecHitCollection> miniHBHERecHitCollection(new HBHERecHitCollection);
55  std::auto_ptr<HORecHitCollection> miniHORecHitCollection(new HORecHitCollection);
56  std::auto_ptr<HFRecHitCollection> miniHFRecHitCollection(new HFRecHitCollection);
57 
58  const HBHERecHitCollection Hithbhe = *(hbhe.product());
59  for(HBHERecHitCollection::const_iterator hbheItr=Hithbhe.begin(); hbheItr!=Hithbhe.end(); hbheItr++)
60  {
61  miniHBHERecHitCollection->push_back(*hbheItr);
62  }
63  const HORecHitCollection Hitho = *(ho.product());
64  for(HORecHitCollection::const_iterator hoItr=Hitho.begin(); hoItr!=Hitho.end(); hoItr++)
65  {
66  miniHORecHitCollection->push_back(*hoItr);
67  }
68 
69  const HFRecHitCollection Hithf = *(hf.product());
70  for(HFRecHitCollection::const_iterator hfItr=Hithf.begin(); hfItr!=Hithf.end(); hfItr++)
71  {
72  miniHFRecHitCollection->push_back(*hfItr);
73  }
74 
75 
76 
77  //Put selected information in the event
78  iEvent.put( miniHBHERecHitCollection, "HBHERecHitCollection");
79  iEvent.put( miniHORecHitCollection, "HORecHitCollection");
80  iEvent.put( miniHFRecHitCollection, "HFRecHitCollection");
81 
82 
83 }
#define LogDebug(id)
std::vector< T >::const_iterator const_iterator
void push_back(T const &t)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356

Member Data Documentation

edm::InputTag AlCaEcalHcalReadoutsProducer::hbheLabel_
private

Definition at line 47 of file AlCaEcalHcalReadoutsProducer.h.

Referenced by AlCaEcalHcalReadoutsProducer(), and produce().

edm::InputTag AlCaEcalHcalReadoutsProducer::hfLabel_
private

Definition at line 49 of file AlCaEcalHcalReadoutsProducer.h.

Referenced by AlCaEcalHcalReadoutsProducer(), and produce().

edm::InputTag AlCaEcalHcalReadoutsProducer::hoLabel_
private

Definition at line 48 of file AlCaEcalHcalReadoutsProducer.h.

Referenced by AlCaEcalHcalReadoutsProducer(), and produce().