Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add labelsFromToken function to event/lumi/run #8183

Merged
merged 1 commit into from Mar 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions FWCore/Framework/interface/EDConsumerBase.h
Expand Up @@ -34,6 +34,7 @@
#include "DataFormats/Provenance/interface/BranchType.h"
#include "FWCore/Utilities/interface/ProductHolderIndex.h"
#include "FWCore/Utilities/interface/ProductKindOfType.h"
#include "FWCore/Utilities/interface/ProductLabels.h"


// forward declarations
Expand Down Expand Up @@ -71,11 +72,7 @@ namespace edm {
void updateLookup(BranchType iBranchType,
ProductHolderIndexHelper const&);

struct Labels {
const char* module;
const char* productInstance;
const char* process;
};
typedef ProductLabels Labels;
void labelsForToken(EDGetToken iToken, Labels& oLabels) const;

void modulesDependentUpon(const std::string& iProcessName,
Expand Down
2 changes: 2 additions & 0 deletions FWCore/Framework/interface/Event.h
Expand Up @@ -216,6 +216,8 @@ namespace edm {

ModuleCallingContext const* moduleCallingContext() const { return moduleCallingContext_; }

void labelsForToken(EDGetToken const& iToken, ProductLabels& oLabels) const { provRecorder_.labelsForToken(iToken, oLabels); }

typedef std::vector<std::pair<std::unique_ptr<WrapperBase>, BranchDescription const*> > ProductPtrVec;

private:
Expand Down
2 changes: 2 additions & 0 deletions FWCore/Framework/interface/LuminosityBlock.h
Expand Up @@ -129,6 +129,8 @@ namespace edm {

ModuleCallingContext const* moduleCallingContext() const { return moduleCallingContext_; }

void labelsForToken(EDGetToken const& iToken, ProductLabels& oLabels) const { provRecorder_.labelsForToken(iToken, oLabels); }

private:
LuminosityBlockPrincipal const&
luminosityBlockPrincipal() const;
Expand Down
3 changes: 3 additions & 0 deletions FWCore/Framework/interface/PrincipalGetAdapter.h
Expand Up @@ -104,6 +104,7 @@ edm::Ref<AppleCollection> ref(refApples, index);
#include "FWCore/Utilities/interface/InputTag.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Utilities/interface/ProductKindOfType.h"
#include "FWCore/Utilities/interface/ProductLabels.h"


namespace edm {
Expand Down Expand Up @@ -202,6 +203,8 @@ namespace edm {
// from the Principal class.
EDProductGetter const* prodGetter() const;

void labelsForToken(EDGetToken const& iToken, ProductLabels& oLabels) const;

private:
// Is this an Event, a LuminosityBlock, or a Run.
BranchType const& branchType() const;
Expand Down
2 changes: 2 additions & 0 deletions FWCore/Framework/interface/Run.h
Expand Up @@ -142,6 +142,8 @@ namespace edm {

ModuleCallingContext const* moduleCallingContext() const { return moduleCallingContext_; }

void labelsForToken(EDGetToken const& iToken, ProductLabels& oLabels) const { provRecorder_.labelsForToken(iToken, oLabels); }

private:
RunPrincipal const&
runPrincipal() const;
Expand Down
5 changes: 5 additions & 0 deletions FWCore/Framework/src/PrincipalGetAdapter.cc
Expand Up @@ -96,6 +96,11 @@ namespace edm {
<< "The index of the token was "<<token.index()<<".\n";
}

void
PrincipalGetAdapter::labelsForToken(EDGetToken const& iToken, ProductLabels& oLabels) const {
consumer_->labelsForToken(iToken,oLabels);
}

BasicHandle
PrincipalGetAdapter::makeFailToGetException(KindOfType kindOfType,
TypeID const& productType,
Expand Down
10 changes: 10 additions & 0 deletions FWCore/Utilities/interface/ProductLabels.h
@@ -0,0 +1,10 @@
#ifndef FWCore_Utilities_ProductLabels_h
#define FWCore_Utilities_ProductLabels_h
namespace edm {
struct ProductLabels {
char const* module;
char const* productInstance;
char const* process;
};
}
#endif