Belle II Software  release-06-02-00
GeoEKLMCreator.h
Go to the documentation of this file.
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 /* KLM headers. */
12 #include <klm/eklm/simulation/EKLMSensitiveDetector.h>
13 #include <klm/eklm/geometry/GeometryData.h>
14 #include <klm/eklm/geometry/TransformData.h>
15 
16 /* Belle 2 headers. */
17 #include <framework/gearbox/GearDir.h>
18 #include <geometry/CreatorBase.h>
19 
20 /* C++ headers. */
21 #include <string>
22 
23 /* Geant4 headers. */
24 #include <G4Box.hh>
25 #include <G4LogicalVolume.hh>
26 #include <G4Material.hh>
27 #include <G4SubtractionSolid.hh>
28 #include <G4Transform3D.hh>
29 #include <G4Tubs.hh>
30 
36 namespace Belle2 {
42  namespace EKLM {
43 
48  G4VSolid* itube;
49  G4VSolid* otube;
50  };
51 
56  G4LogicalVolume* corn1;
57  G4LogicalVolume* corn2;
58  G4LogicalVolume* corn3;
59  G4LogicalVolume* corn4;
60  G4LogicalVolume* supp;
61  };
62 
67  G4LogicalVolume* detailA;
68  G4LogicalVolume* detailB;
69  G4LogicalVolume* detailC;
70  G4LogicalVolume* detailD;
71  };
72 
113  struct Solids {
114  G4VSolid* section;
115  G4VSolid* layer;
116  G4VSolid* sector;
117  G4VSolid* secsupp;
118  G4VSolid** plane;
119  G4VSolid** stripSegment;
121  G4VSolid** psheet;
122  G4VSolid** strip;
123  G4VSolid** groove;
126  };
127 
168  struct LogicalVolumes {
169  G4LogicalVolume* shieldLayer;
170  G4LogicalVolume* shieldLayerSector;
171  G4LogicalVolume* cover;
172  G4LogicalVolume** segment;
173  G4LogicalVolume** stripSegment;
174  G4LogicalVolume** strip;
175  G4LogicalVolume** groove;
176  G4LogicalVolume** scint;
177  G4LogicalVolume** psheet;
178  G4LogicalVolume*** segmentsup;
181  };
182 
186  struct Materials {
187  G4Material* air;
188  G4Material* polyethylene;
189  G4Material* polystyrene;
190  G4Material* polystyrol;
191  G4Material* iron;
192  G4Material* duralumin;
193  G4Material* silicon;
194  G4Material* gel;
195  };
196 
200  struct VolumeNumbers {
201  int section;
202  int layer;
203  int sector;
204  int plane;
205  int segment;
206  int strip;
207  };
208 
214 
215  public:
216 
220  GeoEKLMCreator();
221 
225  ~GeoEKLMCreator();
226 
233  void create(const GearDir& content, G4LogicalVolume& topVolume,
234  geometry::GeometryTypes type) override;
235 
242  void createFromDB(const std::string& name, G4LogicalVolume& topVolume,
243  geometry::GeometryTypes type) override;
244 
250  void createPayloads(const GearDir& content,
251  const IntervalOfValidity& iov) override;
252 
253  private:
254 
258  void createMaterials();
259 
264 
268  void createSectionSolid();
269 
275  G4LogicalVolume* createLayerLogicalVolume(const char* name) const;
276 
280  void createLayerSolid();
281 
287  G4LogicalVolume* createSectorLogicalVolume(const char* name) const;
288 
292  void createSectorSolid();
293 
298 
303 
308 
315  G4Box* createSectorSupportBoxX(G4Transform3D& t);
316 
323  G4Box* createSectorSupportBoxY(G4Transform3D& t);
324 
331  G4Box* createSectorSupportBoxTop(G4Transform3D& t);
332 
337 
342 
347 
352 
357 
362 
375  G4SubtractionSolid* cutSolidCorner(
376  const char* name, G4VSolid* solid, G4Box* subtractionBox,
377  const HepGeom::Transform3D& transf, bool largerAngles,
378  double x1, double y1, double x2, double y2);
379 
391  G4SubtractionSolid* cutSolidCorner(
392  const char* name, G4VSolid* solid, G4Box* subtractionBox,
393  const HepGeom::Transform3D& transf, bool largerAngles,
394  double x, double y, double ang);
395 
400  void createPlaneSolid(int n);
401 
407  void createSegmentSupportLogicalVolume(int iPlane, int iSegmentSupport);
408 
416  G4VSolid* unifySolids(G4VSolid** solids, HepGeom::Transform3D* transf,
417  int nSolids, const std::string& name);
418 
423  void createPlasticSheetLogicalVolume(int iSegment);
424 
429  void createStripSegmentLogicalVolume(int iSegment);
430 
435  void createSegmentLogicalVolume(int iSegment);
436 
441  void createStripLogicalVolume(int iStrip);
442 
447  void createStripGrooveLogicalVolume(int iStrip);
448 
453  void createScintillatorLogicalVolume(int iStrip);
454 
459 
464 
469 
474 
478  void createSolids();
479 
486  bool detectorLayer(int section, int layer) const;
487 
493  G4LogicalVolume* createSection(G4LogicalVolume* topVolume) const;
494 
505  G4LogicalVolume* createLayer(G4LogicalVolume* section,
506  G4LogicalVolume* layer) const;
507 
518  G4LogicalVolume* createSector(G4LogicalVolume* layer,
519  G4LogicalVolume* sector) const;
520 
526  void createSectorCover(int iCover, G4LogicalVolume* sector) const;
527 
532  void createSectorSupport(G4LogicalVolume* sector) const;
533 
538  void createSectorSupportCorner1(G4LogicalVolume* sector) const;
539 
544  void createSectorSupportCorner2(G4LogicalVolume* sector) const;
545 
550  void createSectorSupportCorner3(G4LogicalVolume* sector) const;
551 
556  void createSectorSupportCorner4(G4LogicalVolume* sector) const;
557 
563  G4LogicalVolume* createPlane(G4LogicalVolume* sector) const;
564 
570  void createSegmentSupport(int iSegmentSupport,
571  G4LogicalVolume* plane) const;
572 
578  void createPlasticSheet(int iSheetPlane, int iSheet) const;
579 
584  void createStripSegment(int iSegment) const;
585 
590  void createSegment(G4LogicalVolume* plane) const;
591 
596  void createStrip(G4LogicalVolume* segment) const;
597 
602  void createStripGroove(int iStrip) const;
603 
608  void createScintillator(int iStrip) const;
609 
614  void createShield(G4LogicalVolume* sector) const;
615 
619  void newVolumes();
620 
624  void newSensitive();
625 
629  void deleteVolumes();
630 
634  void deleteSensitive();
635 
641 
646  void create(G4LogicalVolume& topVolume);
647 
649  struct Solids m_Solids;
650 
652  struct LogicalVolumes m_LogVol;
653 
655  struct Materials m_Materials;
656 
658  struct VolumeNumbers m_CurVol;
659 
662 
665 
668 
671 
672  };
673 
674  }
675 
677 }
EKLM element numbers.
The Class for EKLM Sensitive Detector.
Class GeoEKLMCreator.
G4Box * createSectorSupportBoxY(G4Transform3D &t)
Create Y side of sector support structure.
struct Solids m_Solids
Solids.
void readXMLDataStrips()
Read strip parameters from XML database.
void createShieldDetailDLogicalVolume()
Create shield detail D logical volume.
void createShieldDetailALogicalVolume()
Create shield detail A logical volume.
double getSectorSupportCornerAngle()
Get cutted corner angle.
G4LogicalVolume * createSector(G4LogicalVolume *layer, G4LogicalVolume *sector) const
Create sector.
void createShieldDetailCLogicalVolume()
Create shield detail C logical volume.
void createSegment(G4LogicalVolume *plane) const
Create segment (strips + plastic sheets).
void createMaterials()
Creation of materials.
G4Tubs * createSectorSupportOuterTube()
Create outer tube of sector support structure.
struct LogicalVolumes m_LogVol
Logical volumes.
TransformData * m_TransformData
Transformation data.
struct VolumeNumbers m_CurVol
Current volumes.
void createSectorSupportCorner4(G4LogicalVolume *sector) const
Create sector support corner 4.
struct Materials m_Materials
Materials.
void createShieldDetailBLogicalVolume()
Create shield detail B logical volume.
void createScintillator(int iStrip) const
Create scintillator.
G4LogicalVolume * createSection(G4LogicalVolume *topVolume) const
Create section.
void createSectorSupportCorner1LogicalVolume()
Create sector support corner 1 logical volume.
G4LogicalVolume * createLayer(G4LogicalVolume *section, G4LogicalVolume *layer) const
Create layer.
void createFromDB(const std::string &name, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
Creation of the detector geometry from database.
void createPlaneSolid(int n)
Create plane solid.
G4SubtractionSolid * cutSolidCorner(const char *name, G4VSolid *solid, G4Box *subtractionBox, const HepGeom::Transform3D &transf, bool largerAngles, double x1, double y1, double x2, double y2)
Cut corner of a solid.
void createSectorSupportCorner2LogicalVolume()
Create sector support corner 2 logical volume.
void newVolumes()
Create new volumes.
void createSubtractionBoxSolid()
Create subtraction box solid.
G4Box * createSectorSupportBoxTop(G4Transform3D &t)
Create box in the cutted corner of sector support structure.
void newSensitive()
Create new sensitive detectors.
void createSectorSupportCorner1(G4LogicalVolume *sector) const
Create sector support corner 1.
void createSectorSupportCorner3(G4LogicalVolume *sector) const
Create sector support corner 3.
void deleteSensitive()
Delete sensitive detectors.
G4LogicalVolume * createLayerLogicalVolume(const char *name) const
Create layer logical volume.
void createPayloads(const GearDir &content, const IntervalOfValidity &iov) override
Creation of payloads.
void createSectorCover(int iCover, G4LogicalVolume *sector) const
Create sector cover.
void createStripSegment(int iSegment) const
Create strip segment.
G4LogicalVolume * createPlane(G4LogicalVolume *sector) const
Create plane.
EKLMSensitiveDetector * m_Sensitive
Sensitive detector.
void createScintillatorLogicalVolume(int iStrip)
Create scintillator logical volume.
void createSegmentSupportLogicalVolume(int iPlane, int iSegmentSupport)
Create segment support logical volume.
void createShield(G4LogicalVolume *sector) const
Create shield.
void createPlasticSheet(int iSheetPlane, int iSheet) const
Create plastic sheet.
const EKLMElementNumbers * m_ElementNumbers
Element numbers.
void createSectorSupportCorner4LogicalVolume()
Create sector support corner 4 logical volume.
void createSegmentLogicalVolume(int iSegment)
Create segment logical volume (strips + plastic sheets).
void createSolids()
Create solids (or logical volumes which must be created only once).
void createPlasticSheetLogicalVolume(int iSegment)
Create plastic sheet logical volume.
void createSectorSupportLogicalVolume()
Create sector support logical volume.
void createLayerSolid()
Create layer solid.
G4Box * createSectorSupportBoxX(G4Transform3D &t)
Create X side of sector support structure.
void createSectorCoverLogicalVolume()
Create sector cover solid.
void createSectorSupportCorner2(G4LogicalVolume *sector) const
Create sector support corner 2.
void createStripGrooveLogicalVolume(int iStrip)
Create strip groove logical volume.
bool detectorLayer(int section, int layer) const
Check if a given layer is a detector layer.
void createStripGroove(int iStrip) const
Create strip groove.
void createSectorSupportCorner3LogicalVolume()
Create sector support corner 3 logical volume.
G4VSolid * unifySolids(G4VSolid **solids, HepGeom::Transform3D *transf, int nSolids, const std::string &name)
Unify a group of solids.
void createSectionSolid()
Create section solid.
G4LogicalVolume * createSectorLogicalVolume(const char *name) const
Create sector logical volume.
void createStrip(G4LogicalVolume *segment) const
Create strip.
void createSectorSolid()
Create sector solid.
void createStripLogicalVolume(int iStrip)
Create strip logical volume.
void deleteVolumes()
Delete volumes.
void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
Creation of the detector geometry from Gearbox (XML).
void createSectorSupport(G4LogicalVolume *sector) const
Create sector support structure (main part without corners).
const GeometryData * m_GeoDat
Geometry data.
void createStripSegmentLogicalVolume(int iSegment)
Create strip segment logical volume.
void createSegmentSupport(int iSegmentSupport, G4LogicalVolume *plane) const
Create segment support.
G4Tubs * createSectorSupportInnerTube()
Create inner tube of sector support structure.
EKLM geometry data.
Definition: GeometryData.h:38
Transformation data.
Definition: TransformData.h:35
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:31
A class that describes the interval of experiments/runs for which an object in the database is valid.
Pure virtual base class for all geometry creators.
Definition: CreatorBase.h:28
GeometryTypes
Flag indiciating the type of geometry to be used.
Abstract base class for different kinds of events.
Logical volumes of EKLM.
G4LogicalVolume * shieldLayerSector
Shield layer sector.
G4LogicalVolume ** strip
Strips.
G4LogicalVolume ** scint
Scintillator.
G4LogicalVolume * shieldLayer
Shield layer.
G4LogicalVolume ** groove
Strip grooves.
G4LogicalVolume ** stripSegment
Strip segments.
struct ShieldLogicalVolumes shield
Shield.
G4LogicalVolume *** segmentsup
Segment support.
G4LogicalVolume ** psheet
Plastic sheet.
G4LogicalVolume ** segment
Segments.
G4LogicalVolume * cover
Sector cover.
struct SectorSupportLogicalVolumes sectorsup
Sector support.
Materials for EKLM.
G4Material * iron
Iron.
G4Material * silicon
Silicon.
G4Material * duralumin
Duralumin.
G4Material * air
Air.
G4Material * polystyrene
Polystyrene.
G4Material * polyethylene
Polyethylene.
G4Material * gel
Gel.
G4Material * polystyrol
Polystyrol.
Sector support logical volumes.
G4LogicalVolume * detailC
Detail C.
G4LogicalVolume * detailD
Detail D.
G4LogicalVolume * detailA
Detail A.
G4LogicalVolume * detailB
Detail B.
All solids of EKLM.
G4VSolid * section
Section.
G4VSolid ** plane
Plane.
G4VSolid ** strip
Strips.
G4VSolid * secsupp
Sector support.
G4VSolid * sector
Sector.
G4VSolid * layer
Layer.
G4VSolid ** groove
Strip grooves.
G4VSolid ** stripSegment
Strip segment.
G4VSolid ** plasticSheetElement
Plastic sheet element.
G4VSolid ** psheet
Plastic sheets (combined).
G4Box * subtractionBox
Box used for subtractions.
struct SectorSupportSolids sectorsup
Sector support.