ATLAS Offline Software
ZDC_BRANModule.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "ZDC_BRANModule.h"
6 
7 #include "GeoModelKernel/GeoElement.h"
8 #include "GeoModelKernel/GeoBox.h"
9 #include "GeoModelKernel/GeoTube.h"
10 #include "GeoModelKernel/GeoLogVol.h"
11 #include "GeoModelKernel/GeoNameTag.h"
12 #include "GeoModelKernel/GeoPhysVol.h"
13 #include "GeoModelKernel/GeoFullPhysVol.h"
14 #include "GeoModelKernel/GeoIdentifierTag.h"
15 #include "GeoModelKernel/GeoAlignableTransform.h"
16 #include "GeoModelKernel/GeoDefinitions.h"
17 #include "GeoModelKernel/Units.h"
18 #include "GaudiKernel/SystemOfUnits.h"
19 #include "StoreGate/StoreGateSvc.h"
21 #include "GeoModelKernel/GeoMaterial.h"
22 
23 
25 #include "CLHEP/Geometry/Transform3D.h"
26 
27 /*
28  * For now we create the Run3 BRAN only. The detector is a stack of plates in z
29  * with grooves milled vertically to allow channels for silica rods to be placed in.
30  * The stack ordering is Cu, Al, Cu, Cu, Al, Cu. This will be simplified here by
31  * creating a copper body with aluminum plates placed within.
32 */
33 void ZDC_BRANModule::create(GeoFullPhysVol* mother, GeoAlignableTransform* trf){
34 
35  MsgStream LogStream(Athena::getMessageSvc(), "ZDC_ZDCModule::create");
36 
37  StoredMaterialManager *materialManager = nullptr;
38  if (StatusCode::SUCCESS != m_detectorStore->retrieve(materialManager, "MATERIALS")) {
39  MsgStream LogStream(Athena::getMessageSvc(), "ZDC_ZDCModule::create");
40  LogStream << MSG::ERROR << "execute: Could not retrieve StoredMaterialManager object from the detector store" << endmsg;
41  return;
42  }
43 
44  const GeoMaterial *OpAir = materialManager->getMaterial("ZDC::opticalAir" );
45  const GeoMaterial *OpSilica = materialManager->getMaterial("ZDC::opticalSilica");
46  const GeoMaterial *copper = materialManager->getMaterial("std::Copper" );
47  const GeoMaterial *aluminum = materialManager->getMaterial("std::Aluminium" );
48 
49  // geometric constants. All units are in millimeters unless otherwise specified.
50  // All dimensions are gathered from technical drawings available at TODO: insert link to tech drawings
51  const float width = 88.0; // x dimension of the module
52  const float height = 180.0; // y dimension of the module
53  const float channelSide = 11.0; // side dimension of the silica rod channels
54  const float pitch = 2.0*channelSide; // distance between adjacent silica rod channels
55  const float faceDepth = 10.0; // z depth of the front and back faces
56  const float alPlateDepth = 14.5; // z depth of the aluminum plates
57  const float innerPlateDepth = 25.5; // z depth of the inner plates
58  const float rodDia = 10.0; // diameter of the silica rods
59  const float depth = 2.0 *(faceDepth + alPlateDepth + innerPlateDepth); // y dimension of the module
60 
61  GeoBox *Cu_Body = new GeoBox (width * Gaudi::Units::mm * 0.5, height * Gaudi::Units::mm * 0.5, depth * Gaudi::Units::mm * 0.5 );
62  GeoBox *Al_Plate = new GeoBox (width * Gaudi::Units::mm * 0.5, height * Gaudi::Units::mm * 0.5, alPlateDepth * Gaudi::Units::mm * 0.5 );
63  GeoBox *Air_Channel = new GeoBox (channelSide * Gaudi::Units::mm * 0.5, height * Gaudi::Units::mm * 0.5, channelSide * Gaudi::Units::mm * 0.5 );
64  GeoTube *Silica_Rod = new GeoTube (0.0 * Gaudi::Units::mm , rodDia * Gaudi::Units::mm * 0.5, height * Gaudi::Units::mm * 0.5 );
65 
66  GeoLogVol *Cu_Body_Logical = new GeoLogVol("BRAN_Cu_Body_Logical" , Cu_Body , copper );
67  GeoLogVol *Al_Plate_Logical = new GeoLogVol("BRAN_Al_Plate_Logical" , Al_Plate , aluminum);
68  GeoLogVol *Air_Channel_Logical = new GeoLogVol("BRAN_Air_Channel_Logical" , Air_Channel , OpAir );
69  GeoLogVol *Silica_Rod_Logical = new GeoLogVol("BRAN_Rod_Logical" , Silica_Rod , OpSilica);
70 
71  // Create the copper body
72  GeoFullPhysVol *Cu_Body_Physical = new GeoFullPhysVol(Cu_Body_Logical);
73 
74  //Create the IDs and names here since we aren't doing any channel separation
78 
79  char airName[64], rodName[64], aluName[64];
80  sprintf(airName, "ZDC::BRAN_Air %s", airID.getString().c_str());
81  sprintf(aluName, "ZDC::BRAN_Alu %s", aluID.getString().c_str());
82  sprintf(rodName, "ZDC::BRAN_Rod %s", rodID.getString().c_str());
83 
84  //Assemble the silica rods in the air channels
85  GeoFullPhysVol *Air_Channel_Pyisical = new GeoFullPhysVol(Air_Channel_Logical);
86  Air_Channel_Pyisical->add(new GeoNameTag(rodName));
87  Air_Channel_Pyisical->add(new GeoIdentifierTag(rodID.get_identifier32().get_compact()));
88  Air_Channel_Pyisical->add(new GeoAlignableTransform(GeoTrf::RotateX3D(90 * Gaudi::Units::deg)));
89  Air_Channel_Pyisical->add(new GeoFullPhysVol(Silica_Rod_Logical));
90 
91  GeoFullPhysVol *Al_Plate_Physical = new GeoFullPhysVol(Al_Plate_Logical);
92 
93  /*This is a strange loop but the arrangement of the rods is
94  * ----------------------------------
95  * | {-1,-1} {-1,0} {-1,1} |
96  * | {-1} {1} |
97  * | {1,-1} {1,0} {1,1} |
98  * ----------------------------------
99  */
100  for(int i : {-1,1}){
101  /*************************************************
102  * Place the inner air channels with silica included
103  **************************************************/
104  Cu_Body_Physical->add(new GeoNameTag(airName));
105  Cu_Body_Physical->add(new GeoIdentifierTag(airID.get_identifier32().get_compact()));
106  Cu_Body_Physical->add(new GeoAlignableTransform(GeoTrf::TranslateX3D( i * channelSide * Gaudi::Units::mm)));
107  Cu_Body_Physical->add(Air_Channel_Pyisical);
108 
109  /*************************************************
110  * Place the aluminum plates
111  **************************************************/
112  Cu_Body_Physical->add(new GeoNameTag(aluName));
113  Cu_Body_Physical->add(new GeoIdentifierTag(aluID.get_identifier32().get_compact()));
114  Cu_Body_Physical->add(new GeoAlignableTransform(GeoTrf::TranslateZ3D( i * (innerPlateDepth + alPlateDepth * 0.5) * Gaudi::Units::mm)));
115  Cu_Body_Physical->add(Al_Plate_Physical);
116 
117  for(int j : {-1,0,1}){
118  /*************************************************
119  * Place the outter air channels
120  **************************************************/
121  Cu_Body_Physical->add(new GeoNameTag(airName));
122  Cu_Body_Physical->add(new GeoIdentifierTag(airID.get_identifier32().get_compact()));
123  Cu_Body_Physical->add(new GeoAlignableTransform(GeoTrf::Translate3D( j * pitch * Gaudi::Units::mm, 0.0, i * (innerPlateDepth - channelSide) * Gaudi::Units::mm )));
124  Cu_Body_Physical->add(Air_Channel_Pyisical);
125  }
126  }
127 
128  // Place the copper body in the mother volume
129  char volName[64];
131  sprintf(volName, "Zdc::BRAN_Mod %s", id.getString().c_str());
132  mother->add(new GeoNameTag(volName));
133  mother->add(new GeoIdentifierTag(id.get_identifier32().get_compact()));
134  mother->add(trf);
135  mother->add(Cu_Body_Physical);
136 
137 }
egammaParameters::depth
@ depth
pointing depth of the shower as calculated in egammaqgcld
Definition: egammaParamDefs.h:276
HOUSING
@ HOUSING
Definition: ZdcID.h:22
ZDC_BRANModule.h
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
ZDC_ModuleBase::m_module
int m_module
Definition: ZDC_ModuleBase.h:41
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
deg
#define deg
Definition: SbPolyhedron.cxx:17
AIR
@ AIR
Definition: ZdcID.h:22
READOUT
@ READOUT
Definition: ZdcID.h:22
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
ZdcID::channel_id
Identifier channel_id(int side, int module, int type, int channel) const
Definition: ZdcID.h:205
lumiFormat.i
int i
Definition: lumiFormat.py:85
ZDC_ModuleBase::m_detectorStore
StoreGateSvc * m_detectorStore
Definition: ZDC_ModuleBase.h:39
ZDC_ModuleBase::m_zdcID
const ZdcID * m_zdcID
Definition: ZDC_ModuleBase.h:42
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ZDC_BRANModule::create
virtual void create(GeoFullPhysVol *mother, GeoAlignableTransform *trf) override
Definition: ZDC_BRANModule.cxx:33
StoredMaterialManager.h
ZDC_ModuleBase::m_side
int m_side
Definition: ZDC_ModuleBase.h:40
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
ACTIVE
@ ACTIVE
Definition: ZdcID.h:21
CaloLCW_tf.trf
trf
Definition: CaloLCW_tf.py:20
INACTIVE
@ INACTIVE
Definition: ZdcID.h:21
StoreGateSvc.h
Identifier
Definition: IdentifierFieldParser.cxx:14