Falaise  4.0.1
SuperNEMO Software Toolkit
calo_tapered_scin_box_model.h
Go to the documentation of this file.
1 // -*- mode: c++ ; -*-
2 /// \file falaise/bipo3/geometry/calo_tapered_scin_box_model.h
3 /* Author (s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
4  * Creation date: 2010-03-25
5  * Last modified: 2015-02-10
6  *
7  * License:
8  *
9  * Copyright 2007-2015 F. Mauger
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or (at
14  * your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
24  * Boston, MA 02110-1301, USA.
25  *
26  * Description:
27  * A simplified model of a calorimeter scintillator box
28  * extruded using the spherical shape of a PMT entrance
29  * and tapered using a conic shape
30  *
31  * History:
32  *
33  */
34 
35 #ifndef FALAISE_SNEMO_GEOMETRY_CALO_TAPERED_SCIN_BOX_MODEL_H
36 #define FALAISE_SNEMO_GEOMETRY_CALO_TAPERED_SCIN_BOX_MODEL_H 1
37 
38 // Standard library:
39 #include <iostream>
40 #include <string>
41 
42 // Third party:
43 // - Boost:
44 #include <boost/scoped_ptr.hpp>
45 // - Bayeux/geomtools:
46 #include <geomtools/box.h>
47 #include <geomtools/i_model.h>
50 #include <geomtools/polycone.h>
51 #include <geomtools/sphere.h>
53 
54 namespace snemo {
55 
56 namespace geometry {
57 
58 /// \brief The geometry model for SuperNEMO calorimeter tapered scintillator block
60  public:
61  /// Return the mother solid shape
63 
64  /// Return the model identifier
65  virtual std::string get_model_id() const;
66 
67  /// Default constructor
69 
70  /// Destructor
72 
73  /// Smart print
74  virtual void tree_dump(std::ostream& out_ = std::clog, const std::string& title_ = "",
75  const std::string& indent_ = "", bool inherit_ = false) const;
76 
77  /// \brief Special Gnuplot wires 3D rendering
78  struct wires_drawer : public geomtools::i_wires_drawer<calo_tapered_scin_box_model> {
79  //! \brief Rendering options
81  WR_CTSBM_NO_SCIN_BLOCK = (WR_BASE_LAST << 1), //!< Do not render the scintillator block faces
82  WR_CTSBM_NO_EXTRUSION = (WR_BASE_LAST << 2) //!< Do not render the extrusion
83  };
84 
85  //! Constructor
87 
88  //! Destructor
89  virtual ~wires_drawer();
90 
91  //! Generate a list of polylines representing the contour of the shape (for display clients)
92  virtual void generate_wires_self(geomtools::wires_type& wires_, uint32_t options_ = 0) const;
93  };
94 
95  protected:
96  /// Main construction
97  virtual void _at_construct(const std::string& name_, const datatools::properties& setup_,
98  geomtools::models_col_type* models_ = 0);
99 
100  private:
101  std::string _material_;
102  geomtools::sphere _extrusion_;
103  geomtools::box _mother_box_;
104  geomtools::polycone _removed_cone_;
105  geomtools::subtraction_3d _solid_0_;
107  double _w_;
108  double _x_;
109  double _y_;
110  double _z_;
111  double _h_;
112  double _r_;
113  double _tapered_r_;
114  double _tapered_angle_;
115  double _optical_glue_thickness_;
116  double _zt_;
117  double _ze_;
118  double _re_;
119  double _angle_e_;
120 
121  boost::scoped_ptr<wires_drawer> _drawer_;
122 
123  // registration interface :
125 };
126 
127 } // end of namespace geometry
128 
129 } // end of namespace snemo
130 
131 #endif // FALAISE_SNEMO_GEOMETRY_CALO_TAPERED_SCIN_BOX_MODEL_H
Special Gnuplot wires 3D rendering.
Definition: calo_tapered_scin_box_model.h:78
std::map< std::string, i_model * > models_col_type
virtual void generate_wires_self(geomtools::wires_type &wires_, uint32_t options_=0) const
Generate a list of polylines representing the contour of the shape (for display clients)
wires_drawer(const calo_tapered_scin_box_model &model_)
Constructor.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
calo_tapered_scin_box_model()
Default constructor.
Do not render the extrusion.
Definition: calo_tapered_scin_box_model.h:82
Definition: calo_tapered_scin_box_model.h:54
virtual void _at_construct(const std::string &name_, const datatools::properties &setup_, geomtools::models_col_type *models_=0)
Main construction.
Do not render the scintillator block faces.
Definition: calo_tapered_scin_box_model.h:81
const geomtools::intersection_3d & get_solid() const
Return the mother solid shape.
The geometry model for SuperNEMO calorimeter tapered scintillator block.
Definition: calo_tapered_scin_box_model.h:59
std::list< polyline_type > wires_type
#define GEOMTOOLS_MODEL_REGISTRATION_INTERFACE(ModelClassName)
virtual std::string get_model_id() const
Return the model identifier.