File indexing completed on 2024-04-06 12:01:43
0001 #include "CondCore/ESSources/interface/registration_macros.h"
0002
0003 #include "CondFormats/DataRecord/interface/PerformancePayloadRecord.h"
0004 #include "CondFormats/DataRecord/interface/PerformanceWPRecord.h"
0005 #include "CondFormats/DataRecord/interface/PFCalibrationRcd.h"
0006
0007 #include "CondFormats/PhysicsToolsObjects/interface/PerformancePayload.h"
0008 #include "CondFormats/PhysicsToolsObjects/interface/PerformanceWorkingPoint.h"
0009
0010 #include "CondFormats/PhysicsToolsObjects/interface/PerformancePayloadFromBinnedTFormula.h"
0011 #include "CondFormats/PhysicsToolsObjects/interface/PerformancePayloadFromTFormula.h"
0012 #include "CondFormats/PhysicsToolsObjects/interface/PerformancePayloadFromTable.h"
0013
0014 #include "CondCore/CondDB/interface/Serialization.h"
0015
0016 namespace cond {
0017 template <>
0018 std::unique_ptr<PerformancePayload> deserialize<PerformancePayload>(const std::string& payloadType,
0019 const Binary& payloadData,
0020 const Binary& streamerInfoData) {
0021
0022 DESERIALIZE_POLIMORPHIC_CASE(PerformancePayload, PerformancePayloadFromTFormula);
0023 DESERIALIZE_POLIMORPHIC_CASE(PerformancePayload, PerformancePayloadFromBinnedTFormula);
0024 DESERIALIZE_POLIMORPHIC_CASE(PerformancePayload, PerformancePayloadFromTable);
0025
0026 throwException(std::string("Type mismatch, target object is type \"") + payloadType + "\"", "createPayload");
0027 }
0028 }
0029
0030 namespace {
0031 struct InitPerformancePayload {
0032 void operator()(PerformancePayload& e) { e.initialize(); }
0033 };
0034 }
0035
0036 namespace cond::serialization {
0037 template <>
0038 struct BaseClassInfo<PerformancePayload> {
0039 constexpr static bool kAbstract = true;
0040 using inheriting_classes_t = edm::mpl::
0041 Vector<PerformancePayloadFromTFormula, PerformancePayloadFromBinnedTFormula, PerformancePayloadFromTable>;
0042 };
0043 }
0044
0045 DEFINE_COND_CLASSNAME(PerformancePayloadFromTFormula)
0046 DEFINE_COND_CLASSNAME(PerformancePayloadFromBinnedTFormula)
0047 DEFINE_COND_CLASSNAME(PerformancePayloadFromTable)
0048
0049 REGISTER_PLUGIN_INIT(PerformancePayloadRecord, PerformancePayload, InitPerformancePayload);
0050 REGISTER_PLUGIN(PerformanceWPRecord, PerformanceWorkingPoint);
0051 REGISTER_PLUGIN_NO_SERIAL_INIT(PFCalibrationRcd, PerformancePayload, InitPerformancePayload);