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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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::ESGetToken< HcalDbService, HcalDbRecordtok_dbService_
 
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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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 30 of file HcalDigiToRaw.h.

Constructor & Destructor Documentation

◆ HcalDigiToRaw()

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

Definition at line 11 of file HcalDigiToRaw.cc.

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

◆ ~HcalDigiToRaw()

HcalDigiToRaw::~HcalDigiToRaw ( )
override

Definition at line 30 of file HcalDigiToRaw.cc.

30 {}

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 33 of file HcalDigiToRaw.cc.

33  {
35 
36  // Step A: Get Inputs
38  if (!hbheTag_.label().empty()) {
39  e.getByToken(tok_hbhe_, hbhe);
40  colls.hbhe = hbhe.product();
41  }
43  if (!hoTag_.label().empty()) {
44  e.getByToken(tok_ho_, ho);
45  colls.hoCont = ho.product();
46  }
48  if (!hfTag_.label().empty()) {
49  e.getByToken(tok_hf_, hf);
50  colls.hfCont = hf.product();
51  }
53  if (!calibTag_.label().empty()) {
54  e.getByToken(tok_calib_, Calib);
55  colls.calibCont = Calib.product();
56  }
58  if (!zdcTag_.label().empty()) {
59  e.getByToken(tok_zdc_, zdc);
60  colls.zdcCont = zdc.product();
61  }
63  if (!trigTag_.label().empty()) {
64  e.getByToken(tok_htp_, htp);
65  if (htp.isValid())
66  colls.tpCont = htp.product();
67  }
68  // get the mapping
69  edm::ESHandle<HcalDbService> pSetup = es.getHandle(tok_dbService_);
70  const HcalElectronicsMap* readoutMap = pSetup->getHcalMapping();
71  // Step B: Create empty output
72  auto raw = std::make_unique<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(), orbitN, bcnN, colls, *readoutMap, fed);
85  } catch (cms::Exception& e) {
86  edm::LogWarning("Unpacking error") << e.what();
87  } catch (...) {
88  edm::LogWarning("Unpacking exception");
89  }
90  }
91 
92  e.put(std::move(raw));
93 }

References HcalPacker::Collections::calibCont, calibTag_, MillePedeFileConverter_cfg::e, edm::EventSetup::getHandle(), 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_dbService_, 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 38 of file HcalDigiToRaw.h.

Referenced by produce().

◆ hbheTag_

const edm::InputTag HcalDigiToRaw::hbheTag_
private

Definition at line 38 of file HcalDigiToRaw.h.

Referenced by produce().

◆ hfTag_

const edm::InputTag HcalDigiToRaw::hfTag_
private

Definition at line 38 of file HcalDigiToRaw.h.

Referenced by produce().

◆ hoTag_

const edm::InputTag HcalDigiToRaw::hoTag_
private

Definition at line 38 of file HcalDigiToRaw.h.

Referenced by produce().

◆ packer_

HcalPacker HcalDigiToRaw::packer_
private

Definition at line 37 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_calib_

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

Definition at line 42 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_dbService_

const edm::ESGetToken<HcalDbService, HcalDbRecord> HcalDigiToRaw::tok_dbService_
private

Definition at line 45 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_hbhe_

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

Definition at line 39 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_hf_

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

Definition at line 41 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_ho_

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

Definition at line 40 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_htp_

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

Definition at line 44 of file HcalDigiToRaw.h.

Referenced by produce().

◆ tok_zdc_

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

Definition at line 43 of file HcalDigiToRaw.h.

Referenced by produce().

◆ trigTag_

const edm::InputTag HcalDigiToRaw::trigTag_
private

Definition at line 38 of file HcalDigiToRaw.h.

Referenced by produce().

◆ zdcTag_

const edm::InputTag HcalDigiToRaw::zdcTag_
private

Definition at line 38 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:39
HcalDigiToRaw::tok_ho_
const edm::EDGetTokenT< HODigiCollection > tok_ho_
Definition: HcalDigiToRaw.h:40
HcalDigiToRaw::tok_dbService_
const edm::ESGetToken< HcalDbService, HcalDbRecord > tok_dbService_
Definition: HcalDigiToRaw.h:45
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:43
HcalDigiToRaw::hfTag_
const edm::InputTag hfTag_
Definition: HcalDigiToRaw.h:38
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
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HcalDbService::getHcalMapping
const HcalElectronicsMap * getHcalMapping() const
Definition: HcalDbService.cc:343
HcalDigiToRaw::packer_
HcalPacker packer_
Definition: HcalDigiToRaw.h:37
FEDRawData
Definition: FEDRawData.h:19
HcalDigiToRaw::calibTag_
const edm::InputTag calibTag_
Definition: HcalDigiToRaw.h:38
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
FEDNumbering::MAXHCALFEDID
Definition: FEDNumbering.h:48
HcalDigiToRaw::tok_hf_
const edm::EDGetTokenT< HFDigiCollection > tok_hf_
Definition: HcalDigiToRaw.h:41
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:38
HcalDigiToRaw::hoTag_
const edm::InputTag hoTag_
Definition: HcalDigiToRaw.h:38
HcalPacker::Collections::hbhe
const HBHEDigiCollection * hbhe
Definition: HcalPacker.h:16
FEDNumbering::MINHCALFEDID
Definition: FEDNumbering.h:47
photonIsolationHIProducer_cfi.ho
ho
Definition: photonIsolationHIProducer_cfi.py:10
HcalPacker::Collections::tpCont
const HcalTrigPrimDigiCollection * tpCont
Definition: HcalPacker.h:21
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:97
eostools.move
def move(src, dest)
Definition: eostools.py:511
HcalDigiToRaw::trigTag_
const edm::InputTag trigTag_
Definition: HcalDigiToRaw.h:38
HcalDigiToRaw::tok_calib_
const edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
Definition: HcalDigiToRaw.h:42
cms::Exception
Definition: Exception.h:70
HcalDigiToRaw::hbheTag_
const edm::InputTag hbheTag_
Definition: HcalDigiToRaw.h:38
HcalDigiToRaw::tok_htp_
const edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_htp_
Definition: HcalDigiToRaw.h:44
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