 |
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);
338 IdentifierHash idHash =
index;
367 (*pixelIdHashMap)[idHash] = silicon;
386 IdentifierHash idHash =
index;
409 (*sctIdHashMap)[idHash] = silicon;
418 ATH_MSG_DEBUG(
"Silicon L0 module successfully added to the list");
450 for(
unsigned int ipar=0;ipar<fullModPars->
size();++ipar) {
469 allFullModPars->push_back(fullModPars);
470 allActiveModPars->push_back(activeModPars);
480 for(
int i=0;
i<nsel;++
i)
491 for(
unsigned int ipar=0;ipar<modPars->
size();++ipar)
526 ATH_MSG_INFO(
"---------------------------------------------------");
528 TGeoManager* gm=
new TGeoManager(
"Silicon",
"Silicon");
529 TGeoMaterial*
mat=
new TGeoMaterial(
"Vacuum",0,0,0);
530 TGeoMedium* med=
new TGeoMedium(
"Vacuum",1,
mat);
531 TGeoVolume*
top = gm->MakeBox(
"Silicon",med,2000.,2000.,10000.);
532 gm->SetTopVolume(
top);
533 TGeoVolume* Si_cog[60000];
534 TGeoVolume* Si[60000];
536 TGeoTranslation* tr[60000];
537 TGeoRotation* ro[60000];
538 TGeoCombiTrans*
mx[60000];
540 TGeoTranslation* nulltrans=
new TGeoTranslation(0.0,0.0,0.0);
541 TGeoRotation* nullrota=
new TGeoRotation();
542 nullrota->SetAngles(0.0,0.0,0.0);
543 TGeoRotation* fliprota=
new TGeoRotation();
544 fliprota->SetAngles(0.0,-90.0,0.0);
545 TGeoCombiTrans* donothing=
new TGeoCombiTrans(*nulltrans,*nullrota);
546 TGeoCombiTrans* swapaxes=
new TGeoCombiTrans(*nulltrans,*fliprota);
552 TGeoVolume* L0_A = gm->MakeTube(
"L0_A",med,0.0,1100.0,5000.0);
553 L0_A->SetVisibility(kFALSE);
554 top->AddNodeOverlap(L0_A,Si_count,donothing);
556 TGeoVolume* L1_IBL_A = gm->MakeTube(
"L1_IBL_A",med,20.0,40.0,700.0);
557 L1_IBL_A->SetVisibility(kFALSE);
558 L0_A->AddNodeOverlap(L1_IBL_A,Si_count,donothing);
560 TGeoVolume* L1_DBM_A = gm->MakeTube(
"L1_DBM_A",med,20.0,40.0,1000.0);
561 L1_DBM_A->SetVisibility(kFALSE);
562 L0_A->AddNodeOverlap(L1_DBM_A,Si_count,donothing);
564 TGeoVolume* L1_PIX_A = gm->MakeTube(
"L1_PIX_A",med,40.0,150.0,700.0);
565 L1_PIX_A->SetVisibility(kFALSE);
566 L0_A->AddNodeOverlap(L1_PIX_A,Si_count,donothing);
568 TGeoVolume* L1_SCTA_A = gm->MakeTube(
"L1_SCTA_A",med,250.0,550.0,3000.0);
569 L1_SCTA_A->SetVisibility(kFALSE);
570 L0_A->AddNodeOverlap(L1_SCTA_A,Si_count,donothing);
572 TGeoVolume* L1_SCTB_A = gm->MakeTube(
"L1_SCTB_A",med,250.0,550.0,3000.0);
573 L1_SCTB_A->SetVisibility(kFALSE);
574 L0_A->AddNodeOverlap(L1_SCTB_A,Si_count,donothing);
576 TGeoVolume* L1_SCTC_A = gm->MakeTube(
"L1_SCTC_A",med,250.0,550.0,3000.0);
577 L1_SCTC_A->SetVisibility(kFALSE);
578 L0_A->AddNodeOverlap(L1_SCTC_A,Si_count,donothing);
583 ATH_MSG_INFO(
"---------------------------------------------------");
592 unsigned int npix(0);
593 unsigned int nsct(0);
599 nSi = npix;
isPix =
true;
604 nSi = nsct; isSCT =
true;
610 for(
unsigned int j=0;j<nSi;j++) {
615 ATH_MSG_WARNING(
"Dynamic cast to SiDetectorElement from pixel or SCT module failed");
618 const Identifier element_id = element->identify();
644 if(!resok)
ATH_MSG_INFO(
" UNRESOLVED module found: "<<element_id);
646 if(resok && !(element->isStereo())) {
649 xyz = element->transform().translation();
650 ea = element->transform().rotation().eulerAngles(2, 0, 2);
652 xyz = element->defTransform().translation();
653 ea = element->defTransform().rotation().eulerAngles(2, 0, 2);
656 ATH_MSG_INFO(
">>> Element ident,det,bec,layer,ring,sector,side: "<<element_id<<
", "<<
det<<
", "<<
bec<<
", "<<
layer<<
", "<<ring<<
", "<<sector<<
", "<<
side);
657 ATH_MSG_INFO(
">>> Element length/width/thickness: "<<element->length()<<
", "<<element->width()<<
", "<<element->thickness());
658 if(element->isSCT() && element->isEndcap())
659 ATH_MSG_INFO(
">>> SCT Endcap wedge, min/max "<<element->minWidth()<<
" / "<<element->maxWidth());
660 ATH_MSG_INFO(
">>> Center position: "<<element->center());
663 ATH_MSG_INFO(
">>> Euler angles: Phi="<<57.2957*ea[0]<<
" Theta="<<57.2957*ea[1]<<
" Psi="<<57.2957*ea[2]);
666 ATH_MSG_INFO(
"Adding a volume to the Silicon geometry:");
667 TString nname =
"Si_COG_";
668 TString mname =
"Si_MOD_";
676 const auto suffix = TString(det_str)+undsc+TString(bec_str)+undsc+TString(layer_str)+undsc+TString(ring_str)+undsc+TString(sector_str);
680 Si_cog[Si_count] = gm->MakeSphere(nname,med,0.0,element->length(),0.0,180.0,0.0,360.0);
681 Si_cog[Si_count]->SetVisibility(kFALSE);
683 if(element->isSCT() && element->isEndcap()) {
684 Si[Si_count] = gm->MakeTrd1(mname,med,0.5*element->minWidth(),0.5*element->maxWidth(),0.5*element->thickness(),0.5*element->length());
686 Si[Si_count] = gm->MakeBox(mname,med,0.5*element->width(),0.5*element->thickness(),0.5*element->length());
688 tr[Si_count] =
new TGeoTranslation();
689 tr[Si_count]->SetTranslation(
xyz[0],
xyz[1],
xyz[2]);
690 ro[Si_count] =
new TGeoRotation();
691 ro[Si_count]->SetAngles(57.2957*ea[0],57.2957*ea[1],57.2957*ea[2]);
692 mx[Si_count] =
new TGeoCombiTrans(*tr[Si_count],*ro[Si_count]);
694 TGeoVolume* parrent_elem =
nullptr;
698 if(
bec==0 &&
layer==0) parrent_elem = L1_IBL_A;
699 else if(abs(
bec)==4) parrent_elem = L1_DBM_A;
700 else parrent_elem = L1_PIX_A;
706 parrent_elem = L1_SCTC_A;
709 parrent_elem = L1_SCTB_A;
712 parrent_elem = L1_SCTA_A;
724 top->AddNode(Si_cog[Si_count],0,
mx[Si_count]);
727 Si_cog[Si_count]->AddNode(Si[Si_count],0,swapaxes);
735 ATH_MSG_INFO(
" - has "<<npix+nsct<<
" Silicon modules in total");
738 ATH_MSG_DEBUG(
" - local to global : "<<std::setprecision(12)<<localtoglobal.translation()<<
" "<<localtoglobal.rotation());
741 int npars =
pars->size();
742 ATH_MSG_DEBUG(
" - number of active transform parameters: "<<npars);
743 for(
int j=0;j<npars;j++)
751 gm->Export(
"Silicon.root",
"Silicon",
"v");
758 ATH_MSG_DEBUG(
"in isOneDetOnly for detector type "<<dettype);
760 if(!coll || coll->empty())
769 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)
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
AlignModule::TransformParameters paramType() const
returns the type of parameter (i.e.
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
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.
size_type wafer_hash_max() const
@ 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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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
size_type wafer_hash_max() const
int layer_disk(const Identifier &id) const
Ensure that the ATLAS eigen extensions are properly loaded.
int eta_module(const Identifier &id) 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.
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
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier
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...