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4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 //
 26 //
 27 // ------------------------------------------------------------
 28 //      GEANT 4 class header file
 29 //      CERN Geneva Switzerland
 30 //
 31 //
 32 //      ------------ GammaRayTelDetectorConstruction  ------
 33 //           by F.Longo, R.Giannitrapani & G.Santin (13 nov 2000)
 34 //
 35 // ************************************************************
 36 
 37 #ifndef GammaRayTelDetectorConstruction_h
 38 #define GammaRayTelDetectorConstruction_h 1
 39 
 40 #include "G4Cache.hh"
 41 #include "G4PhysicalConstants.hh"
 42 #include "G4SystemOfUnits.hh"
 43 #include "G4VUserDetectorConstruction.hh"
 44 #include "globals.hh"
 45 
 46 class GammaRayTelAnticoincidenceSD;
 47 class GammaRayTelCalorimeterSD;
 48 class GammaRayTelDetectorMessenger;
 49 class GammaRayTelTrackerSD;
 50 
 51 class G4Box;
 52 class G4GlobalMagFieldMessenger;
 53 class G4LogicalVolume;
 54 class G4Material;
 55 class G4Region;
 56 class G4UniformMagField;
 57 class G4VPhysicalVolume;
 58 
 59 class GammaRayTelDetectorConstruction: public G4VUserDetectorConstruction {
 60 public:
 61     explicit GammaRayTelDetectorConstruction();
 62 
 63   ~GammaRayTelDetectorConstruction() override;
 64 
 65   void SetNbOfTKRLayers(G4int value); // tracker (TKR) number of layers
 66 
 67   void SetTKRTileSizeXY(G4double value);
 68 
 69   void SetNbOfTKRTiles(G4int value); // tracker (TKR) number of tiles
 70 
 71   void SetTKRSiliconThickness(G4double value);
 72 
 73   void SetTKRSiliconPitch(G4double value);
 74 
 75   void SetTKRLayerDistance(G4double value);
 76 
 77   void SetTKRViewsDistance(G4double value);
 78 
 79   void SetConverterMaterial(G4String materialChoice); // tracker (TKR) converter material
 80 
 81   void SetConverterThickness(G4double value); // tracker (TKR) converter thickness
 82 
 83   void SetNbOfCALLayers(G4int value); // calorimeter (CAL) material, length, thickness
 84 
 85   void SetNbOfCALBars(G4int value);
 86 
 87   void SetCALBarThickness(G4double value);
 88 
 89   void SetACDThickness(G4double value); // anticoincidence (ACD) thickness
 90 
 91   void SetMagField(G4double fieldValue); // magnetic field
 92 
 93   auto Construct() -> G4VPhysicalVolume* override;
 94 
 95   void ConstructSDandField() override;
 96 
 97   void PrintPayloadParameters();
 98 
 99   void UpdateGeometry();
100 
101   [[nodiscard]]
102   auto GetWorldSizeZ() const -> G4double {
103     return worldSizeZ;
104   }
105 
106   [[nodiscard]]
107   auto GetWorldSizeXY() const -> G4double {
108     return worldSizeXY;
109   }
110 
111   [[nodiscard]]
112   auto GetPayloadSizeZ() const -> G4double {
113     return payloadSizeZ;
114   }
115 
116   [[nodiscard]]
117   auto GetPayloadSizeXY() const -> G4double {
118     return payloadSizeXY;
119   }
120 
121   [[nodiscard]]
122   auto GetTKRSizeZ() const -> G4double {
123     return tkrSizeZ;
124   }
125 
126   [[nodiscard]]
127   auto GetTKRSizeXY() const -> G4double {
128     return tkrSizeXY;
129   }
130 
131   [[nodiscard]]
132   auto GetCALSizeZ() const -> G4double {
133     return calSizeZ;
134   }
135 
136   [[nodiscard]]
137   auto GetCALTKRDistance() const -> G4double {
138     return calTKRDistance;
139   }
140 
141   [[nodiscard]]
142   auto GetTKRSiliconThickness() const -> G4double {
143     return tkrSiliconThickness;
144   }
145 
146   [[nodiscard]]
147   auto GetTKRSiliconTileXY() const -> G4double {
148     return tkrSiliconTileXY;
149   }
150 
151   [[nodiscard]]
152   auto GetTKRSiliconPitch() const -> G4double {
153     return tkrSiliconPitch;
154   }
155 
156   [[nodiscard]]
157   auto GetNbOfTKRLayers() const -> G4int {
158     return numberOfTKRLayers;
159   }
160 
161   auto GetNbOfTKRTiles() const -> G4int {
162     return numberOfTKRTiles;
163   }
164 
165   [[nodiscard]]
166   auto GetNbOfTKRStrips() const -> G4int {
167     return numberOfTKRStrips;
168   }
169 
170   [[nodiscard]]
171   auto GetTKRLayerDistance() const -> G4double {
172     return tkrLayerDistance;
173   }
174 
175   [[nodiscard]]
176   auto GetTKRViewsDistance() const -> G4double {
177     return tkrViewsDistance;
178   }
179 
180   [[nodiscard]]
181   auto GetTKRActiveTileXY() const -> G4double {
182     return tkrActiveTileXY;
183   }
184 
185   [[nodiscard]]
186   auto GetTKRActiveTileZ() const -> G4double {
187     return tkrActiveTileZ;
188   }
189 
190   [[nodiscard]]
191   auto GetSiliconGuardRing() const -> G4double {
192     return siliconGuardRing;
193   }
194 
195   [[nodiscard]]
196   auto GetTilesSeparation() const -> G4double {
197     return tilesSeparation;
198   }
199 
200   [[nodiscard]]
201   auto GetConverterMaterial() const -> G4Material* {
202     return converterMaterial;
203   }
204 
205   [[nodiscard]]
206   auto GetConverterThickness() const -> G4double {
207     return converterThickness;
208   }
209 
210   [[nodiscard]]
211   auto GetCALBarThickness() const -> G4double {
212     return calBarThickness;
213   }
214 
215   [[nodiscard]]
216   auto GetNbOfCALLayers() const -> G4int {
217     return numberOfCALLayers;
218   }
219 
220   [[nodiscard]]
221   auto GetNbOfCALBars() const -> G4int {
222     return numberOfCALBars;
223   }
224 
225   [[nodiscard]]
226   auto GetACDThickness() const -> G4double {
227     return acdThickness;
228   }
229 
230   [[nodiscard]]
231   auto GetNbOfACDTopTiles() const -> G4int {
232     return numberOfACDTopTiles;
233   }
234 
235   [[nodiscard]]
236   auto GetNbOfACDLateralTiles() const -> G4int {
237     return numberOfACDLateralTiles;
238   }
239 
240 private:
241   G4Material *converterMaterial;
242   G4double converterThickness{300. * micrometer};
243 
244   // Tracker (TKR)
245 
246   G4double tkrSiliconThickness{400. * micrometer};
247   G4double tkrSiliconTileXY{9. * cm};
248   G4double tkrSiliconPitch{200. * micrometer};
249 
250   G4double tkrSizeXY;
251   G4double tkrSizeZ;
252   G4double tkrLayerDistance{3. * cm};
253   G4double tkrViewsDistance{1. * mm};
254   G4double tkrSupportThickness;
255 
256   G4int numberOfTKRLayers{15};
257   G4int numberOfTKRTiles{4};
258 
259   // Calorimeter (CAL)
260 
261   G4double calBarThickness{1.5 * cm};
262 
263   G4int numberOfCALLayers{5};
264   G4int numberOfCALBars{12};
265 
266   G4double calSizeXY;
267   G4double calSizeZ;
268   G4double calBarX;
269   G4double calBarY;
270   G4double calBarZ;
271 
272   // Anticoincidence (ACD)
273 
274   G4double acdThickness{1. * cm};
275 
276   G4double actSizeXY;
277   G4double actSizeZ;
278 
279   G4double acl1SizeX;
280   G4double acl1SizeY;
281   G4double acl1SizeZ;
282 
283   G4double acl2SizeX;
284   G4double acl2SizeY;
285   G4double acl2SizeZ;
286 
287   G4int numberOfACDTopTiles{1};
288   G4int numberOfACDLateralTiles{2};
289 
290   G4double tilesSeparation{100. * micrometer};
291   G4double acdTKRDistance{5. * cm};
292   G4double calTKRDistance{1.5 * cm};
293   G4double tkrActiveTileXY;
294   G4double tkrActiveTileZ;
295 
296   G4double siliconGuardRing{1.5 * mm};
297   G4int numberOfTKRStrips;
298 
299   G4double tkrXStripX;
300   G4double tkrYStripX;
301   G4double tkrXStripY;
302   G4double tkrYStripY;
303   G4double tkrZStrip;
304 
305   G4double payloadSizeZ;
306   G4double payloadSizeXY;
307 
308   G4double worldSizeXY;
309   G4double worldSizeZ;
310 
311   // Material
312     G4Material *defaultMaterial;
313     G4Material *calMaterial;
314     G4Material *tkrMaterial;
315     G4Material *acdMaterial;
316 
317   // World
318   G4Box *solidWorld{nullptr};
319   G4LogicalVolume *logicWorld{nullptr};
320   G4VPhysicalVolume *physiWorld{nullptr};
321 
322   // Payload
323   G4Box *solidPayload{nullptr};
324   G4LogicalVolume *logicPayload{nullptr};
325   G4VPhysicalVolume *physiPayload{nullptr};
326 
327   // Tracker
328   G4Box *solidTKR{nullptr};
329   G4LogicalVolume *logicTKR{nullptr};
330   G4VPhysicalVolume *physiTKR{nullptr};
331 
332   // Calorimeter
333   G4Box *solidCAL{nullptr};
334   G4LogicalVolume *logicCAL{nullptr};
335   G4VPhysicalVolume *physiCAL{nullptr};
336 
337   // Top Anticoincidence
338   G4Box *solidACT{nullptr};
339   G4LogicalVolume *logicACT{nullptr};
340   G4VPhysicalVolume *physiACT{nullptr};
341 
342   // Lateral Anticoincidence
343   G4Box *solidACL1{nullptr};
344   G4LogicalVolume *logicACL1{nullptr};
345   G4VPhysicalVolume *physiACL1{nullptr};
346 
347   G4Box *solidACL2{nullptr};
348   G4LogicalVolume *logicACL2{nullptr};
349   G4VPhysicalVolume *physiACL2{nullptr};
350 
351   // Tracker PLANE X
352   G4Box *solidTKRDetectorX{nullptr};
353   G4LogicalVolume *logicTKRDetectorX{nullptr};
354   G4VPhysicalVolume *physiTKRDetectorX{nullptr};
355 
356   // Tracker PLANE Y
357   G4Box *solidTKRDetectorY{nullptr};
358   G4LogicalVolume *logicTKRDetectorY{nullptr};
359   G4VPhysicalVolume *physiTKRDetectorY{nullptr};
360 
361   // Calorimeter PLANE X
362   G4Box *solidCALLayerX{nullptr};
363   G4LogicalVolume *logicCALLayerX{nullptr};
364   G4VPhysicalVolume *physiCALLayerX{nullptr};
365 
366   // Calorimeter PLANE Y
367   G4Box *solidCALLayerY{nullptr};
368   G4LogicalVolume *logicCALLayerY{nullptr};
369   G4VPhysicalVolume *physiCALLayerY{nullptr};
370 
371   // Calorimeter DETECTOR X
372   G4Box *solidCALDetectorX{nullptr};
373   G4LogicalVolume *logicCALDetectorX{nullptr};
374   G4VPhysicalVolume *physiCALDetectorX{nullptr};
375 
376   // Calorimeter DETECTOR Y
377   G4Box *solidCALDetectorY{nullptr};
378   G4LogicalVolume *logicCALDetectorY{nullptr};
379   G4VPhysicalVolume *physiCALDetectorY{nullptr};
380 
381   // Support Plane
382   G4Box *solidPlane{nullptr};
383   G4LogicalVolume *logicPlane{nullptr};
384   G4VPhysicalVolume *physiPlane{nullptr};
385 
386   // Converter
387   G4Box *solidConverter{nullptr};
388   G4LogicalVolume *logicConverter{nullptr};
389   G4VPhysicalVolume *physiConverter{nullptr};
390 
391   G4LogicalVolume *logicTKRStripX{nullptr};
392   G4LogicalVolume *logicTKRStripY{nullptr};
393 
394   // magnetic field messenger
395   static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
396 
397   GammaRayTelDetectorMessenger *detectorMessenger;  // pointer to the messenger
398 
399   G4Cache<GammaRayTelTrackerSD*> trackerSD; // pointer to the sensitive detector, tracker (TRK)
400   G4Cache<GammaRayTelCalorimeterSD*> calorimeterSD; // pointer to the sensitive detector, calorimeter (CAL)
401   G4Cache<GammaRayTelAnticoincidenceSD*> anticoincidenceSD; // pointer to the sensitive detector, anticoincidence (ACD)
402 
403 //    G4Region* trackerCutRegion; // tracker (TKR) cut region
404 //    G4Region* calorimeterCutRegion; // calorimeter (CAL) cut region
405 
406   void ComputePayloadParameters();
407 
408   auto ConstructPayload() -> G4VPhysicalVolume*;
409 
410   void DefineMaterials();
411 };
412 
413 inline auto GammaRayTelDetectorConstruction::ComputePayloadParameters() -> void {
414   // Compute derived parameters of the payload
415 
416   tkrSupportThickness = tkrLayerDistance - 2 * tkrSiliconThickness - tkrViewsDistance - converterThickness;
417   tkrSizeXY = numberOfTKRTiles * tkrSiliconTileXY + (numberOfTKRTiles + 1) * tilesSeparation;
418   tkrSizeZ = numberOfTKRLayers * tkrLayerDistance;
419 
420   tkrActiveTileXY = tkrSiliconTileXY - 2 * siliconGuardRing;
421   tkrActiveTileZ = tkrSiliconThickness;
422   numberOfTKRStrips = G4int(tkrActiveTileXY / tkrSiliconPitch);
423 
424   siliconGuardRing = tkrActiveTileXY - numberOfTKRStrips * tkrSiliconPitch;
425   tkrActiveTileXY = tkrSiliconTileXY - 2 * siliconGuardRing;
426 
427   tkrXStripX = tkrYStripY = tkrSiliconPitch;
428   tkrYStripX = tkrXStripY = tkrActiveTileXY;
429   tkrZStrip = tkrSiliconThickness;
430 
431   calSizeXY = tkrSizeXY;
432   calSizeZ = 2 * numberOfCALLayers * calBarThickness;
433 
434   calBarX = calSizeXY;
435   calBarY = calSizeXY / (numberOfCALBars);
436   calBarZ = calBarThickness;
437 
438   actSizeXY = tkrSizeXY + 2 * acdTKRDistance + 2 * acdThickness;
439   actSizeZ = acdThickness;
440 
441   acl1SizeX = tkrSizeXY + 2 * acdTKRDistance + acdThickness;
442   acl1SizeY = acdThickness;
443   acl1SizeZ = tkrSizeZ + calSizeZ + acdTKRDistance + calTKRDistance;
444 
445   acl2SizeX = acdThickness;
446   acl2SizeY = tkrSizeXY + 2 * acdTKRDistance + acdThickness;
447   acl2SizeZ = tkrSizeZ + calSizeZ + acdTKRDistance + calTKRDistance;
448 
449   payloadSizeZ = 1.1 * (acl1SizeZ + actSizeZ);
450   payloadSizeXY = (actSizeXY);
451 
452   worldSizeZ = 1.5 * payloadSizeZ;
453   worldSizeXY = 1.5 * payloadSizeXY;
454 }
455 #endif
456