Belle II Software development
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/geometry/GeometryData.h>
13#include <klm/eklm/geometry/TransformData.h>
14#include <klm/simulation/SensitiveDetector.h>
15
16/* Basf2 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
35
36namespace Belle2 {
41
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
163 G4LogicalVolume* cover;
164 G4LogicalVolume** segment;
165 G4LogicalVolume** stripSegment;
166 G4LogicalVolume** strip;
167 G4LogicalVolume** groove;
168 G4LogicalVolume** scint;
169 G4LogicalVolume** psheet;
170 G4LogicalVolume*** segmentsup;
173 };
174
178 struct Materials {
179 G4Material* air;
180 G4Material* polyethylene;
181 G4Material* polystyrene;
182 G4Material* polystyrol;
183 G4Material* iron;
184 G4Material* duralumin;
185 G4Material* silicon;
186 G4Material* gel;
187 };
188
194 int layer;
195 int sector;
196 int plane;
198 int strip;
199 };
200
206
207 public:
208
213
217 ~GeoEKLMCreator() override;
218
221
224
231 void create(const GearDir& content, G4LogicalVolume& topVolume,
232 geometry::GeometryTypes type) override;
233
240 void createFromDB(const std::string& name, G4LogicalVolume& topVolume,
241 geometry::GeometryTypes type) override;
242
248 void createPayloads(const GearDir& content,
249 const IntervalOfValidity& iov) override;
250
251 private:
252
256 void createMaterials();
257
262
266 void createSectionSolid();
267
273 G4LogicalVolume* createLayerLogicalVolume(const char* name) const;
274
278 void createLayerSolid();
279
285 G4LogicalVolume* createSectorLogicalVolume(const char* name) const;
286
290 void createSectorSolid();
291
296
301
306
313 G4Box* createSectorSupportBoxX(G4Transform3D& t);
314
321 G4Box* createSectorSupportBoxY(G4Transform3D& t);
322
329 G4Box* createSectorSupportBoxTop(G4Transform3D& t);
330
335
340
345
350
355
360
373 static G4SubtractionSolid* cutSolidCorner(
374 const char* name, G4VSolid* solid, G4Box* subtractionBox,
375 const HepGeom::Transform3D& transf, bool largerAngles,
376 double x1, double y1, double x2, double y2);
377
389 static G4SubtractionSolid* cutSolidCorner(
390 const char* name, G4VSolid* solid, G4Box* subtractionBox,
391 const HepGeom::Transform3D& transf, bool largerAngles,
392 double x, double y, double ang);
393
398 void createPlaneSolid(int n);
399
405 void createSegmentSupportLogicalVolume(int iPlane, int iSegmentSupport);
406
414 static G4VSolid* unifySolids(G4VSolid** solids, HepGeom::Transform3D* transf,
415 int nSolids, const std::string& name);
416
421 void createPlasticSheetLogicalVolume(int iSegment);
422
427 void createStripSegmentLogicalVolume(int iSegment);
428
433 void createSegmentLogicalVolume(int iSegment);
434
439 void createStripLogicalVolume(int iStrip);
440
445 void createStripGrooveLogicalVolume(int iStrip);
446
451 void createScintillatorLogicalVolume(int iStrip);
452
457
462
467
472
476 void createSolids();
477
484 bool detectorLayer(int section, int layer) const;
485
491 G4LogicalVolume* createSection(G4LogicalVolume* topVolume) const;
492
498 G4LogicalVolume* createLayer(G4LogicalVolume* section) const;
499
505 G4LogicalVolume* createSector(G4LogicalVolume* layer) const;
506
512 void createSectorCover(int iCover, G4LogicalVolume* sector) const;
513
518 void createSectorSupport(G4LogicalVolume* sector) const;
519
524 void createSectorSupportCorner1(G4LogicalVolume* sector) const;
525
530 void createSectorSupportCorner2(G4LogicalVolume* sector) const;
531
536 void createSectorSupportCorner3(G4LogicalVolume* sector) const;
537
542 void createSectorSupportCorner4(G4LogicalVolume* sector) const;
543
549 G4LogicalVolume* createPlane(G4LogicalVolume* sector) const;
550
556 void createSegmentSupport(int iSegmentSupport,
557 G4LogicalVolume* plane) const;
558
564 void createPlasticSheet(int iSheetPlane, int iSheet) const;
565
570 void createStripSegment(int iSegment) const;
571
576 void createSegment(G4LogicalVolume* plane) const;
577
582 void createStrip(G4LogicalVolume* segment) const;
583
588 void createStripGroove(int iStrip) const;
589
594 void createScintillator(int iStrip) const;
595
600 void createShield(G4LogicalVolume* sector) const;
601
605 void newVolumes();
606
610 void newSensitive();
611
615 void deleteVolumes();
616
620 void deleteSensitive();
621
627
632 void create(G4LogicalVolume& topVolume);
633
636
639
642
645
648
651
654
657
658 };
659
660 }
661
663}
~GeoEKLMCreator() override
Destructor.
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.
void createShieldDetailCLogicalVolume()
Create shield detail C logical volume.
GeoEKLMCreator(const GeoEKLMCreator &)=delete
Copying is not allowed: the class manages raw pointers.
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.
GeoEKLMCreator & operator=(const GeoEKLMCreator &)=delete
Copying is not allowed: the class manages raw pointers.
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.
void createFromDB(const std::string &name, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
Creation of the detector geometry from database.
KLM::SensitiveDetector * m_Sensitive
Sensitive detector.
G4LogicalVolume * createSector(G4LogicalVolume *layer) const
Create sector.
void createPlaneSolid(int n)
Create plane solid.
static 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.
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.
G4LogicalVolume * createLayer(G4LogicalVolume *section) const
Create layer.
static 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.
Transformation data.
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.
KLM sensitive-detector class.
Pure virtual base class for all geometry creators.
Definition CreatorBase.h:28
GeometryTypes
Flag indicating the type of geometry to be used.
Abstract base class for different kinds of events.
Logical volumes of EKLM.
G4LogicalVolume ** groove
Strip grooves.
struct ShieldLogicalVolumes shield
Shield.
G4LogicalVolume * cover
Sector cover.
G4LogicalVolume *** segmentsup
Segment support.
G4LogicalVolume ** scint
Scintillator.
G4LogicalVolume ** segment
Segments.
struct SectorSupportLogicalVolumes sectorsup
Sector support.
G4LogicalVolume ** stripSegment
Strip segments.
G4LogicalVolume ** psheet
Plastic sheet.
G4LogicalVolume ** strip
Strips.
Materials for EKLM.
G4Material * iron
Iron.
G4Material * silicon
Silicon.
G4Material * duralumin
Duralumin.
G4Material * polystyrene
Polystyrene.
G4Material * polyethylene
Polyethylene.
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.
G4Box * subtractionBox
Box used for subtractions.
G4VSolid ** plasticSheetElement
Plastic sheet element.
G4VSolid ** strip
Strips.
G4VSolid ** psheet
Plastic sheets (combined).
G4VSolid * secsupp
Sector support.
G4VSolid * sector
Sector.
G4VSolid * section
Section.
struct SectorSupportSolids sectorsup
Sector support.
G4VSolid ** stripSegment
Strip segment.
G4VSolid * layer
Layer.
G4VSolid ** plane
Plane.
G4VSolid ** groove
Strip grooves.