CMS 3D CMS Logo

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

#include <ESRawToDigi.h>

Inheritance diagram for ESRawToDigi:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ESRawToDigi (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &es)
 
virtual ~ESRawToDigi ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< FEDRawDataCollectiondataToken_
 
bool debug_
 
std::string ESdigiCollection_
 
ESUnpackerESUnpacker_
 
edm::EDGetTokenT< ESListOfFEDSfedsToken_
 
bool regional_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

Definition at line 14 of file ESRawToDigi.h.

Constructor & Destructor Documentation

ESRawToDigi::ESRawToDigi ( const edm::ParameterSet ps)

Definition at line 15 of file ESRawToDigi.cc.

References dataToken_, debug_, ESdigiCollection_, ESUnpacker_, fedsToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), regional_, mixOne_simraw_on_sim_cfi::sourceTag, and AlCaHLTBitMon_QueryRunRegistry::string.

16 {
17 
19  ESdigiCollection_ = ps.getParameter<std::string>("ESdigiCollection");
20  regional_ = ps.getUntrackedParameter<bool>("DoRegional",false);
21  edm::InputTag fedsListLabel
22  = ps.getUntrackedParameter<edm::InputTag>("ESFedsListLabel", edm::InputTag(":esfedslist"));
23  debug_ = ps.getUntrackedParameter<bool>("debugMode", false);
24 
25  ESUnpacker_ = new ESUnpacker(ps);
26 
27  produces<ESRawDataCollection>();
28  produces<ESLocalRawDataCollection>();
29  produces<ESDigiCollection>();
30  dataToken_=consumes<FEDRawDataCollection>(sourceTag);
31  if (regional_){
32  fedsToken_=consumes<ESListOfFEDS>(fedsListLabel);
33  }
34 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition: ESRawToDigi.h:30
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:38
std::string ESdigiCollection_
Definition: ESRawToDigi.h:29
bool regional_
Definition: ESRawToDigi.h:34
edm::EDGetTokenT< ESListOfFEDS > fedsToken_
Definition: ESRawToDigi.h:31
ESRawToDigi::~ESRawToDigi ( )
virtual

Definition at line 36 of file ESRawToDigi.cc.

References ESUnpacker_.

36  {
37 
38  delete ESUnpacker_;
39 
40 }
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:38

Member Function Documentation

void ESRawToDigi::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 42 of file ESRawToDigi.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

42  {
44  desc.add<edm::InputTag>("sourceTag",edm::InputTag("rawDataCollector"));
45  desc.addUntracked<bool>("debugMode",false);
46  desc.add<std::string>("InstanceES","");
47  desc.add<edm::FileInPath>("LookupTable",edm::FileInPath("EventFilter/ESDigiToRaw/data/ES_lookup_table.dat"));
48  desc.add<std::string>("ESdigiCollection","");
49  descriptions.add("esRawToDigi",desc);
50 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ESRawToDigi::produce ( edm::Event e,
const edm::EventSetup es 
)

Definition at line 52 of file ESRawToDigi.cc.

References gather_cfg::cout, dataToken_, debug_, ESdigiCollection_, ESUnpacker_, FEDRawDataCollection::FEDData(), l1t::stage2::layer2::fedId, fedsToken_, edm::Event::getByToken(), ESListOfFEDS::GetList(), mps_fire::i, ESUnpacker::interpretRawData(), edm::HandleBase::isValid(), LogDebug, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MINPreShowerFEDID, eostools::move(), edm::Event::put(), matplotRender::rawdata, regional_, and FEDRawData::size().

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

52  {
53 
54  // Input
56  e.getByToken(dataToken_, rawdata);
57  if (!rawdata.isValid()) {
58  LogDebug("") << "ESRawToDigi : Error! can't get rawdata!" << std::endl;
59  }
60 
61  std::vector<int> esFeds_to_unpack;
62  if (regional_) {
64  e.getByToken(fedsToken_, fedslist);
65  esFeds_to_unpack = fedslist->GetList();
66  }
67 
68  // Output
69  auto productDCC = std::make_unique<ESRawDataCollection>();
70  auto productKCHIP = std::make_unique<ESLocalRawDataCollection>();
71  auto productDigis = std::make_unique<ESDigiCollection>();
72 
73  ESDigiCollection digis;
74 
75  if (regional_) {
76  for (unsigned int i=0; i<esFeds_to_unpack.size(); ++i) {
77 
78  const FEDRawData& fedRawData = rawdata->FEDData(esFeds_to_unpack[i]);
79  ESUnpacker_->interpretRawData(esFeds_to_unpack[i], fedRawData, *productDCC, *productKCHIP, *productDigis);
80 
81  if (debug_) std::cout<<"FED : "<<esFeds_to_unpack[i]<<" Data size : "<<fedRawData.size()<<" (Bytes)"<<std::endl;
82  }
83  } else {
85 
86  const FEDRawData& fedRawData = rawdata->FEDData(fedId);
87  ESUnpacker_->interpretRawData(fedId, fedRawData, *productDCC, *productKCHIP, *productDigis);
88 
89  if (debug_) std::cout<<"FED : "<<fedId<<" Data size : "<<fedRawData.size()<<" (Bytes)"<<std::endl;
90  }
91  }
92 
93  e.put(std::move(productDCC));
94  e.put(std::move(productKCHIP));
95  e.put(std::move(productDigis), ESdigiCollection_);
96 }
#define LogDebug(id)
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition: ESRawToDigi.h:30
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:38
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< int > GetList() const
Definition: ESListOfFEDS.h:11
std::string ESdigiCollection_
Definition: ESRawToDigi.h:29
bool regional_
Definition: ESRawToDigi.h:34
bool isValid() const
Definition: HandleBase.h:74
void interpretRawData(int fedId, const FEDRawData &rawData, ESRawDataCollection &dccs, ESLocalRawDataCollection &kchips, ESDigiCollection &digis)
Definition: ESUnpacker.cc:53
edm::EDGetTokenT< ESListOfFEDS > fedsToken_
Definition: ESRawToDigi.h:31
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetTokenT<FEDRawDataCollection> ESRawToDigi::dataToken_
private

Definition at line 30 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

bool ESRawToDigi::debug_
private

Definition at line 36 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

std::string ESRawToDigi::ESdigiCollection_
private

Definition at line 29 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

ESUnpacker* ESRawToDigi::ESUnpacker_
private

Definition at line 38 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), produce(), and ~ESRawToDigi().

edm::EDGetTokenT<ESListOfFEDS> ESRawToDigi::fedsToken_
private

Definition at line 31 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

bool ESRawToDigi::regional_
private

Definition at line 34 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().