Back to home page

EIC code displayed by LXR

 
 

    


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

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 // DDDB is a detector description convention developed by the LHCb experiment.
0015 // For further information concerning the DTD, please see:
0016 // http://lhcb-comp.web.cern.ch/lhcb-comp/Frameworks/DetDesc/Documents/lhcbDtd.pdf
0017 //
0018 //==========================================================================
0019 
0020 // Framework includes
0021 #include "DD4hep/Detector.h"
0022 #include "DD4hep/Printout.h"
0023 #include "DD4hep/Factories.h"
0024 #include "DDDB/DDDBConditionsLoader.h"
0025 
0026 using namespace dd4hep;
0027 
0028 //==========================================================================
0029 /// Plugin function
0030 static long dddb_dump_conditions(Detector& description, int argc, char** argv) {
0031   const char* prt_level = "INFO";
0032   for(int i=0; i<argc; ++i)  {
0033     if ( ::strcmp(argv[i],"--print")==0 )  {
0034       prt_level = argv[++i];
0035       printout(INFO,"DDDB","Setting conditions print level to %s",prt_level);
0036     }
0037   }
0038   const void* args[] = { "-processor", "DD4hep_ConditionsPrinter",
0039                          "-name", "DDDB",
0040                          "-prefix", "DDDB",
0041                          "-print", prt_level,
0042                          "-end-processor", 0};
0043   description.apply("DD4hep_ConditionsDump", 9, (char**)args);
0044   return 1;
0045 }
0046 DECLARE_APPLY(DDDB_ConditionsDump,dddb_dump_conditions)
0047 
0048 //==========================================================================
0049 /// Plugin function
0050 static long dddb_dump_conditions_summary(Detector& description, int , char** ) {
0051   const void* args[] = { "-processor", "DD4hep_ConditionsPrinter",
0052                          "-name", "DDDB",
0053                          "-prefix", "DDDB",
0054                          "-print", "DEBUG",
0055                          "-end-processor", 0};
0056   description.apply("DD4hep_ConditionsDump", 9, (char**)args);
0057   return 1;
0058 }
0059 DECLARE_APPLY(DDDB_ConditionsSummary,dddb_dump_conditions_summary)
0060 
0061 //==========================================================================
0062 /// Plugin function
0063 static void* create_dddb_loader(Detector& description, int argc, char** argv)   {
0064   const char* name = argc>0 ? argv[0] : "DDDBLoader";
0065   cond::ConditionsManagerObject* mgr = (cond::ConditionsManagerObject*)(argc>0 ? argv[1] : 0);
0066   return new DDDB::DDDBConditionsLoader(description,mgr,name);
0067 }
0068 DECLARE_DD4HEP_CONSTRUCTOR(DD4hep_Conditions_dddb_Loader,create_dddb_loader)