Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:17:44

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 #ifndef EXAMPLES_ALIGNDET_SRC_ALIGNMENTEXAMPLEOBJECTS_H
0014 #define EXAMPLES_ALIGNDET_SRC_ALIGNMENTEXAMPLEOBJECTS_H
0015 
0016 // Framework include files
0017 #include "DD4hep/Detector.h"
0018 #include "DD4hep/Printout.h"
0019 #include "DD4hep/Alignments.h"
0020 #include "DD4hep/AlignmentData.h"
0021 #include "DD4hep/DetectorProcessor.h"
0022 #include "DD4hep/ConditionsProcessor.h"
0023 #include "DD4hep/AlignmentsProcessor.h"
0024 #include "DD4hep/AlignmentsPrinter.h"
0025 #include "DD4hep/AlignmentsCalculator.h"
0026 
0027 #include "DDCond/ConditionsSlice.h"
0028 
0029 /// Namespace for the AIDA detector description toolkit
0030 namespace dd4hep {
0031 
0032   /// Namespace for alignment examples
0033   namespace AlignmentExamples {
0034 
0035     using cond::ConditionsPool;
0036     using cond::ConditionsSlice;
0037     using cond::ConditionsContent;
0038     using cond::ConditionsManager;
0039     using cond::conditionsCollector;
0040 
0041     using align::AlignmentsPrinter;
0042     using align::AlignmentsCalculator;
0043     using align::AlignedVolumePrinter;
0044     using align::DeltaCollector;
0045     using align::deltaCollector;
0046     using align::alignmentsCollector;
0047     
0048     /// Example how to populate the detector description with alignment constants
0049     /**
0050      *  This is simply a DetElement crawler...
0051      *
0052      *  \author  M.Frank
0053      *  \version 1.0
0054      *  \date    01/04/2016
0055      */
0056     class AlignmentCreator {
0057     public:
0058       /// Reference to the conditions manager
0059       ConditionsManager manager;
0060       /// Reference to the used conditions pool
0061       ConditionsPool&   pool;
0062       /// Print level
0063       PrintLevel        printLevel;
0064       /// Constructor
0065       AlignmentCreator(ConditionsManager m, ConditionsPool& p)
0066         : manager(m), pool(p), printLevel(DEBUG) {}
0067       /// Callback to process a single detector element
0068       int operator()(DetElement de, int level)  const;
0069     };
0070 
0071     /// Example how to access the alignment constants from a detector element
0072     /**
0073      *  \author  M.Frank
0074      *  \version 1.0
0075      *  \date    01/04/2016
0076      */
0077     class AlignmentDataAccess {
0078     public:
0079       ConditionsMap& mapping;
0080       /// Print level
0081       PrintLevel printLevel;
0082       /// Constructor
0083       AlignmentDataAccess(ConditionsMap& m) : mapping(m), printLevel(DEBUG) {}
0084       /// Callback to process a single detector element
0085       int operator()(DetElement de, int level)  const;
0086     };
0087 
0088     /// Helper to run DetElement scans
0089     typedef DetectorScanner Scanner;
0090 
0091     /// Install the consitions and the alignment manager
0092     ConditionsManager installManager(Detector& description);
0093   }       /* End namespace AlignmentExamples           */
0094 }         /* End namespace dd4hep                      */
0095 #endif // EXAMPLES_ALIGNDET_SRC_ALIGNMENTEXAMPLEOBJECTS_H