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;
111 for(
unsigned i = 0;
i < eles->size(); ++
i ) {
125 for(
unsigned i = 0;
i < phos->size(); ++
i ) {
141 template<
typename T,
typename U,
typename V>
142 inline void make_consumes(
T&
tag,U& tok,V& sume) {
if( !(empty_tag == tag) ) tok = sume.template consumes<edm::ValueMap<int> >(
tag); }
163 template<
typename T,
typename U,
typename V>
164 inline void assignValue(
const T& ptr,
const U& tok,
const V& map,
int&
value) {
165 if( !tok.isUninitialized() ) value = map.find(tok.index())->
second->get(ptr.id(),ptr.key());
182 <<
" not found in cache!";
188 assignValue(ptr,itr->second,
ele_vmaps,value);
193 <<
"Trying to add new UserInt = " << itr->first
194 <<
" failed because it already exists!";
212 <<
"Original object pointer with key = " << pho.
originalObjectRef().
key() <<
" not found in cache!";
218 assignValue(ptr,itr->second,
pho_vmaps,value);
223 <<
"Trying to add new UserInt = " << itr->first
224 <<
" 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
std::vector< std::string > getParameterNames() const
const edm::Ptr< reco::Candidate > & originalObjectRef() const
reference to original object. Returns a null reference if not available
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
void addUserInt(const std::string &label, int32_t data, const bool overwrite=false)
Set user-defined int.
Analysis-level electron class.
bool isUninitialized() const
#define DEFINE_EDM_PLUGIN(factory, type, name)