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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
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
 

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.

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 }

References SimL1EmulatorRepack_Full_cff::inputTag, inputTags_, and inputTokens_.

◆ ~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.

92  {
94 
95  desc.add<std::vector<edm::InputTag>>(
96  "rawCollectionList",
97  {{"rawDataCollector", "", "@skipCurrentProcess"}, {"rawDataRepacker"}, {"rawDataReducedFormat"}});
98  desc.add<edm::InputTag>("mainCollection", edm::InputTag("rawDataCollector"));
99 
100  descriptions.add("rawDataMapperByLabel", desc);
101 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

◆ produce()

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

Definition at line 64 of file RawDataMapperByLabel.cc.

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 }

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

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

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
input
static const std::string input
Definition: EdmProvDump.cc:48
RawDataMapperByLabel::inputTokens_
std::vector< edm::EDGetTokenT< FEDRawDataCollection > > inputTokens_
Definition: RawDataMapperByLabel.cc:42
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
RawDataMapperByLabel::filledCollectionName_
edm::InputTag filledCollectionName_
Definition: RawDataMapperByLabel.cc:45
edm::Handle
Definition: AssociativeIterator.h:50
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
RawDataMapperByLabel::tok_iterator_t
std::vector< edm::EDGetTokenT< FEDRawDataCollection > >::const_iterator tok_iterator_t
Definition: RawDataMapperByLabel.cc:39
RawDataMapperByLabel::firstEvent_
bool firstEvent_
Definition: RawDataMapperByLabel.cc:46
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
RawDataMapperByLabel::mainCollectionTag_
edm::InputTag mainCollectionTag_
Definition: RawDataMapperByLabel.cc:44
RawDataMapperByLabel::tag_iterator_t
std::vector< edm::InputTag >::const_iterator tag_iterator_t
Definition: RawDataMapperByLabel.cc:38
Exception
Definition: hltDiff.cc:246
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
RawDataMapperByLabel::inputTags_
std::vector< edm::InputTag > inputTags_
Definition: RawDataMapperByLabel.cc:41
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37