Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:42

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 // Framework include files
0015 #include "JSON/Elements.h"
0016 #include "JSON/DocumentHandler.h"
0017 #include "DD4hep/Printout.h"
0018 #include "DD4hep/Factories.h"
0019 
0020 using namespace dd4hep;
0021 
0022 static long json_dump(Detector& /* description */, int argc, char** argv)   {
0023   if ( argc < 1 )  {
0024     ::printf("DD4hep_JsonDumper <file>                               \n");
0025     exit(EINVAL);
0026   }
0027   std::string fname = argv[0];
0028   json::DocumentHolder doc(json::DocumentHandler().load(fname));
0029   dumpTree(doc.root());
0030   printout(INFO,"JsonDumper","+++ Successfully dumped json input: %s.",fname.c_str());
0031   return 1;
0032 }
0033 DECLARE_APPLY(DD4hep_JsonDumper,json_dump)