|
ATLAS Offline Software
|
Go to the documentation of this file.
30 SiGeometryManagerTool::SiGeometryManagerTool(
const std::string&
type,
31 const std::string&
name,
34 , m_pixelDetManager(nullptr)
35 , m_sctDetManager(nullptr)
39 , m_pixelGeoManager(
"")
41 , m_alignModuleTool(
"Trk::AlignModuleTool/AlignModuleTool")
43 , m_alignParList(nullptr)
44 , m_fullAlignParList(nullptr)
46 declareInterface<IGeometryManagerTool>(
this);
138 ATH_MSG_FATAL(
"Alignment of both Pixel and SCT turned off. Aborting.");
139 return StatusCode::FAILURE;
145 return StatusCode::FAILURE;
148 return StatusCode::SUCCESS;
156 return StatusCode::SUCCESS;
166 ATH_MSG_INFO(
"Setting up level 0 alignment of the Silicon");
169 case 1:
case 2:
case 3:
173 ATH_MSG_ERROR(
"PixelGeometryManagerTool and/or SCTGeometryManagerTool not available");
191 ATH_MSG_ERROR(
"PixelGeometryManagerTool and/or SCTGeometryManagerTool not available");
234 std::vector<Trk::AlignModule *>::const_iterator imod =
m_alignModuleList.begin();
235 std::vector<Trk::AlignModule *>::const_iterator imod_end =
m_alignModuleList.end();
236 for( ; imod!=imod_end ; ++imod) {
256 ATH_MSG_INFO(
"Total number of degrees of freedom: "<<nDoF);
339 IdentifierHash idHash =
index;
368 (*pixelIdHashMap)[idHash] = silicon;
387 IdentifierHash idHash =
index;
410 (*sctIdHashMap)[idHash] = silicon;
419 ATH_MSG_DEBUG(
"Silicon L0 module successfully added to the list");
451 for(
unsigned int ipar=0;ipar<fullModPars->
size();++ipar) {
470 allFullModPars->push_back(fullModPars);
471 allActiveModPars->push_back(activeModPars);
481 for(
int i=0;
i<nsel;++
i)
492 for(
unsigned int ipar=0;ipar<modPars->
size();++ipar)
527 ATH_MSG_INFO(
"---------------------------------------------------");
529 TGeoManager* gm=
new TGeoManager(
"Silicon",
"Silicon");
530 TGeoMaterial*
mat=
new TGeoMaterial(
"Vacuum",0,0,0);
531 TGeoMedium* med=
new TGeoMedium(
"Vacuum",1,
mat);
532 TGeoVolume*
top = gm->MakeBox(
"Silicon",med,2000.,2000.,10000.);
533 gm->SetTopVolume(
top);
534 TGeoVolume* Si_cog[22000];
535 TGeoVolume* Si[22000];
537 TGeoTranslation* tr[22000];
538 TGeoRotation* ro[22000];
539 TGeoCombiTrans*
mx[22000];
541 TGeoTranslation* nulltrans=
new TGeoTranslation(0.0,0.0,0.0);
542 TGeoRotation* nullrota=
new TGeoRotation();
543 nullrota->SetAngles(0.0,0.0,0.0);
544 TGeoRotation* fliprota=
new TGeoRotation();
545 fliprota->SetAngles(0.0,-90.0,0.0);
546 TGeoCombiTrans* donothing=
new TGeoCombiTrans(*nulltrans,*nullrota);
547 TGeoCombiTrans* swapaxes=
new TGeoCombiTrans(*nulltrans,*fliprota);
553 TGeoVolume* L0_A = gm->MakeTube(
"L0_A",med,0.0,1100.0,5000.0);
554 L0_A->SetVisibility(kFALSE);
555 top->AddNodeOverlap(L0_A,Si_count,donothing);
557 TGeoVolume* L1_IBL_A = gm->MakeTube(
"L1_IBL_A",med,20.0,40.0,700.0);
558 L1_IBL_A->SetVisibility(kFALSE);
559 L0_A->AddNodeOverlap(L1_IBL_A,Si_count,donothing);
561 TGeoVolume* L1_DBM_A = gm->MakeTube(
"L1_DBM_A",med,20.0,40.0,1000.0);
562 L1_DBM_A->SetVisibility(kFALSE);
563 L0_A->AddNodeOverlap(L1_DBM_A,Si_count,donothing);
565 TGeoVolume* L1_PIX_A = gm->MakeTube(
"L1_PIX_A",med,40.0,150.0,700.0);
566 L1_PIX_A->SetVisibility(kFALSE);
567 L0_A->AddNodeOverlap(L1_PIX_A,Si_count,donothing);
569 TGeoVolume* L1_SCTA_A = gm->MakeTube(
"L1_SCTA_A",med,250.0,550.0,3000.0);
570 L1_SCTA_A->SetVisibility(kFALSE);
571 L0_A->AddNodeOverlap(L1_SCTA_A,Si_count,donothing);
573 TGeoVolume* L1_SCTB_A = gm->MakeTube(
"L1_SCTB_A",med,250.0,550.0,3000.0);
574 L1_SCTB_A->SetVisibility(kFALSE);
575 L0_A->AddNodeOverlap(L1_SCTB_A,Si_count,donothing);
577 TGeoVolume* L1_SCTC_A = gm->MakeTube(
"L1_SCTC_A",med,250.0,550.0,3000.0);
578 L1_SCTC_A->SetVisibility(kFALSE);
579 L0_A->AddNodeOverlap(L1_SCTC_A,Si_count,donothing);
584 ATH_MSG_INFO(
"---------------------------------------------------");
593 unsigned int npix(0);
594 unsigned int nsct(0);
600 nSi = npix;
isPix =
true;
605 nSi = nsct; isSCT =
true;
611 for(
unsigned int j=0;j<nSi;j++) {
616 ATH_MSG_WARNING(
"Dynamic cast to SiDetectorElement from pixel or SCT module failed");
619 const Identifier element_id = element->identify();
640 if(!resok)
ATH_MSG_INFO(
" UNRESOLVED module found: "<<element_id);
642 if(resok && !(element->isStereo())) {
645 xyz = element->transform().translation();
646 ea = element->transform().rotation().eulerAngles(2, 0, 2);
648 xyz = element->defTransform().translation();
649 ea = element->defTransform().rotation().eulerAngles(2, 0, 2);
652 ATH_MSG_INFO(
">>> Element ident,det,bec,layer,ring,sector,side: "<<element_id<<
", "<<
det<<
", "<<
bec<<
", "<<
layer<<
", "<<ring<<
", "<<sector<<
", "<<
side);
653 ATH_MSG_INFO(
">>> Element length/width/thickness: "<<element->length()<<
", "<<element->width()<<
", "<<element->thickness());
654 if(element->isSCT() && element->isEndcap())
655 ATH_MSG_INFO(
">>> SCT Endcap wedge, min/max "<<element->minWidth()<<
" / "<<element->maxWidth());
656 ATH_MSG_INFO(
">>> Center position: "<<element->center());
659 ATH_MSG_INFO(
">>> Euler angles: Phi="<<57.2957*ea[0]<<
" Theta="<<57.2957*ea[1]<<
" Psi="<<57.2957*ea[2]);
662 ATH_MSG_INFO(
"Adding a volume to the Silicon geometry:");
663 TString nname =
"Si_COG_";
664 TString mname =
"Si_MOD_";
672 const auto suffix = TString(det_str)+undsc+TString(bec_str)+undsc+TString(layer_str)+undsc+TString(ring_str)+undsc+TString(sector_str);
676 Si_cog[Si_count] = gm->MakeSphere(nname,med,0.0,element->length(),0.0,180.0,0.0,360.0);
677 Si_cog[Si_count]->SetVisibility(kFALSE);
679 if(element->isSCT() && element->isEndcap()) {
680 Si[Si_count] = gm->MakeTrd1(mname,med,0.5*element->minWidth(),0.5*element->maxWidth(),0.5*element->thickness(),0.5*element->length());
682 Si[Si_count] = gm->MakeBox(mname,med,0.5*element->width(),0.5*element->thickness(),0.5*element->length());
684 tr[Si_count] =
new TGeoTranslation();
685 tr[Si_count]->SetTranslation(
xyz[0],
xyz[1],
xyz[2]);
686 ro[Si_count] =
new TGeoRotation();
687 ro[Si_count]->SetAngles(57.2957*ea[0],57.2957*ea[1],57.2957*ea[2]);
688 mx[Si_count] =
new TGeoCombiTrans(*tr[Si_count],*ro[Si_count]);
690 TGeoVolume* parrent_elem =
nullptr;
694 if(
bec==0 &&
layer==0) parrent_elem = L1_IBL_A;
695 else if(abs(
bec)==4) parrent_elem = L1_DBM_A;
696 else parrent_elem = L1_PIX_A;
702 parrent_elem = L1_SCTC_A;
705 parrent_elem = L1_SCTB_A;
708 parrent_elem = L1_SCTA_A;
720 top->AddNode(Si_cog[Si_count],0,
mx[Si_count]);
723 Si_cog[Si_count]->AddNode(Si[Si_count],0,swapaxes);
731 ATH_MSG_INFO(
" - has "<<npix+nsct<<
" Silicon modules in total");
734 ATH_MSG_DEBUG(
" - local to global : "<<std::setprecision(12)<<localtoglobal.translation()<<
" "<<localtoglobal.rotation());
737 int npars =
pars->size();
738 ATH_MSG_DEBUG(
" - number of active transform parameters: "<<npars);
739 for(
int j=0;j<npars;j++)
747 gm->Export(
"Silicon.root",
"Silicon",
"v");
754 ATH_MSG_DEBUG(
"in isOneDetOnly for detector type "<<dettype);
756 if(!coll || coll->size() == 0)
765 nelem += coll->size();
def retrieve(aClass, aKey=None)
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
bool is_pixel(Identifier id) const
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
std::vector< AlignModule * > AlignModuleList
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
bool is_sct(Identifier id) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
void addDetElement(AlignModule::DetectorType detType, const TrkDetElementBase *det, const Amg::Transform3D &transform, Identifier id=Identifier())
used to add a detector element to the align module with a align frame to detector element local frame...
bool msgLvl(const MSG::Level lvl) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int phi_module(const Identifier &id) const
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
AlignModule::TransformParameters paramType() const
returns the type of parameter (i.e.
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
AlignModule is a grouping of TrkDetElementBase objects, grouped according to the type of alignment,...
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be pixel id, otherwise answer is not accurate. Use SiliconID for g...
void setSigma(double sigma)
sets sigma
void setName(const std::string &name)
Set and return name of align module (i.e.
void setIdentifier(Identifier identifier)
Set and return identifier of module.
@ OWN_ELEMENTS
this data object owns its elements
IdentifierHash identifyHash() const
Set and return index of module, used by alignment classes to keep track of order of align module.
::StatusCode StatusCode
StatusCode definition for legacy code.
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
This is an Identifier helper class for both the Pixel and SCT subdetectors. This class defines identi...
std::vector< const TrkDetElementBase * > DetElementCollection
typedefs to contain detector element pointers and transforms
const std::string & name() const
int layer_disk(const Identifier &id) const
Ensure that the ATLAS eigen extensions are properly loaded.
int eta_module(const Identifier &id) const
size_type wafer_hash_max(void) const
std::string to_string(const DetectorType &type)
int layer_disk(const Identifier &id) const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type wafer_hash_max(void) const
Eigen::Matrix< double, 3, 1 > Vector3D
void setIdHash(IdentifierHash id)
An STL vector of pointers that by default owns its pointed-to elements.
#define ATH_MSG_WARNING(x)
int eta_module(const Identifier &id) const
int side(const Identifier &id) const
const T * at(size_type n) const
Access an element, as an rvalue.
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
int phi_module(const Identifier &id) const
size_type size() const noexcept
Returns the number of elements in the collection.
Identifier identify() const
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be sct id, otherwise answer is not accurate. Use SiliconID for gen...
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier