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
AlignmentsProcessor.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/DetAlign.h"
18 
19 using namespace DD4hep;
20 using namespace DD4hep::Alignments;
21 
24  return 1;
25 }
26 
29  if ( m_pool ) {
30  for(const auto& k : container.keys() ) {
31  Alignment a = container.get(k.first,*m_pool);
32  (*this)(a);
33  }
34  return 1;
35  }
36  except("Alignments","Cannot process alignments container without user-pool.");
37  return 0;
38 }
39 
42  if ( de.isValid() ) {
43  if ( m_pool ) {
44  DetAlign align(de);
45  (*this)(align.alignments());
46  return 1;
47  }
48  except("Alignments","Cannot process DetElement alignments from '%s' without user-pool",de.name());
49  }
50  except("Alignments","Cannot process alignments of an invalid detector element");
51  return 0;
52 }
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
pool_type * m_pool
Reference to the user pool.
Main handle class to hold an alignment object.
Definition: Alignments.h:65
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
const Keys & keys() const
Known keys of conditions in this container.
Definition: Alignments.cpp:132
virtual int processElement(DetElement de)
Callback to output alignments information of an entire DetElement.
Container alignments() const
Access to the alignments information.
Definition: DetAlign.cpp:45
Handle class describing a detector element.
Definition: Detector.h:172
Handle class describing the access to DetElement dependent alignments.
Definition: DetAlign.h:42
Container class for alignment handles aggregated by a detector element.
Definition: Alignments.h:206
Alignment get(const std::string &alignment_key, const iov_type &iov)
Access to alignment objects by key and IOV.
Definition: Alignments.cpp:141
virtual int operator()(Alignment cond)
Callback to output alignments information.