Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:23

0001 /*
0002  *  plugin.cc
0003  *  CMSSW
0004  *
0005  *  Created by Chris Jones on 7/24/05.
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     // DESERIALIZE_BASE_CASE( condex::Efficiency ); abstract
0027     DESERIALIZE_POLIMORPHIC_CASE(condex::Efficiency, condex::ParametricEfficiencyInPt);
0028     DESERIALIZE_POLIMORPHIC_CASE(condex::Efficiency, condex::ParametricEfficiencyInEta);
0029 
0030     // here we come if none of the deserializations above match the payload type:
0031     throwException(std::string("Type mismatch, target object is type \"") + payloadType + "\"", "deserialize<>");
0032   }
0033 }  // namespace cond
0034 
0035 namespace {
0036   struct InitEfficiency {
0037     void operator()(condex::Efficiency& e) { e.initialize(); }
0038   };
0039 }  // namespace
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 }  // namespace cond::serialization
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);