Skip to content
Snippets Groups Projects
Commit dbfd9e18 authored by Duc Ta's avatar Duc Ta
Browse files

Merge branch '23.0-ZDC_GeoM-BRAN' into '23.0'

Add BRAN to ZDC geometry description

See merge request atlas/athena!68638
parents f4051cb7 ccdc43d5
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#include "ZDC_BRANModule.h"
#include "GeoModelKernel/GeoElement.h"
#include "GeoModelKernel/GeoBox.h"
#include "GeoModelKernel/GeoTube.h"
#include "GeoModelKernel/GeoLogVol.h"
#include "GeoModelKernel/GeoNameTag.h"
#include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoFullPhysVol.h"
#include "GeoModelKernel/GeoIdentifierTag.h"
#include "GeoModelKernel/GeoAlignableTransform.h"
#include "GeoModelKernel/GeoDefinitions.h"
#include "GeoModelKernel/Units.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "StoreGate/StoreGateSvc.h"
#include "GeoModelInterfaces/StoredMaterialManager.h"
#include "GeoModelKernel/GeoMaterial.h"
#include "AthenaKernel/getMessageSvc.h"
#include "CLHEP/Geometry/Transform3D.h"
/*
* For now we create the Run3 BRAN only. The detector is a stack of plates in z
* with grooves milled vertically to allow channels for silica rods to be placed in.
* The stack ordering is Cu, Al, Cu, Cu, Al, Cu. This will be simplified here by
* creating a copper body with aluminum plates placed within.
*/
GeoFullPhysVol* ZDC_BRANModule::create(){
MsgStream LogStream(Athena::getMessageSvc(), "ZDC_ZDCModule::create");
StoredMaterialManager *materialManager = nullptr;
if (StatusCode::SUCCESS != m_detectorStore->retrieve(materialManager, "MATERIALS")) {
MsgStream LogStream(Athena::getMessageSvc(), "ZDC_ZDCModule::create");
LogStream << MSG::ERROR << "execute: Could not retrieve StoredMaterialManager object from the detector store" << endmsg;
return nullptr;
}
const GeoMaterial *OpAir = materialManager->getMaterial("ZDC::opticalAir" );
const GeoMaterial *OpSilica = materialManager->getMaterial("ZDC::opticalSilica");
const GeoMaterial *copper = materialManager->getMaterial("std::Copper" );
const GeoMaterial *aluminum = materialManager->getMaterial("std::Aluminium" );
// geometric constants. All units are in millimeters unless otherwise specified.
// All dimensions are gathered from technical drawings available at TODO: insert link to tech drawings
const float width = 88.0; // x dimension of the module
const float height = 180.0; // y dimension of the module
const float channelSide = 11.0; // side dimension of the silica rod channels
const float pitch = 2.0*channelSide; // distance between adjacent silica rod channels
const float faceDepth = 10.0; // z depth of the front and back faces
const float alPlateDepth = 14.5; // z depth of the aluminum plates
const float innerPlateDepth = 25.5; // z depth of the inner plates
const float rodDia = 10.0; // diameter of the silica rods
const float depth = 2.0 *(faceDepth + alPlateDepth + innerPlateDepth); // y dimension of the module
GeoBox *Cu_Body = new GeoBox (width * Gaudi::Units::mm * 0.5, height * Gaudi::Units::mm * 0.5, depth * Gaudi::Units::mm * 0.5 );
GeoBox *Al_Plate = new GeoBox (width * Gaudi::Units::mm * 0.5, height * Gaudi::Units::mm * 0.5, alPlateDepth * Gaudi::Units::mm * 0.5 );
GeoBox *Air_Channel = new GeoBox (channelSide * Gaudi::Units::mm * 0.5, height * Gaudi::Units::mm * 0.5, channelSide * Gaudi::Units::mm * 0.5 );
GeoTube *Silica_Rod = new GeoTube (0.0 * Gaudi::Units::mm , rodDia * Gaudi::Units::mm * 0.5, height * Gaudi::Units::mm * 0.5 );
GeoLogVol *Cu_Body_Logical = new GeoLogVol("BRAN_Cu_Body_Logical" , Cu_Body , copper );
GeoLogVol *Al_Plate_Logical = new GeoLogVol("BRAN_Al_Plate_Logical" , Al_Plate , aluminum);
GeoLogVol *Air_Channel_Logical = new GeoLogVol("BRAN_Air_Channel_Logical" , Air_Channel , OpAir );
GeoLogVol *Silica_Rod_Logical = new GeoLogVol("BRAN_Rod_Logical" , Silica_Rod , OpSilica);
// Create the copper body
GeoFullPhysVol *Cu_Body_Physical = new GeoFullPhysVol(Cu_Body_Logical);
//Create the IDs and names here since we aren't doing any channel separation
Identifier airID = m_zdcID->channel_id(m_side,m_module,ZdcIDType::INACTIVE,ZdcIDVolChannel::AIR);;
Identifier aluID = m_zdcID->channel_id(m_side,m_module,ZdcIDType::INACTIVE,ZdcIDVolChannel::HOUSING);
Identifier rodID = m_zdcID->channel_id(m_side,m_module,ZdcIDType::ACTIVE,ZdcIDVolChannel::READOUT);
char airName[64], rodName[64], aluName[64];
sprintf(airName, "ZDC::BRAN_Air %s", airID.getString().c_str());
sprintf(aluName, "ZDC::BRAN_Alu %s", aluID.getString().c_str());
sprintf(rodName, "ZDC::BRAN_Rod %s", rodID.getString().c_str());
//Assemble the silica rods in the air channels
GeoFullPhysVol *Air_Channel_Pyisical = new GeoFullPhysVol(Air_Channel_Logical);
Air_Channel_Pyisical->add(new GeoNameTag(rodName));
Air_Channel_Pyisical->add(new GeoIdentifierTag(rodID.get_identifier32().get_compact()));
Air_Channel_Pyisical->add(new GeoAlignableTransform(GeoTrf::RotateX3D(90 * Gaudi::Units::deg)));
Air_Channel_Pyisical->add(new GeoFullPhysVol(Silica_Rod_Logical));
GeoFullPhysVol *Al_Plate_Physical = new GeoFullPhysVol(Al_Plate_Logical);
/*This is a strange loop but the arrangement of the rods is
* ----------------------------------
* | {-1,-1} {-1,0} {-1,1} |
* | {-1} {1} |
* | {1,-1} {1,0} {1,1} |
* ----------------------------------
*/
for(int i : {-1,1}){
/*************************************************
* Place the inner air channels with silica included
**************************************************/
Cu_Body_Physical->add(new GeoNameTag(airName));
Cu_Body_Physical->add(new GeoIdentifierTag(airID.get_identifier32().get_compact()));
Cu_Body_Physical->add(new GeoAlignableTransform(GeoTrf::TranslateX3D( i * channelSide * Gaudi::Units::mm)));
Cu_Body_Physical->add(Air_Channel_Pyisical);
/*************************************************
* Place the aluminum plates
**************************************************/
Cu_Body_Physical->add(new GeoNameTag(aluName));
Cu_Body_Physical->add(new GeoIdentifierTag(aluID.get_identifier32().get_compact()));
Cu_Body_Physical->add(new GeoAlignableTransform(GeoTrf::TranslateZ3D( i * (innerPlateDepth + alPlateDepth * 0.5) * Gaudi::Units::mm)));
Cu_Body_Physical->add(Al_Plate_Physical);
for(int j : {-1,0,1}){
/*************************************************
* Place the outter air channels
**************************************************/
Cu_Body_Physical->add(new GeoNameTag(airName));
Cu_Body_Physical->add(new GeoIdentifierTag(airID.get_identifier32().get_compact()));
Cu_Body_Physical->add(new GeoAlignableTransform(GeoTrf::Translate3D( j * pitch * Gaudi::Units::mm, 0.0, i * (innerPlateDepth - channelSide) * Gaudi::Units::mm )));
Cu_Body_Physical->add(Air_Channel_Pyisical);
}
}
return Cu_Body_Physical;
}
\ No newline at end of file
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ZDC_BRANMODULE_H
#define ZDC_BRANMODULE_H
#include "ZDC_ModuleBase.h"
class ZDC_BRANModule : public ZDC_ModuleBase{
public:
// Just use the inherited constructor
using ZDC_ModuleBase::ZDC_ModuleBase;
virtual ~ZDC_BRANModule() = default;
virtual GeoFullPhysVol* create() override;
};
#endif
\ No newline at end of file
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#include "ZDC_DetFactory.h"
#include "ZDC_ZDCModule.h"
#include "ZDC_RPDModule.h"
#include "ZDC_BRANModule.h"
#include "GeoModelKernel/GeoMaterial.h"
#include "GeoModelKernel/GeoElement.h"
......@@ -65,13 +66,15 @@ void ZDC_DetFactory::initializePbPb2015(){
void ZDC_DetFactory::initializePbPb2023(){
m_RPDs_On = true; //Flag for both RPD modules
m_BRANs_On = true; //Flag for both BRAN modules
m_zdcOn = {{true, true, true, true}, //If the given ZDC is on
{true, true, true, true}};
m_zdcPos = {{-397.0, -27.0, 153.0, 303.0}, //Positions of the ZDC modules
{-397.0, -27.0, 153.0, 303.0}};
m_zdcPos = {{-394.0, -15.0, 170.0, 325.0}, //Positions of the ZDC modules
{-272.75, 6.0, 191.0, 346.0}};
m_zdcPixelStart_Stop = {{{1,8}, {0,9}, {0,0}, {0,0}}, //Pixel start and stop layers for each ZDC
{{0,0}, {0,9}, {0,0}, {0,0}}};
m_rpdPos = {-190,-190}; //Positions of the RPD modules
m_rpdPos = {-204.625,-183.375}; //Positions of the RPD modules
m_branPos = {-142.5,-121.5};
}
void ZDC_DetFactory::create(GeoPhysVol *world)
......@@ -127,6 +130,19 @@ void ZDC_DetFactory::create(GeoPhysVol *world)
Envelope_Physical->add(rpdMod->create());
}
/*************************************************
* Place BRAN
**************************************************/
if(m_BRANs_On){
id = m_zdcID->channel_id(sideSign, 5, ZdcIDType::INACTIVE,ZdcIDVolChannel::HOUSING);
ZDC_BRANModule *branMod = new ZDC_BRANModule(m_detectorStore, sideSign, 5, m_zdcID);
sprintf(volName, "Zdc::BRAN_Mod %s", id.getString().c_str());
Envelope_Physical->add(new GeoNameTag(volName));
Envelope_Physical->add(new GeoIdentifierTag(id.get_identifier32().get_compact()));
Envelope_Physical->add(new GeoAlignableTransform(GeoTrf::TranslateZ3D(m_branPos[side] * Gaudi::Units::mm)));
Envelope_Physical->add(branMod->create());
}
/*************************************************
* Place TAN/TAXN slot
**************************************************/
......
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ZDC_DETFACTORY_H
......@@ -35,10 +35,12 @@ private:
StoreGateSvc *m_detectorStore;
const ZdcID *m_zdcID;
bool m_RPDs_On; //Flag for both RPD modules
bool m_BRANs_On; //Flag for both BRAN modules
std::vector< std::vector< bool > > m_zdcOn;
std::vector< std::vector< float > > m_zdcPos; //Positions of the ZDC modules
std::vector< std::vector< std::pair<int,int> > > m_zdcPixelStart_Stop; //Start and stop layers of the pixels for a given ZDC module
std::vector< float > m_rpdPos; //Positions of the RPD modules
std::vector< float > m_branPos; //Positions of the BRAN modules
};
......
......@@ -11,7 +11,8 @@ def ZDC_FiberSDCfg(flags, name="ZDC_FiberSD", **kwargs):
,"ZDC::RPD_Buff_Active_Logical*"
,"ZDC::RPD_Core_Readout_Logical"
,"ZDC::RPD_Clad_Readout_Logical"
,"ZDC::RPD_Buff_Readout_Logical"])
,"ZDC::RPD_Buff_Readout_Logical"
,"ZDC::BRAN_Rod_Logical"])
kwargs.setdefault("OutputCollectionNames", ["ZDC_SimFiberHit_Collection"])
result.setPrivateTools(CompFactory.ZDC_FiberSDTool(name, **kwargs))
return result
......@@ -32,7 +33,8 @@ def ZDC_G4CalibSDCfg(flags, name="ZDC_G4CalibSD", **kwargs):
,"ZDC::RPD_Buff_Active_Logical*"
,"ZDC::RPD_Core_Readout_Logical"
,"ZDC::RPD_Clad_Readout_Logical"
,"ZDC::RPD_Buff_Readout_Logical"])
,"ZDC::RPD_Buff_Readout_Logical"
,"ZDC::BRAN*"])
kwargs.setdefault("OutputCollectionNames", ["ZDC_CalibrationHits"])
result.setPrivateTools(CompFactory.ZDC_G4CalibSDTool(name, **kwargs))
return result
......@@ -8,7 +8,8 @@ def getZDC_FiberSD(name="ZDC_FiberSD", **kwargs):
,"ZDC::RPD_Buff_Active_Logical*"
,"ZDC::RPD_Core_Readout_Logical"
,"ZDC::RPD_Clad_Readout_Logical"
,"ZDC::RPD_Buff_Readout_Logical"])
,"ZDC::RPD_Buff_Readout_Logical"
,"ZDC::BRAN_Rod_Logical"])
kwargs.setdefault("OutputCollectionNames", ["ZDC_SimFiberHit_Collection"])
return CfgMgr.ZDC_FiberSDTool(name, **kwargs)
......@@ -28,6 +29,7 @@ def getZDC_G4CalibSD(name="ZDC_G4CalibSD", **kwargs):
,"ZDC::RPD_Buff_Active_Logical*"
,"ZDC::RPD_Core_Readout_Logical"
,"ZDC::RPD_Clad_Readout_Logical"
,"ZDC::RPD_Buff_Readout_Logical"])
,"ZDC::RPD_Buff_Readout_Logical"
,"ZDC::BRAN*"])
kwargs.setdefault("OutputCollectionNames", ["ZDC_CalibrationHits"])
return CfgMgr.ZDC_G4CalibSDTool(name, **kwargs)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment