Belle II Software  release-05-01-25
GeoCDCCreator.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Makoto Uchida, Eiichi Nakano *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef GEOCDCCREATOR_H
12 #define GEOCDCCREATOR_H
13 
14 #include <geometry/CreatorBase.h>
15 
16 #include <framework/gearbox/GearDir.h>
17 #include <framework/logging/Logger.h>
18 #include <framework/database/DBObjPtr.h>
19 #include <framework/database/IntervalOfValidity.h>
20 #include <framework/database/DBImportObjPtr.h>
21 
22 #include <cdc/simulation/CDCSensitiveDetector.h>
23 #include <cdc/dbobjects/CDCGeometry.h>
24 
25 class G4LogicalVolume;
26 class G4VPhysicalVolume;
27 class G4VisAttributes;
28 class G4UserLimits;
29 
30 namespace Belle2 {
36  class BkgSensitiveDetector;
37 
38  namespace CDC {
39 
41 
45 
46  public:
47 
49  GeoCDCCreator();
50 
53 
55 
58  virtual void create(const GearDir& content, G4LogicalVolume& topVolume, geometry::GeometryTypes type) override
59  {
60  CDCGeometry config = createConfiguration(content);
61  createGeometry(config, topVolume, type);
62  }
63 
67  virtual void createFromDB(const std::string& name, G4LogicalVolume& topVolume, geometry::GeometryTypes type) override
68  {
70  if (!geo) {
71  B2FATAL("No configuration for " << name << " found.");
72  }
73  createGeometry(*geo, topVolume, type);
74  }
75 
79  virtual void createPayloads(const GearDir& content, const IntervalOfValidity& iov) override
80  {
82  importObj.construct(createConfiguration(content));
83  importObj.import(iov);
84  }
85 
89  void createCovers(const GearDir& content);
90 
94  void createCovers(const CDCGeometry& geom);
95 
99  void createNeutronShields(const GearDir& content);
100 
101 
105  void createNeutronShields(const CDCGeometry& geom);
106 
110  void createCover2s(const GearDir& content);
111 
115  void createCover2s(const CDCGeometry& geom);
116 
120  void createCone(const double rmin1, const double rmax1,
121  const double rmin2, const double rmax2,
122  const double thick, const double posz,
123  const int id, G4Material* med, const std::string& name);
127  void createBox(const double length, const double height,
128  const double thick, const double x,
129  const double y, const double z,
130  const int id, G4Material* med,
131  const std::string& name);
135  void createTube(const double rmin, const double rmax,
136  const double thick, const double posZ,
137  const int id, G4Material* med,
138  const std::string& name);
142  void createTorus(const double rmin1, const double rmax1,
143  const double thick, const double posZ,
144  const int id, G4Material* med,
145  const std::string& name);
146 
150  void createTube2(const double rmin, const double rmax,
151  const double phis, const double phie,
152  const double thick, const double posZ,
153  const int id, G4Material* med,
154  const std::string& name);
155 
156  protected:
157 
158  private:
163  {
164  CDCGeometry cdcGeometry;
165  cdcGeometry.read(param);
166  return cdcGeometry;
167  }
171  void createGeometry(const CDCGeometry& parameters, G4LogicalVolume& topVolume,
176  void createMapper(G4LogicalVolume& topVolume);
177 
179  G4LogicalVolume* logical_cdc;
180 
182  G4VPhysicalVolume* physical_cdc;
183 
186 
189 
191  std::vector<G4VisAttributes*> m_VisAttributes;
192 
194  std::vector<G4UserLimits*> m_userLimits;
195 
196  };
197 
198  } // end of cdc namespace
200 } // end of Belle2 namespace
201 
202 #endif /* GEOCDCBELLEII_H */
Belle2::IntervalOfValidity
A class that describes the interval of experiments/runs for which an object in the database is valid.
Definition: IntervalOfValidity.h:35
Belle2::CDC::GeoCDCCreator::createCone
void createCone(const double rmin1, const double rmax1, const double rmin2, const double rmax2, const double thick, const double posz, const int id, G4Material *med, const std::string &name)
Create G4Cone.
Definition: GeoCDCCreator.cc:1701
Belle2::CDC::GeoCDCCreator::m_VisAttributes
std::vector< G4VisAttributes * > m_VisAttributes
Vector of pointers to G4VisAttributes.
Definition: GeoCDCCreator.h:191
Belle2::CDC::GeoCDCCreator::createGeometry
void createGeometry(const CDCGeometry &parameters, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Create G4 geometry of CDC.
Definition: GeoCDCCreator.cc:93
Belle2::CDC::GeoCDCCreator::createCovers
void createCovers(const GearDir &content)
Create CDC covers from gear box.
Definition: GeoCDCCreator.cc:1181
Belle2::CDC::CDCSensitiveDetector
The Class for CDC Sensitive Detector.
Definition: CDCSensitiveDetector.h:46
Belle2::CDC::GeoCDCCreator::m_sensitive
CDCSensitiveDetector * m_sensitive
Sensitive detector.
Definition: GeoCDCCreator.h:185
Belle2::CDC::GeoCDCCreator::m_bkgsensitive
BkgSensitiveDetector * m_bkgsensitive
Sensitive detector for background studies.
Definition: GeoCDCCreator.h:188
Belle2::BkgSensitiveDetector
The Class for BeamBackground Sensitive Detector.
Definition: BkgSensitiveDetector.h:34
Belle2::CDC::GeoCDCCreator::createBox
void createBox(const double length, const double height, const double thick, const double x, const double y, const double z, const int id, G4Material *med, const std::string &name)
Create G4Box.
Definition: GeoCDCCreator.cc:1742
Belle2::DBImportObjPtr::construct
void construct(Args &&... params)
Construct an object of type T in this DBImportObjPtr using the provided constructor arguments.
Definition: DBImportObjPtr.h:57
Belle2::DBImportBase::import
bool import(const IntervalOfValidity &iov)
Import the object to database.
Definition: DBImportBase.cc:38
Belle2::CDC::GeoCDCCreator::logical_cdc
G4LogicalVolume * logical_cdc
CDC G4 logical volume.
Definition: GeoCDCCreator.h:179
Belle2::CDC::GeoCDCCreator::createPayloads
virtual void createPayloads(const GearDir &content, const IntervalOfValidity &iov) override
Create payloads.
Definition: GeoCDCCreator.h:79
Belle2::CDC::GeoCDCCreator::createNeutronShields
void createNeutronShields(const GearDir &content)
Create neutron shield from gearbox.
Definition: GeoCDCCreator.cc:1100
Belle2::CDC::GeoCDCCreator::createMapper
void createMapper(G4LogicalVolume &topVolume)
Create the B-field mapper geometry (tentative function)
Definition: GeoCDCCreator.cc:1811
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::CDC::GeoCDCCreator::GeoCDCCreator
GeoCDCCreator()
Constructor of the GeoCDCCreator class.
Definition: GeoCDCCreator.cc:68
Belle2::CDCGeometry
The Class for CDC geometry.
Definition: CDCGeometry.h:37
Belle2::CDC::GeoCDCCreator::createTorus
void createTorus(const double rmin1, const double rmax1, const double thick, const double posZ, const int id, G4Material *med, const std::string &name)
Create G4Torus.
Definition: GeoCDCCreator.cc:1762
Belle2::CDC::GeoCDCCreator::~GeoCDCCreator
~GeoCDCCreator()
The destructor of the GeoCDCCreator class.
Definition: GeoCDCCreator.cc:83
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CDC::GeoCDCCreator::createCover2s
void createCover2s(const GearDir &content)
Create CDC cover2s from gear box.
Belle2::CDC::GeoCDCCreator::m_userLimits
std::vector< G4UserLimits * > m_userLimits
Vector of pointers to G4UserLimits.
Definition: GeoCDCCreator.h:194
Belle2::GearDir
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:41
Belle2::DBImportObjPtr
Class for importing a single object to the database.
Definition: DBImportObjPtr.h:33
Belle2::CDC::GeoCDCCreator::physical_cdc
G4VPhysicalVolume * physical_cdc
CDC G4 physical volume.
Definition: GeoCDCCreator.h:182
Belle2::CDC::GeoCDCCreator::createFromDB
virtual void createFromDB(const std::string &name, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
Create geometry from DB.
Definition: GeoCDCCreator.h:67
Belle2::CDC::GeoCDCCreator::createConfiguration
CDCGeometry createConfiguration(const GearDir &param)
Create DB object of CDC geometry from gearbox.
Definition: GeoCDCCreator.h:162
Belle2::CDC::GeoCDCCreator::createTube
void createTube(const double rmin, const double rmax, const double thick, const double posZ, const int id, G4Material *med, const std::string &name)
Create G4Tube.
Definition: GeoCDCCreator.cc:1720
Belle2::CDC::GeoCDCCreator
The GeoCDCCreator class.
Definition: GeoCDCCreator.h:44
Belle2::geometry::CreatorBase
Pure virtual base class for all geometry creators.
Definition: CreatorBase.h:31
Belle2::CDC::GeoCDCCreator::createTube2
void createTube2(const double rmin, const double rmax, const double phis, const double phie, const double thick, const double posZ, const int id, G4Material *med, const std::string &name)
Create G4Tube2.
Definition: GeoCDCCreator.cc:1788
Belle2::CDCGeometry::read
void read(const GearDir &)
Get geometry parameters from Gearbox.
Definition: CDCGeometry.cc:36
Belle2::CDC::GeoCDCCreator::create
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
Creates the ROOT Objects for the CDC geometry.
Definition: GeoCDCCreator.h:58
Belle2::geometry::GeometryTypes
GeometryTypes
Flag indiciating the type of geometry to be used.
Definition: GeometryManager.h:39