Commit e52eead2 authored by Noemi Calace's avatar Noemi Calace Committed by Tadej Novak
Browse files

Adding material for HGTD tracking geometry

parent 3732550a
......@@ -18,22 +18,21 @@ from HGTD_TrackingGeometry.HGTD_TrackingGeometryConf import HGTDet__HGTD_Trackin
class ConfiguredHGTDTrackingGeometryBuilder( HGTDet__HGTD_TrackingGeometryBuilder ):
# constructor
def __init__(self,name = 'HGTDTrackingGeometryBuilder'):
from AthenaCommon.AppMgr import ToolSvc
from AthenaCommon.AppMgr import ToolSvc, ServiceMgr
from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
from HGTD_TrackingGeometry.HGTD_TrackingGeometryConf import HGTDet__HGTD_LayerBuilder
# HGTD building
HGTD_LayerBuilder = HGTDet__HGTD_LayerBuilder(name='HGTD_LayerBuilder')
HGTD_LayerBuilder.Identification = 'HGTD'
HGTD_LayerBuilder.SetLayerAssociation = True
# output level
#HGTD_LayerBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel()
HGTD_LayerBuilder.Identification = 'HGTD'
HGTD_LayerBuilder.SetLayerAssociation = True
# output level
HGTD_LayerBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel()
# the binning type of the layer
HGTD_LayerBinning = 2
# HGTD -> ToolSvc
ToolSvc += HGTD_LayerBuilder
HGTDCylinderVolumeCreator = ToolSvc.InDetCylinderVolumeCreator
HGTDet__HGTD_TrackingGeometryBuilder.__init__(self,name,
LayerBuilder = HGTD_LayerBuilder,
TrackingVolumeCreator=ToolSvc.InDetCylinderVolumeCreator)
EnvelopeDefinitionSvc = ServiceMgr.AtlasEnvelopeSvcDefinitionSvc,
TrackingVolumeCreator = ToolSvc.InDetCylinderVolumeCreator)
......@@ -182,7 +182,8 @@ const Trk::TrackingGeometry* HGTDet::HGTD_TrackingGeometryBuilder::trackingGeome
float envelope = layerInfo.thickness*0.5;
float minZ_HGTD = layerInfo.minZ-envelope;
float maxZ_HGTD = enclosedOuterSectorHalflength;
float maxZ_HGTD = layerInfo.maxZ+envelope;
float maxZ_HGTDEnclosure = enclosedOuterSectorHalflength;
// dummy material property
Trk::Material* materialProperties = new Trk::Material;
......@@ -233,8 +234,7 @@ const Trk::TrackingGeometry* HGTDet::HGTD_TrackingGeometryBuilder::trackingGeome
const Trk::TrackingVolume* inDetEnclosed =
m_trackingVolumeCreator->createContainerTrackingVolume(inBufferVolumes,
*materialProperties,
"HGTD::Container::EnclosedInnerDetector");
"HGTD::Container::EnclosedInnerDetector");
// create the tracking volumes
// create the three volumes
......@@ -254,31 +254,62 @@ const Trk::TrackingGeometry* HGTDet::HGTD_TrackingGeometryBuilder::trackingGeome
(Trk::BinningType)m_layerBinningType);
// the base volumes have been created
ATH_MSG_VERBOSE('\t' << '\t'<< "Volumes have been created, now pack them into a triple.");
negativeVolume->registerColorCode(m_colorCodeConfig);
inDetEnclosed->registerColorCode(m_colorCodeConfig);
positiveVolume->registerColorCode(m_colorCodeConfig);
// pack them together
std::vector<const Trk::TrackingVolume*> tripleVolumes;
tripleVolumes.push_back(negativeVolume);
tripleVolumes.push_back(inDetEnclosed);
tripleVolumes.push_back(positiveVolume);
// create the tiple container
const Trk::TrackingVolume* tripleContainer =
m_trackingVolumeCreator->createContainerTrackingVolume(tripleVolumes,
*materialProperties,
"HGTD::Detectors::"+m_layerBuilder->identification(),
m_buildBoundaryLayers,
m_replaceJointBoundaries);
ATH_MSG_VERBOSE( '\t' << '\t'<< "Created container volume with bounds: " << tripleContainer->volumeBounds() );
hgtdTrackingGeometry = new Trk::TrackingGeometry(tripleContainer);
if (m_indexStaticLayers and hgtdTrackingGeometry)
hgtdTrackingGeometry->indexStaticLayers( Trk::Global );
ATH_MSG_VERBOSE('\t' << '\t'<< "Volumes have been created, now pack them into a triple.");
negativeVolume->registerColorCode(m_colorCodeConfig);
inDetEnclosed->registerColorCode(m_colorCodeConfig);
positiveVolume->registerColorCode(m_colorCodeConfig);
// pack them together
std::vector<const Trk::TrackingVolume*> tripleVolumes;
tripleVolumes.push_back(negativeVolume);
tripleVolumes.push_back(inDetEnclosed);
tripleVolumes.push_back(positiveVolume);
// create the tiple container
const Trk::TrackingVolume* tripleContainer =
m_trackingVolumeCreator->createContainerTrackingVolume(tripleVolumes,
*materialProperties,
"HGTD::Containers::"+m_layerBuilder->identification(),
m_buildBoundaryLayers,
m_replaceJointBoundaries);
ATH_MSG_VERBOSE( '\t' << '\t'<< "Created container volume with bounds: " << tripleContainer->volumeBounds() );
// finally create the two endplates: negative
const Trk::TrackingVolume* negativeEnclosure = m_trackingVolumeCreator->createGapTrackingVolume(*materialProperties,
enclosedInnerRadius,enclosedOuterRadius,
-maxZ_HGTDEnclosure, -maxZ_HGTD,
1, false,
"HGTD::Gaps::NegativeEnclosure"+m_layerBuilder->identification());
// finally create the two endplates: positive
const Trk::TrackingVolume* positiveEnclosure = m_trackingVolumeCreator->createGapTrackingVolume(*materialProperties,
enclosedInnerRadius,enclosedOuterRadius,
maxZ_HGTD,maxZ_HGTDEnclosure,
1, false,
"HGTD::Gaps::PositiveEnclosure"+m_layerBuilder->identification());
// and the final tracking volume
std::vector<const Trk::TrackingVolume*> enclosedVolumes;
enclosedVolumes.push_back(negativeEnclosure);
enclosedVolumes.push_back(tripleContainer);
enclosedVolumes.push_back(positiveEnclosure);
const Trk::TrackingVolume* enclosedDetector =
m_trackingVolumeCreator->createContainerTrackingVolume(enclosedVolumes,
*materialProperties,
"HGTD::Detectors::"+m_layerBuilder->identification(),
m_buildBoundaryLayers,
m_replaceJointBoundaries);
ATH_MSG_VERBOSE( '\t' << '\t'<< "Created enclosed HGTD volume with bounds: " << enclosedDetector->volumeBounds() );
// create the TrackingGeometry ------------------------------------------------------
hgtdTrackingGeometry = new Trk::TrackingGeometry(enclosedDetector);
if (m_indexStaticLayers and hgtdTrackingGeometry)
hgtdTrackingGeometry->indexStaticLayers( geometrySignature() );
if (msgLvl(MSG::VERBOSE) && hgtdTrackingGeometry)
hgtdTrackingGeometry->printVolumeHierarchy(msg(MSG::VERBOSE));
return hgtdTrackingGeometry;
}
......@@ -14,7 +14,7 @@ if DetDescrVersion.startswith('ATLAS-P2-ITK-17') or DetDescrVersion.startswith('
TrkDetFlags.MaterialVersion = 20
TrkDetFlags.InDetBuildMaterialBoundaries = False
else:
TrkDetFlags.MaterialVersion = 21
TrkDetFlags.MaterialVersion = 22
TrkDetFlags.MaterialSubVersion = ""
# change for GMX: also need splitGeo[4] and splitGeo[5]
......
run event nTopo nIdTracks nJets nMuons nElec nTrueElec nFakeElec nPhot nTruePhot nFakePhot
242000 2 296 40 5 1 7 2 5 10 6 4
242000 3 285 43 5 3 5 0 5 5 2 3
242000 4 380 64 6 2 3 1 2 13 7 6
242000 3 285 43 5 4 5 0 5 5 2 3
242000 4 380 64 6 1 3 1 2 13 7 6
242000 5 242 37 6 3 8 0 8 7 2 5
242000 6 473 74 7 1 4 0 4 8 7 1
242000 7 331 65 8 1 14 0 14 14 9 5
242000 8 169 29 6 1 7 3 4 8 6 2
242000 8 169 29 6 2 7 3 4 8 6 2
242000 9 326 49 7 2 5 1 4 6 4 2
242000 10 481 101 8 2 21 0 21 17 11 6
242000 11 241 50 7 4 7 0 7 8 3 5
242000 11 241 50 7 3 7 0 7 8 3 5
......@@ -76,23 +76,23 @@ namespace Trk {
mutable int m_layerIndex; //!< the layer index given by the TrackingGeometry
mutable int m_layerType; //!< the type of the layer 1 - cylinder, 2 - disk
mutable float m_layerTranslation[3]; //!< center of the transform
mutable float m_layerRotation[9]; //!< orientation of the layer
std::vector<float>* m_layerTranslation; //!< center of the transform
std::vector<float>* m_layerRotation; //!< orientation of the layer
mutable float m_layerDimension0; //!< dimension 0 : cylinder r, disk r_min
mutable float m_layerDimension1; //!< dimension 1 : cylinder z, disk r_max
mutable int m_layerBins; //!< total number of bins - loc0 * loc 1
mutable int m_layerBins0; //!< total number of bins - loc 0
mutable int m_layerBins1; //!< total number of bins - loc 0
mutable int m_bin0[LAYERMAXBINS]; //!< bin 0
mutable int m_bin1[LAYERMAXBINS]; //!< bin 1
mutable float m_thickness[LAYERMAXBINS]; //!< gathered thickness from material mapping/material properties
mutable float m_X0[LAYERMAXBINS]; //!< gathered X0 from material mapping/material properties
mutable float m_L0[LAYERMAXBINS]; //!< gathered L0 from material mapping/material properties
mutable float m_A[LAYERMAXBINS]; //!< gathered A from material mapping/material properties
mutable float m_Z[LAYERMAXBINS]; //!< gathered Z from material mapping/material properties
mutable float m_Rho[LAYERMAXBINS]; //!< gathered rho from material mapping/material properties
mutable int m_elements[LAYERMAXBINS]; //!< gathered number of elements from material mapping/material properties
mutable int m_binCounter[LAYERMAXBINS]; //!< how often was this bin hit / used
std::vector<int>* m_bin0; //!< bin 0
std::vector<int>* m_bin1; //!< bin 1
std::vector<float>* m_thickness; //!< gathered thickness from material mapping/material properties
std::vector<float>* m_X0; //!< gathered X0 from material mapping/material properties
std::vector<float>* m_L0; //!< gathered L0 from material mapping/material properties
std::vector<float>* m_A; //!< gathered A from material mapping/material properties
std::vector<float>* m_Z; //!< gathered Z from material mapping/material properties
std::vector<float>* m_Rho; //!< gathered rho from material mapping/material properties
std::vector<int>* m_elements; //!< gathered number of elements from material mapping/material properties
std::vector<int>* m_binCounter; //!< how often was this bin hit / used
};
......
......@@ -36,8 +36,26 @@ Trk::LayerMaterialAnalyser::LayerMaterialAnalyser(const std::string& t, const st
m_validationTree(0),
m_validationTreeName("LayerMaterialAnalyser"),
m_validationTreeDescription("LayerMaterialAnalyser information"),
m_validationTreeFolder("/val/LayerMaterialAnalyser")
m_validationTreeFolder("/val/LayerMaterialAnalyser"),
m_layerIndex(0),
m_layerType(0),
m_layerTranslation(nullptr),
m_layerRotation(nullptr),
m_layerDimension0(0.),
m_layerDimension1(0.),
m_layerBins(0),
m_layerBins0(0),
m_layerBins1(0),
m_bin0(nullptr),
m_bin1(nullptr),
m_thickness(nullptr),
m_X0(nullptr),
m_L0(nullptr),
m_A(nullptr),
m_Z(nullptr),
m_Rho(nullptr),
m_elements(nullptr),
m_binCounter(nullptr)
{
declareInterface<Trk::ILayerMaterialAnalyser>(this);
// give the map a name
......@@ -55,6 +73,18 @@ Trk::LayerMaterialAnalyser::~LayerMaterialAnalyser()
// initialize
StatusCode Trk::LayerMaterialAnalyser::initialize()
{
m_layerTranslation = new std::vector<float>(3, 0.);
m_layerRotation = new std::vector<float>(9, 0.);
m_bin0 = new std::vector<int>(LAYERMAXBINS, 0);
m_bin1 = new std::vector<int>(LAYERMAXBINS, 0);
m_thickness = new std::vector<float>(LAYERMAXBINS, 0.);
m_X0 = new std::vector<float>(LAYERMAXBINS, 0.);
m_L0 = new std::vector<float>(LAYERMAXBINS, 0.);
m_A = new std::vector<float>(LAYERMAXBINS, 0.);
m_Z = new std::vector<float>(LAYERMAXBINS, 0.);
m_Rho = new std::vector<float>(LAYERMAXBINS, 0.);
m_elements = new std::vector<int>(LAYERMAXBINS, 0);
m_binCounter = new std::vector<int>(LAYERMAXBINS, 0);
// now register the Tree
ITHistSvc* tHistSvc = 0;
......@@ -63,25 +93,25 @@ StatusCode Trk::LayerMaterialAnalyser::initialize()
m_validationTree = new TTree(m_validationTreeName.c_str(), m_validationTreeDescription.c_str());
// position coordinates of the update
m_validationTree->Branch("LayerIndex", &m_layerIndex, "lIndex/I");
m_validationTree->Branch("LayerType", &m_layerType, "lType/I");
m_validationTree->Branch("LayerTranslation", m_layerTranslation, "lTranslation[3]/F");
m_validationTree->Branch("LayerRotation", m_layerRotation, "lRotation[9]/F");
m_validationTree->Branch("LayerDimension0", &m_layerDimension0, "lDimension0/F");
m_validationTree->Branch("LayerDimension1", &m_layerDimension1, "lDimension1/F");
m_validationTree->Branch("LayerBins", &m_layerBins, "lBins/I");
m_validationTree->Branch("LayerBins0", &m_layerBins0, "lBins0/I");
m_validationTree->Branch("LayerBins1", &m_layerBins1, "lBins1/I");
m_validationTree->Branch("LayerBin0", m_bin0, "lBin0[lBins]/I");
m_validationTree->Branch("LayerBin1", m_bin1, "lBin1[lBins]/I");
m_validationTree->Branch("LayerBinCounter", m_binCounter, "lBinC[lBins]/I");
m_validationTree->Branch("LayerThickness", m_thickness, "lt[lBins]/F");
m_validationTree->Branch("LayerX0", m_X0, "lX0[lBins]/F");
m_validationTree->Branch("LayerL0", m_L0, "lL0[lBins]/F");
m_validationTree->Branch("LayerA", m_A, "lA[lBins]/F");
m_validationTree->Branch("LayerZ", m_Z, "lZ[lBins]/F");
m_validationTree->Branch("LayerRo", m_Rho, "lRho[lBins]/F");
m_validationTree->Branch("LayerElements", m_elements, "lElements[lBins]/I");
m_validationTree->Branch("LayerIndex", &m_layerIndex );
m_validationTree->Branch("LayerType", &m_layerType );
m_validationTree->Branch("LayerTranslation", &m_layerTranslation );
m_validationTree->Branch("LayerRotation", &m_layerRotation );
m_validationTree->Branch("LayerDimension0", &m_layerDimension0 );
m_validationTree->Branch("LayerDimension1", &m_layerDimension1 );
m_validationTree->Branch("LayerBins", &m_layerBins );
m_validationTree->Branch("LayerBins0", &m_layerBins0 );
m_validationTree->Branch("LayerBins1", &m_layerBins1 );
m_validationTree->Branch("LayerBin0", &m_bin0 );
m_validationTree->Branch("LayerBin1", &m_bin1 );
m_validationTree->Branch("LayerBinCounter", &m_binCounter );
m_validationTree->Branch("LayerThickness", &m_thickness );
m_validationTree->Branch("LayerX0", &m_X0 );
m_validationTree->Branch("LayerL0", &m_L0 );
m_validationTree->Branch("LayerA", &m_A );
m_validationTree->Branch("LayerZ", &m_Z );
m_validationTree->Branch("LayerRo", &m_Rho );
m_validationTree->Branch("LayerElements", &m_elements );
// now register the Tree
if (service("THistSvc",tHistSvc).isFailure()) {
......@@ -101,6 +131,18 @@ StatusCode Trk::LayerMaterialAnalyser::initialize()
// finalize
StatusCode Trk::LayerMaterialAnalyser::finalize()
{
delete m_layerTranslation ;
delete m_layerRotation ;
delete m_bin0 ;
delete m_bin1 ;
delete m_thickness ;
delete m_X0 ;
delete m_L0 ;
delete m_A ;
delete m_Z ;
delete m_Rho ;
delete m_elements ;
delete m_binCounter ;
return StatusCode::SUCCESS;
}
......@@ -163,20 +205,20 @@ StatusCode Trk::LayerMaterialAnalyser::analyse(const Trk::Layer& layer,
// general layer information
m_layerIndex = layer.layerIndex().value();
const Trk::Surface& lSurface = layer.surfaceRepresentation();
m_layerTranslation[0] = lSurface.center().x();
m_layerTranslation[1] = lSurface.center().y();
m_layerTranslation[2] = lSurface.center().z();
m_layerTranslation->at(0) = lSurface.center().x();
m_layerTranslation->at(1) = lSurface.center().y();
m_layerTranslation->at(2) = lSurface.center().z();
AmgMatrix(3,3) rMatrix = lSurface.transform().rotation();
m_layerRotation[0] = rMatrix(0,0);
m_layerRotation[1] = rMatrix(1,0);
m_layerRotation[2] = rMatrix(2,0);
m_layerRotation[3] = rMatrix(0,1);
m_layerRotation[4] = rMatrix(1,1);
m_layerRotation[5] = rMatrix(2,1);
m_layerRotation[6] = rMatrix(0,2);
m_layerRotation[7] = rMatrix(1,2);
m_layerRotation[8] = rMatrix(2,2);
m_layerRotation->at(0) = rMatrix(0,0);
m_layerRotation->at(1) = rMatrix(1,0);
m_layerRotation->at(2) = rMatrix(2,0);
m_layerRotation->at(3) = rMatrix(0,1);
m_layerRotation->at(4) = rMatrix(1,1);
m_layerRotation->at(5) = rMatrix(2,1);
m_layerRotation->at(6) = rMatrix(0,2);
m_layerRotation->at(7) = rMatrix(1,2);
m_layerRotation->at(8) = rMatrix(2,2);
// cylinder bounds
if ( lSurface.type() == Trk::Surface::Cylinder ){
......@@ -205,29 +247,29 @@ StatusCode Trk::LayerMaterialAnalyser::analyse(const Trk::Layer& layer,
for (auto& outerIter : mpMatrix){
int bin0 = 0;
for (auto& innerIter : outerIter ){
m_bin0[m_layerBins] = bin0;
m_bin1[m_layerBins] = bin1;
m_bin0->at(m_layerBins) = bin0;
m_bin1->at(m_layerBins) = bin1;
// get the material
const Trk::MaterialProperties* mProperties = innerIter;
if (mProperties){
m_thickness[m_layerBins] = mProperties->thickness();
m_X0[m_layerBins] = mProperties->x0();
m_L0[m_layerBins] = mProperties->l0();
m_A[m_layerBins] = mProperties->averageA();
m_Z[m_layerBins] = mProperties->averageZ();
m_Rho[m_layerBins] = mProperties->averageRho();
m_elements[m_layerBins] = mProperties->material().composition ? mProperties->material().composition->size() : 0;
m_thickness->at(m_layerBins) = mProperties->thickness();
m_X0->at(m_layerBins) = mProperties->x0();
m_L0->at(m_layerBins) = mProperties->l0();
m_A->at(m_layerBins) = mProperties->averageA();
m_Z->at(m_layerBins) = mProperties->averageZ();
m_Rho->at(m_layerBins) = mProperties->averageRho();
m_elements->at(m_layerBins) = mProperties->material().composition ? mProperties->material().composition->size() : 0;
} else {
m_thickness[m_layerBins] = 0.;
m_X0[m_layerBins] = 0.;
m_L0[m_layerBins] = 0.;
m_A[m_layerBins] = 0.;
m_Z[m_layerBins] = 0.;
m_Rho[m_layerBins] = 0.;
m_elements[m_layerBins] = 0.;
m_thickness->at(m_layerBins) = 0.;
m_X0->at(m_layerBins) = 0.;
m_L0->at(m_layerBins) = 0.;
m_A->at(m_layerBins) = 0.;
m_Z->at(m_layerBins) = 0.;
m_Rho->at(m_layerBins) = 0.;
m_elements->at(m_layerBins) = 0.;
}
// set the bin Counter
m_binCounter[m_layerBins] = bCounter ? (*bCounter)[bin1][bin0] : 1;
m_binCounter->at(m_layerBins) = bCounter ? (*bCounter)[bin1][bin0] : 1;
//
++bin0;
if (!bin1) ++m_layerBins0;
......
......@@ -443,11 +443,9 @@ template <class T, class P> StatusCode Trk::ExtrapolationEngineTest::fillStepInf
}
}
m_materialtInX0AccumulatedUpTo->push_back(m_materialThicknessInX0Accumulated->back());
m_materialtInL0AccumulatedUpTo->push_back(m_materialThicknessInL0Accumulated->back());
}
m_materialtInX0AccumulatedUpTo->push_back(m_materialThicknessInX0Accumulated->empty() ? 0. : m_materialThicknessInX0Accumulated->back());
m_materialtInL0AccumulatedUpTo->push_back(m_materialThicknessInL0Accumulated->empty() ? 0. : m_materialThicknessInL0Accumulated->back());
}
// collect the material if configured to do so
if (m_collectMaterial && es.material){
// VERBOSE output
......@@ -485,7 +483,7 @@ template <class T, class P> StatusCode Trk::ExtrapolationEngineTest::fillStepInf
m_materialThicknessInX0Accumulated->push_back(m_materialThicknessInX0);
m_materialThicknessInL0Accumulated->push_back(m_materialThicknessInL0);
m_materialThicknessInX0Steps->push_back(tInX0);
m_materialThicknessInX0Steps->push_back(tInL0);
m_materialThicknessInL0Steps->push_back(tInL0);
m_materialPositionX->push_back(es.materialPosition.x());
m_materialPositionY->push_back(es.materialPosition.y());
m_materialPositionZ->push_back(es.materialPosition.z());
......@@ -510,9 +508,9 @@ template <class T, class P> StatusCode Trk::ExtrapolationEngineTest::fillStepInf
} else if (es.surface && es.surface->type() == Trk::Surface::Plane ){
m_materialThicknessInX0Plane += tInX0;
}
// delete the parameters if there are any there
delete parameters;
}
// delete the parameters if there are any there
delete parameters;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment