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

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

Definition at line 38 of file RawDataMapperByLabel.cc.

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 ( const edm::ParameterSet pset)

Constructor.

Definition at line 49 of file RawDataMapperByLabel.cc.

References SimL1EmulatorRepack_Full_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 }
T getParameter(std::string const &) const
edm::InputTag filledCollectionName_
std::vector< edm::EDGetTokenT< FEDRawDataCollection > > inputTokens_
edm::InputTag mainCollectionTag_
std::vector< edm::InputTag > inputTags_
RawDataMapperByLabel::~RawDataMapperByLabel ( )
override

Destructor.

Definition at line 62 of file RawDataMapperByLabel.cc.

62 {}

Member Function Documentation

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

Definition at line 92 of file RawDataMapperByLabel.cc.

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

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 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void RawDataMapperByLabel::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 64 of file RawDataMapperByLabel.cc.

References Exception, filledCollectionName_, firstEvent_, edm::Event::getByToken(), input, SimL1EmulatorRepack_Full_cff::inputTag, inputTags_, inputTokens_, edm::HandleBase::isValid(), mainCollectionTag_, edm::Handle< T >::product(), and edm::Event::put().

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

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 
82  if (!(filledCollectionName_ == *inputTag))
83  throw cms::Exception("BadInput") << "The filled collection has changed!";
84 
86  e.put(std::make_unique<FEDRawDataCollection>(*input.product()));
87  }
88  }
89  }
90 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
edm::InputTag filledCollectionName_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::vector< edm::EDGetTokenT< FEDRawDataCollection > > inputTokens_
static std::string const input
Definition: EdmProvDump.cc:48
std::vector< edm::EDGetTokenT< FEDRawDataCollection > >::const_iterator tok_iterator_t
bool isValid() const
Definition: HandleBase.h:70
std::vector< edm::InputTag >::const_iterator tag_iterator_t
T const * product() const
Definition: Handle.h:69
edm::InputTag mainCollectionTag_
std::vector< edm::InputTag > inputTags_

Member Data Documentation

edm::InputTag RawDataMapperByLabel::filledCollectionName_
private

Definition at line 45 of file RawDataMapperByLabel.cc.

Referenced by produce().

bool RawDataMapperByLabel::firstEvent_
private

Definition at line 46 of file RawDataMapperByLabel.cc.

Referenced by produce().

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

Definition at line 41 of file RawDataMapperByLabel.cc.

Referenced by produce(), and RawDataMapperByLabel().

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

Definition at line 42 of file RawDataMapperByLabel.cc.

Referenced by produce(), and RawDataMapperByLabel().

edm::InputTag RawDataMapperByLabel::mainCollectionTag_
private

Definition at line 44 of file RawDataMapperByLabel.cc.

Referenced by produce().