test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
< FEDRawDataCollection
dataToken_
 
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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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(), HLT_25ns10e33_v2_cff::InputTag, regional_, HLT_25ns10e33_v2_cff::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(), HLT_25ns10e33_v2_cff::InputTag, 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 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 52 of file ESRawToDigi.cc.

References gather_cfg::cout, dataToken_, debug_, ESdigiCollection_, ESUnpacker_, stage2BMTFBufferRaw_cfi::fedId, fedsToken_, edm::Event::getByToken(), i, ESUnpacker::interpretRawData(), edm::HandleBase::isValid(), LogDebug, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MINPreShowerFEDID, edm::Event::put(), lumiPlot::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  std::auto_ptr<ESRawDataCollection> productDCC(new ESRawDataCollection);
70  std::auto_ptr<ESLocalRawDataCollection> productKCHIP(new ESLocalRawDataCollection);
71  std::auto_ptr<ESDigiCollection> productDigis(new 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(productDCC);
94  e.put(productKCHIP);
95  e.put(productDigis, ESdigiCollection_);
96 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition: ESRawToDigi.h:30
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:38
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
std::string ESdigiCollection_
Definition: ESRawToDigi.h:29
bool regional_
Definition: ESRawToDigi.h:34
bool isValid() const
Definition: HandleBase.h:75
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
tuple cout
Definition: gather_cfg.py:145
dictionary rawdata
Definition: lumiPlot.py:393

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