Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/HGCal_testbeam/src/HGCalTBMaterials.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.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 ]

Diff markup

Differences between /examples/advanced/HGCal_testbeam/src/HGCalTBMaterials.cc (Version 11.3.0) and /examples/advanced/HGCal_testbeam/src/HGCalTBMaterials.cc (Version 10.3.p2)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 #include "HGCalTBMaterials.hh"                    
 27 #include "G4Box.hh"                               
 28 #include "G4Colour.hh"                            
 29 #include "G4Element.hh"                           
 30 #include "G4LogicalVolume.hh"                     
 31 #include "G4Material.hh"                          
 32 #include "G4NistManager.hh"                       
 33 #include "G4PVPlacement.hh"                       
 34 #include "G4RotationMatrix.hh"                    
 35 #include "G4SubtractionSolid.hh"                  
 36 #include "G4ThreeVector.hh"                       
 37 #include "G4Tubs.hh"                              
 38 #include "G4VisAttributes.hh"                     
 39                                                   
 40 //....oooOO0OOooo........oooOO0OOooo........oo    
 41                                                   
 42 G4SubtractionSolid *HexagonSolid(G4String aNam    
 43                                  G4double aCel    
 44   G4double fullCcellX = (2.) * aCellSideLength    
 45   G4double fullCellY = std::sqrt(3.) * aCellSi    
 46   G4Box *solidFullcell = new G4Box(aName, // i    
 47                                    0.5 * fullC    
 48                                    0.5 * aCell    
 49                                                   
 50   G4double deltaXDash = aCellSideLength;          
 51   G4double deltaYDash = std::sqrt(3) / 4 * aCe    
 52                                                   
 53   G4Box *solidCutcell = new G4Box(aName, // it    
 54                                   0.5 * deltaX    
 55                                   1. * aCellTh    
 56                                                   
 57   G4double deltaTheta[4] = {30. * CLHEP::deg,     
 58   G4double deltaThetaRot[4] = {60. * CLHEP::de    
 59   G4double delta = std::sqrt(3) / 2 * aCellSid    
 60                                                   
 61   G4RotationMatrix *rot = new G4RotationMatrix    
 62   rot->rotateZ(deltaThetaRot[0]);                 
 63   std::vector<G4SubtractionSolid *> subtracted    
 64   subtracted.push_back(                           
 65       new G4SubtractionSolid("cellSubtracted",    
 66                              G4ThreeVector(std    
 67                                            std    
 68                                                   
 69   for (int i = 1; i < 4; i++) {                   
 70     rot->rotateZ(-deltaThetaRot[i - 1]);          
 71     rot->rotateZ(deltaThetaRot[i]);               
 72     subtracted.push_back(new G4SubtractionSoli    
 73         "cellSubtracted", subtracted[i - 1], s    
 74         G4ThreeVector(std::cos(deltaTheta[i])     
 75                       0.)));                      
 76   }                                               
 77   delete rot;                                     
 78                                                   
 79   return subtracted[3];                           
 80 }                                                 
 81                                                   
 82 //....oooOO0OOooo........oooOO0OOooo........oo    
 83                                                   
 84 G4LogicalVolume *HexagonLogical(G4String aName    
 85                                 G4double aCell    
 86                                 G4Material *aM    
 87   return new G4LogicalVolume(                     
 88       HexagonSolid(aName, aCellThickness, aCel    
 89       aMaterial,                                  
 90       aName);                                     
 91 }                                                 
 92                                                   
 93 //....oooOO0OOooo........oooOO0OOooo........oo    
 94                                                   
 95 void HGCalTBMaterials::DefineMaterials() {        
 96   /***** Definition of all available materials    
 97   // Get nist aMaterial manager                   
 98   G4NistManager *nist = G4NistManager::Instanc    
 99   fMatVacuum = nist->FindOrBuildMaterial("G4_G    
100   fMatAIR = nist->FindOrBuildMaterial("G4_AIR"    
101   fMatAr = nist->FindOrBuildMaterial("G4_Ar");    
102   fMatAl = nist->FindOrBuildMaterial("G4_Al");    
103   fMatFe = nist->FindOrBuildMaterial("G4_Fe");    
104   fMatGlass = nist->FindOrBuildMaterial("G4_GL    
105   fMatPb = nist->FindOrBuildMaterial("G4_Pb");    
106   fMatCu = nist->FindOrBuildMaterial("G4_Cu");    
107   fMatW = nist->FindOrBuildMaterial("G4_W");      
108   fMatSi = nist->FindOrBuildMaterial("G4_Si");    
109   fMatAu = nist->FindOrBuildMaterial("G4_Au");    
110   fMatQuartz = nist->FindOrBuildMaterial("G4_S    
111   fMatC = nist->FindOrBuildMaterial("G4_C");      
112   fMatH = nist->FindOrBuildMaterial("G4_H");      
113   fMatO = nist->FindOrBuildMaterial("G4_O");      
114   fMatMn = nist->FindOrBuildMaterial("G4_Mn");    
115   fMatCr = nist->FindOrBuildMaterial("G4_Cr");    
116   fMatNi = nist->FindOrBuildMaterial("G4_Ni");    
117   fMatPolyethylene = nist->FindOrBuildMaterial    
118   fMatCl = nist->FindOrBuildMaterial("G4_Cl");    
119   fMatF = nist->FindOrBuildMaterial("G4_F");      
120                                                   
121   // AHCAL SiPMs                                  
122   G4double a = 1.01 * CLHEP::g / CLHEP::mole;     
123   G4Element *elH = new G4Element("Hydrogen", "    
124   a = 12.01 * CLHEP::g / CLHEP::mole;             
125   G4Element *elC = new G4Element("Carbon", "C"    
126   G4double density = 1.032 * CLHEP::g / CLHEP:    
127   fMatPolystyrene = new G4Material("Polystyren    
128   fMatPolystyrene->AddElement(elC, 19);           
129   fMatPolystyrene->AddElement(elH, 21);           
130                                                   
131   // CuW alloy: 60% Cu, 40% W in mass             
132   G4double CuFracInCuW = 0.75;                    
133   fMatCuW = new G4Material("CuW", 14.979 * CLH    
134   fMatCuW->AddMaterial(fMatCu, CuFracInCuW);      
135   fMatCuW->AddMaterial(fMatW, 1 - CuFracInCuW)    
136                                                   
137   // PCB aMaterial                                
138   fMatPCB = new G4Material("PCB", 1.7 * CLHEP:    
139   fMatPCB->AddMaterial(fMatC, 0.13232243);        
140   fMatPCB->AddMaterial(fMatH, 0.032572448);       
141   fMatPCB->AddMaterial(fMatO, 0.48316123);        
142   fMatPCB->AddMaterial(fMatSi, 0.35194389);       
143                                                   
144   // Kapton aMaterial                             
145   fMatKAPTON = new G4Material("Kapton", 1.11 *    
146   fMatKAPTON->AddMaterial(fMatC, 0.59985105);     
147   fMatKAPTON->AddMaterial(fMatH, 0.080541353);    
148   fMatKAPTON->AddMaterial(fMatO, 0.31960759);     
149                                                   
150   // steel                                        
151   fMatSteel = new G4Material("StainlessSteel",    
152   fMatSteel->AddMaterial(fMatFe, 0.6996);         
153   fMatSteel->AddMaterial(fMatC, 0.0004);          
154   fMatSteel->AddMaterial(fMatMn, 0.01);           
155   fMatSteel->AddMaterial(fMatCr, 0.19);           
156   fMatSteel->AddMaterial(fMatNi, 0.1);            
157                                                   
158   // Scintillator aMaterial                       
159   fMatScintillator = new G4Material("Scintilla    
160   fMatScintillator->AddMaterial(fMatC, 0.91512    
161   fMatScintillator->AddMaterial(fMatH, 0.08487    
162                                                   
163   // DWC gas                                      
164   fMatArCO2 = new G4Material("ArCO2", 1.729 *     
165   fMatArCO2->AddMaterial(fMatAr, 0.475815);       
166   fMatArCO2->AddMaterial(fMatC, 0.14306133);      
167   fMatArCO2->AddMaterial(fMatO, 0.38112367);      
168                                                   
169   fMatFreon = new G4Material("Freon-12", 4.93     
170   fMatFreon->AddMaterial(fMatC, 0.099340816);     
171   fMatFreon->AddMaterial(fMatCl, 0.58640112);     
172   fMatFreon->AddMaterial(fMatF, 0.31425807);      
173 }                                                 
174                                                   
175 //....oooOO0OOooo........oooOO0OOooo........oo    
176                                                   
177 void HGCalTBMaterials::SetEventDisplayColorSch    
178   G4VisAttributes *visAttributes;                 
179                                                   
180   visAttributes = new G4VisAttributes(G4Colour    
181   visAttributes->SetVisibility(false);            
182   fSiWaferLogical->SetVisAttributes(visAttribu    
183                                                   
184   visAttributes = new G4VisAttributes(G4Colour    
185   visAttributes->SetVisibility(true);             
186   fSiPixelLogical->SetVisAttributes(visAttribu    
187                                                   
188   visAttributes = new G4VisAttributes(G4Colour    
189   visAttributes->SetVisibility(false);            
190   fCuWbaseplateLogical->SetVisAttributes(visAt    
191   fCuWbaseplate550umLogical->SetVisAttributes(    
192   fCuWbaseplate610umLogical->SetVisAttributes(    
193   fCuWbaseplate710umLogical->SetVisAttributes(    
194   fCuBaseplateLogical->SetVisAttributes(visAtt    
195   fCuBaseplate25umLogical->SetVisAttributes(vi    
196   fCuBaseplate175umLogical->SetVisAttributes(v    
197   fPCBbaseplateLogical->SetVisAttributes(visAt    
198   fPCBbaseplateThinLogical->SetVisAttributes(v    
199   fKaptonLayerLogical->SetVisAttributes(visAtt    
200   fAlCaseLogical->SetVisAttributes(visAttribut    
201   fAlCaseThickLogical->SetVisAttributes(visAtt    
202   fSteelCaseLogical->SetVisAttributes(visAttri    
203   fSteelCaseThickLogical->SetVisAttributes(vis    
204   fPbAbsorberEElogical->SetVisAttributes(visAt    
205   fFeAbsorberEElogical->SetVisAttributes(visAt    
206   fCuAbsorberEElogical->SetVisAttributes(visAt    
207   fWabsorberEElogical->SetVisAttributes(visAtt    
208   fW2mmAbsorberEEDESY2018Logical->SetVisAttrib    
209   fW4mmAbsorberEEDESY2018Logical->SetVisAttrib    
210   fCuAbsorberFHlogical->SetVisAttributes(visAt    
211   fFeAbsorberFHlogical->SetVisAttributes(visAt    
212   fAHCALSiPMlogical->SetVisAttributes(visAttri    
213   fAHCALSiPM2x2HUBlogical->SetVisAttributes(vi    
214   fAlAbsorberAHCALlogical->SetVisAttributes(vi    
215   fPCBAHCALlogical->SetVisAttributes(visAttrib    
216   fFeAbsorberAHCALlogical->SetVisAttributes(vi    
217   fScintillatorLogical->SetVisAttributes(visAt    
218   fScintillatorThinLogical->SetVisAttributes(v    
219   fMCPlogical->SetVisAttributes(visAttributes)    
220   fCK3logical->SetVisAttributes(visAttributes)    
221   fDWClogical->SetVisAttributes(visAttributes)    
222   fDWCgasLogical->SetVisAttributes(visAttribut    
223   fAlChipLogical->SetVisAttributes(visAttribut    
224 }                                                 
225                                                   
226 //....oooOO0OOooo........oooOO0OOooo........oo    
227                                                   
228 HGCalTBMaterials::HGCalTBMaterials() {            
229   DefineMaterials();                              
230   DefineSiWaferAndCells();                        
231   DefineHGCalBaseplates();                        
232   DefineHGCalCases();                             
233   DefineHGCalEEAbsorbers();                       
234   DefineHGCalFHAbsorbers();                       
235   DefineAHCALSiPM();                              
236   DefineAHCALAbsorbers();                         
237   DefineBeamLineElements();                       
238 }                                                 
239                                                   
240 //....oooOO0OOooo........oooOO0OOooo........oo    
241                                                   
242 void HGCalTBMaterials::DefineSiWaferAndCells()    
243   /***** Definition of silicon (wafer) sensors    
244   // 300 microns thickness only                   
245   fSiPixelSideLength = 0.6496345 * CLHEP::cm;     
246   fSiWaferThickness = 0.3 * CLHEP::mm;            
247   fAlpha = 60. / 180. * CLHEP::pi;                
248   fSiWaferSideLength = 11 * fSiPixelSideLength    
249                                                   
250   fSiWaferLogical = HexagonLogical("Si_wafer",    
251                                    fSiWaferSid    
252                                                   
253   // Silicon pixel setups                         
254   double dx = 2 * std::sin(fAlpha) * fSiPixelS    
255   double dy = fSiPixelSideLength * (2. + 2 * s    
256   fSiPixelLogical =                               
257       HexagonLogical("SiCell", fSiWaferThickne    
258                                                   
259   int index = 1;                                  
260   int nRows[11] = {7, 6, 7, 6, 5, 6, 5, 4, 5,     
261   for (int nC = 0; nC < 11; nC++) {               
262     for (int middle_index = 0; middle_index <     
263       new G4PVPlacement(                          
264           0,                                      
265           G4ThreeVector(dy * (middle_index - n    
266                         0.),                      
267           fSiPixelLogical, "SiCell", fSiWaferL    
268       if (nC <= 0)                                
269         continue;                                 
270       new G4PVPlacement(                          
271           0,                                      
272           G4ThreeVector(dy * (middle_index - n    
273                         -nC * dx / 2, 0.),        
274           fSiPixelLogical, "SiCell", fSiWaferL    
275     }                                             
276   }                                               
277                                                   
278   fThicknessMap["Si_wafer"] = fSiWaferThicknes    
279   fLogicalVolumeMap["Si_wafer"] = fSiWaferLogi    
280 }                                                 
281                                                   
282 //....oooOO0OOooo........oooOO0OOooo........oo    
283                                                   
284 void HGCalTBMaterials::DefineHGCalBaseplates()    
285   /***** Definition of all baseplates *****/      
286   // CuW                                          
287   G4double CuWbaseplateThickness = 1.2 * CLHEP    
288   G4double CuWbaseplatesideLength = 11 * fSiPi    
289   fCuWbaseplateLogical = HexagonLogical("CuW_b    
290                                         CuWbas    
291   fThicknessMap["CuW_baseplate"] = CuWbaseplat    
292   fLogicalVolumeMap["CuW_baseplate"] = fCuWbas    
293   G4double CuWbaseplate550umthickness = 0.55 *    
294   fCuWbaseplate550umLogical =                     
295       HexagonLogical("CuW_baseplate_550um", Cu    
296                      CuWbaseplatesideLength, f    
297   fThicknessMap["CuW_baseplate_550um"] = CuWba    
298   fLogicalVolumeMap["CuW_baseplate_550um"] = f    
299   G4double CuWbaseplate610umThickness = 0.61 *    
300   fCuWbaseplate610umLogical =                     
301       HexagonLogical("CuW_baseplate_610um", Cu    
302                      CuWbaseplatesideLength, f    
303   fThicknessMap["CuW_baseplate_610um"] = CuWba    
304   fLogicalVolumeMap["CuW_baseplate_610um"] = f    
305   G4double CuWbaseplate710umThickness = 0.71 *    
306   fCuWbaseplate710umLogical =                     
307       HexagonLogical("CuW_baseplate_710um", Cu    
308                      CuWbaseplatesideLength, f    
309   fThicknessMap["CuW_baseplate_710um"] = CuWba    
310   fLogicalVolumeMap["CuW_baseplate_710um"] = f    
311                                                   
312   // Cu                                           
313   G4double CuBaseplateThickness = 1.2 * CLHEP:    
314   G4double CuBaseplatesideLength = 11 * fSiPix    
315   fCuBaseplateLogical = HexagonLogical("Cu_bas    
316                                        CuBasep    
317   fThicknessMap["Cu_baseplate"] = CuBaseplateT    
318   fLogicalVolumeMap["Cu_baseplate"] = fCuBasep    
319   G4double CuBaseplate25umThickness = 0.025 *     
320   fCuBaseplate25umLogical =                       
321       HexagonLogical("Cu_baseplate_25um", CuBa    
322                      CuBaseplatesideLength, fM    
323   fThicknessMap["Cu_baseplate_25um"] = CuBasep    
324   fLogicalVolumeMap["Cu_baseplate_25um"] = fCu    
325   G4double CuBaseplate175umThickness = 0.175 *    
326   fCuBaseplate175umLogical =                      
327       HexagonLogical("Cu_baseplate_175um", CuB    
328                      CuBaseplatesideLength, fM    
329   fThicknessMap["Cu_baseplate_175um"] = CuBase    
330   fLogicalVolumeMap["Cu_baseplate_175um"] = fC    
331                                                   
332   // PCB                                          
333   G4double PCBbaseplateThickness = 1.3 * CLHEP    
334   G4double PCBbaseplateSideLength = 11 * fSiPi    
335   fPCBbaseplateLogical = HexagonLogical("PCB",    
336                                         PCBbas    
337   fThicknessMap["PCB"] = PCBbaseplateThickness    
338   fLogicalVolumeMap["PCB"] = fPCBbaseplateLogi    
339                                                   
340   G4double PCBbaseplateThinThickness = 1.2 * C    
341   fPCBbaseplateThinLogical = HexagonLogical(      
342       "PCB_thin", PCBbaseplateThinThickness, P    
343   fThicknessMap["PCB_thin"] = PCBbaseplateThin    
344   fLogicalVolumeMap["PCB_thin"] = fPCBbaseplat    
345                                                   
346   // Kapton layer                                 
347   G4double KaptonLayerThickness = 0.075 * CLHE    
348   G4double KaptonLayerSideLength = 11 * fSiPix    
349   fKaptonLayerLogical = HexagonLogical("Kapton    
350                                        KaptonL    
351   fThicknessMap["Kapton_layer"] = KaptonLayerT    
352   fLogicalVolumeMap["Kapton_layer"] = fKaptonL    
353 }                                                 
354                                                   
355 //....oooOO0OOooo........oooOO0OOooo........oo    
356                                                   
357 void HGCalTBMaterials::DefineHGCalCases() {       
358   G4double AlCaseThickness = 2.1 * CLHEP::mm;     
359   G4double AlCaseXY = 40 * CLHEP::cm;             
360   G4Box *AlCaseSolid = new G4Box("Al_case", 0.    
361                                  0.5 * AlCaseT    
362   fAlCaseLogical = new G4LogicalVolume(AlCaseS    
363   fThicknessMap["Al_case"] = AlCaseThickness;     
364   fLogicalVolumeMap["Al_case"] = fAlCaseLogica    
365                                                   
366   G4double AlCaseThickThickness = 5 * CLHEP::m    
367   G4Box *AlCaseThickSolid =                       
368       new G4Box("Al_case_thick", 0.5 * AlCaseX    
369                 0.5 * AlCaseThickThickness);      
370   fAlCaseThickLogical =                           
371       new G4LogicalVolume(AlCaseThickSolid, fM    
372   fThicknessMap["Al_case_thick"] = AlCaseThick    
373   fLogicalVolumeMap["Al_case_thick"] = fAlCase    
374                                                   
375   G4double SteelCaseThickness = 9 * CLHEP::mm;    
376   G4double SteelCaseXY = 60 * CLHEP::cm;          
377   G4Box *SteelCaseSolid =                         
378       new G4Box("Steel_case", 0.5 * SteelCaseX    
379                 0.5 * SteelCaseThickness);        
380   fSteelCaseLogical = new G4LogicalVolume(Stee    
381   fThicknessMap["Steel_case"] = SteelCaseThick    
382   fLogicalVolumeMap["Steel_case"] = fSteelCase    
383                                                   
384   G4double SteelCaseThickThickness = 40 * CLHE    
385   G4Box *SteelCaseThickSolid =                    
386       new G4Box("Steel_case_thick", 0.5 * Stee    
387                 0.5 * SteelCaseThickThickness)    
388   fSteelCaseThickLogical =                        
389       new G4LogicalVolume(SteelCaseThickSolid,    
390   fThicknessMap["Steel_case_thick"] = SteelCas    
391   fLogicalVolumeMap["Steel_case_thick"] = fSte    
392 }                                                 
393                                                   
394 //....oooOO0OOooo........oooOO0OOooo........oo    
395                                                   
396 void HGCalTBMaterials::DefineHGCalEEAbsorbers(    
397   // defintion of absorber plates in the EE pa    
398   G4double PbAbsorberEEthickness = 4.9 * CLHEP    
399   G4double PbAbsorberEExy = 30 * CLHEP::cm;       
400   G4Box *PbAbsorberEEsolid =                      
401       new G4Box("Pb_absorber_EE", 0.5 * PbAbso    
402                 0.5 * PbAbsorberEEthickness);     
403   fPbAbsorberEElogical =                          
404       new G4LogicalVolume(PbAbsorberEEsolid, f    
405   fThicknessMap["Pb_absorber_EE"] = PbAbsorber    
406   fLogicalVolumeMap["Pb_absorber_EE"] = fPbAbs    
407                                                   
408   G4double FeAbsorberEEthickness = 0.3 * CLHEP    
409   G4double FeAbsorberEExy = 30 * CLHEP::cm;       
410   G4Box *FeAbsorberEEsolid =                      
411       new G4Box("Fe_absorber_EE", 0.5 * FeAbso    
412                 0.5 * FeAbsorberEEthickness);     
413   fFeAbsorberEElogical =                          
414       new G4LogicalVolume(FeAbsorberEEsolid, f    
415   fThicknessMap["Fe_absorber_EE"] = FeAbsorber    
416   fLogicalVolumeMap["Fe_absorber_EE"] = fFeAbs    
417                                                   
418   G4double CuAbsorberEEthickness = 6 * CLHEP::    
419   G4double CuAbsorberEExy = 30 * CLHEP::cm;       
420   G4Box *CuAbsorberEEsolid =                      
421       new G4Box("Cu_absorber_EE", 0.5 * CuAbso    
422                 0.5 * CuAbsorberEEthickness);     
423   fCuAbsorberEElogical =                          
424       new G4LogicalVolume(CuAbsorberEEsolid, f    
425   fThicknessMap["Cu_absorber_EE"] = CuAbsorber    
426   fLogicalVolumeMap["Cu_absorber_EE"] = fCuAbs    
427                                                   
428   G4double WabsorberEEthickness = 2.8 * CLHEP:    
429   G4double WabsorberEExy = 30 * CLHEP::cm;        
430   G4Box *WabsorberEEsolid =                       
431       new G4Box("W_absorber_EE", 0.5 * Wabsorb    
432                 0.5 * WabsorberEEthickness);      
433   fWabsorberEElogical =                           
434       new G4LogicalVolume(WabsorberEEsolid, fM    
435   fThicknessMap["W_absorber_EE"] = WabsorberEE    
436   fLogicalVolumeMap["W_absorber_EE"] = fWabsor    
437                                                   
438   G4double W2mmAbsorberEEDESY2018thickness = 2    
439   G4double W2mmAbsorberEEDESY2018xy = 15 * CLH    
440   G4Box *W2mmAbsorberEEDESY2018solid = new G4B    
441       "W_2mm_absorber_EE_DESY2018", 0.5 * W2mm    
442       0.5 * W2mmAbsorberEEDESY2018xy, 0.5 * W2    
443   fW2mmAbsorberEEDESY2018Logical = new G4Logic    
444       W2mmAbsorberEEDESY2018solid, fMatW, "W_2    
445   fThicknessMap["W_2mm_absorber_EE_DESY2018"]     
446   fLogicalVolumeMap["W_2mm_absorber_EE_DESY201    
447       fW2mmAbsorberEEDESY2018Logical;             
448                                                   
449   G4double W4mmAbsorberEEDESY2018thickness = 4    
450   G4double W4mmAbsorberEEDESY2018xy = 15 * CLH    
451   G4Box *W4mmAbsorberEEDESY2018solid = new G4B    
452       "W_4mm_absorber_EE_DESY2018", 0.5 * W4mm    
453       0.5 * W4mmAbsorberEEDESY2018xy, 0.5 * W4    
454   fW4mmAbsorberEEDESY2018Logical = new G4Logic    
455       W4mmAbsorberEEDESY2018solid, fMatW, "W_4    
456   fThicknessMap["W_4mm_absorber_EE_DESY2018"]     
457   fLogicalVolumeMap["W_4mm_absorber_EE_DESY201    
458       fW4mmAbsorberEEDESY2018Logical;             
459 }                                                 
460                                                   
461 //....oooOO0OOooo........oooOO0OOooo........oo    
462                                                   
463 void HGCalTBMaterials::DefineHGCalFHAbsorbers(    
464   // defintion of absorber plates in the FH pa    
465   G4double CuAbsorberFHthickness = 6 * CLHEP::    
466   G4double CuAbsorberFHxy = 50 * CLHEP::cm;       
467   G4Box *CuAbsorberFHsolid =                      
468       new G4Box("Cu_absorber_FH", 0.5 * CuAbso    
469                 0.5 * CuAbsorberFHthickness);     
470   fCuAbsorberFHlogical =                          
471       new G4LogicalVolume(CuAbsorberFHsolid, f    
472   fThicknessMap["Cu_absorber_FH"] = CuAbsorber    
473   fLogicalVolumeMap["Cu_absorber_FH"] = fCuAbs    
474                                                   
475   G4double FeAbsorberFHthickness = 40 * CLHEP:    
476   G4double FeAbsorberFHxy = 50 * CLHEP::cm;       
477   G4Box *FeAbsorberFHsolid =                      
478       new G4Box("Fe_absorber_FH", 0.5 * FeAbso    
479                 0.5 * FeAbsorberFHthickness);     
480   fFeAbsorberFHlogical =                          
481       new G4LogicalVolume(FeAbsorberFHsolid, f    
482   fThicknessMap["Fe_absorber_FH"] = FeAbsorber    
483   fLogicalVolumeMap["Fe_absorber_FH"] = fFeAbs    
484 }                                                 
485                                                   
486 //....oooOO0OOooo........oooOO0OOooo........oo    
487                                                   
488 void HGCalTBMaterials::DefineAHCALSiPM() {        
489   G4double AHCALSiPMthickness = 5.4 * CLHEP::m    
490   fAHCALSiPMxy = 3 * CLHEP::cm;                   
491   fAHCALSiPMsolid = new G4Box("AHCAL_SiPM", 0.    
492                               0.5 * fAHCALSiPM    
493   fAHCALSiPMlogical =                             
494       new G4LogicalVolume(fAHCALSiPMsolid, fMa    
495   fThicknessMap["AHCAL_SiPM"] = AHCALSiPMthick    
496   fLogicalVolumeMap["AHCAL_SiPM"] = fAHCALSiPM    
497                                                   
498   G4double AHCALSiPM2x2HUBxy = 2 * 12 * fAHCAL    
499   G4double AHCALSiPM2x2HUBthickness = AHCALSiP    
500   G4Box *AHCALSiPM2x2HUBsolid =                   
501       new G4Box("AHCAL_SiPM_2x2HUB", 0.5 * AHC    
502                 0.5 * AHCALSiPM2x2HUBxy, 0.5 *    
503   fAHCALSiPM2x2HUBlogical =                       
504       new G4LogicalVolume(AHCALSiPM2x2HUBsolid    
505   fThicknessMap["AHCAL_SiPM_2x2HUB"] = AHCALSi    
506   fLogicalVolumeMap["AHCAL_SiPM_2x2HUB"] = fAH    
507   int copy_counter = 0;                           
508   for (float _dx = -11.5; _dx <= 11.5; _dx = _    
509     for (float _dy = -11.5; _dy <= 11.5; _dy =    
510       new G4PVPlacement(                          
511           0, G4ThreeVector(_dx * fAHCALSiPMxy,    
512           fAHCALSiPMlogical, "AHCAL_SiPM", fAH    
513           copy_counter++, true);                  
514 }                                                 
515                                                   
516 //....oooOO0OOooo........oooOO0OOooo........oo    
517                                                   
518 void HGCalTBMaterials::DefineAHCALAbsorbers()     
519   G4double AlAbsorberAHCALthickness = 1 * CLHE    
520   G4double AlAbsorberAHCALxy = 2 * 12 * fAHCAL    
521   G4Box *AlAbsorberAHCALsolid =                   
522       new G4Box("Al_absorber_AHCAL", 0.5 * AlA    
523                 0.5 * AlAbsorberAHCALxy, 0.5 *    
524   fAlAbsorberAHCALlogical =                       
525       new G4LogicalVolume(AlAbsorberAHCALsolid    
526   fThicknessMap["Al_absorber_AHCAL"] = AlAbsor    
527   fLogicalVolumeMap["Al_absorber_AHCAL"] = fAl    
528                                                   
529   G4double PCBAHCALthickness = 1.2 * CLHEP::mm    
530   G4double PCBAHCALxy = 2 * 12 * fAHCALSiPMxy;    
531   G4Box *PCBAHCALsolid = new G4Box("PCB_AHCAL"    
532                                    0.5 * PCBAH    
533   fPCBAHCALlogical = new G4LogicalVolume(PCBAH    
534   fThicknessMap["PCB_AHCAL"] = PCBAHCALthickne    
535   fLogicalVolumeMap["PCB_AHCAL"] = fPCBAHCALlo    
536                                                   
537   G4double FeAbsorberAHCALthickness = 17 * CLH    
538   G4double FeAbsorberAHCALx = 80.8 * CLHEP::cm    
539   G4double FeAbsorberAHCALy = 65.7 * CLHEP::cm    
540   G4Box *FeAbsorberAHCALsolid =                   
541       new G4Box("Fe_absorber_AHCAL", 0.5 * FeA    
542                 0.5 * FeAbsorberAHCALy, 0.5 *     
543   fFeAbsorberAHCALlogical =                       
544       new G4LogicalVolume(FeAbsorberAHCALsolid    
545   fThicknessMap["Fe_absorber_AHCAL"] = FeAbsor    
546   fLogicalVolumeMap["Fe_absorber_AHCAL"] = fFe    
547 }                                                 
548                                                   
549 //....oooOO0OOooo........oooOO0OOooo........oo    
550                                                   
551 void HGCalTBMaterials::DefineBeamLineElements(    
552   /***** Definition of beam line elements ****    
553   // scintillators                                
554   G4double scintillatorThickness = 2 * 2 * CLH    
555   G4double scintillatorXY = 2 * 9.5 * CLHEP::c    
556   G4Box *scintillatorSolid =                      
557       new G4Box("Scintillator", 0.5 * scintill    
558                 0.5 * scintillatorThickness);     
559   fScintillatorLogical =                          
560       new G4LogicalVolume(scintillatorSolid, f    
561   fThicknessMap["Scintillator"] = scintillator    
562   fLogicalVolumeMap["Scintillator"] = fScintil    
563                                                   
564   G4double fScintillatorThinThickness = 1 * CL    
565   G4Box *fScintillatorThinSolid =                 
566       new G4Box("Scintillator_thin", 0.5 * sci    
567                 0.5 * fScintillatorThinThickne    
568   fScintillatorThinLogical = new G4LogicalVolu    
569       fScintillatorThinSolid, fMatScintillator    
570   fThicknessMap["Scintillator_thin"] = fScinti    
571   fLogicalVolumeMap["Scintillator_thin"] = fSc    
572                                                   
573   // MCPs = quartz disks                          
574   G4double MCPthickness = 10 * CLHEP::mm;         
575   G4double MCPradius = 2 * CLHEP::cm;             
576   G4Tubs *MCPsolid =                              
577       new G4Tubs("MCP", 0., MCPradius, MCPthic    
578   fMCPlogical = new G4LogicalVolume(MCPsolid,     
579   fThicknessMap["MCP"] = MCPthickness;            
580   fLogicalVolumeMap["MCP"] = fMCPlogical;         
581                                                   
582   // CK3                                          
583   G4double CK3thickness = 2 * CLHEP::m;           
584   G4double CK3radius = 8.35 * CLHEP::cm;          
585   G4Tubs *CK3solid =                              
586       new G4Tubs("CK3", 0., CK3radius, 0.5 * C    
587   fCK3logical = new G4LogicalVolume(CK3solid,     
588   fThicknessMap["CK3"] = CK3thickness;            
589   fLogicalVolumeMap["CK3"] = fCK3logical;         
590                                                   
591   // Aluminium circle for testing of chip impa    
592   G4double AlChipXY = 1 * CLHEP::cm;              
593   G4double AlChipThickness = 0.89 * CLHEP::mm;    
594   G4Box *AlChipSolid = new G4Box("Al_chip", 0.    
595                                  0.5 * AlChipT    
596   fAlChipLogical = new G4LogicalVolume(AlChipS    
597   fThicknessMap["Al_chip"] = AlChipThickness;     
598   fLogicalVolumeMap["Al_chip"] = fAlChipLogica    
599                                                   
600   // DWC related aMaterial                        
601   G4double DWCthickness = 2 * 27.5 * CLHEP::mm    
602   G4double DWCxy = 2 * 11 * CLHEP::cm;            
603   G4Box *DWCsolid =                               
604       new G4Box("DWC", 0.5 * DWCxy, 0.5 * DWCx    
605   fDWClogical = new G4LogicalVolume(DWCsolid,     
606   fThicknessMap["DWC"] = DWCthickness;            
607   fLogicalVolumeMap["DWC"] = fDWClogical;         
608                                                   
609   // WChambGas                                    
610   G4double DWCgasThickness = 2 * 22.5 * CLHEP:    
611   G4double DWCgasXY = 2 * 8.5 * CLHEP::cm;        
612   G4Box *DWCgasSolid = new G4Box("DWC_gas", 0.    
613                                  0.5 * DWCgasT    
614   fDWCgasLogical = new G4LogicalVolume(DWCgasS    
615   new G4PVPlacement(0, G4ThreeVector(0, 0., 0.    
616                     fDWClogical, false, 0, tru    
617                                                   
618   G4VisAttributes *visAttributes = new G4VisAt    
619   visAttributes->SetVisibility(false);            
620   // WChambWindow                                 
621   G4double DWCwindowThickness = 0.025 * CLHEP:    
622   G4double DWCwindowXY = 2 * 5.5 * CLHEP::cm;     
623   G4Box *DWCwindowSolid =                         
624       new G4Box("DWC_window", 0.5 * DWCwindowX    
625                 0.5 * DWCwindowThickness);        
626   auto DWCwindowLogical =                         
627       new G4LogicalVolume(DWCwindowSolid, fMat    
628   DWCwindowLogical->SetVisAttributes(visAttrib    
629   new G4PVPlacement(                              
630       0, G4ThreeVector(0, 0., 27.5 * CLHEP::mm    
631       DWCwindowLogical, "DWC_window_0", fDWClo    
632   new G4PVPlacement(                              
633       0, G4ThreeVector(0, 0., -(27.5 * CLHEP::    
634       DWCwindowLogical, "DWC_window_1", fDWClo    
635                                                   
636   G4RotationMatrix *rotation = new G4RotationM    
637   rotation->rotateZ(90 * CLHEP::deg);             
638                                                   
639   // WChambAl1                                    
640   G4double DWCal1thickness = 2 * 2.5 * CLHEP::    
641   G4double DWCal1x = 2 * 8.25 * CLHEP::cm;        
642   G4double DWCal1y = 2 * 2.75 * CLHEP::cm;        
643   G4Box *DWCal1solid =                            
644       new G4Box("DWC_al1", 0.5 * DWCal1x, 0.5     
645   auto DWCal1logical = new G4LogicalVolume(DWC    
646   DWCal1logical->SetVisAttributes(visAttribute    
647   new G4PVPlacement(0,                            
648                     G4ThreeVector(0.5 * DWCal1    
649                                   (0.5 * DWCth    
650                     DWCal1logical, "DWC_al1_0"    
651   new G4PVPlacement(rotation,                     
652                     G4ThreeVector(-0.5 * DWCal    
653                                   (0.5 * DWCth    
654                     DWCal1logical, "DWC_al1_1"    
655   new G4PVPlacement(0,                            
656                     G4ThreeVector(-0.5 * DWCal    
657                                   (0.5 * DWCth    
658                     DWCal1logical, "DWC_al1_2"    
659   new G4PVPlacement(rotation,                     
660                     G4ThreeVector(0.5 * DWCal1    
661                                   (0.5 * DWCth    
662                     DWCal1logical, "DWC_al1_3"    
663   new G4PVPlacement(                              
664       0,                                          
665       G4ThreeVector(0.5 * DWCal1y, 0.5 * DWCal    
666                     -(0.5 * DWCthickness - 0.5    
667       DWCal1logical, "DWC_al1_4", fDWClogical,    
668   new G4PVPlacement(                              
669       rotation,                                   
670       G4ThreeVector(-0.5 * DWCal1x, 0.5 * DWCa    
671                     -(0.5 * DWCthickness - 0.5    
672       DWCal1logical, "DWC_al1_5", fDWClogical,    
673   new G4PVPlacement(                              
674       0,                                          
675       G4ThreeVector(-0.5 * DWCal1y, -0.5 * DWC    
676                     -(0.5 * DWCthickness - 0.5    
677       DWCal1logical, "DWC_al1_6", fDWClogical,    
678   new G4PVPlacement(                              
679       rotation,                                   
680       G4ThreeVector(0.5 * DWCal1x, -0.5 * DWCa    
681                     -(0.5 * DWCthickness - 0.5    
682       DWCal1logical, "DWC_al1_7", fDWClogical,    
683                                                   
684   // WChambAl2                                    
685   G4double DWCal2thickness = 2 * 2.25 * CLHEP:    
686   G4double DWCal2x = 2 * 10.75 * CLHEP::cm;       
687   G4double DWCal2y = 2 * 2.5 * CLHEP::mm;         
688   G4Box *DWCal2solid =                            
689       new G4Box("DWC_al2", 0.5 * DWCal2x, 0.5     
690   auto DWCal2logical = new G4LogicalVolume(DWC    
691   DWCal2logical->SetVisAttributes(visAttribute    
692   new G4PVPlacement(0, G4ThreeVector(0.5 * DWC    
693                     DWCal2logical, "DWC_al2_0"    
694   new G4PVPlacement(rotation, G4ThreeVector(-0    
695                     DWCal2logical, "DWC_al2_1"    
696   new G4PVPlacement(0, G4ThreeVector(-0.5 * DW    
697                     DWCal2logical, "DWC_al2_2"    
698   new G4PVPlacement(rotation, G4ThreeVector(0.    
699                     DWCal2logical, "DWC_al2_3"    
700                                                   
701   // WChambGasVet                                 
702   G4double DWCgasVetThickness = 2 * 2.5 * CLHE    
703   G4double DWCgasVetX = 2 * 7.25 * CLHEP::cm;     
704   G4double DWCgasVetY = 2 * 1.25 * CLHEP::cm;     
705   G4Box *DWCgasVetSolid = new G4Box("DWC_gasVe    
706                                     0.5 * DWCg    
707   auto DWCgasVetLogical =                         
708       new G4LogicalVolume(DWCgasVetSolid, fMat    
709   DWCgasVetLogical->SetVisAttributes(visAttrib    
710   new G4PVPlacement(0,                            
711                     G4ThreeVector(0.5 * DWCgas    
712                                   0.5 * (DWCga    
713                     DWCgasVetLogical, "DWC_gas    
714                     true);                        
715   new G4PVPlacement(rotation,                     
716                     G4ThreeVector(-0.5 * DWCga    
717                                   0.5 * (DWCga    
718                     DWCgasVetLogical, "DWC_gas    
719                     true);                        
720   new G4PVPlacement(0,                            
721                     G4ThreeVector(-0.5 * DWCga    
722                                   0.5 * (DWCga    
723                     DWCgasVetLogical, "DWC_gas    
724                     true);                        
725   new G4PVPlacement(rotation,                     
726                     G4ThreeVector(0.5 * DWCgas    
727                                   0.5 * (DWCga    
728                     DWCgasVetLogical, "DWC_gas    
729                     true);                        
730   new G4PVPlacement(0, G4ThreeVector(0.5 * DWC    
731                     DWCgasVetLogical, "DWC_gas    
732                     true);                        
733   new G4PVPlacement(                              
734       rotation, G4ThreeVector(-0.5 * DWCgasVet    
735       DWCgasVetLogical, "DWC_gasVet_5", fDWCga    
736   new G4PVPlacement(0, G4ThreeVector(-0.5 * DW    
737                     DWCgasVetLogical, "DWC_gas    
738                     true);                        
739   new G4PVPlacement(                              
740       rotation, G4ThreeVector(0.5 * DWCgasVetX    
741       DWCgasVetLogical, "DWC_gasVet_7", fDWCga    
742   new G4PVPlacement(                              
743       0,                                          
744       G4ThreeVector(0.5 * DWCgasVetY, 0.5 * DW    
745                     -0.5 * (DWCgasThickness -     
746       DWCgasVetLogical, "DWC_gasVet_8", fDWCga    
747   new G4PVPlacement(                              
748       rotation,                                   
749       G4ThreeVector(-0.5 * DWCgasVetX, 0.5 * D    
750                     -0.5 * (DWCgasThickness -     
751       DWCgasVetLogical, "DWC_gasVet_9", fDWCga    
752   new G4PVPlacement(                              
753       0,                                          
754       G4ThreeVector(-0.5 * DWCgasVetY, -0.5 *     
755                     -0.5 * (DWCgasThickness -     
756       DWCgasVetLogical, "DWC_gasVet_10", fDWCg    
757   new G4PVPlacement(                              
758       rotation,                                   
759       G4ThreeVector(0.5 * DWCgasVetX, -0.5 * D    
760                     -0.5 * (DWCgasThickness -     
761       DWCgasVetLogical, "DWC_gasVet_11", fDWCg    
762 }                                                 
763                                                   
764 //....oooOO0OOooo........oooOO0OOooo........oo    
765                                                   
766 void HGCalTBMaterials::PlaceItemInLogicalVolum    
767                                                   
768                                                   
769   if (aName.find("_DAISY") != std::string::npo    
770     aName.resize(aName.find("_DAISY"));           
771     if (fCopyCounterMap.find(aName) == fCopyCo    
772       fCopyCounterMap[aName] = 0;                 
773     double dx_ = 2 * std::sin(fAlpha) * 11 * f    
774     double dy_ = 11 * fSiPixelSideLength * (2.    
775     int nRows_[3] = {1, 2, 1};                    
776     for (int nC = 0; nC < 3; nC++) {              
777       for (int middle_index = 0; middle_index     
778         new G4PVPlacement(                        
779             0,                                    
780             G4ThreeVector(dy_ * (middle_index     
781                           -nC * dx_ / 2, aZ0 +    
782             fLogicalVolumeMap[aName], aName, a    
783             fCopyCounterMap[aName]++, true);      
784         if (nC <= 0)                              
785           continue;                               
786         new G4PVPlacement(                        
787             0,                                    
788             G4ThreeVector(dy_ * (middle_index     
789                           +nC * dx_ / 2, aZ0 +    
790             fLogicalVolumeMap[aName], aName, a    
791             fCopyCounterMap[aName]++, true);      
792       }                                           
793     }                                             
794     aZ0 += fThicknessMap[aName];                  
795   } else if (aName.find("_SUMMER2017TRIPLET")     
796     aName.resize(aName.find("_SUMMER2017TRIPLE    
797     if (fCopyCounterMap.find(aName) == fCopyCo    
798       fCopyCounterMap[aName] = 0;                 
799     double dx_ = 2 * std::sin(fAlpha) * 11 * f    
800     double dy_ = 11 * fSiPixelSideLength * (2.    
801     int nRows_[2] = {1, 2};                       
802     for (int nC = 0; nC < 2; nC++) {              
803       new G4PVPlacement(0,                        
804                         G4ThreeVector(-dy_ * (    
805                                       -nC * dx    
806                                       aZ0 + 0.    
807                         fLogicalVolumeMap[aNam    
808                         fCopyCounterMap[aName]    
809       if (nC <= 0)                                
810         continue;                                 
811       new G4PVPlacement(0,                        
812                         G4ThreeVector(-dy_ * (    
813                                       +nC * dx    
814                                       aZ0 + 0.    
815                         fLogicalVolumeMap[aNam    
816                         fCopyCounterMap[aName]    
817     }                                             
818     aZ0 += fThicknessMap[aName];                  
819   } else if (aName.find("_rot30") != std::stri    
820     aName.resize(aName.find("_rot30"));           
821     if (fCopyCounterMap.find(aName) == fCopyCo    
822       fCopyCounterMap[aName] = 0;                 
823     G4RotationMatrix *rot = new G4RotationMatr    
824     rot->rotateZ(30 * CLHEP::deg);                
825     new G4PVPlacement(rot,                        
826                       G4ThreeVector(0, 0, aZ0     
827                       fLogicalVolumeMap[aName]    
828                       fCopyCounterMap[aName]++    
829     aZ0 += fThicknessMap[aName];                  
830   } else {                                        
831     if (fCopyCounterMap.find(aName) == fCopyCo    
832       fCopyCounterMap[aName] = 0;                 
833     new G4PVPlacement(0, G4ThreeVector(0, 0, a    
834                       fLogicalVolumeMap[aName]    
835                       fCopyCounterMap[aName]++    
836     aZ0 += fThicknessMap[aName];                  
837   }                                               
838 }                                                 
839                                                   
840 //....oooOO0OOooo........oooOO0OOooo........oo    
841