Commit 0f3de4fc authored by Sarka Todorova's avatar Sarka Todorova Committed by Graeme Stewart
Browse files

set default HEC material scaling factor (LArTrackingGeometry-01-00-22)

	* set default scaling factor for HEC material to 1.1
        * tag LArTrackingGeometry-01-00-22

2016-09-16 Sharka Todorova <sarka.todorova@cern.ch>
	* add configurable scaling factor for HEC material
        * tag LArTrackingGeometry-01-00-21

2016-08-10  scott snyder  <snyder@bnl.gov>

        * Tagging LArTrackingGeometry-01-00-20.
	* endreq -> endmsg.

2015-03-31 Sharka Todorova <sarka.todorova@cern.ch>
	* pass MBTS info to CaloTG
        * tag LArTrackingGeometry-01-00-19
parent b2bfb18a
......@@ -72,6 +72,7 @@ namespace LAr {
void printInfo(GeoPVConstLink pv, int gen=-1) const;
void printChildren(GeoPVConstLink pv, int gen, int igen, Amg::Transform3D tr) const;
GeoPVConstLink getChild(GeoPVConstLink mother, std::string name, Amg::Transform3D& trIn) const;
void throwIntoGarbage(const Trk::Material* mat) const;
......@@ -113,9 +114,16 @@ namespace LAr {
bool m_useCaloSurfBuilder; //!< if true use DetDescr based layering, if false use biequidistant layering
unsigned int m_lArLayersPerRegion; //!< if m_useCaloSurfBuilder == true, number of layers per dead material region or sampling
bool m_useCaloTrackingGeometryBounds;//!< if true use DetDescr based layering, if false use biequidistant layering
mutable float m_mbtsZ; // MBTS layer position
mutable float m_mbts_rmin; // MBTS layer dimensions
mutable float m_mbts_rmax; // MBTS layer dimensions
ToolHandle<ICaloSurfaceBuilder> m_calosurf; //!< tool required for DetDescr-based layering
mutable std::map<const Trk::Material*, bool> m_materialGarbage;
// material scaling ( temporary ? )
float m_scale_HECmaterial;
};
} // end of namespace
......
......@@ -17,6 +17,7 @@
#include "GeoModelKernel/GeoLogVol.h"
#include "GeoModelKernel/GeoShape.h"
#include "GeoModelKernel/GeoTubs.h"
#include "GeoModelKernel/GeoTube.h"
#include "GeoModelKernel/GeoPcon.h"
#include "GeoModelKernel/GeoTrd.h"
#include "GeoModelKernel/GeoMaterial.h"
......@@ -66,7 +67,11 @@ LAr::LArVolumeBuilder::LArVolumeBuilder(const std::string& t, const std::string&
m_useCaloSurfBuilder(true),
m_lArLayersPerRegion(1),
m_useCaloTrackingGeometryBounds(true),
m_calosurf("CaloSurfaceBuilder")
m_mbtsZ(-1.),
m_mbts_rmin(0.),
m_mbts_rmax(0.),
m_calosurf("CaloSurfaceBuilder"),
m_scale_HECmaterial(1.1)
{
declareInterface<Trk::ITrackingVolumeBuilder>(this);
// declare the properties via Python
......@@ -81,6 +86,7 @@ LAr::LArVolumeBuilder::LArVolumeBuilder(const std::string& t, const std::string&
declareProperty("LayersPerRegion", m_lArLayersPerRegion);
declareProperty("UseCaloTrackingGeometryBounds", m_useCaloTrackingGeometryBounds);
declareProperty("CaloSurfaceBuilder", m_calosurf);
declareProperty("ScaleFactor_HECmaterial", m_scale_HECmaterial);
}
......@@ -631,6 +637,8 @@ const std::vector<const Trk::TrackingVolume*>* LAr::LArVolumeBuilder::trackingVo
}
GeoFullPhysVol* lArPositiveEndcapPhysVol = storedPV ? storedPV->getPhysVol() : 0;
const GeoLogVol* lArPositiveEndcapLogVol = lArPositiveEndcapPhysVol ? lArPositiveEndcapPhysVol->getLogVol() : 0;
if(detStore()->contains<StoredPhysVol>("EMEC_NEG"))
{
if(detStore()->retrieve(storedPV,"EMEC_NEG")==StatusCode::FAILURE)
......@@ -641,7 +649,6 @@ const std::vector<const Trk::TrackingVolume*>* LAr::LArVolumeBuilder::trackingVo
}
GeoFullPhysVol* lArNegativeEndcapPhysVol = storedPV ? storedPV->getPhysVol() : 0;
const GeoLogVol* lArPositiveEndcapLogVol = lArPositiveEndcapPhysVol ? lArPositiveEndcapPhysVol->getLogVol() : 0;
const GeoLogVol* lArNegativeEndcapLogVol = lArNegativeEndcapPhysVol ? lArNegativeEndcapPhysVol->getLogVol() : 0;
// get the material
......@@ -664,6 +671,7 @@ const std::vector<const Trk::TrackingVolume*>* LAr::LArVolumeBuilder::trackingVo
ATH_MSG_VERBOSE( " -> Retrieved GeoModel Volume " << lArNegativeEndcapPhysVol->getAbsoluteName()
<< " (" << negchilds << " childs)." );
// and the shapes
const GeoShape* lArPositiveEndcapShape = lArPositiveEndcapLogVol->getShape();
const GeoShape* lArNegativeEndcapShape = lArNegativeEndcapLogVol->getShape();
......@@ -1446,13 +1454,13 @@ const std::vector<const Trk::TrackingVolume*>* LAr::LArVolumeBuilder::trackingVo
// layer material can be adjusted here
baseID = Trk::GeometrySignature(Trk::Calo)*1000 + 8;
matHEC.push_back(new std::pair<const Trk::Material*,int>(lArHecFcalCoverMaterial->scale(0.13),0));
matHEC.push_back(new std::pair<const Trk::Material*,int>(lArHecMaterial,baseID));
matHEC.push_back(new std::pair<const Trk::Material*,int>(lArHecFcalCoverMaterial->scale(0.93),baseID+1));
matHEC.push_back(new std::pair<const Trk::Material*,int>(lArHecFcalCoverMaterial->scale(0.13*m_scale_HECmaterial),0));
matHEC.push_back(new std::pair<const Trk::Material*,int>(lArHecMaterial->scale(m_scale_HECmaterial),baseID));
matHEC.push_back(new std::pair<const Trk::Material*,int>(lArHecFcalCoverMaterial->scale(0.93*m_scale_HECmaterial),baseID+1));
throwIntoGarbage(matHEC.back()->first);
matHEC.push_back(new std::pair<const Trk::Material*,int>(lArHecFcalCoverMaterial->scale(1.09),baseID+2));
matHEC.push_back(new std::pair<const Trk::Material*,int>(lArHecFcalCoverMaterial->scale(1.09*m_scale_HECmaterial),baseID+2));
throwIntoGarbage(matHEC.back()->first);
matHEC.push_back(new std::pair<const Trk::Material*,int>(lArHecFcalCoverMaterial->scale(1.12),baseID+3));
matHEC.push_back(new std::pair<const Trk::Material*,int>(lArHecFcalCoverMaterial->scale(1.12*m_scale_HECmaterial),baseID+3));
throwIntoGarbage(matHEC.back()->first);
// divide the HEC into two parts per EC :
......@@ -1696,41 +1704,70 @@ const std::vector<const Trk::TrackingVolume*>* LAr::LArVolumeBuilder::trackingVo
// fill in the inner Gap
// ST this better to be done by CaloTrackingGeometry ( to glue with BeamPipe )
// pass MBTS info to CaloTG
// MBTS
const PVConstLink topEC = m_lArMgr->getTreeTop(1U);
Amg::Transform3D trIn= Amg::CLHEPTransformToEigen(topEC->getX());
Amg::Transform3D tr2(trIn);
const PVConstLink mbts= getChild(topEC,"MBTS_mother",trIn);
if (mbts) {
//printChildren(mbts,-1,0,Amg::Transform3D(trIn));
const PVConstLink mbts1= getChild(mbts,"MBTS1",trIn);
if (mbts1) m_mbtsZ=fabs(trIn.translation().z());
if (mbts1) {
ATH_MSG_VERBOSE("MBTS1 layer found at z "<<m_mbtsZ);
// retrieve Rmin
const GeoLogVol* clv = mbts1->getLogVol();
const GeoTrd* trd=dynamic_cast<const GeoTrd*> (clv->getShape());
if (trd) m_mbts_rmin = trIn.translation().perp()-trd->getZHalfLength();
}
// retrieve MBTS2 for Rmax
const PVConstLink mbts2= getChild(mbts,"MBTS2",tr2);
if (mbts2) {
const GeoLogVol* clv = mbts2->getLogVol();
const GeoTrd* trd=dynamic_cast<const GeoTrd*> (clv->getShape());
if (trd) m_mbts_rmax = (tr2.translation().perp()+trd->getZHalfLength())/cos(acos(-1.)/8);
}
ATH_MSG_VERBOSE("MBTS layer span in R "<<m_mbts_rmin<<","<<m_mbts_rmax);
} else {
ATH_MSG_VERBOSE("MBTS not found ");
}
/*
if (lArPositiveEndcap && lArPositiveFcalBounds){
// create the Bounds
Trk::CylinderVolumeBounds* lArNegativeEndcapInnerGapBounds = new Trk::CylinderVolumeBounds(
lArPositiveFcalBounds->innerRadius(),
lArEndcapInnerRadius,
lArEndcapHalfZ );
if (m_mbtsZ>0. && m_mbts_rmin>0. && m_mbts_rmax>0.){
// create the dummy volume to pass on the MBTS position
//Trk::CylinderVolumeBounds* lArNegativeEndcapInnerGapBounds = new Trk::CylinderVolumeBounds(
// lArPositiveFcalBounds->innerRadius(),
// lArEndcapInnerRadius,
// 10. );
Trk::CylinderVolumeBounds* lArNegativeMBTSBounds = new Trk::CylinderVolumeBounds(
m_mbts_rmin,
m_mbts_rmax,
10. );
ATH_MSG_DEBUG( "Filled in LAr Endcap Inner Gap bounds : " << *lArNegativeEndcapInnerGapBounds );
ATH_MSG_DEBUG( " -> at z-position: +/- " << lArPositiveEndcap->center().z() );
ATH_MSG_DEBUG( "Filled in LAr MBTS bounds : " << *lArNegativeMBTSBounds );
ATH_MSG_DEBUG( " -> at z-position: +/- " << m_mbtsZ );
Amg::Vector3D lArEndcapInnerGapPos(0.,0.,lArEndcapZpos);
Amg::Vector3D lArEndcapInnerGapNeg(0.,0.,-lArEndcapZpos);
Amg::Transform3D* lArPositiveEndcapInnerGapTransform = new Amg::Transform3D(Amg::Translation3D(lArEndcapInnerGapPos));
Amg::Transform3D* lArNegativeEndcapInnerGapTransform = new Amg::Transform3D(Amg::Translation3D(lArEndcapInnerGapNeg));
Amg::Vector3D lArEndcapInnerGapPos(0.,0., m_mbtsZ);
Amg::Vector3D lArEndcapInnerGapNeg(0.,0.,-m_mbtsZ);
Amg::Transform3D* lArPositiveMBTSTransform = new Amg::Transform3D(Amg::Translation3D(lArEndcapInnerGapPos));
Amg::Transform3D* lArNegativeMBTSTransform = new Amg::Transform3D(Amg::Translation3D(lArEndcapInnerGapNeg));
// building dense volume here
//Trk::MaterialProperties lArEndcapInnerGapMaterial = Trk::MaterialProperties(1., 186./0.19, 0.0065*pow(0.19,3), 59.);
Trk::Material lArEndcapInnerGapMaterial = Trk::Material(390., 1223., 18.,8.7, 0.0014);
lArPositiveEndcapInnerGap = new Trk::TrackingVolume(lArPositiveEndcapInnerGapTransform,
lArNegativeEndcapInnerGapBounds->clone(),
lArEndcapInnerGapMaterial,
lArPositiveEndcapInnerGap = new Trk::TrackingVolume(lArPositiveMBTSTransform,
lArNegativeMBTSBounds->clone(),
dummyMaterial,
dummyLayers, dummyVolumes,
"Calo::GapVolumes::LAr::PositiveEndcapInnerGap");
"Calo::Detectors::MBTS");
lArNegativeEndcapInnerGap = new Trk::TrackingVolume(lArNegativeEndcapInnerGapTransform,
lArNegativeEndcapInnerGapBounds,
lArEndcapInnerGapMaterial,
lArNegativeEndcapInnerGap = new Trk::TrackingVolume(lArNegativeMBTSTransform,
lArNegativeMBTSBounds,
dummyMaterial,
dummyLayers, dummyVolumes,
"Calo::GapVolumes::LAr::NegativeEndcapInnerGap");
"Calo::Detectors::MBTS");
}
*/
if (msgLvl(MSG::DEBUG)) {
ATH_MSG_DEBUG( "Checking the existence of all Tracking Volumes:" );
......@@ -1820,8 +1857,8 @@ const std::vector<const Trk::TrackingVolume*>* LAr::LArVolumeBuilder::trackingVo
void LAr::LArVolumeBuilder::printCheckResult(MsgStream& log, const Trk::TrackingVolume* vol) const
{
if (vol) log << "... ok" << endreq;
else log << "... missing" << endreq;
if (vol) log << "... ok" << endmsg;
else log << "... missing" << endmsg;
}
......@@ -1955,6 +1992,8 @@ void LAr::LArVolumeBuilder::printInfo(const PVConstLink pv, int gen) const
if (trd) std::cout<<"trddim:"<< trd->getXHalfLength1()<<","<<trd->getXHalfLength2()<<","<<trd->getYHalfLength1()<<","<<trd->getYHalfLength2()<<","<<trd->getZHalfLength()<< std::endl;
const GeoTubs* tub=dynamic_cast<const GeoTubs*> (lv->getShape());
if (tub) std::cout<<"tubdim:"<< tub->getRMin()<<","<<tub->getRMax()<<","<<tub->getZHalfLength()<< std::endl;
const GeoTube* tube=dynamic_cast<const GeoTube*> (lv->getShape());
if (tube) std::cout<<"tubdim:"<< tube->getRMin()<<","<<tube->getRMax()<<","<<tube->getZHalfLength()<< std::endl;
const GeoPcon* con=dynamic_cast<const GeoPcon*> (lv->getShape());
if (con) {
const unsigned int nPlanes=con->getNPlanes();
......@@ -1963,6 +2002,8 @@ void LAr::LArVolumeBuilder::printInfo(const PVConstLink pv, int gen) const
}
}
Amg::Transform3D transf = Amg::CLHEPTransformToEigen(pv->getX());
std::cout << "position:"<< "R:"<<transf.translation().perp()<<",phi:"<< transf.translation().phi()<<",x:"<<transf.translation().x()<<",y:"<<transf.translation().y()<<",z:"<<transf.translation().z()<<std::endl;
int igen = 0;
printChildren(pv,gen,igen,transf);
}
......@@ -1979,6 +2020,7 @@ void LAr::LArVolumeBuilder::printChildren(const PVConstLink pv,int gen, int igen
//
//std::cout << " dumping transform to subcomponent" << std::endl;
//std::cout << transf.rotation()<< std::endl;
//std::cout << transf[0][0]<<"," <<transf[0][1]<<"," <<transf[0][2]<<","<<transf[0][3] << std::endl;
//std::cout << transf[1][0]<<"," <<transf[1][1]<<"," <<transf[1][2]<<","<<transf[1][3] << std::endl;
//std::cout << transf[2][0]<<"," <<transf[2][1]<<"," <<transf[2][2]<<","<<transf[2][3] << std::endl;
......@@ -1993,6 +2035,8 @@ void LAr::LArVolumeBuilder::printChildren(const PVConstLink pv,int gen, int igen
if (trd) std::cout<<"trddim:"<< trd->getXHalfLength1()<<","<<trd->getXHalfLength2()<<","<<trd->getYHalfLength1()<<","<<trd->getYHalfLength2()<<","<<trd->getZHalfLength()<< std::endl;
const GeoTubs* tub=dynamic_cast<const GeoTubs*> (clv->getShape());
if (tub) std::cout<<"tubdim:"<< tub->getRMin()<<","<<tub->getRMax()<<","<<tub->getZHalfLength()<< std::endl;
const GeoTube* tube=dynamic_cast<const GeoTube*> (clv->getShape());
if (tube) std::cout<<"tubdim:"<< tube->getRMin()<<","<<tube->getRMax()<<","<<tube->getZHalfLength()<< std::endl;
const GeoPcon* con=dynamic_cast<const GeoPcon*> (clv->getShape());
if (con) {
const unsigned int nPlanes=con->getNPlanes();
......@@ -2010,3 +2054,17 @@ void LAr::LArVolumeBuilder::printChildren(const PVConstLink pv,int gen, int igen
}
GeoPVConstLink LAr::LArVolumeBuilder::getChild(GeoPVConstLink mother, std::string name, Amg::Transform3D& trIn) const
{
// subcomponents
unsigned int nc = mother->getNChildVols();
for (unsigned int ic=0; ic<nc; ic++) {
Amg::Transform3D transf = trIn*Amg::CLHEPTransformToEigen(mother->getXToChildVol(ic));
GeoPVConstLink cv = mother->getChildVol(ic);
const GeoLogVol* clv = cv->getLogVol();
if (clv->getName().substr(0,name.size())==name) { trIn = transf; return cv; }
GeoPVConstLink next=getChild(cv,name,transf);
if (next) {trIn = transf; return next; }
}
return 0;
}
Supports Markdown
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