test
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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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::EDGetTokenT
< HcalCalibDigiCollection
tok_calib_
 
edm::EDGetTokenT
< HBHEDigiCollection
tok_hbhe_
 
edm::EDGetTokenT
< HFDigiCollection
tok_hf_
 
edm::EDGetTokenT
< HODigiCollection
tok_ho_
 
edm::EDGetTokenT
< HcalTrigPrimDigiCollection
tok_htp_
 
edm::EDGetTokenT
< ZDCDigiCollection
tok_zdc_
 
edm::InputTag trigTag_
 
edm::InputTag zdcTag_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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 27 of file HcalDigiToRaw.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file HcalDigiToRaw.cc.

References calibTag_, hbheTag_, hfTag_, hoTag_, tok_calib_, tok_hbhe_, tok_hf_, tok_ho_, tok_htp_, tok_zdc_, trigTag_, and zdcTag_.

15  :
16  hbheTag_(conf.getUntrackedParameter("HBHE",edm::InputTag())),
17  hoTag_(conf.getUntrackedParameter("HO",edm::InputTag())),
18  hfTag_(conf.getUntrackedParameter("HF",edm::InputTag())),
19  zdcTag_(conf.getUntrackedParameter("ZDC",edm::InputTag())),
20  calibTag_(conf.getUntrackedParameter("CALIB",edm::InputTag())),
21  trigTag_(conf.getUntrackedParameter("TRIG",edm::InputTag()))
22 {
23  // register for data access
24  tok_hbhe_ = consumes<HBHEDigiCollection>(hbheTag_);
25  tok_ho_ = consumes<HODigiCollection>(hoTag_);
26  tok_hf_ = consumes<HFDigiCollection>(hfTag_);
27  tok_calib_ = consumes<HcalCalibDigiCollection>(calibTag_);
28  tok_zdc_ = consumes<ZDCDigiCollection>(zdcTag_);
29  tok_htp_ = consumes<HcalTrigPrimDigiCollection>(trigTag_);
30 
31  produces<FEDRawDataCollection>();
32 }
edm::EDGetTokenT< HODigiCollection > tok_ho_
Definition: HcalDigiToRaw.h:37
edm::EDGetTokenT< HFDigiCollection > tok_hf_
Definition: HcalDigiToRaw.h:38
edm::InputTag hbheTag_
Definition: HcalDigiToRaw.h:35
edm::InputTag hoTag_
Definition: HcalDigiToRaw.h:35
edm::InputTag zdcTag_
Definition: HcalDigiToRaw.h:35
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
Definition: HcalDigiToRaw.h:39
edm::InputTag hfTag_
Definition: HcalDigiToRaw.h:35
edm::InputTag calibTag_
Definition: HcalDigiToRaw.h:35
tuple conf
Definition: dbtoconf.py:185
edm::InputTag trigTag_
Definition: HcalDigiToRaw.h:35
edm::EDGetTokenT< ZDCDigiCollection > tok_zdc_
Definition: HcalDigiToRaw.h:40
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
Definition: HcalDigiToRaw.h:36
edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_htp_
Definition: HcalDigiToRaw.h:41
HcalDigiToRaw::~HcalDigiToRaw ( )
virtual

Definition at line 35 of file HcalDigiToRaw.cc.

35 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 38 of file HcalDigiToRaw.cc.

References HcalPacker::Collections::calibCont, calibTag_, edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByToken(), 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(), tok_calib_, tok_hbhe_, tok_hf_, tok_ho_, tok_htp_, tok_zdc_, HcalPacker::Collections::tpCont, trigTag_, cms::Exception::what(), HcalPacker::Collections::zdcCont, and zdcTag_.

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

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

Member Data Documentation

edm::InputTag HcalDigiToRaw::calibTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

edm::InputTag HcalDigiToRaw::hbheTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

edm::InputTag HcalDigiToRaw::hfTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

edm::InputTag HcalDigiToRaw::hoTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

HcalPacker HcalDigiToRaw::packer_
private

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

edm::EDGetTokenT<HcalCalibDigiCollection> HcalDigiToRaw::tok_calib_
private

Definition at line 39 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

edm::EDGetTokenT<HBHEDigiCollection> HcalDigiToRaw::tok_hbhe_
private

Definition at line 36 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

edm::EDGetTokenT<HFDigiCollection> HcalDigiToRaw::tok_hf_
private

Definition at line 38 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

edm::EDGetTokenT<HODigiCollection> HcalDigiToRaw::tok_ho_
private

Definition at line 37 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

edm::EDGetTokenT<HcalTrigPrimDigiCollection> HcalDigiToRaw::tok_htp_
private

Definition at line 41 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

edm::EDGetTokenT<ZDCDigiCollection> HcalDigiToRaw::tok_zdc_
private

Definition at line 40 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

edm::InputTag HcalDigiToRaw::trigTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().

edm::InputTag HcalDigiToRaw::zdcTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by HcalDigiToRaw(), and produce().