15 #include <unordered_map>
20 typedef std::unordered_map<std::string,ValMapIntToken>
ValueMaps;
40 void setConsumes(edm::ConsumesCollector&) override final;
57 "EGExtraInfoModifierFromIntValueMaps");
59 EGExtraInfoModifierFromIntValueMaps::
62 constexpr char electronSrc[] =
"electronSrc";
65 if( conf.exists(
"electron_config") ) {
76 if( conf.exists(
"photon_config") ) {
87 ele_idx = pho_idx = 0;
109 for(
unsigned i = 0;
i < eles->size(); ++
i ) {
123 for(
unsigned i = 0;
i < phos->size(); ++
i ) {
138 template<
typename T,
typename U,
typename V>
139 inline void make_consumes(
T&
tag,U&
tok,V& sume) {
if( !(empty_tag == tag) ) tok = sume.template consumes<edm::ValueMap<int> >(
tag); }
158 template<
typename T,
typename U,
typename V>
160 if( !tok.isUninitialized() ) value = map.find(tok.index())->
second->get(ptr.id(),ptr.key());
176 <<
" not found in cache!";
187 <<
"Trying to add new UserInt = " << itr->first
188 <<
" failed because it already exists!";
206 <<
"Original object pointer with key = " << pho.
originalObjectRef().
key() <<
" not found in cache!";
217 <<
"Trying to add new UserInt = " << itr->first
218 <<
" failed because it already exists!";
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Analysis-level Photon class.
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
U second(std::pair< T, U > const &p)
bool hasUserInt(const std::string &key) const
Return true if there is a user-defined int with a given name.
const std::string & name() const
void addUserInt(const std::string &label, int32_t data)
Set user-defined int.
std::vector< std::string > getParameterNames() const
const edm::Ptr< reco::Candidate > & originalObjectRef() const
reference to original object. Returns a null reference if not available
Analysis-level electron class.
bool isUninitialized() const
#define DEFINE_EDM_PLUGIN(factory, type, name)