CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
RawDataMapperByLabel Class Reference
Inheritance diagram for RawDataMapperByLabel:
edm::stream::EDProducer<>

Public Member Functions

void produce (edm::Event &e, const edm::EventSetup &c) override
 
 RawDataMapperByLabel (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~RawDataMapperByLabel () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::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
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Types

typedef std::vector< edm::InputTag >::const_iterator tag_iterator_t
 
typedef std::vector< edm::EDGetTokenT< FEDRawDataCollection > >::const_iterator tok_iterator_t
 

Private Attributes

edm::InputTag filledCollectionName_
 
bool firstEvent_
 
std::vector< edm::InputTaginputTags_
 
std::vector< edm::EDGetTokenT< FEDRawDataCollection > > inputTokens_
 
edm::InputTag mainCollectionTag_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 25 of file RawDataMapperByLabel.cc.

Member Typedef Documentation

◆ tag_iterator_t

typedef std::vector<edm::InputTag>::const_iterator RawDataMapperByLabel::tag_iterator_t
private

Definition at line 38 of file RawDataMapperByLabel.cc.

◆ tok_iterator_t

typedef std::vector<edm::EDGetTokenT<FEDRawDataCollection> >::const_iterator RawDataMapperByLabel::tok_iterator_t
private

Definition at line 39 of file RawDataMapperByLabel.cc.

Constructor & Destructor Documentation

◆ RawDataMapperByLabel()

RawDataMapperByLabel::RawDataMapperByLabel ( const edm::ParameterSet pset)

Constructor.

Definition at line 49 of file RawDataMapperByLabel.cc.

References ALCARECOSiStripCalZeroBias_cff::inputTag, inputTags_, and inputTokens_.

50  : inputTags_(pset.getParameter<std::vector<edm::InputTag>>("rawCollectionList")),
51  mainCollectionTag_(pset.getParameter<edm::InputTag>("mainCollection")),
53  firstEvent_(true) {
54  inputTokens_.reserve(inputTags_.size());
55  for (auto const& inputTag : inputTags_) {
56  inputTokens_.push_back(consumes<FEDRawDataCollection>(inputTag));
57  }
58 
59  produces<FEDRawDataCollection>();
60 }
edm::InputTag filledCollectionName_
std::vector< edm::EDGetTokenT< FEDRawDataCollection > > inputTokens_
edm::InputTag mainCollectionTag_
std::vector< edm::InputTag > inputTags_

◆ ~RawDataMapperByLabel()

RawDataMapperByLabel::~RawDataMapperByLabel ( )
override

Destructor.

Definition at line 62 of file RawDataMapperByLabel.cc.

62 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 92 of file RawDataMapperByLabel.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

92  {
94 
95  desc.add<std::vector<edm::InputTag>>("rawCollectionList",
96  {{"rawDataCollector", "", "@skipCurrentProcess"},
97  {"rawDataRepacker"},
98  {"rawPrimeDataRepacker"},
99  {"rawDataReducedFormat"}});
100  desc.add<edm::InputTag>("mainCollection", edm::InputTag("rawDataCollector"));
101 
102  descriptions.add("rawDataMapperByLabel", desc);
103 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void RawDataMapperByLabel::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 64 of file RawDataMapperByLabel.cc.

References MillePedeFileConverter_cfg::e, Exception, filledCollectionName_, firstEvent_, input, ALCARECOSiStripCalZeroBias_cff::inputTag, inputTags_, inputTokens_, and mainCollectionTag_.

64  {
65  bool alreadyACollectionFilled = false;
67  for (tok_iterator_t inputTok = inputTokens_.begin(); inputTok != inputTokens_.end(); ++inputTok, ++inputTag) {
69  if (e.getByToken(*inputTok, input)) {
70  if (input.isValid()) {
71  if (alreadyACollectionFilled)
72  throw cms::Exception("BadInput")
73  << "Two input collections are present." << std::endl
74  << "Please make sure that the input dataset has only one FEDRawDataCollector collection filled";
75 
76  if (firstEvent_) {
78  alreadyACollectionFilled = true;
79  firstEvent_ = false;
80  }
81 
83  throw cms::Exception("BadInput") << "The filled collection has changed!";
84 
86  e.put(std::make_unique<FEDRawDataCollection>(*input.product()));
87  }
88  }
89  }
90 }
edm::InputTag filledCollectionName_
std::vector< edm::EDGetTokenT< FEDRawDataCollection > > inputTokens_
static std::string const input
Definition: EdmProvDump.cc:50
std::vector< edm::EDGetTokenT< FEDRawDataCollection > >::const_iterator tok_iterator_t
std::vector< edm::InputTag >::const_iterator tag_iterator_t
edm::InputTag mainCollectionTag_
std::vector< edm::InputTag > inputTags_

Member Data Documentation

◆ filledCollectionName_

edm::InputTag RawDataMapperByLabel::filledCollectionName_
private

Definition at line 45 of file RawDataMapperByLabel.cc.

Referenced by produce().

◆ firstEvent_

bool RawDataMapperByLabel::firstEvent_
private

Definition at line 46 of file RawDataMapperByLabel.cc.

Referenced by produce().

◆ inputTags_

std::vector<edm::InputTag> RawDataMapperByLabel::inputTags_
private

Definition at line 41 of file RawDataMapperByLabel.cc.

Referenced by produce(), and RawDataMapperByLabel().

◆ inputTokens_

std::vector<edm::EDGetTokenT<FEDRawDataCollection> > RawDataMapperByLabel::inputTokens_
private

Definition at line 42 of file RawDataMapperByLabel.cc.

Referenced by produce(), and RawDataMapperByLabel().

◆ mainCollectionTag_

edm::InputTag RawDataMapperByLabel::mainCollectionTag_
private

Definition at line 44 of file RawDataMapperByLabel.cc.

Referenced by produce().