CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalDigiToRaw Class Reference

#include <HcalDigiToRaw.h>

Inheritance diagram for HcalDigiToRaw:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HcalDigiToRaw (const edm::ParameterSet &ps)
 
virtual void produce (edm::StreamID id, edm::Event &e, const edm::EventSetup &c) const override
 
virtual ~HcalDigiToRaw ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const edm::InputTag calibTag_
 
const edm::InputTag hbheTag_
 
const edm::InputTag hfTag_
 
const edm::InputTag hoTag_
 
HcalPacker packer_
 
const edm::EDGetTokenT< HcalCalibDigiCollectiontok_calib_
 
const edm::EDGetTokenT< HBHEDigiCollectiontok_hbhe_
 
const edm::EDGetTokenT< HFDigiCollectiontok_hf_
 
const edm::EDGetTokenT< HODigiCollectiontok_ho_
 
const edm::EDGetTokenT< HcalTrigPrimDigiCollectiontok_htp_
 
const edm::EDGetTokenT< ZDCDigiCollectiontok_zdc_
 
const edm::InputTag trigTag_
 
const edm::InputTag zdcTag_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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::global::EDProducerBase
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.

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  // register for data access
23  tok_hbhe_(consumes<HBHEDigiCollection>(hbheTag_)),
24  tok_ho_(consumes<HODigiCollection>(hoTag_)),
25  tok_hf_(consumes<HFDigiCollection>(hfTag_)),
26  tok_calib_(consumes<HcalCalibDigiCollection>(calibTag_)),
27  tok_zdc_(consumes<ZDCDigiCollection>(zdcTag_)),
28  tok_htp_(consumes<HcalTrigPrimDigiCollection>(trigTag_))
29 {
30  produces<FEDRawDataCollection>();
31 }
const edm::EDGetTokenT< ZDCDigiCollection > tok_zdc_
Definition: HcalDigiToRaw.h:40
const edm::EDGetTokenT< HODigiCollection > tok_ho_
Definition: HcalDigiToRaw.h:37
const edm::InputTag calibTag_
Definition: HcalDigiToRaw.h:35
const edm::InputTag hoTag_
Definition: HcalDigiToRaw.h:35
const edm::EDGetTokenT< HFDigiCollection > tok_hf_
Definition: HcalDigiToRaw.h:38
const edm::InputTag hfTag_
Definition: HcalDigiToRaw.h:35
const edm::InputTag zdcTag_
Definition: HcalDigiToRaw.h:35
const edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
Definition: HcalDigiToRaw.h:39
const edm::InputTag hbheTag_
Definition: HcalDigiToRaw.h:35
const edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
Definition: HcalDigiToRaw.h:36
const edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_htp_
Definition: HcalDigiToRaw.h:41
const edm::InputTag trigTag_
Definition: HcalDigiToRaw.h:35
HcalDigiToRaw::~HcalDigiToRaw ( )
virtual

Definition at line 34 of file HcalDigiToRaw.cc.

34 { }

Member Function Documentation

void HcalDigiToRaw::produce ( edm::StreamID  id,
edm::Event e,
const edm::EventSetup c 
) const
overridevirtual

Definition at line 37 of file HcalDigiToRaw.cc.

References HcalPacker::Collections::calibCont, calibTag_, edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByToken(), HcalDbService::getHcalMapping(), photonIsolationHIProducer_cfi::hbhe, HcalPacker::Collections::hbhe, hbheTag_, photonIsolationHIProducer_cfi::hf, HcalPacker::Collections::hfCont, hfTag_, photonIsolationHIProducer_cfi::ho, HcalPacker::Collections::hoCont, hoTag_, edm::EventBase::id(), edm::HandleBase::isValid(), edm::InputTag::label(), FEDNumbering::MAXHCALFEDID, FEDNumbering::MINHCALFEDID, eostools::move(), 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(), hcalSimParameters_cfi::zdc, HcalPacker::Collections::zdcCont, and zdcTag_.

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

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

Member Data Documentation

const edm::InputTag HcalDigiToRaw::calibTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

const edm::InputTag HcalDigiToRaw::hbheTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

const edm::InputTag HcalDigiToRaw::hfTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

const edm::InputTag HcalDigiToRaw::hoTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

HcalPacker HcalDigiToRaw::packer_
private

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

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

Definition at line 39 of file HcalDigiToRaw.h.

Referenced by produce().

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

Definition at line 36 of file HcalDigiToRaw.h.

Referenced by produce().

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

Definition at line 38 of file HcalDigiToRaw.h.

Referenced by produce().

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

Definition at line 37 of file HcalDigiToRaw.h.

Referenced by produce().

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

Definition at line 41 of file HcalDigiToRaw.h.

Referenced by produce().

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

Definition at line 40 of file HcalDigiToRaw.h.

Referenced by produce().

const edm::InputTag HcalDigiToRaw::trigTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

const edm::InputTag HcalDigiToRaw::zdcTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().