Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:12:40

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 //  Original Author: Matevz Tadel 2009 (MultiView.C)
0012 //
0013 //==========================================================================
0014 #ifndef DDEVE_DISPLAYCONFIGURATION_H
0015 #define DDEVE_DISPLAYCONFIGURATION_H
0016 
0017 // Framework include files
0018 #include "TClass.h"
0019 
0020 // C/C++ include files
0021 #include <string>
0022 #include <list>
0023 #include <map>
0024 
0025 /// Namespace for the AIDA detector description toolkit
0026 namespace dd4hep {
0027 
0028   // Forward declarations
0029   class Display;
0030 
0031   /// Generic display configuration structure for DDEve
0032   /*
0033    * The data content is filled from the XML configuration file
0034    * and then used when building the application interface
0035    *
0036    * \author  M.Frank
0037    * \version 1.0
0038    * \ingroup DD4HEP_EVE
0039    */
0040   class  DisplayConfiguration   {
0041   protected:
0042     Display* m_display;
0043   public:
0044 
0045     enum { NO_DATA    = 0,
0046            CALODATA   = 1<<1, 
0047            DETELEMENT = 1<<2, 
0048            VIEW       = 1<<3, 
0049            PANEL      = 1<<4,
0050            COLLECTION = 1<<5
0051     };
0052 
0053     /// Default base class for all configurations
0054     struct Defaults {
0055       char  load_geo;
0056       char  show_evt;
0057       short default_pad;
0058       int   color;
0059       float alpha;
0060     };
0061 
0062     /// Configuration class for 3D calorimeter display
0063     struct Calo3D : public Defaults  {
0064       float rmin, dz, threshold, towerH, emax;
0065     };
0066 
0067     /// Configuration class for 3D calorimeter data display
0068     struct Calodata : public Defaults {
0069       float rmin, dz, threshold, towerH, emax;
0070       float eta_min, eta_max;
0071       float phi_min, phi_max;
0072       short n_eta;
0073       short n_phi;
0074       int spare;
0075     };
0076 
0077     /// Generic panel configuration 
0078     struct Panel : public Defaults {
0079     };
0080 
0081     /// Configuration class for hit data display
0082     struct Hits : public Defaults {
0083       float size;   // Marker size
0084       float width;
0085       float threshold;
0086       float towerH;
0087       float emax;   // Max energy deposit displayed
0088       int   type;   // Marker type
0089     };
0090 
0091     /// Container with full display configuration
0092     class Config  {
0093     public:
0094       /// Union to store specific data. Discriminator is Config::type
0095       union Values  {
0096         double vals[20];
0097         Defaults defaults;
0098         Calo3D calo3d;
0099         Calodata calodata;
0100         Panel pane;
0101         Hits hits;
0102       } data;
0103       std::string name;
0104       std::string hits;
0105       std::string use;
0106       int type;
0107       /// Default constructor
0108       Config();
0109       /// Copy constructor
0110       Config(const Config& c);
0111       /// Default destructor
0112       ~Config();
0113       /// Assignment operator
0114       Config& operator=(const Config& c);
0115     };
0116     typedef std::vector<Config> Configurations;
0117 
0118     /// View configuration
0119     class ViewConfig : public Config {
0120     public:
0121       std::string type;
0122       Configurations subdetectors;
0123       bool show_sensitive;
0124       bool show_structure;
0125       /// Default constructor
0126       ViewConfig();
0127       /// Copy constructor
0128       ViewConfig(const ViewConfig& c);
0129       /// Default destructor
0130       virtual ~ViewConfig();
0131       /// Assignment operator
0132       ViewConfig& operator=(const ViewConfig& c);
0133     };
0134     typedef std::list<ViewConfig> ViewConfigurations;
0135 
0136     /// Container with view configurations
0137     ViewConfigurations views;
0138     /// Container with calorimeter data configurations
0139     Configurations     calodata;
0140     /// Container for data collection configurations
0141     Configurations     collections;
0142   public:
0143     /// Initializing constructor
0144     DisplayConfiguration(Display* eve);
0145     /// Default destructor
0146     virtual ~DisplayConfiguration();
0147     /// Root implementation macro
0148     ClassDef(DisplayConfiguration,0);
0149   };
0150 }        /* End namespace dd4hep                */
0151 #endif // DDEVE_DISPLAYCONFIGURATION_H
0152