15 #include <unordered_map>
20 typedef std::unordered_map<std::string,ValMapFloatToken>
ValueMaps;
40 void setConsumes(edm::ConsumesCollector&) override final;
57 "EGExtraInfoModifierFromFloatValueMaps");
59 EGExtraInfoModifierFromFloatValueMaps::
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<float> >(
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 UserFloat = " << 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 UserFloat = " << 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
bool hasUserFloat(const std::string &key) const
Return true if there is a user-defined float with a given name.
U second(std::pair< T, U > const &p)
const std::string & name() const
void addUserFloat(const std::string &label, float data)
Set user-defined float.
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)