Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-21 23:14:24

0001 #include "TClass.h"
0002 
0003 #include <string>
0004 #include <vector>
0005 
0006 // Begin AUTO code, some classes commented out.
0007 
0008 std::vector<std::string> classes = {
0009     // "mkfit::IterationConfig",
0010     "mkfit::IterationLayerConfig",
0011     "mkfit::IterationParams",
0012     // "mkfit::IterationSeedPartition",
0013     "mkfit::IterationConfig",
0014     "mkfit::IterationsInfo"};
0015 
0016 // End AUTO code.
0017 
0018 /*
0019     1. When running for the first time, after changing of classes:
0020        Review extracto.pl
0021        Run: ./extracto.pl ../SteeringParams.h
0022        Cut-n-paste code fragments above and into Config.LinkDef.h
0023 
0024     2. To run:
0025          # setup root environment
0026          make
0027          root.exe dump_vars.C
0028        Then cut-n-paste NLOHMANN defines into SteeringParams.cc 
0029 */
0030 
0031 void dump_vars() {
0032   gSystem->Load("libConfigDict.so");
0033 
0034   for (auto &cls : classes) {
0035     printf("NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(%s,\n", cls.c_str());
0036 
0037     TClass *tc = TClass::GetClass(cls.c_str());
0038     TList *ml = tc->GetListOfDataMembers();
0039     TIter it(ml);
0040     TDataMember *dm = (TDataMember *)it.Next();
0041     while (dm) {
0042       // dm->GetTypeName(), dm->GetFullTypeName(), dm->GetTrueTypeName(),
0043       printf("  /* %s */   %s", dm->GetTypeName(), dm->GetName());
0044       dm = (TDataMember *)it.Next();
0045       if (dm)
0046         printf(",");
0047       printf("\n");
0048     }
0049     printf(")\n\n");
0050   }
0051 }