Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-03-13 08:19:35

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 // Framework includes
0015 #include <DD4hep/IOV.h>
0016 #include <DD4hep/World.h>
0017 #include <DD4hep/Printout.h>
0018 #include <DD4hep/InstanceCount.h>
0019 #include <DD4hep/detail/Handle.inl>
0020 #include <DD4hep/detail/DetectorInterna.h>
0021 #include <DD4hep/detail/AlignmentsInterna.h>
0022 
0023 using namespace dd4hep;
0024 using AlignmentObject = detail::AlignmentObject;
0025 
0026 DD4HEP_INSTANTIATE_HANDLE_UNNAMED(AlignmentData);
0027 #if defined(DD4HEP_MINIMAL_CONDITIONS)
0028 DD4HEP_INSTANTIATE_HANDLE_UNNAMED(AlignmentObject,ConditionObject);
0029 #else
0030 DD4HEP_INSTANTIATE_HANDLE_NAMED(AlignmentObject,ConditionObject);
0031 #endif
0032 
0033 /// Default constructor
0034 AlignmentObject::AlignmentObject()
0035   : ConditionObject(), alignment_data(0)
0036 {
0037   InstanceCount::increment(this);
0038   flags  = Condition::ALIGNMENT_DERIVED;
0039   AlignmentData& d = data.construct<AlignmentData>();
0040   alignment_data   = &d;
0041 }
0042 
0043 /// Standard constructor
0044 AlignmentObject::AlignmentObject(const std::string& nam, const std::string& tit, void* p, size_t len)
0045   : ConditionObject(nam, tit), alignment_data(0)
0046 {
0047   InstanceCount::increment(this);
0048   flags  = Condition::ALIGNMENT_DERIVED|Condition::ONSTACK;
0049   AlignmentData& d = data.bind<AlignmentData>(p,len);
0050   alignment_data   = &d;
0051 }
0052 
0053 /// Standard Destructor
0054 AlignmentObject::~AlignmentObject()  {
0055   InstanceCount::decrement(this);
0056 }
0057 
0058 /// Clear data content on demand.
0059 void AlignmentObject::clear()   {
0060   AlignmentCondition a(this);
0061   AlignmentData& d = a.data();
0062   d.trToWorld = Transform3D();
0063   d.detectorTrafo.Clear();
0064   d.worldTrafo.Clear();
0065   d.nodes.clear();
0066   flags = Condition::ALIGNMENT_DERIVED;
0067 }
0068 
0069 #include <DD4hep/GrammarUnparsed.h>
0070 static auto s_registry = GrammarRegistry::pre_note<AlignmentObject>();