Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:46:15

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     // DESERIALIZE_BASE_CASE( PerformancePayload );  abstract
0022     DESERIALIZE_POLIMORPHIC_CASE(PerformancePayload, PerformancePayloadFromTFormula);
0023     DESERIALIZE_POLIMORPHIC_CASE(PerformancePayload, PerformancePayloadFromBinnedTFormula);
0024     DESERIALIZE_POLIMORPHIC_CASE(PerformancePayload, PerformancePayloadFromTable);
0025     // here we come if none of the deserializations above match the payload type:
0026     throwException(std::string("Type mismatch, target object is type \"") + payloadType + "\"", "createPayload");
0027   }
0028 }  // namespace cond
0029 
0030 namespace {
0031   struct InitPerformancePayload {
0032     void operator()(PerformancePayload& e) { e.initialize(); }
0033   };
0034 }  // namespace
0035 
0036 REGISTER_PLUGIN_INIT(PerformancePayloadRecord, PerformancePayload, InitPerformancePayload);
0037 REGISTER_PLUGIN(PerformanceWPRecord, PerformanceWorkingPoint);
0038 REGISTER_PLUGIN_INIT(PFCalibrationRcd, PerformancePayload, InitPerformancePayload);