DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
AlignmentsProcessor.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 includes
15 #include <DD4hep/Printout.h>
20 
21 using namespace dd4hep;
22 using namespace dd4hep::align;
23 
25 template <typename T>
26 int DeltaCollector<T>::operator()(DetElement de, int level) const {
27  if ( de.isValid() ) {
28  int count = 0;
29  std::vector<Condition> conditions;
30  cond::conditionsCollector(mapping,conditions)(de,level);
31  for( auto cond : conditions ) {
32  if ( cond->testFlag(Condition::ALIGNMENT_DELTA) ) {
33  insert_item(deltas, de, cond.get<Delta>());
34  ++count;
35  }
36  }
37  return count;
38  }
39  except("Alignments","Cannot process alignments of an invalid detector element");
40  return 0;
41 }
42 
44 template <typename T>
46  if ( de.isValid() ) {
47  int count = 0;
48  std::vector<Condition> conditions;
49  cond::conditionsCollector(mapping,conditions)(de,level);
50  for( auto cond : conditions ) {
51  if ( cond->testFlag(Condition::ALIGNMENT_DERIVED) ) {
52  Alignment align = cond;
53  insert_item(alignments, de, align);
54  ++count;
55  }
56  }
57  return count;
58  }
59  except("Alignments","Cannot process alignments of an invalid detector element");
60  return 0;
61 }
62 
63 
65 namespace dd4hep {
66 
68  namespace align {
69 
70  template class DeltaCollector<std::list<Delta> >;
71  template class DeltaCollector<std::vector<Delta> >;
75 
79 
80 
86 
90 
91  } /* End namespace align */
92 } /* End namespace dd4hep */
cond
AlignmentCondition::Object * cond
Definition: AlignmentsCalculator.cpp:68
ConditionsInterna.h
dd4hep::cond::conditionsCollector
ConditionsCollector< typename std::remove_reference< T >::type > conditionsCollector(ConditionsMap &m, T &&conditions)
Creator utility function for ConditionsCollector objects.
Definition: ConditionsProcessor.h:150
dd4hep::align::AlignmentsCollector::operator()
virtual int operator()(DetElement de, int level=0) const final
Callback to output alignments information.
Definition: AlignmentsProcessor.cpp:45
dd4hep::Handle::isValid
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:128
dd4hep::Delta
Class describing an condition to re-adjust an alignment.
Definition: AlignmentData.h:38
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:188
dd4hep::Condition::ALIGNMENT_DELTA
@ ALIGNMENT_DELTA
Definition: Conditions.h:86
dd4hep::insert_item
void insert_item(std::vector< T > &c, Q, const T &d)
Definition: ContainerHelpers.h:37
dd4hep::Alignment
Main handle class to hold an alignment object.
Definition: Alignments.h:115
dd4hep::align::DeltaCollector
Generic Alignment-Delta collector keyed by detector elements.
Definition: AlignmentsProcessor.h:117
AlignmentsProcessor.h
mapping
ConditionsMap & mapping
Definition: AlignmentsCalculator.cpp:82
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::Condition::ALIGNMENT_DERIVED
@ ALIGNMENT_DERIVED
Definition: Conditions.h:87
ContainerHelpers.h
Printout.h
dd4hep::align
Namespace for implementation details of the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:31
ConditionsProcessor.h