1 #ifndef DQMOffline_Trigger_FunctionDefs_h
2 #define DQMOffline_Trigger_FunctionDefs_h
39 template <
typename ObjType>
41 return obj.superCluster()->eta();
45 template <
typename ObjType>
47 std::function<float(const ObjType&)> varFunc;
52 template <
typename ObjType>
54 std::function<float(const ObjType&)> varFunc;
56 varFunc = &ObjType::et;
57 else if (varName ==
"pt")
59 else if (varName ==
"eta")
61 else if (varName ==
"phi")
64 varFunc = getUnaryFuncExtraFloat<ObjType>(varName);
66 if (!varFunc && !varName.empty()) {
68 <<
"var " << varName <<
" not recognised " << __FILE__ <<
"," << __LINE__ << std::endl;
74 std::function<float(const reco::GsfElectron&)> getUnaryFuncExtraFloat<reco::GsfElectron>(
const std::string& varName);
76 std::function<float(const reco::Photon&)> getUnaryFuncExtraFloat<reco::Photon>(
const std::string& varName);
float scEtaFunc(const ObjType &obj)
std::function< float(const ObjType &)> getUnaryFuncFloat(const std::string &varName)
std::function< float(const ObjType &)> getUnaryFuncExtraFloat(const std::string &varName)