File indexing completed on 2024-04-06 12:01:23
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "CondCore/ESSources/interface/registration_macros.h"
0010 #include "CondFormats/Calibration/interface/Pedestals.h"
0011 #include "CondFormats/Calibration/interface/Conf.h"
0012 #include "CondFormats/DataRecord/interface/PedestalsRcd.h"
0013 #include "CondFormats/Calibration/interface/mySiStripNoises.h"
0014 #include "CondFormats/DataRecord/interface/mySiStripNoisesRcd.h"
0015 #include "CondFormats/Calibration/interface/Efficiency.h"
0016 #include "CondFormats/DataRecord/interface/ExEfficiency.h"
0017
0018
0019 #include "CondCore/CondDB/interface/Serialization.h"
0020
0021 namespace cond {
0022 template <>
0023 std::unique_ptr<condex::Efficiency> deserialize<condex::Efficiency>(const std::string& payloadType,
0024 const Binary& payloadData,
0025 const Binary& streamerInfoData) {
0026
0027 DESERIALIZE_POLIMORPHIC_CASE(condex::Efficiency, condex::ParametricEfficiencyInPt);
0028 DESERIALIZE_POLIMORPHIC_CASE(condex::Efficiency, condex::ParametricEfficiencyInEta);
0029
0030
0031 throwException(std::string("Type mismatch, target object is type \"") + payloadType + "\"", "deserialize<>");
0032 }
0033 }
0034
0035 namespace {
0036 struct InitEfficiency {
0037 void operator()(condex::Efficiency& e) { e.initialize(); }
0038 };
0039 }
0040
0041 namespace cond::serialization {
0042 template <>
0043 struct BaseClassInfo<condex::Efficiency> {
0044 constexpr static bool kAbstract = true;
0045 using inheriting_classes_t = edm::mpl::Vector<condex::ParametricEfficiencyInPt, condex::ParametricEfficiencyInEta>;
0046 };
0047
0048 }
0049
0050 DEFINE_COND_CLASSNAME(condex::ParametricEfficiencyInPt)
0051 DEFINE_COND_CLASSNAME(condex::ParametricEfficiencyInEta)
0052
0053 REGISTER_PLUGIN(PedestalsRcd, Pedestals);
0054 REGISTER_PLUGIN_NO_SERIAL(anotherPedestalsRcd, Pedestals);
0055 REGISTER_PLUGIN(mySiStripNoisesRcd, mySiStripNoises);
0056 REGISTER_PLUGIN_INIT(ExEfficiencyRcd, condex::Efficiency, InitEfficiency);