DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConditionsProcessor.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation for LCD
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 includes
15 #include "DD4hep/Printout.h"
16 #include "DD4hep/DetConditions.h"
18 
19 using namespace DD4hep;
20 using namespace DD4hep::Conditions;
21 
24  return 1;
25 }
26 
29  if ( m_pool ) {
30  for(const auto& k : container.keys() ) {
31  Condition c = container.get(k.first,*m_pool);
32  (*this)(c);
33  }
34  return 1;
35  }
36  except("Conditions","Cannot process conditions container without user-pool.");
37  return 0;
38 }
39 
42  if ( de.isValid() ) {
43  if ( m_pool ) {
44  DetConditions conds(de);
45  (*this)(conds.conditions());
46  return 1;
47  }
48  except("Conditions","Cannot process DetElement conditions from '%s' without user-pool",de.name());
49  }
50  except("Conditions","Cannot process conditions of an invalid detector element");
51  return 0;
52 }
Container conditions() const
Access to the conditions information.
virtual int operator()(Condition cond)
Callback to output conditions information.
const char * name() const
Access the object name (or "" if not supported by the object)
Definition: Handle.inl:36
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:124
virtual int processElement(DetElement de)
Callback to output conditions information of an entire DetElement.
Main condition object handle.
Definition: Conditions.h:70
Container class for condition handles aggregated by a detector element.
Definition: Conditions.h:206
Condition get(const std::string &condition_key, const iov_type &iov)
Access to condition objects by key and IOV.
Definition: Conditions.cpp:189
int except(const std::string &src, const std::string &fmt,...)
Calls the display action with ERROR and throws an std::runtime_error exception.
Definition: Printout.cpp:217
pool_type * m_pool
Reference to the user pool.
const Keys & keys() const
Known keys of conditions in this container.
Definition: Conditions.cpp:180
Handle class describing the access to DetElement dependent conditions.
Definition: DetConditions.h:43
Handle class describing a detector element.
Definition: Detector.h:172