9#include "CoralBase/AttributeListSpecification.h"
10#include "CoralBase/Attribute.h"
19#include "GaudiKernel/NTuple.h"
20#include "GaudiKernel/INTupleSvc.h"
21#include "GaudiKernel/SmartDataPtr.h"
23#include "GaudiKernel/RndmGenerators.h"
24#include "GaudiKernel/IRndmGenSvc.h"
61 const std::string& name,
const IInterface* parent)
64 declareInterface<IInDetAlignDBTool>(
this);
73 ATH_MSG_DEBUG(
"InDetAlignDBTool initialize instance: " << name() );
76 if (
detStore().retrieve().isFailure()){
82 return StatusCode::FAILURE;
119 ATH_MSG_FATAL(
"Pixel and SCT Managers have different alignfolder type registered --> Check ");
120 return StatusCode::FAILURE;
128 return StatusCode::FAILURE;
133 return StatusCode::FAILURE;
146 int TransfLevel_low = 0;
149 for (
int i=0;i<3;++i) chan[i]=100*i;
150 std::string man_name;
154 if (element!=
nullptr) {
156 int det,bec,layer,ring,sector,side;
157 if (
idToDetSet(ident,det,bec,layer,ring,sector,side)) {
158 std::string level[3];
159 for (
int i=TransfLevel_low;i<3;++i) {
160 level[i]=
dirkey(det,bec,layer,1+i,sector);
162 std::vector<std::string>::const_iterator ix=
171 ATH_MSG_ERROR(
"Si detector element type " << idet <<
" has no detset conversion" );
178 ATH_MSG_INFO(
"Geometry initialisation sees " << ndet[0] <<
179 " pixel and " << ndet[1] <<
" SCT modules giving " <<
m_alignobjs.size()
180 <<
" alignment keys" );
185 " pixel and " << ndet[1] <<
" SCT modules giving " <<
m_alignobjs.size()
186 <<
" alignment keys" );
193 ATH_MSG_DEBUG(
"Assuming new COOL alignment DB model based on AlignableTransformContainer");
196 ATH_MSG_DEBUG(
"Assuming old (Lisbon) alignment DB model based on separate AlignableTransforms");
203 coral::AttributeListSpecification* spec =
new coral::AttributeListSpecification();
204 spec->extend(
"stave",
"int");
205 spec->extend(
"eta",
"int");
206 spec->extend(
"mag",
"float");
207 spec->extend(
"base",
"float");
208 spec->extend(
"free",
"float");
210 const int ibl_stave_max = 14;
212 for (
int this_stave=0; this_stave<ibl_stave_max; this_stave++){
214 coral::AttributeList atrlist(*spec);
216 atrlist[
"stave" ].data<
int>()=this_stave;
217 atrlist[
"eta" ].data<
int>()=0;
218 atrlist[
"mag" ].data<
float>()=0;
219 atrlist[
"base" ].data<
float>()=0;
220 atrlist[
"free" ].data<
float>()=0;
224 return StatusCode::SUCCESS;
230 return StatusCode::SUCCESS;
238 ATH_MSG_FATAL(
"Cannot create new database when geometry is faked");
249 ATH_MSG_ERROR(
"createDB: AlignableTransformContainer already exists");
253 ATH_MSG_DEBUG(
"Setup database structures in AlignableTransformContainer");
257 ATH_MSG_DEBUG(
"Setup separate AlignableTransform for each layer");
262 else ATH_MSG_DEBUG(
"Treat both sides of SCT module as single entity" );
287 ATH_MSG_ERROR(
"Could not record AlignableTransformContainer");
292 std::vector<std::string> level2;
299 if (element!=
nullptr) {
301 std::string key=
dirkey(ident,3);
307 else ATH_MSG_ERROR(
"Cannot retrieve AlignableTransform for key " << key );
311 std::vector<std::string>::const_iterator ix =
find(level2.begin(),level2.end(),key);
312 if (ix==level2.end()) {
313 level2.push_back(key);
317 if (
m_pixid->is_pixel(ident)) {
327 std::string key2=
dirkey(ident,2);
330 }
else ATH_MSG_ERROR(
"Cannot retrieve AlignableTransform for key " << key2 );
338 std::string key1=
dirkey(ident1,1);
341 globshift.setIdentity();
344 ident1=
m_pixid->wafer_id(0,0,0,0);
349 ident1=
m_sctid->wafer_id(0,0,0,0,0);
352 ident1=
m_sctid->wafer_id(-2,0,0,0,0);
354 ident1=
m_sctid->wafer_id(2,0,0,0,0);
358 ATH_MSG_ERROR(
"Cannot retrieve AlignableTransform for key " << key1 );
363 ATH_MSG_DEBUG(
"Dumping size of created AlignableTransform objects");
369 int& layer,
int& ring,
int& sector,
int& side)
const {
377 bec=
m_pixid->barrel_ec(ident)/2;
378 layer=
m_pixid->layer_disk(ident);
379 ring=
m_pixid->eta_module(ident);
380 sector=
m_pixid->phi_module(ident);
385 bec=
m_sctid->barrel_ec(ident)/2;
386 layer=
m_sctid->layer_disk(ident);
387 ring=
m_sctid->eta_module(ident);
388 sector=
m_sctid->phi_module(ident);
396 const int level)
const {
399 int det,bec,layer,ring,sector,side;
400 idToDetSet(ident,det,bec,layer,ring,sector,side);
401 return dirkey(det,bec,layer,level,sector);
407 int layer,
const int level)
const {
410 std::ostringstream
result;
415 if (det==1)
result <<
"PIX";
416 if (det==2)
result <<
"SCT";
418 if (bec==1)
result <<
"EA";
419 if (bec==0)
result <<
"B";
420 if (bec==-1)
result <<
"EC";
428 int layer,
const int level,
const int sector)
const {
432 std::ostringstream
result;
434 result <<
"/Indet/AlignL";
444 if (det==1)
result <<
"PIX";
445 if (det==2)
result <<
"SCT";
447 if (det==1 && abs(bec)==2)
result <<
DBMkey(det,bec,level,sector);
449 if (bec==1)
result <<
"EA";
450 if (bec==0)
result <<
"B";
451 if (bec==-1)
result <<
"EC";
461 const int level,
const int sector)
const {
464 std::ostringstream
result;
465 if (det==1 && level==3 && abs(bec)==2) {
466 if (bec==2)
result <<
"EADBM";
467 if (bec==-2)
result <<
"ECDBM";
478 const int layer,
const int ring,
const int sector,
479 const float rphidisp,
const float rdisp,
const float zdisp,
480 const int syst,
const int level,
const int skip)
const {
482 ATH_MSG_DEBUG(
"dispGroup called: level " << level <<
" syst " << syst);
485 SmartIF<IRndmGenSvc> randsvc{Gaudi::svcLocator()->service(
"RndmGenSvc")};
486 if(!randsvc.isValid())
ATH_MSG_ERROR(
"Cannot find RndmGenSvc" );
488 Rndm::Numbers gauss(randsvc,Rndm::Gauss(0.,1.));
491 for (
int i=0;i<
skip;++i) gauss();
494 float rpd=0,rd=0,zd=0;
496 rpd=rphidisp*gauss();
501 std::vector<Identifier> lvl12id;
504 for (
int idet=1;idet<3;++idet) {
506 if (element!=
nullptr) {
508 int mdet,mbec,mlayer,mring,msector,mside;
509 idToDetSet(ident,mdet,mbec,mlayer,mring,msector,mside);
511 if ((dettype==-1 || mdet==dettype) && (bec==-1 || std::abs(2*mbec)==bec) &&
512 (layer==-1 || mlayer==layer) && (ring==-1 || mring==ring) &&
513 (sector== -1 || msector==sector) && mside==0) {
520 if (dettype!=2 || mside!=1) {
521 if (syst==2 || syst==4 || (syst==6 && mring==-6)) {
522 rpd=rphidisp*gauss();
526 mlayer <<
" " << mring <<
" z " << zd );
535 if (syst<=2 || syst==6) {
538 float dx=modcent.x();
539 float dy=modcent.y();
540 float dr=std::sqrt(dx*dx+dy*dy);
541 xd=(rd*dx-rpd*dy)/dr;
542 yd=(rd*dy+rpd*dx)/dr;
548 std::string key=
dirkey(mdet,mbec,mlayer,level);
557 }
else if (level==2) {
561 m_pixid->layer_disk(ident),0,0);
564 m_sctid->layer_disk(ident),0,0,0);
567 std::vector<Identifier>::const_iterator ix=
568 find(lvl12id.begin(),lvl12id.end(),ident2);
569 if (ix==lvl12id.end()) {
570 lvl12id.push_back(ident2);
577 ident2=
m_pixid->wafer_id(0,0,0,0);
579 ident2=
m_sctid->wafer_id(0,0,0,0,0);
582 std::vector<Identifier>::const_iterator ix=
583 find(lvl12id.begin(),lvl12id.end(),ident2);
584 if (ix==lvl12id.end()) {
585 lvl12id.push_back(ident2);
596 <<
"," << mlayer <<
"," << mring <<
"," << msector <<
" to xyz" <<
597 xd <<
"," << yd <<
"," << zd );
601 ATH_MSG_ERROR(
"Cannot find AlignableTransform for key" << key <<
" in AlignableTransform container");
607 ATH_MSG_DEBUG(
"Added displacement to " << nmod <<
" modules " << dettype <<
","
608 << bec <<
"," << layer <<
" [" << rphidisp <<
"," << rdisp
609 <<
"," << zdisp <<
"]"
610 <<
" type " << syst );
615 std::ofstream* outfile=
nullptr;
616 SmartIF<INTupleSvc> ntsvc{Gaudi::svcLocator()->service(
"NTupleSvc")};
617 if(!ntsvc.isValid())
ATH_MSG_ERROR(
"Cannot find NTupleSvc" );
618 const std::string path=
file+
"/9002";
619 NTuplePtr nt(ntsvc.get(),path);
622 ATH_MSG_DEBUG(
"writeFile: Write AlignableTransforms on ntuple 9002, path: " <<
file );
628 nt=ntsvc->book(
file,ntid,CLID_ColumnWiseTuple,
"AlignDB");
633 sc=nt->addItem(
"MODPROP/Bec",
nt_bec);
642 sc=nt->addItem(
"MODPROP/Phi",
nt_phi);
644 sc=nt->addItem(
"MODPROP/Psi",
nt_psi);
645 sc=nt->addItem(
"MODPROP/Phi",
nt_phi);
647 sc=nt->addItem(
"MODPROP/Psi",
nt_psi);
649 "Error booking ntuple 9002 contents" );
652 outfile=
new std::ofstream(
file.c_str());
656 for (std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
661 if (!ntuple) *outfile << *iobj << std::endl;
663 cit!=pat->end();++cit) {
666 int det,bec,layer,ring,sector,side;
668 if(!ident.is_valid())
ATH_MSG_FATAL(
"Attempting to write an Invalid ID!!!");
669 if (!
idToDetSet(ident,det,bec,layer,ring,sector,side)) {
674 det=1;bec=0;layer=0;ring=0;sector=0;side=0;
681 double alpha, beta, gamma;
700 std::string r3=iobj->substr(iobj->size()-3,3);
702 if (r3==
"SCT" || r3==
"PIX")
nt_level=2;
713 if (StatusCode::SUCCESS!=nt->write())
ATH_MSG_ERROR(
"Problem filling ntuple 9002" );
715 *outfile <<
"2 " << det <<
" " << 2*bec <<
" " << layer <<
" " << sector <<
716 " " << ring <<
" " << side <<
" " << dx <<
" " << dy <<
" "
717 << dz <<
" " << alpha/CLHEP::mrad <<
" " << beta/CLHEP::mrad <<
" " << gamma/CLHEP::mrad << std::endl;
719 << *iobj <<
" when writing output file");
724 << *iobj <<
" when writing output file");
732 ATH_MSG_DEBUG(
"Written " << nobj <<
" AlignableTransform objects" <<
" with " << ntrans <<
" transforms to text file" );
738 std::ofstream* outfile=
nullptr;
741 outfile=
new std::ofstream(
file.c_str());
742 *outfile <<
"/Indet/IBLDist" << std::endl;
745 if (StatusCode::SUCCESS==
detStore()->retrieve(atrlistcol,
"/Indet/IBLDist")) {
749 const coral::AttributeList& atrlist=citr->second;
750 *outfile << citr->first <<
" " << atrlist[
"stave"].data<
int>()
752 <<
" " << atrlist[
"mag"].data<
float>()
753 <<
" " << atrlist[
"base"].
data<float>() << std::endl;
758 msg(MSG::INFO) <<
"Cannot find IBLDist Container - cannot write IBLDist DB in text file " <<
endmsg;
770 std::ofstream* outfile=
nullptr;
774 outfile=
new std::ofstream(
file.c_str());
775 std::vector<std::string> folder_list = {
"/Indet/AlignL1/ID",
"/Indet/AlignL2/PIX",
"/Indet/AlignL2/SCT"};
777 for (std::vector<std::string>::iterator it = folder_list.begin(); it != folder_list.end(); ++it){
779 *outfile << *it << std::endl;
782 if (StatusCode::SUCCESS==
detStore()->retrieve(atrlistcol,*it)) {
786 const coral::AttributeList& atrlist=citr->second;
787 *outfile << atrlist[
"subsystem"].data<
int>()
789 <<
" " << atrlist[
"bec"].data<
int>()
791 <<
" " << atrlist[
"ring"].data<
int>()
793 <<
" " << atrlist[
"side"].data<
int>()
795 <<
" " << atrlist[
"Ty"].data<
float>()
797 <<
" " << atrlist[
"Rx"].data<
float>()
799 <<
" " << atrlist[
"Rz"].data<
float>() << std::endl;
804 msg(MSG::INFO) <<
"Cannot find " << *it <<
" Container - cannot write DB in text file " <<
endmsg;
811 ATH_MSG_DEBUG(
"writeFile: No dynamic Run2 DB structure is present --> skipping writing file " <<
file );
820 ATH_MSG_DEBUG(
"readTextFile - set alignment constants from text file: " <<
file );
821 std::ifstream infile;
822 infile.open(
file.c_str());
832 std::string channelName;
837 std::getline(infile, tmpline);
841 if ((tmpline.substr(0,2) ==
"//") || (tmpline.substr(0,1) ==
"#"))
continue;
843 std::istringstream instring(tmpline);
848 if (tmpstr.empty())
continue;
850 if (tmpstr[0] ==
'/') {
852 channelName = tmpstr;
853 ATH_MSG_DEBUG(
"Read in AlignableTransform data, key " << channelName );
857 ATH_MSG_ERROR(
"Cannot find AlignableTransform object for key"
858 << channelName <<
" when reading text file");
871 std::istringstream datastream(tmpline);
873 int subsystem,dettype,bec,layer,phiModule,etaModule,side;
874 float dx,dy,dz,alpha,beta,gamma;
875 datastream >> subsystem >> dettype >> bec >> layer >> phiModule >> etaModule >> side >> dx
876 >> dy >> dz >> alpha >> beta >> gamma;
878 if (datastream.fail()) {
881 alpha *= CLHEP::mrad;
883 gamma *= CLHEP::mrad;
888 ident=
m_pixid->wafer_id(bec,layer,phiModule,etaModule);
889 }
else if (dettype==2) {
890 ident=
m_sctid->wafer_id(bec,layer,phiModule,etaModule,side);
895 if (!ident.is_valid()) {
897 " [" << subsystem <<
"," << dettype <<
"," << bec <<
"," << layer <<
"," <<
898 phiModule <<
"," << etaModule <<
"," << side <<
"] key " << channelName <<
899 " shift [" << dx <<
"," << dy <<
"," << dz <<
"]" );
906 Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
918 while ((itr->identify()!=ident) && (itr!=pat2->
mend())) ++itr;
919 if (itr!=pat2->
mend()) {
928 " shift [" << dx <<
"," << dy <<
"," << dz <<
"]" );
936 ATH_MSG_DEBUG(
"Read " << nobj <<
" objects from file with " << ntrans <<
" transforms" );
941 ATH_MSG_DEBUG(
"readNtuple - set alignment constants from ntuple path: " <<
file );
942 SmartIF<INTupleSvc> ntsvc{Gaudi::svcLocator()->service(
"NTupleSvc")};
943 if(!ntsvc.isValid())
ATH_MSG_ERROR(
"Cannot find NTupleSvc" );
944 const std::string path=
file+
"/9002";
945 NTuplePtr nt(ntsvc.get(),path);
963 "Error booking ntuple 9002 contents" );
965 while (nt->read().isSuccess()) {
977 Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
985 ATH_MSG_DEBUG(
"Read " << ntrans <<
" transforms from ntuple");
1005 std::string key=
dirkey(ident,level);
1011 if (pat2!=
nullptr) {
1016 ATH_MSG_ERROR(
"setTrans: cannot retrieve AlignableTransform for key" << key );
1024 const Amg::Vector3D& translate,
double alpha,
double beta,
double gamma)
const
1028 Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
1033 return setTrans(ident, level, newtrans);
1050 std::string key=
dirkey(ident,level);
1055 if (pat2!=
nullptr) {
1058 "Attempt to tweak non-existent transform for element "<<
m_pixid->show_to_string(ident));
1064 "tweakTrans: cannot retrieve AlignableTransform for key" << key );
1072 const Amg::Vector3D& translate,
double alpha,
double beta,
double gamma)
const
1076 Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
1088 if( level == 3 )
return ident ;
1090 if(
m_pixid->is_pixel(ident) ) {
1092 return m_pixid->wafer_id( 0, 0, 0, 0 ) ;
1095 int barrel_ec =
m_pixid->barrel_ec( ident ) ;
1096 int layer_disk =
m_pixid->layer_disk( ident ) ;
1097 return m_pixid->wafer_id( barrel_ec, layer_disk, 0, 0 ) ;
1101 if(
m_sctid->is_sct(ident) ) {
1103 int barrel_ec =
m_sctid->barrel_ec( ident ) ;
1104 return m_sctid->wafer_id( barrel_ec, 0, 0, 0, 0 ) ;
1107 int barrel_ec =
m_sctid->barrel_ec( ident ) ;
1108 int layer_disk =
m_sctid->layer_disk( ident ) ;
1109 return m_sctid->wafer_id( barrel_ec, layer_disk, 0, 0, 0 ) ;
1121 element =
m_sctman->getDetectorElement( ident ) ;
1124 ATH_MSG_ERROR(
"getTransL123(): Module not found in PIX or SCT!" );
1130 ATH_MSG_FATAL(
"Code needs to corrected otherwise you will get nonsensical results-- IndetAlignDBTool:2060");
1133 result = trfL1 * trfL2 * trfL3 ;
1141 const int level)
const {
1144 const std::string key=
dirkey(identifier,level);
1160 return StatusCode::FAILURE;
1192 ATH_MSG_DEBUG(
"starting to register typeKey for IBLDist" );
1195 typekeys_IBLDist[0] =
pair;
1198 if (StatusCode::SUCCESS!=
m_par_condstream->streamObjects(typekeys_IBLDist)) {
1200 return StatusCode::FAILURE;
1212 return StatusCode::SUCCESS;
1216 const unsigned int run1,
const unsigned int event1,
1217 const unsigned int run2,
const unsigned int event2)
const {
1220 ATH_MSG_DEBUG(
"Run/evt1 [" << run1 <<
"," << event1 <<
"]" );
1221 ATH_MSG_DEBUG(
"Run/evt2 [" << run2 <<
"," << event2 <<
"]" );
1224 SmartIF<IIOVRegistrationSvc> regsvc{Gaudi::svcLocator()->service(
"IOVRegistrationSvc")};
1225 if (!regsvc.isValid()) {
1232 if (StatusCode::SUCCESS==regsvc->registerIOV(
1233 "AlignableTransformContainer",
m_par_dbroot,tag,run1,run2,event1,event2)) {
1241 for (std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
1243 if (StatusCode::SUCCESS==regsvc->registerIOV(
"AlignableTransform",
1244 *iobj,tag,run1,run2,event1,event2)) {
1245 ATH_MSG_DEBUG(
"Stored AlignableTransform object " << *iobj );
1248 ATH_MSG_ERROR(
"Failed (registerIOV) to store object " << *iobj );
1252 ATH_MSG_DEBUG(
" Written " << nobj <<
" AlignableTransform objects to conditions database" );
1257 ATH_MSG_DEBUG(
"Printout InDetAlign database contents, detail level" << level );
1259 for (std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
1266 cit!=pat->end();++cit) {
1271 int det,bec,layer,ring,sector,side;
1272 if (
idToDetSet(ident,det,bec,layer,ring,sector,side)) {
1274 double alpha, beta, gamma;
1276 ATH_MSG_DEBUG(
"ID [" << det <<
"," << bec <<
"," << layer <<
1277 "," << ring <<
"," << sector <<
"," << side <<
"] Trans:(" <<
1278 shift.x() <<
"," << shift.y() <<
"," << shift.z() <<
") Rot:{"
1279 << alpha <<
"," << beta <<
"," << gamma <<
"}");
1286 ATH_MSG_DEBUG(
"Object contains " << nobj <<
" transforms" );
1288 ATH_MSG_ERROR(
"AlignableTransform " << *iobj <<
" not found" );
1304 dva!=patc->
end();++dva) {
1305 if ((*dva)->tag()==key) {
1312 if (StatusCode::SUCCESS!=
detStore()->retrieve(pat,key)) pat=
nullptr;
1327 dva!=patc->
end();++dva) {
1328 if ((*dva)->tag()==key) {
1335 if (StatusCode::SUCCESS!=
detStore()->retrieve(pat,key)) pat=
nullptr;
1341 const int nbsct,
const int necsct) {
1353 if (nbpix!=0 || necpix!=0) {
1360 for (
int i=0;i<necpix;++i) {
1365 for (
int i=0;i<nbpix;++i) {
1370 for (
int i=0;i<necpix;++i) {
1375 if (nbsct!=0 || necsct!=0) {
1381 for (
int i=0;i<necsct;++i) {
1386 for (
int i=0;i<nbsct;++i) {
1391 for (
int i=0;i<necsct;++i) {
1409 double& alpha,
double& beta,
double &gamma)
const
1411 double siny = trans(0,2);
1419 if ((trans(1,2) == 0) && (trans(2,2) == 0)) {
1423 alpha = atan2(trans(1,1),trans(2,1));
1425 alpha = atan2(-trans(1,2),trans(2,2));
1426 gamma = atan2(-trans(0,1),trans(0,0));
1427 if (alpha == 0) alpha = 0;
1428 if (gamma == 0) gamma = 0;
1439 if (StatusCode::SUCCESS==
detStore()->retrieve(atrlistcol1,
"/Indet/IBLDist")) {
1442 if (atrlistcol2!=
nullptr){
1445 const coral::AttributeList& atrlist=citr->second;
1446 coral::AttributeList& atrlist2 =
const_cast<coral::AttributeList&
>(atrlist);
1448 if(atrlist2[
"stave"].
data<int>()!=stave)
continue;
1450 msg(MSG::DEBUG) <<
"IBLDist DB -- channel before update: " << citr->first
1451 <<
" ,stave: " << atrlist2[
"stave"].data<
int>()
1453 <<
" ,base: " << atrlist2[
"base"].data<
float>() <<
endmsg;
1455 atrlist2[
"mag"].data<
float>() += bowx;
1457 msg(MSG::DEBUG) <<
"IBLDist DB -- channel after update: " << citr->first
1458 <<
" ,stave: " << atrlist2[
"stave"].data<
int>()
1460 <<
" ,base: " << atrlist2[
"base"].data<
float>() <<
endmsg;
1466 ATH_MSG_ERROR(
"tweakIBLDist: cast fails for stave " << stave );
1471 ATH_MSG_ERROR(
"tweakIBLDist: cannot retrieve CondAttrListCollection for key /Indet/IBLDist" );
1487 std::string key=
dirkey(ident,level);
1488 int det,bec,layer,ring,sector,side;
1489 idToDetSet(ident,det,bec,layer,ring,sector,side);
1490 const unsigned int DBident=det*10000+2*bec*1000+layer*100+ring*10+sector;
1493 if (StatusCode::SUCCESS==
detStore()->retrieve(atrlistcol1,key)) {
1497 if (atrlistcol2!=
nullptr){
1500 const coral::AttributeList& atrlist=citr->second;
1501 coral::AttributeList& atrlist2 =
const_cast<coral::AttributeList&
>(atrlist);
1503 if(citr->first!=DBident)
continue;
1505 msg(MSG::DEBUG) <<
"Tweak Old global DB -- channel: " << citr->first
1506 <<
" ,det: " << atrlist2[
"det"].data<
int>()
1507 <<
" ,bec: " << atrlist2[
"bec"].
data<int>()
1508 <<
" ,layer: " << atrlist2[
"layer"].data<
int>()
1509 <<
" ,ring: " << atrlist2[
"ring"].
data<int>()
1510 <<
" ,sector: " << atrlist2[
"sector"].data<
int>()
1512 <<
" ,Ty: " << atrlist2[
"Ty"].data<
float>()
1514 <<
" ,Rx: " << atrlist2[
"Rx"].data<
float>()
1516 <<
" ,Rz: " << atrlist2[
"Rz"].data<
float>() <<
endmsg;
1521 Amg::Transform3D oldtrans = oldtranslation * Amg::RotationMatrix3D::Identity();
1531 double alpha, beta, gamma;
1534 atrlist2[
"Tx"].data<
float>() = shift.x();
1535 atrlist2[
"Ty"].data<
float>() = shift.y();
1536 atrlist2[
"Tz"].data<
float>() = shift.z();
1537 atrlist2[
"Rx"].data<
float>() = alpha/CLHEP::mrad ;
1538 atrlist2[
"Ry"].data<
float>() = beta/CLHEP::mrad ;
1539 atrlist2[
"Rz"].data<
float>() = gamma/CLHEP::mrad ;
1542 msg(MSG::DEBUG) <<
"Tweak New global DB -- channel: " << citr->first
1543 <<
" ,det: " << atrlist2[
"det"].data<
int>()
1544 <<
" ,bec: " << atrlist2[
"bec"].
data<int>()
1545 <<
" ,layer: " << atrlist2[
"layer"].data<
int>()
1546 <<
" ,ring: " << atrlist2[
"ring"].
data<int>()
1547 <<
" ,sector: " << atrlist2[
"sector"].data<
int>()
1549 <<
" ,Ty: " << atrlist2[
"Ty"].data<
float>()
1551 <<
" ,Rx: " << atrlist2[
"Rx"].data<
float>()
1553 <<
" ,Rz: " << atrlist2[
"Rz"].data<
float>() <<
endmsg;
1559 ATH_MSG_ERROR(
"tweakGlobalFolder: cast fails for DBident " << DBident );
1564 ATH_MSG_ERROR(
"tweakGlobalFolder: cannot retrieve CondAttrListCollection for key " << key );
Scalar phi() const
phi method
Scalar theta() const
theta method
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
char data[hepevt_bytes_allocation_ATLAS]
This is an interface to a tool used to register conditions objects in the Interval of Validity (IOV) ...
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
This class is a collection of AttributeLists where each one is associated with a channel number.
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
void add(ChanNum chanNum)
Adding in channel numbers.
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataModel_detail::iterator< DataVector > iterator
Standard iterator.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
Class to hold geometrical description of a silicon detector element.
Base class for Pixel and SCT Detector managers.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
std::string find(const std::string &s)
return a remapped string
Eigen::AngleAxisd AngleAxis3D
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Amg::Transform3D CLHEPTransformToEigen(const HepGeom::Transform3D &CLHEPtransf)
Converts a CLHEP-based HepGeom::Transform3D into an Eigen Amg::Transform3D.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D