Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 09:57:59

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 DD4HEP_ALIGNMENTSPRINTER_H
0014 #define DD4HEP_ALIGNMENTSPRINTER_H
0015 
0016 // Framework includes
0017 #include <DD4hep/Printout.h>
0018 #include <DD4hep/DetElement.h>
0019 #include <DD4hep/Alignments.h>
0020 
0021 /// Namespace for the AIDA detector description toolkit
0022 namespace dd4hep {
0023 
0024   /// Namespace for the AIDA detector description toolkit supporting XML utilities
0025   namespace align {
0026 
0027     /// Generic Alignments data dumper.
0028     /**
0029      *   Please note that the principle of locality applies:
0030      *   The object is designed for stack allocation and configuration.
0031      *   It may NOT be shared across threads!
0032      *
0033      *   \author  M.Frank
0034      *   \version 1.0
0035      *   \date    31/03/2016
0036      *   \ingroup DD4HEP_DDDB
0037      */
0038     class AlignmentsPrinter {
0039     public:
0040       /// Conditionsmap to resolve things
0041       ConditionsMap* mapping;
0042       /// Printer name. Want to know who is printing what
0043       std::string    name;
0044       /// Printout prefix
0045       std::string    prefix;
0046       /// Printout level
0047       PrintLevel     printLevel;
0048     protected:
0049       /// Printout processing and customization flag
0050       int            m_flag;
0051 
0052     public:
0053       /// No default constructor
0054       AlignmentsPrinter() = delete;
0055       /// Initializing constructor
0056       AlignmentsPrinter(ConditionsMap* m, const std::string& prefix="",int flags=0);
0057       /// Default destructor
0058       virtual ~AlignmentsPrinter() = default;
0059       /// Set name for printouts
0060       void setName(const std::string& value)    {  name = value;   }
0061       /// Set prefix for printouts
0062       void setPrefix(const std::string& value)  {  prefix = value; }
0063       /// Callback to output alignments information of an entire DetElement
0064       virtual int operator()(DetElement de, int level) const;
0065       /// Callback to output alignments information
0066       virtual int operator()(Alignment alignment)  const;
0067     };
0068 
0069     
0070     /// Generic Alignments data dumper.
0071     /**
0072      *   Please note that the principle of locality applies:
0073      *   The object is designed for stack allocation and configuration.
0074      *   It may NOT be shared across threads!
0075      *
0076      *   \author  M.Frank
0077      *   \version 1.0
0078      *   \date    31/03/2016
0079      *   \ingroup DD4HEP_DDDB
0080      */
0081     class AlignedVolumePrinter : public AlignmentsPrinter {
0082     public:
0083       /// No default constructor
0084       AlignedVolumePrinter() = delete;
0085       /// Initializing constructor
0086       AlignedVolumePrinter(ConditionsMap* map, const std::string& prefix="",int flags=0);
0087       /// Default destructor
0088       virtual ~AlignedVolumePrinter() = default;
0089       /// Callback to output alignments information of an entire DetElement
0090       virtual int operator()(DetElement de, int level) const override
0091       { return this->AlignmentsPrinter::operator()(de,level);        }
0092       /// Callback to output alignments information
0093       virtual int operator()(Alignment cond)  const  override;
0094     };
0095 
0096     
0097     /// Default printout of an alignment entry
0098     void printAlignment(PrintLevel prt_level, const std::string& prefix, Alignment alignment);
0099 
0100     void printAlignment(PrintLevel lvl, const std::string& prefix,
0101                         const std::string& opt, DetElement de, Alignment alignment);
0102 
0103     /// Default printout of a detector element entry
0104     void printElement(PrintLevel prt_level, const std::string& prefix, DetElement element, ConditionsMap& pool);
0105 
0106     /// PrintElement placement with/without alignment applied
0107     void printElementPlacement(PrintLevel prt_level, const std::string& prefix, DetElement detector, ConditionsMap& pool);
0108 
0109   }    /* End namespace align           */
0110 }      /* End namespace dd4hep               */
0111 #endif // DD4HEP_ALIGNMENTSPRINTER_H