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
HcalDigiToRaw Class Reference

#include <HcalDigiToRaw.h>

Inheritance diagram for HcalDigiToRaw:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

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

edm::InputTag calibTag_
 
edm::InputTag hbheTag_
 
edm::InputTag hfTag_
 
edm::InputTag hoTag_
 
HcalPacker packer_
 
edm::InputTag trigTag_
 
edm::InputTag zdcTag_
 

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
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

HcalDigiToRaw is the EDProducer subclass which runs the Hcal Unpack algorithm.

Author
Jeremiah Mans
Version
1st Version June 10, 2005

Definition at line 26 of file HcalDigiToRaw.h.

Constructor & Destructor Documentation

HcalDigiToRaw::HcalDigiToRaw ( const edm::ParameterSet ps)
explicit

Definition at line 16 of file HcalDigiToRaw.cc.

16  :
17  hbheTag_(conf.getUntrackedParameter("HBHE",edm::InputTag())),
18  hoTag_(conf.getUntrackedParameter("HO",edm::InputTag())),
19  hfTag_(conf.getUntrackedParameter("HF",edm::InputTag())),
20  zdcTag_(conf.getUntrackedParameter("ZDC",edm::InputTag())),
21  calibTag_(conf.getUntrackedParameter("CALIB",edm::InputTag())),
22  trigTag_(conf.getUntrackedParameter("TRIG",edm::InputTag()))
23 {
24  produces<FEDRawDataCollection>();
25 }
edm::InputTag hbheTag_
Definition: HcalDigiToRaw.h:34
edm::InputTag hoTag_
Definition: HcalDigiToRaw.h:34
edm::InputTag zdcTag_
Definition: HcalDigiToRaw.h:34
edm::InputTag hfTag_
Definition: HcalDigiToRaw.h:34
edm::InputTag calibTag_
Definition: HcalDigiToRaw.h:34
tuple conf
Definition: dbtoconf.py:185
edm::InputTag trigTag_
Definition: HcalDigiToRaw.h:34
HcalDigiToRaw::~HcalDigiToRaw ( )
virtual

Definition at line 28 of file HcalDigiToRaw.cc.

28 { }

Member Function Documentation

void HcalDigiToRaw::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 31 of file HcalDigiToRaw.cc.

References HcalPacker::Collections::calibCont, calibTag_, edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByLabel(), HcalPacker::Collections::hbhe, hbheTag_, HcalPacker::Collections::hfCont, hfTag_, HcalPacker::Collections::hoCont, hoTag_, edm::EventBase::id(), edm::InputTag::label(), FEDNumbering::MAXHCALFEDID, FEDNumbering::MINHCALFEDID, HcalPacker::pack(), packer_, edm::Handle< T >::product(), edm::Event::put(), HcalPacker::Collections::tpCont, trigTag_, cms::Exception::what(), HcalPacker::Collections::zdcCont, and zdcTag_.

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

32 {
34 
35 
36  // Step A: Get Inputs
38  if (!hbheTag_.label().empty()) {
39  e.getByLabel(hbheTag_,hbhe);
40  colls.hbhe=hbhe.product();
41  }
43  if (!hoTag_.label().empty()) {
44  e.getByLabel(hoTag_,ho);
45  colls.hoCont=ho.product();
46  }
48  if (!hfTag_.label().empty()) {
49  e.getByLabel(hfTag_,hf);
50  colls.hfCont=hf.product();
51  }
53  if (!calibTag_.label().empty()) {
54  e.getByLabel(calibTag_,Calib);
55  colls.calibCont=Calib.product();
56  }
58  if (!zdcTag_.label().empty()) {
59  e.getByLabel(zdcTag_,zdc);
60  colls.zdcCont=zdc.product();
61  }
63  if (!trigTag_.label().empty()) {
64  e.getByLabel(trigTag_,htp);
65  colls.tpCont=htp.product();
66  }
67  // get the mapping
69  es.get<HcalDbRecord>().get( pSetup );
70  const HcalElectronicsMap* readoutMap=pSetup->getHcalMapping();
71  // Step B: Create empty output
72  std::auto_ptr<FEDRawDataCollection> raw=std::auto_ptr<FEDRawDataCollection>(new FEDRawDataCollection());
73 
74  const int ifed_first=FEDNumbering::MINHCALFEDID;
75  const int ifed_last=FEDNumbering::MAXHCALFEDID;
76 
77  int orbitN=e.id().event();
78  int bcnN=2000;
79 
80  // Step C: pack all requested FEDs
81  for (int ifed=ifed_first; ifed<=ifed_last; ++ifed) {
82  FEDRawData& fed = raw->FEDData(ifed);
83  try {
84  packer_.pack(ifed,ifed-ifed_first, e.id().event(),
85  orbitN, bcnN, colls, *readoutMap, fed);
86  } catch (cms::Exception& e) {
87  edm::LogWarning("Unpacking error") << e.what();
88  } catch (...) {
89  edm::LogWarning("Unpacking exception");
90  }
91  }
92 
93 
94  e.put(raw);
95 }
virtual char const * what() const
Definition: Exception.cc:141
EventNumber_t event() const
Definition: EventID.h:44
void pack(int fedid, int dccnumber, int nl1a, int orbitn, int bcn, const Collections &inputs, const HcalElectronicsMap &emap, FEDRawData &output)
Definition: HcalPacker.cc:79
edm::InputTag hbheTag_
Definition: HcalDigiToRaw.h:34
HcalPacker packer_
Definition: HcalDigiToRaw.h:33
const HcalCalibDigiCollection * calibCont
Definition: HcalPacker.h:21
edm::InputTag hoTag_
Definition: HcalDigiToRaw.h:34
edm::InputTag zdcTag_
Definition: HcalDigiToRaw.h:34
edm::InputTag hfTag_
Definition: HcalDigiToRaw.h:34
const HcalTrigPrimDigiCollection * tpCont
Definition: HcalPacker.h:23
const ZDCDigiCollection * zdcCont
Definition: HcalPacker.h:22
const HBHEDigiCollection * hbhe
Definition: HcalPacker.h:18
edm::InputTag calibTag_
Definition: HcalDigiToRaw.h:34
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
edm::InputTag trigTag_
Definition: HcalDigiToRaw.h:34
T const * product() const
Definition: Handle.h:74
std::string const & label() const
Definition: InputTag.h:42
edm::EventID id() const
Definition: EventBase.h:56
const HODigiCollection * hoCont
Definition: HcalPacker.h:19
const HFDigiCollection * hfCont
Definition: HcalPacker.h:20

Member Data Documentation

edm::InputTag HcalDigiToRaw::calibTag_
private

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

edm::InputTag HcalDigiToRaw::hbheTag_
private

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

edm::InputTag HcalDigiToRaw::hfTag_
private

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

edm::InputTag HcalDigiToRaw::hoTag_
private

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

HcalPacker HcalDigiToRaw::packer_
private

Definition at line 33 of file HcalDigiToRaw.h.

Referenced by produce().

edm::InputTag HcalDigiToRaw::trigTag_
private

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

edm::InputTag HcalDigiToRaw::zdcTag_
private

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().