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.h
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 #ifndef DD4HEP_DDALIGN_ALIGNMENTSPROCESSOR_H
14 #define DD4HEP_DDALIGN_ALIGNMENTSPROCESSOR_H
15 
16 // Framework includes
17 #include "DD4hep/Alignments.h"
18 #include "DD4hep/Detector.h"
19 
21 namespace DD4hep {
22 
24  namespace Alignments {
25 
27 
43  virtual public Alignment::Processor,
44  virtual public Container::Processor,
45  virtual public Geometry::DetElement::Processor
46  {
47  public:
51  typedef UserPool pool_type;
52  protected:
57  public:
61  virtual ~AlignmentsProcessor() = default;
63  void setPool(pool_type* value) { m_pool = value; }
65  virtual int operator()(Alignment cond);
67  virtual int operator()(Container container);
69  virtual int processElement(DetElement de);
70  };
71 
73 
78  class AlignmentsCollector : virtual public AlignmentsProcessor {
79  public:
81  std::vector<Alignment> alignments;
82  public:
84  AlignmentsCollector() = default;
86  virtual ~AlignmentsCollector() = default;
88  virtual int operator()(Alignment cond) {
89  alignments.push_back(cond);
90  return 1;
91  }
93  virtual int operator()(Container container)
94  { return this->self_type::operator()(container); }
96  virtual int processElement(DetElement detector)
97  { return this->self_type::processElement(detector); }
98  };
99 
100  } /* End namespace Alignments */
101 } /* End namespace DD4hep */
102 #endif /* DD4HEP_DDALIGN_ALIGNMENTSPROCESSOR_H */
virtual int processElement(DetElement detector)
Callback to output alignments information of an entire DetElement.
virtual ~AlignmentsCollector()=default
Default destructor.
pool_type * m_pool
Reference to the user pool.
Geometry::DetElement DetElement
Make DetElement type local.
void setPool(pool_type *value)
Set pool.
Main handle class to hold an alignment object.
Definition: Alignments.h:65
AlignmentsProcessor self_type
Self type definition.
Abstract base for processing callbacks to container objects.
Definition: Alignments.h:73
Generic Alignments processor.
std::vector< Alignment > alignments
Collection container.
virtual ~AlignmentsProcessor()=default
Default destructor.
Abstract base for processing callbacks to DetElement objects.
Definition: Detector.h:180
AlignmentsCollector()=default
Default constructor.
virtual int processElement(DetElement de)
Callback to output alignments information of an entire DetElement.
virtual int operator()(Alignment cond)
Callback to output alignments information.
virtual int operator()(Container container)
Container callback for object processing.
AlignmentsProcessor(pool_type *p)
Initializing constructor.
Handle class describing a detector element.
Definition: Detector.h:172
Container class for alignment handles aggregated by a detector element.
Definition: Alignments.h:206
Abstract base for processing callbacks to container objects.
Definition: Alignments.h:214
Generic Alignment object collector.
virtual int operator()(Alignment cond)
Callback to output alignments information.