DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
AlignmentsProcessor.h
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 #ifndef DD4HEP_ALIGNMENTSPROCESSOR_H
14 #define DD4HEP_ALIGNMENTSPROCESSOR_H
15 
16 // Framework includes
17 #include <DD4hep/ConditionsMap.h>
18 #include <DD4hep/AlignmentData.h>
19 #include <DD4hep/Alignments.h>
20 #include <DD4hep/Printout.h>
21 
22 // C/C++ include files
23 #include <memory>
24 
26 namespace dd4hep {
27 
29  namespace align {
30 
32 
42  template <typename T> class AlignmentsProcessor : public Alignment::Processor {
44  public:
46  AlignmentsProcessor() = default;
50  AlignmentsProcessor(T&& p) = delete;
56  virtual ~AlignmentsProcessor() = default;
60  virtual int operator()(Alignment alignment) const override {
61  return (processor)(alignment);
62  }
63  };
65  template <typename T> inline
68 
70 
81  template <typename T> class AlignmentsProcessorWrapper : public Alignment::Processor {
82  std::unique_ptr<T> processor;
83  public:
91  virtual ~AlignmentsProcessorWrapper() = default;
95  virtual int operator()(Alignment c) const override {
96  return (*(processor.get()))(c);
97  }
98  };
100  template <typename T> inline AlignmentsProcessorWrapper<T>* createProcessorWrapper(T* obj) {
101  return new AlignmentsProcessorWrapper<T>(obj);
102  }
104  template <typename T> inline AlignmentsProcessorWrapper<T> processorWrapper(T* obj) {
105  return AlignmentsProcessorWrapper<T>(obj);
106  }
107 
109 
117  template <typename T> class DeltaCollector {
118  public:
122  T& deltas;
123  public:
127  DeltaCollector(ConditionsMap& m, T&& p) = delete;
131  DeltaCollector(const DeltaCollector& copy) = default;
133  ~DeltaCollector() = default;
137 
145  virtual int operator()(DetElement de, int level=0) const final;
146  };
147 
149  template <typename T> inline
150  DeltaCollector<typename std::remove_reference<T>::type> deltaCollector(ConditionsMap& m, T&& deltas)
152 
154 
162  template <typename T> class AlignmentsCollector {
163  public:
168  public:
170  AlignmentsCollector(ConditionsMap& m, T& d) : mapping(m), alignments(d) {}
172  AlignmentsCollector(ConditionsMap& m, T&& p) = delete;
176  ~AlignmentsCollector() = default;
180 
188  virtual int operator()(DetElement de, int level=0) const final;
189  };
190 
192  template <typename T> inline
193  AlignmentsCollector<typename std::remove_reference<T>::type> alignmentsCollector(ConditionsMap& m, T&& alignments)
195 
196  } /* End namespace align */
197 } /* End namespace dd4hep */
198 #endif // DD4HEP_ALIGNMENTSPROCESSOR_H
dd4hep::align::AlignmentsProcessor::operator()
virtual int operator()(Alignment alignment) const override
Processing callback.
Definition: AlignmentsProcessor.h:60
dd4hep::align::processorWrapper
AlignmentsProcessorWrapper< T > processorWrapper(T *obj)
Creator utility function for AlignmentsProcessorWrapper objects.
Definition: AlignmentsProcessor.h:104
dd4hep::align::DeltaCollector::DeltaCollector
DeltaCollector(const DeltaCollector &copy)=default
Copy constructor.
dd4hep::align::AlignmentsCollector::~AlignmentsCollector
~AlignmentsCollector()=default
Default destructor.
dd4hep::align::alignmentsCollector
AlignmentsCollector< typename std::remove_reference< T >::type > alignmentsCollector(ConditionsMap &m, T &&alignments)
Creator function for alignment collector objects.
Definition: AlignmentsProcessor.h:193
dd4hep::Alignment::Processor
Abstract base for processing callbacks to container objects.
Definition: Alignments.h:123
dd4hep::align::AlignmentsProcessor::AlignmentsProcessor
AlignmentsProcessor()=default
Default constructor.
dd4hep::align::AlignmentsProcessor::AlignmentsProcessor
AlignmentsProcessor(T &&p)=delete
Default move constructor is disabled.
dd4hep::align::AlignmentsCollector::alignments
T & alignments
Collection container.
Definition: AlignmentsProcessor.h:167
Alignments.h
dd4hep::align::AlignmentsProcessor::~AlignmentsProcessor
virtual ~AlignmentsProcessor()=default
Default destructor.
dd4hep::align::AlignmentsProcessorWrapper::processor
std::unique_ptr< T > processor
Definition: AlignmentsProcessor.h:82
dd4hep::align::AlignmentsCollector::AlignmentsCollector
AlignmentsCollector(ConditionsMap &m, T &&p)=delete
Default move constructor is disabled.
dd4hep::align::AlignmentsProcessor::operator=
AlignmentsProcessor & operator=(const AlignmentsProcessor &copy)=default
Assignment operator.
dd4hep::align::createProcessorWrapper
AlignmentsProcessorWrapper< T > * createProcessorWrapper(T *obj)
Creator utility function for AlignmentsProcessorWrapper objects.
Definition: AlignmentsProcessor.h:100
dd4hep::align::AlignmentsProcessorWrapper::operator()
virtual int operator()(Alignment c) const override
Processing callback.
Definition: AlignmentsProcessor.h:95
dd4hep::align::AlignmentsCollector::AlignmentsCollector
AlignmentsCollector(const AlignmentsCollector &copy)=default
Copy constructor.
dd4hep::align::AlignmentsProcessorWrapper::operator=
AlignmentsProcessorWrapper & operator=(const AlignmentsProcessorWrapper &copy)=default
Assignment operator.
dd4hep::align::AlignmentsCollector::AlignmentsCollector
AlignmentsCollector(ConditionsMap &m, T &d)
Default constructor.
Definition: AlignmentsProcessor.h:170
dd4hep::align::DeltaCollector::mapping
ConditionsMap & mapping
Reference to the user pool.
Definition: AlignmentsProcessor.h:120
dd4hep::align::DeltaCollector::DeltaCollector
DeltaCollector(DeltaCollector &&copy)=default
R-value copy from a temporary.
dd4hep::align::AlignmentsProcessor
Generic alignment processor facade for the Conditons::Processor object.
Definition: AlignmentsProcessor.h:42
dd4hep::align::AlignmentsProcessorWrapper::~AlignmentsProcessorWrapper
virtual ~AlignmentsProcessorWrapper()=default
Default destructor.
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:188
dd4hep::align::AlignmentsProcessorWrapper::AlignmentsProcessorWrapper
AlignmentsProcessorWrapper()=default
Default constructor.
dd4hep::align::alignmentsProcessor
AlignmentsProcessor< typename std::remove_reference< T >::type > alignmentsProcessor(T &&obj)
Creator utility function for AlignmentsProcessor objects.
Definition: AlignmentsProcessor.h:66
dd4hep::align::DeltaCollector::DeltaCollector
DeltaCollector(ConditionsMap &m, T &&p)=delete
Default move constructor is disabled.
dd4hep::align::AlignmentsProcessor::processor
T & processor
Definition: AlignmentsProcessor.h:43
dd4hep::align::AlignmentsCollector::mapping
ConditionsMap & mapping
Reference to the user pool.
Definition: AlignmentsProcessor.h:165
dd4hep::align::AlignmentsProcessorWrapper
Generic alignment processor facade for the Conditons::Processor object.
Definition: AlignmentsProcessor.h:81
dd4hep::Alignment
Main handle class to hold an alignment object.
Definition: Alignments.h:115
dd4hep::align::DeltaCollector::DeltaCollector
DeltaCollector(ConditionsMap &m, T &d)
Default constructor.
Definition: AlignmentsProcessor.h:125
dd4hep::align::AlignmentsProcessorWrapper::AlignmentsProcessorWrapper
AlignmentsProcessorWrapper(const AlignmentsProcessorWrapper &copy)=default
Copy constructor.
dd4hep::align::DeltaCollector
Generic Alignment-Delta collector keyed by detector elements.
Definition: AlignmentsProcessor.h:117
dd4hep::align::AlignmentsProcessor::AlignmentsProcessor
AlignmentsProcessor(const AlignmentsProcessor &copy)=default
Copy constructor.
ConditionsMap.h
dd4hep::align::AlignmentsProcessor::AlignmentsProcessor
AlignmentsProcessor(AlignmentsProcessor &&copy)=default
R-value copy from a temporary (Since processor is reference)
std
Definition: Plugins.h:30
dd4hep::align::DeltaCollector::deltas
T & deltas
Collection container.
Definition: AlignmentsProcessor.h:122
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::align::DeltaCollector::operator()
virtual int operator()(DetElement de, int level=0) const final
Callback to output alignments information.
Definition: AlignmentsProcessor.cpp:26
dd4hep::align::AlignmentsCollector
Generic alignment collector keyed by detector elements.
Definition: AlignmentsProcessor.h:162
dd4hep::detail::tools::copy
void copy(Alignment from, Alignment to)
Copy alignment object from source object.
Definition: AlignmentTools.cpp:43
dd4hep::align::DeltaCollector::~DeltaCollector
~DeltaCollector()=default
Default destructor.
dd4hep::align::DeltaCollector::operator=
DeltaCollector & operator=(const DeltaCollector &copy)=default
Assignment operator.
dd4hep::align::deltaCollector
DeltaCollector< typename std::remove_reference< T >::type > deltaCollector(ConditionsMap &m, T &&deltas)
Creator function for alignment collector objects.
Definition: AlignmentsProcessor.h:150
dd4hep::align::AlignmentsProcessorWrapper::AlignmentsProcessorWrapper
AlignmentsProcessorWrapper(T *p)
Initializing constructor.
Definition: AlignmentsProcessor.h:87
dd4hep::align::AlignmentsProcessor::AlignmentsProcessor
AlignmentsProcessor(T &p)
Initializing constructor.
Definition: AlignmentsProcessor.h:48
dd4hep::align::AlignmentsCollector::operator=
AlignmentsCollector & operator=(const AlignmentsCollector &copy)=default
Assignment operator.
Printout.h
AlignmentData.h
dd4hep::ConditionsMap
ConditionsMap class.
Definition: ConditionsMap.h:59