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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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::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 }

◆ ~HcalDigiToRaw()

HcalDigiToRaw::~HcalDigiToRaw ( )
override

Definition at line 31 of file HcalDigiToRaw.cc.

31 {}

Member Function Documentation

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 34 of file HcalDigiToRaw.cc.

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 }

References HcalPacker::Collections::calibCont, calibTag_, MillePedeFileConverter_cfg::e, edm::EventSetup::get(), get, HcalDbService::getHcalMapping(), photonIsolationHIProducer_cfi::hbhe, HcalPacker::Collections::hbhe, hbheTag_, photonIsolationHIProducer_cfi::hf, HcalPacker::Collections::hfCont, hfTag_, photonIsolationHIProducer_cfi::ho, HcalPacker::Collections::hoCont, hoTag_, edm::HandleBase::isValid(), edm::InputTag::label(), FEDNumbering::MAXHCALFEDID, FEDNumbering::MINHCALFEDID, eostools::move(), HcalPacker::pack(), packer_, edm::Handle< T >::product(), tok_calib_, tok_hbhe_, tok_hf_, tok_ho_, tok_htp_, tok_zdc_, HcalPacker::Collections::tpCont, trigTag_, hcalSimParameters_cfi::zdc, HcalPacker::Collections::zdcCont, and zdcTag_.

Member Data Documentation

◆ calibTag_

const edm::InputTag HcalDigiToRaw::calibTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

◆ hbheTag_

const edm::InputTag HcalDigiToRaw::hbheTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

◆ hfTag_

const edm::InputTag HcalDigiToRaw::hfTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

◆ hoTag_

const edm::InputTag HcalDigiToRaw::hoTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

◆ packer_

HcalPacker HcalDigiToRaw::packer_
private

Definition at line 34 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_calib_

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

Definition at line 39 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_hbhe_

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

Definition at line 36 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_hf_

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

Definition at line 38 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_ho_

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

Definition at line 37 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_htp_

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

Definition at line 41 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_zdc_

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

Definition at line 40 of file HcalDigiToRaw.h.

Referenced by produce().

◆ trigTag_

const edm::InputTag HcalDigiToRaw::trigTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

◆ zdcTag_

const edm::InputTag HcalDigiToRaw::zdcTag_
private

Definition at line 35 of file HcalDigiToRaw.h.

Referenced by produce().

edm::Handle::product
T const * product() const
Definition: Handle.h:70
HcalDigiToRaw::tok_hbhe_
const edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
Definition: HcalDigiToRaw.h:36
HcalDigiToRaw::tok_ho_
const edm::EDGetTokenT< HODigiCollection > tok_ho_
Definition: HcalDigiToRaw.h:37
HcalPacker::pack
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
HcalDigiToRaw::tok_zdc_
const edm::EDGetTokenT< ZDCDigiCollection > tok_zdc_
Definition: HcalDigiToRaw.h:40
HcalDigiToRaw::hfTag_
const edm::InputTag hfTag_
Definition: HcalDigiToRaw.h:35
HcalPacker::Collections::calibCont
const HcalCalibDigiCollection * calibCont
Definition: HcalPacker.h:19
edm::Handle
Definition: AssociativeIterator.h:50
HcalPacker::Collections::zdcCont
const ZDCDigiCollection * zdcCont
Definition: HcalPacker.h:20
HcalDbService::getHcalMapping
const HcalElectronicsMap * getHcalMapping() const
Definition: HcalDbService.cc:343
HcalDigiToRaw::packer_
HcalPacker packer_
Definition: HcalDigiToRaw.h:34
FEDRawData
Definition: FEDRawData.h:19
HcalDigiToRaw::calibTag_
const edm::InputTag calibTag_
Definition: HcalDigiToRaw.h:35
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
HcalDigiToRaw::tok_hf_
const edm::EDGetTokenT< HFDigiCollection > tok_hf_
Definition: HcalDigiToRaw.h:38
photonIsolationHIProducer_cfi.hf
hf
Definition: photonIsolationHIProducer_cfi.py:9
HcalPacker::Collections
Definition: HcalPacker.h:14
edm::ESHandle< HcalDbService >
HcalDigiToRaw::zdcTag_
const edm::InputTag zdcTag_
Definition: HcalDigiToRaw.h:35
edm::LogWarning
Definition: MessageLogger.h:141
HcalDigiToRaw::hoTag_
const edm::InputTag hoTag_
Definition: HcalDigiToRaw.h:35
HcalPacker::Collections::hbhe
const HBHEDigiCollection * hbhe
Definition: HcalPacker.h:16
photonIsolationHIProducer_cfi.ho
ho
Definition: photonIsolationHIProducer_cfi.py:10
HcalPacker::Collections::tpCont
const HcalTrigPrimDigiCollection * tpCont
Definition: HcalPacker.h:21
get
#define get
HcalPacker::Collections::hoCont
const HODigiCollection * hoCont
Definition: HcalPacker.h:17
HcalElectronicsMap
Definition: HcalElectronicsMap.h:31
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
hcalSimParameters_cfi.zdc
zdc
Definition: hcalSimParameters_cfi.py:92
eostools.move
def move(src, dest)
Definition: eostools.py:511
FEDNumbering::MINHCALFEDID
Definition: FEDNumbering.h:47
HcalDigiToRaw::trigTag_
const edm::InputTag trigTag_
Definition: HcalDigiToRaw.h:35
HcalDigiToRaw::tok_calib_
const edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
Definition: HcalDigiToRaw.h:39
cms::Exception
Definition: Exception.h:70
HcalDbRecord
Definition: HcalDbRecord.h:30
FEDNumbering::MAXHCALFEDID
Definition: FEDNumbering.h:48
HcalDigiToRaw::hbheTag_
const edm::InputTag hbheTag_
Definition: HcalDigiToRaw.h:35
HcalDigiToRaw::tok_htp_
const edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_htp_
Definition: HcalDigiToRaw.h:41
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
HcalPacker::Collections::hfCont
const HFDigiCollection * hfCont
Definition: HcalPacker.h:18
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37