Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "CondCore/ESSources/interface/ProductResolverFactory.h"
0002 #include "CondCore/ESSources/interface/ProductResolver.h"
0003 #include "FWCore/PluginManager/interface/PluginManager.h"
0004 #include "FWCore/PluginManager/interface/standard.h"
0005 
0006 #include <iostream>
0007 
0008 int main(int argc, char* argv[]) {
0009   if (argc != 2) {
0010     std::cerr << "requires exactly one argument";
0011     return 1;
0012   }
0013 
0014   std::string argument(argv[1]);
0015   if (argument == "-h" or argument == "--help") {
0016     std::cout << "condRecordToDataProduct [record]\n\n"
0017                  "returns the C++ type name of the DataProduct held by Record [record]"
0018               << std::endl;
0019     return 0;
0020   }
0021 
0022   edmplugin::PluginManager::configure(edmplugin::standard::config());
0023 
0024   auto plugin = cond::ProductResolverFactory::get()->tryToCreate(argument + "@NewProxy");
0025   if (not plugin) {
0026     std::cerr << "unable to find proxy for record " << argument;
0027     return 2;
0028   }
0029 
0030   std::cout << plugin->type().name();
0031   return 0;
0032 }