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)
 
void produce (edm::StreamID id, edm::Event &e, const edm::EventSetup &c) const override
 
 ~HcalDigiToRaw () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 13 of file HcalDigiToRaw.cc.

14  : hbheTag_(conf.getUntrackedParameter("HBHE", edm::InputTag())),
15  hoTag_(conf.getUntrackedParameter("HO", edm::InputTag())),
16  hfTag_(conf.getUntrackedParameter("HF", edm::InputTag())),
17  zdcTag_(conf.getUntrackedParameter("ZDC", edm::InputTag())),
18  calibTag_(conf.getUntrackedParameter("CALIB", edm::InputTag())),
19  trigTag_(conf.getUntrackedParameter("TRIG", edm::InputTag())),
20  // register for data access
21  tok_hbhe_(consumes<HBHEDigiCollection>(hbheTag_)),
22  tok_ho_(consumes<HODigiCollection>(hoTag_)),
23  tok_hf_(consumes<HFDigiCollection>(hfTag_)),
24  tok_calib_(consumes<HcalCalibDigiCollection>(calibTag_)),
25  tok_zdc_(consumes<ZDCDigiCollection>(zdcTag_)),
26  tok_htp_(consumes<HcalTrigPrimDigiCollection>(trigTag_)) {
27  produces<FEDRawDataCollection>();
28 }
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 ( )
override

Definition at line 31 of file HcalDigiToRaw.cc.

31 {}

Member Function Documentation

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

Definition at line 34 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().

34  {
36 
37  // Step A: Get Inputs
39  if (!hbheTag_.label().empty()) {
40  e.getByToken(tok_hbhe_, hbhe);
41  colls.hbhe = hbhe.product();
42  }
44  if (!hoTag_.label().empty()) {
45  e.getByToken(tok_ho_, ho);
46  colls.hoCont = ho.product();
47  }
49  if (!hfTag_.label().empty()) {
50  e.getByToken(tok_hf_, hf);
51  colls.hfCont = hf.product();
52  }
54  if (!calibTag_.label().empty()) {
55  e.getByToken(tok_calib_, Calib);
56  colls.calibCont = Calib.product();
57  }
59  if (!zdcTag_.label().empty()) {
60  e.getByToken(tok_zdc_, zdc);
61  colls.zdcCont = zdc.product();
62  }
64  if (!trigTag_.label().empty()) {
65  e.getByToken(tok_htp_, htp);
66  if (htp.isValid())
67  colls.tpCont = htp.product();
68  }
69  // get the mapping
71  es.get<HcalDbRecord>().get(pSetup);
72  const HcalElectronicsMap* readoutMap = pSetup->getHcalMapping();
73  // Step B: Create empty output
74  auto raw = std::make_unique<FEDRawDataCollection>();
75 
76  const int ifed_first = FEDNumbering::MINHCALFEDID;
77  const int ifed_last = FEDNumbering::MAXHCALFEDID;
78 
79  int orbitN = e.id().event();
80  int bcnN = 2000;
81 
82  // Step C: pack all requested FEDs
83  for (int ifed = ifed_first; ifed <= ifed_last; ++ifed) {
84  FEDRawData& fed = raw->FEDData(ifed);
85  try {
86  packer_.pack(ifed, ifed - ifed_first, e.id().event(), orbitN, bcnN, colls, *readoutMap, fed);
87  } catch (cms::Exception& e) {
88  edm::LogWarning("Unpacking error") << e.what();
89  } catch (...) {
90  edm::LogWarning("Unpacking exception");
91  }
92  }
93 
94  e.put(std::move(raw));
95 }
EventNumber_t event() const
Definition: EventID.h:40
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:99
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
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:103
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:70
T const * product() const
Definition: Handle.h:69
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:59
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:511

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().