DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
ConditionsPlugins.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 // Framework include files
15 #include <DD4hep/Detector.h>
16 #include <DD4hep/Plugins.h>
17 #include <DD4hep/Printout.h>
18 #include <DD4hep/Conditions.h>
19 #include <DD4hep/PluginCreators.h>
26 #include <DD4hep/PluginTester.h>
27 
28 #include <DDCond/ConditionsPool.h>
29 #include <DDCond/ConditionsSlice.h>
34 
35 // C/C++ include files
36 #include <memory>
37 
38 using namespace dd4hep;
39 using namespace dd4hep::cond;
40 
42 
49 static int ddcond_install_cond_mgr (Detector& description, int argc, char** argv) {
50  Handle<NamedObject>* h = 0;
52  if ( !mgr.isValid() ) {
53  bool arg_error = false;
54  std::string factory = "DD4hep_ConditionsManager_Type1";
55  for(int i = 0; i < argc && argv[i]; ++i) {
56  if ( 0 == ::strncmp("-type",argv[i],4) )
57  factory = argv[++i];
58  else if ( 0 == ::strncmp("-handle",argv[i],5) )
59  h = (Handle<NamedObject>*)argv[++i];
60  else
61  arg_error = true;
62  }
63  if ( arg_error ) {
65  std::cout <<
66  "Usage: -plugin <name> -arg [-arg] \n"
67  " name: factory name DD4hep_ConditionsManagerInstaller \n"
68  " -type <string> Manager type. \n"
69  " Default: ConditionsManagerObject_Type1_t \n"
70  " -handle <pointer> Pointer to Handle<NamedObject> to pass pointer \n"
71  " to the caller. \n"
72  "\tArguments given: " << arguments(argc,argv) << std::endl << std::flush;
73  ::exit(EINVAL);
74  }
75  ConditionsManagerObject* obj = createPlugin<ConditionsManagerObject>(factory,description);
76  if ( !obj ) {
77  except("ConditionsManagerInstaller","Failed to create manager object of type %s",
78  factory.c_str());
79  }
80  description.addExtension<ConditionsManagerObject>(obj);
81  printout(INFO,"DDCond",
82  "+++ Successfully installed conditions manager instance '%s' to Detector.",
83  factory.c_str());
84  mgr = obj;
85  }
86  else if ( argc > 0 ) {
87  for(int i=0; i<argc && argv[i]; ++i) {
88  if ( 0 == ::strncmp("-handle",argv[i],5) ) {
89  h = (Handle<NamedObject>*)argv[++i];
90  break;
91  }
92  }
93  }
94  if ( h ) *h = mgr;
95  return 1;
96 }
97 DECLARE_APPLY(DD4hep_ConditionsManagerInstaller,ddcond_install_cond_mgr)
98 
99 
106 static ConditionsSlice* ddcond_prepare(Detector& description, const std::string& iov_typ, long iov_val, int argc, char** argv) {
107  const IOVType* iovtype = 0;
108  long iovvalue = iov_val;
109  ConditionsManager manager = ConditionsManager::from(description);
110 
111  for(int i = 0; i < argc; ++i) {
112  if ( ::strncmp(argv[i],"-iov_type",7) == 0 )
113  iovtype = manager.iovType(argv[++i]);
114  else if ( ::strncmp(argv[i],"-iov_value",7) == 0 )
115  iovvalue = ::atol(argv[++i]);
116  }
117  if ( 0 == iovtype )
118  iovtype = manager.iovType(iov_typ);
119  if ( 0 == iovtype )
120  except("ConditionsPrepare","++ Unknown IOV type supplied.");
121  if ( 0 > iovvalue )
122  except("ConditionsPrepare",
123  "++ Unknown IOV value supplied for iov type %s.",iovtype->str().c_str());
124 
125  IOV iov(iovtype,iovvalue);
126  std::shared_ptr<ConditionsContent> content(new ConditionsContent());
127  std::unique_ptr<ConditionsSlice> slice(new ConditionsSlice(manager,content));
128  cond::fill_content(manager,*content,*iovtype);
129  manager.prepare(iov, *slice);
130  printout(INFO,"Conditions",
131  "+++ ConditionsUpdate: Collected %ld conditions of type %s [iov-value:%ld].",
132  long(slice->size()), iovtype ? iovtype->str().c_str() : "???", iovvalue);
133  return slice.release();
134 }
135 
136 // ======================================================================================
138 
145 static int ddcond_conditions_pool_processor(Detector& description, bool process_pool, bool process_conditions, int argc, char** argv) {
146  std::unique_ptr<Condition::Processor> proc(createProcessor<Condition::Processor>(description,argc,argv));
147  ConditionsManager manager = ConditionsManager::from(description);
148  const auto types = manager.iovTypesUsed();
149 
150  if ( !proc.get() ) {
151  printout(WARNING,"Conditions","+++ Conditions processor of type %s is invalid!",argv[0]);
152  }
153  if ( process_conditions && !proc.get() ) {
154  except("Conditions","+++ Conditions processor of type %s is invalid!",argv[0]);
155  }
156  for( const IOVType* type : types ) {
157  if ( type ) {
158  ConditionsIOVPool* pool = manager.iovPool(*type);
159  if ( pool ) {
160  const ConditionsIOVPool::Elements& e = pool->elements;
161  if ( process_pool ) {
162  printout(INFO,"CondPoolProcessor","+++ ConditionsIOVPool for type %s [%d IOV element%s]",
163  type->str().c_str(), int(e.size()),e.size()==1 ? "" : "s");
164  }
165  for ( const auto& cp : e ) {
166  if ( process_pool ) {
167  cp.second->print("");
168  }
169  if ( process_conditions ) {
170  RangeConditions rc;
171  cp.second->select_all(rc);
172  for( auto c : rc ) {
173  if ( proc.get() ) { (*proc)(c); }
174  }
175  }
176  }
177  }
178  }
179  }
180  return 1;
181 }
182 static int ddcond_conditions_pool_process(Detector& description, int argc, char** argv) {
183  return ddcond_conditions_pool_processor(description, false, true, argc, argv);
184 }
185 DECLARE_APPLY(DD4hep_ConditionsPoolProcessor,ddcond_conditions_pool_process)
186 
187 // ======================================================================================
189 
197 static int ddcond_conditions_pool_print(Detector& description, bool print_conditions, int argc, char** argv) {
198  if ( argc > 0 ) {
199  for(int i = 0; i < argc; ++i) {
200  if ( argv[i] && 0 == ::strncmp(argv[i],"-processor",3) ) {
201  std::vector<char*> args;
202  for(int j=i; j<argc && argv[j] && 0 != ::strncmp(argv[i],"-end-processor",8); ++j)
203  args.emplace_back(argv[j]);
204  args.emplace_back(nullptr);
205  return ddcond_conditions_pool_processor(description,true,print_conditions,int(args.size()-1),&args[0]);
206  }
207  }
208  printout(WARNING,"DDCondProcessor","++ Found arguments in plugin call, "
209  "but could not make any sense of them....");
210  }
211  const void* args[] = { "-processor", "DD4hep_ConditionsPrinter", 0};
212  return ddcond_conditions_pool_processor(description,true,print_conditions,2,(char**)args);
213 }
214 
215 static int ddcond_dump_pools(Detector& description, int argc, char** argv) {
216  return ddcond_conditions_pool_print(description, false, argc, argv);
217 }
218 static int ddcond_dump_conditions(Detector& description, int argc, char** argv) {
219  return ddcond_conditions_pool_print(description, true, argc, argv);
220 }
221 DECLARE_APPLY(DD4hep_ConditionsPoolDump,ddcond_dump_pools)
222 DECLARE_APPLY(DD4hep_ConditionsDump,ddcond_dump_conditions)
223 
224 // ======================================================================================
226 
233 static int ddcond_detelement_dump(Detector& description, int argc, char** argv) {
234 
236  /*
237  * \author M.Frank
238  * \version 1.0
239  * \date 01/12/2016
240  */
241  struct Actor : public DetectorProcessor {
242  ConditionsPrinter& printer;
244  Actor(ConditionsPrinter& p) : printer(p) { }
246  virtual ~Actor() { }
248  virtual int operator()(DetElement de,int level) const {
249  const DetElement::Children& children = de.children();
250  PlacedVolume place = de.placement();
251  char sens = place.volume().isSensitive() ? 'S' : ' ';
252  char fmt[128], tmp[32];
253  ::snprintf(tmp,sizeof(tmp),"%03d/",level+1);
254  ::snprintf(fmt,sizeof(fmt),"%03d %%-%ds %%s #Dau:%%d VolID:%%08X %%c",level+1,2*level+1);
255  printout(INFO,"DetectorDump",fmt,"",de.path().c_str(),int(children.size()),
256  (unsigned long)de.volumeID(), sens);
257  printer.prefix = std::string(tmp)+de.name();
258  (printer)(de, level);
259  return 1;
260  }
261  };
262  dd4hep_ptr<ConditionsSlice> slice(ddcond_prepare(description,"run",1500,argc,argv));
263  ConditionsPrinter printer(slice.get(),"");
264  UserPool* pool = slice->pool.get();
265  pool->print("User pool");
266  Actor actor(printer);
267  int ret = actor.process(description.world(),0,true);
268  slice->manager.clean(pool->validity().iovType, 20);
269  return ret > 0 ? 1 : 0;
270 }
271 DECLARE_APPLY(DD4hep_DetElementConditionsDump,ddcond_detelement_dump)
272 
273 // ======================================================================================
275 
282 static void* ddcond_prepare_plugin(Detector& description, int argc, char** argv) {
283  dd4hep_ptr<ConditionsSlice> slice(ddcond_prepare(description,"",-1,argc,argv));
284  UserPool* p = slice->pool.get();
285  return p && p->size() > 0 ? slice.release() : 0;
286 }
287 DECLARE_DD4HEP_CONSTRUCTOR(DD4hep_ConditionsPrepare,ddcond_prepare_plugin)
288 #if 0
289 // ======================================================================================
291 
298 static int ddcond_detelement_processor(Detector& description, int argc, char** argv) {
299 
301  /*
302  * \author M.Frank
303  * \version 1.0
304  * \date 01/12/2016
305  */
306  struct Actor : public DetElementProcessor<ConditionsProcessor> {
309 
311  virtual ~Actor() { }
313  virtual int operator()(DetElement de, int)
314  { return de.hasConditions() ? processor->processElement(de) : 1; }
315  };
316  ConditionsProcessor* processor = 0;
317  if ( argc > 0 ) {
318  processor = createProcessor<ConditionsProcessor>(description, argc, argv);
319  }
320  else {
321  const void* args[] = { "-processor", "DD4hep_ConditionsPrinter", 0};
322  processor = createProcessor<ConditionsProcessor>(description, 2, (char**)args);
323  }
324  dd4hep_ptr<ConditionsSlice> slice(ddcond_prepare(description,"run",1500,argc,argv));
325  UserPool* pool = slice->pool.get();
326  Actor actor(processor);
327  pool->print("User pool");
328  processor->setPool(pool);
329  int ret = Actor(processor).process(description.world(),0,true);
330  slice->manager.clean(pool->validity().iovType, 20);
331  return ret > 0 ? 1 : 0;
332 }
333 DECLARE_APPLY(DD4hep_DetElementConditionsProcessor,ddcond_detelement_processor)
334 #endif
335 // ======================================================================================
337 
344 static long ddcond_synchronize_conditions(Detector& description, int argc, char** argv) {
345  if ( argc >= 2 ) {
346  std::string iov_typ = argv[0];
347  IOV::Key::first_type iov_key = *(IOV::Key::first_type*)argv[1];
348  dd4hep_ptr<ConditionsSlice> slice(ddcond_prepare(description,iov_typ,iov_key,argc,argv));
349  UserPool* pool = slice->pool.get();
350  pool->print("User pool");
351  slice->manager.clean(pool->validity().iovType, 20);
352  pool->clear();
353  return 1;
354  }
355  except("Conditions","+++ Failed update conditions. Arguments were: '%s'",
356  arguments(argc,argv).c_str());
357  return 0;
358 }
359 DECLARE_APPLY(DD4hep_ConditionsSynchronize,ddcond_synchronize_conditions)
360 
361 // ======================================================================================
363 
370 static long ddcond_clean_conditions(Detector& description, int argc, char** argv) {
371  if ( argc > 0 ) {
372  std::string iov_type = argv[0];
373  int max_age = *(int*)argv[1];
374  printout(INFO,"Conditions",
375  "+++ ConditionsUpdate: Cleaning conditions... type:%s max age:%d",
376  iov_type.c_str(), max_age);
377  ConditionsManager manager = ConditionsManager::from(description);
378  const IOVType* iov_typ = manager.iovType(iov_type);
379  manager.clean(iov_typ, max_age);
380  return 1;
381  }
382  except("Conditions","+++ Failed cleaning conditions. Insufficient arguments!");
383  return 0;
384 }
385 DECLARE_APPLY(DD4hep_ConditionsClean,ddcond_clean_conditions)
386 
387 // ======================================================================================
389 
396 template <typename WRAPPER,typename PRINTER>
397 static void* create_printer(Detector& description, int argc,char** argv) {
398  PrintLevel print_level = INFO;
399  std::string prefix = "", name = "";
400  int flags = 0, have_pool = 0, arg_error = false;
401  for(int i=0; i<argc && argv[i]; ++i) {
402  if ( 0 == ::strncmp("-prefix",argv[i],4) )
403  prefix = argv[++i];
404  else if ( 0 == ::strncmp("-name",argv[i],5) )
405  name = argv[++i];
406  else if ( 0 == ::strncmp("-flags",argv[i],5) )
407  flags = ::atol(argv[++i]);
408  else if ( 0 == ::strncmp("-pool",argv[i],5) )
409  have_pool = 1;
410  else if ( 0 == ::strncmp("-print",argv[i],5) )
411  print_level = dd4hep::printLevel(argv[++i]);
412  else
413  arg_error = true;
414  }
415  if ( arg_error ) {
417  std::cout <<
418  "Usage: -plugin <name> -arg [-arg] \n"
419  " name: factory name(s) DD4hep_ConditionsPrinter, \n"
420  " dd4hep_AlignmentsPrinter \n"
421  " dd4hep_AlignedVolumePrinter \n"
422  " -prefix <string> Printout prefix for user customized output. \n"
423  " -flags <number> Printout processing flags. \n"
424  " -pool Attach conditions user pool from \n"
425  " PluginTester's slice instance attached. \n\n"
426  " -print <value> Printout level for the printer object. \n"
427  "\tArguments given: " << arguments(argc,argv) << std::endl << std::flush;
428  ::exit(EINVAL);
429  }
430  DetElement world = description.world();
431  printout(INFO,"Printer","World=%s [%p]",world.path().c_str(),world.ptr());
432  ConditionsSlice* slice = 0;
433  if ( have_pool ) {
434  PluginTester* test = description.extension<PluginTester>();
435  slice = test->extension<ConditionsSlice>("ConditionsTestSlice");
436  }
437  PRINTER* p = (flags) ? new PRINTER(slice, prefix, flags) : new PRINTER(slice, prefix);
438  p->printLevel = print_level;
439  if ( !name.empty() ) p->name = std::move(name);
440  return (void*)dynamic_cast<WRAPPER*>(createProcessorWrapper(p));
441 }
442 
443 static void* create_cond_printer(Detector& description, int argc,char** argv)
444 { return create_printer<Condition::Processor,ConditionsPrinter>(description,argc,argv); }
445 
446 DECLARE_DD4HEP_CONSTRUCTOR(DD4hep_ConditionsPrinter,create_cond_printer)
447 //DECLARE_DD4HEP_CONSTRUCTOR(DD4hep_AlignmentsPrinter,create_printer<AlignmentsPrinter>)
448 //DECLARE_DD4HEP_CONSTRUCTOR(DD4hep_AlignedVolumePrinter,create_printer<AlignedVolumePrinter>)
449 
450 // ======================================================================================
452 
459 static long ddcond_create_repository(Detector& description, int argc, char** argv) {
460  bool arg_error = false;
461  std::string output = "";
462  for(int i=0; i<argc && argv[i]; ++i) {
463  if ( 0 == ::strncmp("-output",argv[i],4) )
464  output = argv[++i];
465  else
466  arg_error = true;
467  }
468  if ( arg_error || output.empty() ) {
470  std::cout <<
471  "Usage: -plugin <name> -arg [-arg] \n"
472  " name: factory name DD4hep_ConditionsCreateRepository \n\n"
473  " -output <string> Output file name. \n\n"
474  "\tArguments given: " << arguments(argc,argv) << std::endl << std::flush;
475  ::exit(EINVAL);
476  }
477  printout(INFO,"Conditions",
478  "+++ ConditionsRepository: Creating %s",output.c_str());
479  ConditionsManager manager = ConditionsManager::from(description);
480  ConditionsRepository().save(manager,output);
481  return 1;
482 }
483 DECLARE_APPLY(DD4hep_ConditionsCreateRepository,ddcond_create_repository)
484 
485 // ======================================================================================
487 
494 static long ddcond_dump_repository(Detector& /* description */, int argc, char** argv) {
495  typedef ConditionsRepository::Data Data;
496  bool arg_error = false;
497  std::string input = "";
498  Data data;
499  for(int i=0; i<argc && argv[i]; ++i) {
500  if ( 0 == ::strncmp("-input",argv[i],4) )
501  input = argv[++i];
502  else
503  arg_error = true;
504  }
505  if ( arg_error || input.empty() ) {
507  std::cout <<
508  "Usage: -plugin <name> -arg [-arg] \n"
509  " name: factory name DD4hep_ConditionsDumpRepository \n\n"
510  " -input <string> Input file name. \n\n"
511  "\tArguments given: " << arguments(argc,argv) << std::endl << std::flush;
512  ::exit(EINVAL);
513  }
514  printout(INFO,"Conditions","+++ ConditionsRepository: Dumping %s",input.c_str());
515  if ( ConditionsRepository().load(input, data) ) {
516  printout(INFO,"Repository","%-8s %-60s %-60s","Key","Name","Address");
517  for(Data::const_iterator i=data.begin(); i!=data.end(); ++i) {
518  const ConditionsRepository::Entry& e = *i;
519  std::string add = e.address;
520  if ( add.length() > 80 ) add = e.address.substr(0,60) + "...";
521  printout(INFO,"Repository","%16llX %s",e.key,e.name.c_str());
522  printout(INFO,"Repository"," -> %s",e.address.c_str());
523  }
524  }
525  return 1;
526 }
527 DECLARE_APPLY(DD4hep_ConditionsDumpRepository,ddcond_dump_repository)
528 
529 // ======================================================================================
531 
541 static long ddcond_load_repository(Detector& /* description */, int argc, char** argv) {
542  if ( argc > 0 ) {
543  std::string input = argv[0];
544  printout(INFO,"Conditions","+++ ConditionsRepository: Loading %s",input.c_str());
546  ConditionsRepository().load(input, data);
547  return 1;
548  }
549  except("Conditions","+++ Failed loading conditions repository. Insufficient arguments!");
550  return 0;
551 }
552 DECLARE_APPLY(DD4hep_ConditionsLoadRepository,ddcond_load_repository)
553 // ======================================================================================
dd4hep::cond::ConditionsManager::iovType
const IOVType * iovType(const std::string &iov_name) const
Access IOV by its name.
Definition: ConditionsManager.cpp:199
dd4hep::DetElement::children
const Children & children() const
Access to the list of children.
Definition: DetElement.cpp:207
dd4hep::DetElement::path
const std::string & path() const
Path of the detector element (not necessarily identical to placement path!)
Definition: DetElement.cpp:158
dd4hep::Detector::addExtension
IFACE * addExtension(CONCRETE *c)
Extend the sensitive detector element with an arbitrary structure accessible by the type.
Definition: Detector.h:331
dd4hep::RangeConditions
std::vector< Condition > RangeConditions
Definition: Conditions.h:491
ConditionsSlice.h
dd4hep::Detector::world
virtual DetElement world() const =0
Return reference to the top-most (world) detector element.
dd4hep::cond::ConditionsRepository::Data
std::vector< Entry > Data
Definition of the entry collection.
Definition: ConditionsRepository.h:56
DetectorProcessor.h
Detector.h
AlignmentsPrinter.h
dd4hep::cond::ConditionsProcessor::process
virtual int process(Condition condition) const override
Processing callback.
Definition: ConditionsProcessor.h:61
dd4hep::cond::ConditionsIOVPool::Elements
std::map< IOV::Key, Element > Elements
Shortcut name for the actual conditions container.
Definition: ConditionsIOVPool.h:43
dd4hep::PlacedVolume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:163
dd4hep::DetElement::placement
PlacedVolume placement() const
Access to the physical volume of this detector element.
Definition: DetElement.cpp:321
dd4hep::DetElementProcessor
Detector scanner using a Processor object.
Definition: DetectorProcessor.h:64
DECLARE_APPLY
#define DECLARE_APPLY(name, func)
Definition: Factories.h:281
dd4hep::IOVType::str
std::string str() const
Conversion to string.
Definition: IOV.cpp:43
dd4hep::cond::ConditionsPrinter::prefix
std::string prefix
Printout prefix.
Definition: ConditionsPrinter.h:58
dd4hep::Handle< NamedObject >
dd4hep::cond::ConditionsIOVPool::elements
Elements elements
Container of IOV dependent conditions pools.
Definition: ConditionsIOVPool.h:46
ConditionsRepository.h
dd4hep::Volume::isSensitive
bool isSensitive() const
Accessor if volume is sensitive (ie. is attached to a sensitive detector)
Definition: Volumes.cpp:1322
ConditionsManager.h
dd4hep::DetElement::volumeID
VolumeID volumeID() const
The cached VolumeID of this subdetector element.
Definition: DetElement.cpp:344
dd4hep::Handle::name
const char * name() const
Access the object name (or "" if not supported by the object)
dd4hep::cond::UserPool::validity
const IOV & validity() const
Access the interval of validity for this user pool.
Definition: ConditionsPool.h:167
dd4hep::IOVType
Class describing the interval of validty type.
Definition: IOV.h:37
dd4hep::cond::ConditionsManager::iovTypesUsed
const std::vector< const IOVType * > iovTypesUsed() const
Access the used/registered IOV types.
Definition: ConditionsManager.cpp:209
dd4hep::cond::ConditionsManagerObject
Basic conditions manager implementation.
Definition: ConditionsManagerObject.h:54
dd4hep::cond::ConditionsManager::iovPool
ConditionsIOVPool * iovPool(const IOVType &type) const
Access conditions multi IOV pool by iov type.
Definition: ConditionsManager.cpp:204
ConditionsManagerObject.h
dd4hep::PluginTester::extension
void * extension(const std::string &name, const std::type_info &info, bool alert) const
Access an existing extension object from the detector element.
Definition: PluginTester.cpp:103
dd4hep::cond::ConditionsManager::from
static ConditionsManager from(T &host)
Static accessor if installed as an extension.
dd4hep::cond::ConditionsRepository
Base class to be implemented by objects to listen on condition callbacks.
Definition: ConditionsRepository.h:38
dd4hep::cond
Namespace for implementation details of the AIDA detector description toolkit.
Definition: ConditionsCleanup.h:23
dd4hep::cond::ConditionsContent
Conditions content object. Defines which conditions should be loaded by the ConditionsManager.
Definition: ConditionsContent.h:74
dd4hep::IOV
Class describing the interval of validty.
Definition: IOV.h:67
dd4hep::cond::ConditionsManager::prepare
Result prepare(const IOV &required_validity, ConditionsSlice &slice, ConditionUpdateUserContext *ctxt=0) const
Prepare all updates to the clients with the defined IOV.
Definition: ConditionsManager.cpp:289
dd4hep::cond::UserPool::print
virtual void print(const std::string &opt) const =0
Print pool content.
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:188
dd4hep::cond::ConditionsProcessor
Generic condition processor facade for the Conditons::Processor object.
Definition: ConditionsProcessor.h:42
ConditionsPrinter.h
DECLARE_DD4HEP_CONSTRUCTOR
#define DECLARE_DD4HEP_CONSTRUCTOR(name, func)
Definition: Factories.h:291
Plugins.h
dd4hep::cond::ConditionsRepository::Entry::name
std::string name
Definition: ConditionsRepository.h:48
ConditionsIOVPool.h
Conditions.h
dd4hep::cond::UserPool::size
virtual size_t size() const =0
Total entry count.
dd4hep::DetectorProcessor
Generic Detector processor.
Definition: DetectorProcessor.h:36
dd4hep::cond::ConditionsManager
Manager class for condition handles.
Definition: ConditionsManager.h:46
dd4hep::cond::UserPool
Interface for conditions pool optimized to host conditions updates.
Definition: ConditionsPool.h:134
DetFactoryHelper.h
dd4hep::PluginTester
Helper class to ease testing of plugins: Effectively a container of object extensions.
Definition: PluginTester.h:30
dd4hep::DetElement::Children
std::map< std::string, DetElement > Children
Definition: DetElement.h:206
dd4hep::cond::UserPool::clear
virtual void clear()=0
Full cleanup of all managed conditions.
dd4hep::Handle::ptr
T * ptr() const
Access to the held object.
Definition: Handle.h:153
dd4hep::cond::ConditionsRepository::save
int save(ConditionsManager m, const std::string &output) const
Save the repository to file.
Definition: ConditionsRepository.cpp:210
dd4hep::IOV::iovType
const IOVType * iovType
Reference to IOV type.
Definition: IOV.h:80
dd4hep::cond::ConditionsManager::clean
void clean(const ConditionsCleanup &cleaner) const
Invoke cache cleanup with user defined policy.
Definition: ConditionsManager.cpp:273
dd4hep::Detector::extension
IFACE * extension(bool alert=true) const
Access extension element by the type.
Definition: Detector.h:342
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
PluginTester.h
dd4hep::PlacedVolume::volume
Volume volume() const
Logical volume of this placement.
Definition: Volumes.cpp:468
dd4hep::cond::fill_content
void fill_content(ConditionsManager mgr, ConditionsContent &content, const IOVType &typ)
Populate the conditions slice from the conditions manager (convenience)
Definition: ConditionsSlice.cpp:182
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
ConditionsPool.h
dd4hep::cond::UserPool::get
virtual Condition get(Condition::key_type key) const =0
Check if a condition exists in the pool and return it to the caller.
dd4hep::cond::createProcessorWrapper
ConditionsProcessorWrapper< T > * createProcessorWrapper(T *obj)
Creator utility function for ConditionsProcessorWrapper objects.
Definition: ConditionsProcessor.h:101
dd4hep::cond::ConditionsRepository::Entry::key
Condition::key_type key
Definition: ConditionsRepository.h:49
dd4hep::cond::ConditionsRepository::Entry
Definition of a single Entry in the conditions repository.
Definition: ConditionsRepository.h:46
dd4hep::cond::ConditionsIOVPool
Pool of conditions satisfying one IOV type (epoch, run, fill, etc)
Definition: ConditionsIOVPool.h:38
Printout.h
dd4hep::cond::ConditionsPrinter
Generic Conditions data dumper.
Definition: ConditionsPrinter.h:38
PluginCreators.h
dd4hep::cond::ConditionsRepository::Entry::address
std::string address
Definition: ConditionsRepository.h:48
dd4hep::cond::ConditionsSlice
Conditions slice object. Defines which conditions should be loaded by the ConditionsManager.
Definition: ConditionsSlice.h:53
dd4hep::dd4hep_ptr
Out version of the std auto_ptr implementation base either on auto_ptr or unique_ptr.
Definition: Memory.h:46
ConditionsProcessor.h
dd4hep::cond::ConditionsRepository::load
int load(const std::string &input, Data &data) const
Load the repository from file and fill user passed data structory.
Definition: ConditionsRepository.cpp:247