CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Public Attributes
EgammaHLTExtraProducer::Tokens Struct Reference

Classes

struct  EgObjTokens
 

Public Member Functions

 Tokens (const edm::ParameterSet &pset, edm::ConsumesCollector &&cc)
 

Static Public Member Functions

template<typename T >
static void setToken (edm::EDGetTokenT< T > &token, edm::ConsumesCollector &cc, const edm::ParameterSet &pset, const std::string &tagname)
 
template<typename T >
static void setToken (std::vector< edm::EDGetTokenT< T >> &tokens, edm::ConsumesCollector &cc, const edm::ParameterSet &pset, const std::string &tagname)
 
template<typename T >
static void setToken (std::vector< std::pair< edm::EDGetTokenT< T >, std::string >> &tokens, edm::ConsumesCollector &cc, const edm::ParameterSet &pset, const std::string &tagname)
 
static void setToken (std::vector< std::pair< EgObjTokens, std::string >> &tokens, edm::ConsumesCollector &cc, const edm::ParameterSet &pset, const std::string &tagname)
 

Public Attributes

std::vector< std::pair< edm::EDGetTokenT< EcalRecHitCollection >, std::string > > ecal
 
std::vector< std::pair< EgObjTokens, std::string > > egCands
 
std::vector< std::pair< edm::EDGetTokenT< HBHERecHitCollection >, std::string > > hcal
 
std::vector< std::pair< edm::EDGetTokenT< reco::PFClusterCollection >, std::string > > pfClusIso
 
std::vector< std::pair< edm::EDGetTokenT< reco::TrackCollection >, std::string > > trks
 

Detailed Description

Definition at line 116 of file EgammaHLTExtraProducer.cc.

Constructor & Destructor Documentation

◆ Tokens()

EgammaHLTExtraProducer::Tokens::Tokens ( const edm::ParameterSet pset,
edm::ConsumesCollector &&  cc 
)

Definition at line 188 of file EgammaHLTExtraProducer.cc.

References egCands, pfClusIso, muonDTDigis_cfi::pset, setToken(), and trks.

188  {
189  setToken(egCands, cc, pset, "egCands");
190  setToken(ecal, cc, pset, "ecal");
191  setToken(hcal, cc, pset, "hcal");
192  setToken(trks, cc, pset, "trks");
193  setToken(pfClusIso, cc, pset, "pfClusIso");
194 }
std::vector< std::pair< edm::EDGetTokenT< reco::PFClusterCollection >, std::string > > pfClusIso
std::vector< std::pair< edm::EDGetTokenT< reco::TrackCollection >, std::string > > trks
static void setToken(edm::EDGetTokenT< T > &token, edm::ConsumesCollector &cc, const edm::ParameterSet &pset, const std::string &tagname)
std::vector< std::pair< EgObjTokens, std::string > > egCands

Member Function Documentation

◆ setToken() [1/4]

template<typename T >
static void EgammaHLTExtraProducer::Tokens::setToken ( edm::EDGetTokenT< T > &  token,
edm::ConsumesCollector cc,
const edm::ParameterSet pset,
const std::string &  tagname 
)
inlinestatic

Definition at line 131 of file EgammaHLTExtraProducer.cc.

References edm::ConsumesCollector::consumes(), muonDTDigis_cfi::pset, createPayload::tagname, and unpackBuffers-CaloStage2::token.

Referenced by setToken(), and Tokens().

134  {
135  token = cc.consumes<T>(pset.getParameter<edm::InputTag>(tagname));
136  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
long double T

◆ setToken() [2/4]

template<typename T >
static void EgammaHLTExtraProducer::Tokens::setToken ( std::vector< edm::EDGetTokenT< T >> &  tokens,
edm::ConsumesCollector cc,
const edm::ParameterSet pset,
const std::string &  tagname 
)
inlinestatic

Definition at line 138 of file EgammaHLTExtraProducer.cc.

References edm::ConsumesCollector::consumes(), HLTMuonOfflineAnalyzer_cfi::inputTags, muonDTDigis_cfi::pset, and createPayload::tagname.

141  {
142  auto inputTags = pset.getParameter<std::vector<edm::InputTag>>(tagname);
143  tokens.resize(inputTags.size());
144  for (size_t tagNr = 0; tagNr < inputTags.size(); tagNr++) {
145  tokens[tagNr] = cc.consumes<T>(inputTags[tagNr]);
146  }
147  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
inputTags
All input tags are specified in this pset for convenience.
long double T

◆ setToken() [3/4]

template<typename T >
static void EgammaHLTExtraProducer::Tokens::setToken ( std::vector< std::pair< edm::EDGetTokenT< T >, std::string >> &  tokens,
edm::ConsumesCollector cc,
const edm::ParameterSet pset,
const std::string &  tagname 
)
inlinestatic

Definition at line 149 of file EgammaHLTExtraProducer.cc.

References edm::ConsumesCollector::consumes(), label, eostools::move(), muonDTDigis_cfi::pset, AlCaHLTBitMon_QueryRunRegistry::string, createPayload::tagname, and unpackBuffers-CaloStage2::token.

152  {
153  const auto& collectionPSets = pset.getParameter<std::vector<edm::ParameterSet>>(tagname);
154  for (const auto& collPSet : collectionPSets) {
155  edm::EDGetTokenT<T> token = cc.consumes<T>(collPSet.getParameter<edm::InputTag>("src"));
156  std::string label = collPSet.getParameter<std::string>("label");
157  tokens.emplace_back(token, std::move(label));
158  }
159  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
char const * label
long double T
def move(src, dest)
Definition: eostools.py:511

◆ setToken() [4/4]

static void EgammaHLTExtraProducer::Tokens::setToken ( std::vector< std::pair< EgObjTokens, std::string >> &  tokens,
edm::ConsumesCollector cc,
const edm::ParameterSet pset,
const std::string &  tagname 
)
inlinestatic

Definition at line 161 of file EgammaHLTExtraProducer.cc.

References EgammaHLTExtraProducer::Tokens::EgObjTokens::ecalCands, EgammaHLTExtraProducer::Tokens::EgObjTokens::gsfTracks, label, eostools::move(), EgammaHLTExtraProducer::Tokens::EgObjTokens::pixelSeeds, muonDTDigis_cfi::pset, setToken(), AlCaHLTBitMon_QueryRunRegistry::string, and createPayload::tagname.

164  {
165  const auto& collectionPSets = pset.getParameter<std::vector<edm::ParameterSet>>(tagname);
166  for (const auto& collPSet : collectionPSets) {
167  EgObjTokens objTokens;
168  setToken(objTokens.ecalCands, cc, collPSet, "ecalCands");
169  setToken(objTokens.gsfTracks, cc, collPSet, "gsfTracks");
170  setToken(objTokens.pixelSeeds, cc, collPSet, "pixelSeeds");
171  std::string label = collPSet.getParameter<std::string>("label");
172  tokens.emplace_back(objTokens, std::move(label));
173  }
174  }
char const * label
static void setToken(edm::EDGetTokenT< T > &token, edm::ConsumesCollector &cc, const edm::ParameterSet &pset, const std::string &tagname)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ ecal

std::vector<std::pair<edm::EDGetTokenT<EcalRecHitCollection>, std::string> > EgammaHLTExtraProducer::Tokens::ecal

Definition at line 125 of file EgammaHLTExtraProducer.cc.

Referenced by EgammaHLTExtraProducer::produce().

◆ egCands

std::vector<std::pair<EgObjTokens, std::string> > EgammaHLTExtraProducer::Tokens::egCands

Definition at line 123 of file EgammaHLTExtraProducer.cc.

Referenced by EgammaHLTExtraProducer::produce(), and Tokens().

◆ hcal

std::vector<std::pair<edm::EDGetTokenT<HBHERecHitCollection>, std::string> > EgammaHLTExtraProducer::Tokens::hcal

Definition at line 126 of file EgammaHLTExtraProducer.cc.

Referenced by EgammaHLTExtraProducer::produce().

◆ pfClusIso

std::vector<std::pair<edm::EDGetTokenT<reco::PFClusterCollection>, std::string> > EgammaHLTExtraProducer::Tokens::pfClusIso

Definition at line 128 of file EgammaHLTExtraProducer.cc.

Referenced by EgammaHLTExtraProducer::produce(), and Tokens().

◆ trks

std::vector<std::pair<edm::EDGetTokenT<reco::TrackCollection>, std::string> > EgammaHLTExtraProducer::Tokens::trks

Definition at line 127 of file EgammaHLTExtraProducer.cc.

Referenced by EgammaHLTExtraProducer::produce(), and Tokens().