38 : base_class(name,pSvcLocator),
46 m_streamer(
"AthenaOutputStreamTool/CondStream1"),
55 declareProperty(
"TrtStrawAlignDbSvc",
m_trtStrawAlignDbSvc,
"Service for interaction with the TRT straw alignment DB");
58 declareProperty(
"forceUserDBConfig",
m_forceUserDBConfig,
"Set to true to override any DB auto-configuration");
81 itermin=
m_trtman->getDetectorElementBegin();
82 itermax=
m_trtman->getDetectorElementEnd();
106 ATH_MSG_INFO(
"Adding key: /TRT/Align/TRT --> We are using static DB folder scheme" );
111 for (iter=itermin;iter!=itermax;++iter) {
113 if (element!=
nullptr) {
141 if( alignFolderExists ) {
147 if( alignTextFileExists )
149 <<
" exists. Will read text file from callback function." );
151 }
else if ( alignTextFileExists ) {
160 ATH_MSG_ERROR(
"AlignableTransformContainer not in IOV service and no textfile specified." );
167 return StatusCode::SUCCESS;
174 ATH_MSG_INFO(
"TRT_AlignDbSvc finalize method called" );
178 return StatusCode::SUCCESS;
197 for (std::list<std::string>::const_iterator itr=keys.begin(); itr!=keys.end(); ++itr)
198 ATH_MSG_INFO(
"IOVCALLBACK for key " << *itr<<
" number " <<
I );
212 return StatusCode::SUCCESS;
220 std::ofstream outfile(
file);
226 std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
227 std::vector<std::string>::const_iterator iobjE=
m_alignobjs.end();
228 for (;iobj!=iobjE; ++iobj) {
230 std::string key=*iobj;
238 ATH_MSG_ERROR(
"Cannot find AlignableTransform for key "<< key );
240 outfile << key << std::endl;
246 outfile << key << std::endl;
252 for (;cit!=citE;++cit) {
265 layer=
m_trtid->layer_or_wheel(ident);
266 sector=
m_trtid->phi_module(ident);
267 strawLayer=
m_trtid->straw_layer(ident);
272 if(msgLvl(MSG::DEBUG)){
273 std::string thisMess = key+
" for "+
file;
279 CLHEP::HepRotation rot=transCLHEP.getRotation();
281 eulerangles[0] = rot.getPhi();
282 eulerangles[1] = rot.getTheta();
283 eulerangles[2] = rot.getPsi();
292 << ident <<
" " << bec <<
" " << layer <<
" " << strawLayer <<
" " << key );
294 outfile << bec <<
" " << layer <<
" " << strawLayer <<
" "
295 << std::setprecision(10) <<
" "
296 << shift.x() <<
" " << shift.y() <<
" " << shift.z() <<
" "
297 << eulerangles[0] <<
" " << eulerangles[1] <<
" " << eulerangles[2]
301 ATH_MSG_DEBUG( bec <<
" " << layer <<
" " << strawLayer <<
" "
302 << std::setprecision(10) <<
" "
303 << shift.x() <<
" " << shift.y() <<
" " << shift.z() <<
" "
304 << eulerangles[0] <<
" " << eulerangles[1] <<
" " << eulerangles[2]
310 << ident <<
" " << bec <<
" " << layer <<
" " << sector <<
" " << key );
312 outfile << bec <<
" " << layer <<
" " << sector <<
" "
313 << std::setprecision(10) <<
" "
314 << shift.x() <<
" " << shift.y() <<
" " << shift.z() <<
" "
315 << eulerangles[0] <<
" " << eulerangles[1] <<
" " << eulerangles[2]
320 << std::setprecision(10) <<
" "
321 << shift.x() <<
" " << shift.y() <<
" " << shift.z() <<
" "
322 << eulerangles[0] <<
" " << eulerangles[1] <<
" " << eulerangles[2]
331 ATH_MSG_INFO(
"Written " << nobj <<
" AlignableTransform objects" <<
" with " << ntrans
332 <<
" transforms to text file" );
335 return StatusCode::SUCCESS;
346 return StatusCode::SUCCESS;
353 std::ifstream infile;
354 infile.open(
file.c_str());
369 return StatusCode::FAILURE ;
379 while( infile.getline(line,512) ) {
382 std::string linestring(line) ;
383 if( linestring.find(
'/') != std::string::npos) {
385 atname = linestring ;
389 ATH_MSG_ERROR(
"Cannot find AlignableTransform object for key " << atname );
390 return StatusCode::FAILURE;
394 }
else if(pat!=
nullptr) {
396 std::istringstream is(line) ;
398 int bec(0),layer(0),sector(0),strawLayer(0);
402 if( is >> bec >> layer >> strawLayer >> dx >> dy >> dz >>
phi ) {
403 CLHEP::Hep3Vector translation(dx, dy, dz);
404 CLHEP::HepRotation rotation;
405 if (is >>
theta >> psi) {
407 <<
" " <<
theta <<
" " << psi);
413 <<
" layer " << layer <<
" strawLayer " << strawLayer );
415 if( pat->findIdent(ident)!=pat->end() ) {
416 ATH_MSG_WARNING (
"WARNING: read module from file which was already in AlignableTransform. Will skip it."
417 <<
" bec,lay,sec,strawlay = " << bec <<
" " << layer <<
" " << sector <<
" " );
419 pat->add(ident,HepGeom::Transform3D(rotation, translation));
420 HepGeom::Transform3D testtrans = HepGeom::Transform3D(rotation, translation);
421 if(msgLvl(MSG::DEBUG)){
422 std::string thisMess = atname+
" for "+
file;
429 <<
" [" << bec <<
"," << layer <<
"," << strawLayer
430 <<
"] key " << atname
431 <<
" rotation=(" <<
phi <<
"," <<
theta <<
"," << psi
432 <<
"), translation=(" << dx <<
"," << dy <<
"," << dz <<
"])"
435 }
else if(!linestring.empty()) {
436 ATH_MSG_WARNING(
"Read invalid line from textfile. Line=\'" << line <<
"\'" );
440 if( is >> bec >> layer >> sector >> dx >> dy >> dz >>
phi ) {
441 CLHEP::Hep3Vector translation(dx,dy,dz) ;
442 CLHEP::HepRotation rotation;
443 if( is >>
theta >> psi ) {
449 rotation = CLHEP::HepRotationZ(
phi) ;
453 if( pat->findIdent(ident)!=pat->end() ) {
454 ATH_MSG_WARNING (
"WARNING: read module from file which was already in AlignableTransform. Will skip it."
455 <<
" bec,lay,sec = " << bec <<
" " << layer <<
" " << sector);
457 pat->add(ident,HepGeom::Transform3D(rotation, translation));
460 <<
" [" << bec <<
"," << layer <<
"," << sector
461 <<
"] key " << atname <<
" rotation=(" <<
phi <<
"," <<
theta <<
"," << psi
462 <<
"), translation=(" << dx <<
"," << dy <<
"," << dz <<
"])" );
464 }
else if(!linestring.empty()) {
465 ATH_MSG_WARNING(
"Read invalid line from textfile. Line=\'" << line <<
"\'" );
475 ATH_MSG_INFO(
"Read " << nobj <<
" objects from file with " << ntrans <<
" transforms."
476 <<
" Now forcing callback in detector manager." );
484 return StatusCode::SUCCESS;
500 typeKeys.push_back(arraypair);
506 ATH_MSG_INFO(
" Streamed out and committed AlignableTransformContainer" );
510 return StatusCode::SUCCESS;
517 ATH_MSG_INFO(
"Run/evt1 [" << run1 <<
"," << event1 <<
"]" );
518 ATH_MSG_INFO(
"Run/evt2 [" << run2 <<
"," << event2 <<
"]" );
521 SmartIF<IIOVRegistrationSvc> regsvc(service(
"IOVRegistrationSvc"));
524 if (StatusCode::SUCCESS==regsvc->registerIOV(
"AlignableTransformContainer",
m_alignroot,tag,run1,run2,event1,event2)){
525 ATH_MSG_INFO(
" Register AlignableTransformContainer object "
528 ATH_MSG_ERROR(
" Failed to register AlignableTranformContainer "
530 return StatusCode::FAILURE;
533 return StatusCode::SUCCESS;
540 if(level != 1 && level != 2){
556 std::string key=
"/TRT/Align/TRT";
579 int bec=
m_trtid->barrel_ec(ident);
580 int layer=
m_trtid->layer_or_wheel(ident);
581 int sector=
m_trtid->phi_module(ident);
582 int strawLayer=
m_trtid->straw_layer(ident);
587 mid=
m_trtid->layer_id(bec,0,layer,ring);
589 mid=
m_trtid->module_id(bec,sector,layer);
600 if(level != 1 && level != 2){
618 int bec=
m_trtid->barrel_ec(ident);
621 if(iter != pat->end() ) {
645 int bec=
m_trtid->barrel_ec(ident);
646 int layer=
m_trtid->layer_or_wheel(ident);
647 int sector=
m_trtid->phi_module(ident);
648 int strawLayer=
m_trtid->straw_layer(ident);
652 mid =
m_trtid->layer_id(bec,0,layer,ring);
654 mid =
m_trtid->module_id(bec,sector,layer);
657 if(iter != pat->end() ){
677 if(level != 1 && level != 2 && level != 3){
680 return StatusCode::FAILURE;
696 return StatusCode::SUCCESS;
705 if(msgLvl(MSG::DEBUG)){
714 return StatusCode::FAILURE;
722 ATH_MSG_FATAL(
"The AlignableTransform for key " <<
"/TRT/Align/TRT" <<
" does not exist " );
724 return StatusCode::FAILURE;
728 if( !(
m_trtid->is_trt(ident)) ){
729 ATH_MSG_FATAL(
"The identifier " << ident <<
" is not from the TRT " );
731 return StatusCode::FAILURE;
734 int bec=
m_trtid->barrel_ec(ident);
738 if( !(pat->update(mid,clhepTrans)) ) {
739 pat->add(mid,clhepTrans);
745 return StatusCode::SUCCESS;
758 if (!pat)
return StatusCode::FAILURE;
761 if( !(
m_trtid->is_trt(ident)) )
return StatusCode::FAILURE;
762 int bec=
m_trtid->barrel_ec(ident);
763 int layer=
m_trtid->layer_or_wheel(ident);
764 int sector=
m_trtid->phi_module(ident);
765 int strawLayer=
m_trtid->straw_layer(ident);
770 <<
" Bec= " << bec <<
" layer= " << layer <<
" sector= " << sector
771 <<
" strawLayer= " << strawLayer );
772 ATH_MSG_DEBUG(
"The translations are: x= " << trans(0,3) <<
" y= "<<trans(1,3) <<
" z= "<<trans(2,3) );
775 ident2=
m_trtid->layer_id(bec,0,layer,ring);
777 ident2=
m_trtid->module_id(bec,sector,layer);
780 if( !(
m_trtid->is_trt(ident2)) ){
781 ATH_MSG_FATAL(
"The identifier " << ident2 <<
" is not from the TRT " );
783 return StatusCode::FAILURE;
788 if( !(pat->update(ident2,clhepTrans)) ) {
789 pat->add(ident2,clhepTrans);
794 return StatusCode::SUCCESS;
802 if( !(
m_trtid->is_trt(ident)) )
return StatusCode::FAILURE;
803 int bec=
m_trtid->barrel_ec(ident);
810 ATH_MSG_INFO(
"Storing L3 Barrel constants, Only dx and rotz will be written to DB");
811 float dx = trans.translation().x();
812 float rotz = std::atan2(trans.rotation()(0,1),trans.rotation()(0,0));
816 double strawLenthOver2 = 0.5* strawElement->
strawLength();
821 double delta_dx_atLargerZ = dx + strawLenthOver2 * std::sin(rotz);
822 double delta_dx_atSmallerZ = dx - strawLenthOver2 * std::sin(rotz);
828 bool sideA =
m_trtid->barrel_ec(ident) == 1;
831 double dx1_new = sideA ? delta_dx_atLargerZ : delta_dx_atSmallerZ;
834 double dx2_new = sideA ? delta_dx_atSmallerZ : delta_dx_atLargerZ;
837 double dxErr = 0.001;
843 ATH_MSG_INFO(
"Storing L3 Endcap constants, Only dy and rotz will be written to DB");
852 float dy = trans.translation().y();
853 float rotx = std::atan2(trans.rotation()(1,2),trans.rotation()(2,2));
857 double strawLenthOver2 = 0.5* strawElement->
strawLength();
861 double delta_dx_nearBeamPipe = dy + strawLenthOver2 * std::sin(rotx);
862 double delta_dx_nearReadOut = dy - strawLenthOver2 * std::sin(rotx);
865 double dxErr = 0.001;
871 return StatusCode::SUCCESS;
879 if(level != 1 && level != 2 && level != 3){
882 return StatusCode::FAILURE;
893 return StatusCode::FAILURE;
906 return StatusCode::FAILURE;
919 return StatusCode::FAILURE;
925 return StatusCode::SUCCESS;
940 return StatusCode::FAILURE;
948 ATH_MSG_WARNING(
"The AlignableTransform for key " <<
"/TRT/Align/TRT" <<
" does not exist " );
950 return StatusCode::FAILURE;
956 if( !(
m_trtid->is_trt(ident)) ){
957 ATH_MSG_WARNING(
"The identifier " << ident <<
" is not from the TRT " );
959 return StatusCode::FAILURE;
962 int bec=
m_trtid->barrel_ec(ident);
969 return StatusCode::FAILURE;
974 return StatusCode::SUCCESS;
987 ATH_MSG_WARNING(
"The transfor for key: " << key <<
"Does not exist" );
989 return StatusCode::FAILURE;
994 if( !(
m_trtid->is_trt(ident)) )
return StatusCode::FAILURE;
995 int bec=
m_trtid->barrel_ec(ident);
996 int layer=
m_trtid->layer_or_wheel(ident);
997 int sector=
m_trtid->phi_module(ident);
998 int strawLayer=
m_trtid->straw_layer(ident);
1002 mid =
m_trtid->layer_id(bec,0,layer,ring);
1004 mid =
m_trtid->module_id(bec,sector,layer);
1009 return StatusCode::FAILURE;
1013 return StatusCode::SUCCESS;
1021 if( !(
m_trtid->is_trt(ident)) )
return StatusCode::FAILURE;
1022 int bec=
m_trtid->barrel_ec(ident);
1029 ATH_MSG_INFO(
"Storing L3 constants, Only dx and rotz will be written to DB");
1030 float dx = trans.translation().x();
1046 bool sideA =
m_trtid->barrel_ec(ident) == 1;
1048 float rotz = std::atan2(trans.rotation()(0,2),trans.rotation()(0,0));
1052 double strawLenthOver2 = 0.5* strawElement->
strawLength();
1059 double delta_dx_atLargerZ;
1060 double delta_dx_atSmallerZ;
1062 delta_dx_atLargerZ = dx - strawLenthOver2 * std::sin(rotz);
1063 delta_dx_atSmallerZ = dx + strawLenthOver2 * std::sin(rotz);
1066 delta_dx_atLargerZ = dx + strawLenthOver2 * std::sin(rotz);
1067 delta_dx_atSmallerZ = dx - strawLenthOver2 * std::sin(rotz);
1071 double delta_dx1 = sideA ? delta_dx_atLargerZ : delta_dx_atSmallerZ;
1074 double delta_dx2 = sideA ? delta_dx_atSmallerZ : delta_dx_atLargerZ;
1077 double dxErr = 0.001;
1090 double dx1_new = dx1_current + delta_dx1;
1091 double dx2_new = dx2_current + delta_dx2;
1101 ATH_MSG_INFO(
"Storing L3 Endcap constants, Only dy and rotz will be written to DB");
1110 float dy = trans.translation().y();
1111 float rotx = std::atan2(trans.rotation()(1,2),trans.rotation()(2,2));
1115 double strawLenthOver2 = 0.5* strawElement->
strawLength();
1119 double delta_dx_nearBeamPipe = dy + strawLenthOver2 * std::sin(rotx);
1120 double delta_dx_nearReadOut = dy - strawLenthOver2 * std::sin(rotx);
1123 double dxErr = 0.001;
1136 double dx1_new = dx1_current + delta_dx_nearReadOut;
1137 double dx2_new = dx2_current + delta_dx_nearBeamPipe;
1143 return StatusCode::SUCCESS;
1173 std::ostringstream
result;
1179 }
else if(
type==
"DF") {
1180 result <<
"/TRT/Calib/DF";
1181 }
else return result.str();
1183 int bec=
m_trtid->barrel_ec(ident);
1190 }
else if(bec==-2) {
1194 int layer =
m_trtid->layer_or_wheel(ident);
1197 }
else if(
type==
"ALold"){
1200 }
else if(bec==-2) {
1205 int layer =
m_trtid->layer_or_wheel(ident);
1232 std::ostringstream
result;
1233 std::string detector=key.substr(1,3);
1235 std::string
type,quantity;
1237 if(detector==
"TRT") {
1238 type=key.substr(5,5);
1241 quantity=key.substr(ind,2);
1242 }
else if(detector==
"Indet") {
1243 type=key.substr(7,5);
1247 if(
type==
"Align" && key.substr(ind1,2)!=
"ID") {
1248 if(key.substr(ind1+3,1)==
"_") quantity=
"DF";
1255 if(quantity==
"DF") {
1257 }
else if (quantity==
"RT") {
1259 }
else if (quantity==
"T0") {
1264 std::string module=key.substr(ind+3,2);
1266 }
else if(
type==
"Align") {
1267 std::string module=key.substr(ind1,2);
1268 if(module==
"ID" || module==
"TR") {
1273 module=key.substr(ind+3,2);
1294 <<
" already exists." );
1295 return StatusCode::FAILURE;
1299 auto patc = std::make_unique<AlignableTransformContainer>();
1302 patc->push_back(std::make_unique<AlignableTransform>(
m_alignobjs[i]));
1311 return StatusCode::SUCCESS;
1320 ATH_MSG_DEBUG(
"createAlignObjectsWhichDoNotAlreadyExist method called" );
1348 ATH_MSG_DEBUG(
"Leaving createAlignObjectsWhichDoNotAlreadyExist" );
1349 return StatusCode::SUCCESS;
1358 std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
1359 std::vector<std::string>::const_iterator iobjE=
m_alignobjs.end();
1360 for (;iobj!=iobjE;++iobj) {
1393 if( (*dva)->tag()==key ) {
1402 ATH_MSG_WARNING(
"Failed to get the AlignableTransform for key " << key );
1412 return strawlayer / 4 * 4;
1420 for(
unsigned int i=0; i<14; ++i){
1423 <<
bool(input.find(testA)!=std::string::npos) );
1424 if(input.find(testA)!=std::string::npos){
1430 <<
bool(input.find(testC)!=std::string::npos) );
1431 if(input.find(testC)!=std::string::npos){
1442 std::ostringstream stm;
1449 std::cout << thisName <<
" " << transform(0,3) <<
" " << transform(1,3) <<
" " << transform(2,3) << std::endl;
1450 std::cout << thisName <<
" " << transform(0,0) <<
" " << transform(0,1) <<
" " << transform(0,2) << std::endl;
1451 std::cout << thisName <<
" " << transform(1,0) <<
" " << transform(1,1) <<
" " << transform(1,2) << std::endl;
1452 std::cout << thisName <<
" " << transform(2,1) <<
" " << transform(2,1) <<
" " << transform(2,2) << std::endl;
1462 std::ofstream outfile(
file);
1463 std::vector<std::string> folder_list = {
"/TRT/AlignL1/TRT"};
1465 for (std::vector<std::string>::iterator it = folder_list.begin(); it != folder_list.end(); ++it){
1467 outfile << *it << std::endl;
1469 if (StatusCode::SUCCESS==
m_detStore->retrieve(atrlistcol,*it)) {
1473 const coral::AttributeList& atrlist=citr->second;
1474 outfile << atrlist[
"bec"].data<
int>()
1476 <<
" " << atrlist[
"sector"].data<
int>()
1478 <<
" " << atrlist[
"Ty"].data<
float>()
1480 <<
" " << atrlist[
"phi"].data<
float>()
1482 <<
" " << atrlist[
"psi"].data<
float>() << std::endl;
1486 if (msgLvl(MSG::INFO)){
1487 ATH_MSG_INFO(
"Cannot find " << *it <<
" Container - cannot write DB in text file " );
1488 return StatusCode::FAILURE;
1493 return StatusCode::SUCCESS;
1496 ATH_MSG_DEBUG(
"writeFile: No dynamic Run2 DB structure is present --> skipping writing file " <<
file );
1497 return StatusCode::SUCCESS;
1512 std::string key=
"/TRT/AlignL1/TRT";
1513 ATH_MSG_DEBUG(
" Identifier is valid: "<< ident.is_valid() );
1514 int bec=
m_trtid->barrel_ec(ident);
1515 const unsigned int DBident=1000+bec*100;
1518 if (StatusCode::SUCCESS==
m_detStore->retrieve(atrlistcol1,key)) {
1521 if (atrlistcol1!=
nullptr){
1524 const coral::AttributeList& atrlist=citr->second;
1525 coral::AttributeList& atrlist2 =
const_cast<coral::AttributeList&
>(atrlist);
1527 if(citr->first!=DBident){
1528 ATH_MSG_DEBUG(
"tweakGlobalFolder fails due to identifier mismatch" );
1532 ATH_MSG_DEBUG(
"Tweak Old global DB -- channel: " << citr->first
1533 <<
" ,bec: " << atrlist2[
"bec"].data<
int>()
1534 <<
" ,layer: " << atrlist2[
"layer"].data<
int>()
1535 <<
" ,sector: " << atrlist2[
"sector"].data<
int>()
1536 <<
" ,Tx: " << atrlist2[
"Tx"].data<
float>()
1537 <<
" ,Ty: " << atrlist2[
"Ty"].data<
float>()
1538 <<
" ,Tz: " << atrlist2[
"Tz"].data<
float>()
1539 <<
" ,phi: " << atrlist2[
"phi"].data<
float>()
1540 <<
" ,theta: " << atrlist2[
"theta"].data<
float>()
1541 <<
" ,psi: " << atrlist2[
"psi"].data<
float>() );
1546 CLHEP::HepRotation oldrotation;
1548 HepGeom::Transform3D oldtransform(oldrotation, oldtranslation);
1556 CLHEP::HepRotation rot=newtrans.getRotation();
1558 eulerangles[0] = rot.getPhi();
1559 eulerangles[1] = rot.getTheta();
1560 eulerangles[2] = rot.getPsi();
1562 atrlist2[
"Tx"].data<
float>() = shift.x();
1563 atrlist2[
"Ty"].data<
float>() = shift.y();
1564 atrlist2[
"Tz"].data<
float>() = shift.z();
1565 atrlist2[
"phi"].data<
float>() = eulerangles[0] ;
1566 atrlist2[
"theta"].data<
float>() = eulerangles[1] ;
1567 atrlist2[
"psi"].data<
float>() = eulerangles[2] ;
1570 ATH_MSG_DEBUG(
"Tweak New global DB -- channel: " << citr->first
1571 <<
" ,bec: " << atrlist2[
"bec"].data<
int>()
1572 <<
" ,layer: " << atrlist2[
"layer"].data<
int>()
1573 <<
" ,sector: " << atrlist2[
"sector"].data<
int>()
1574 <<
" ,Tx: " << atrlist2[
"Tx"].data<
float>()
1575 <<
" ,Ty: " << atrlist2[
"Ty"].data<
float>()
1576 <<
" ,Tz: " << atrlist2[
"Tz"].data<
float>()
1577 <<
" ,phi: " << atrlist2[
"phi"].data<
float>()
1578 <<
" ,theta: " << atrlist2[
"theta"].data<
float>()
1579 <<
" ,psi: " << atrlist2[
"psi"].data<
float>() );
1585 ATH_MSG_ERROR(
"tweakGlobalFolder: cast fails for DBident " << DBident );
1586 return StatusCode::FAILURE;
1590 ATH_MSG_ERROR(
"tweakGlobalFolder: cannot retrieve CondAttrListCollection for key " << key );
1591 return StatusCode::FAILURE;
1594 if (
result)
return StatusCode::SUCCESS;
1595 else return StatusCode::FAILURE;
Scalar phi() const
phi method
Scalar theta() const
theta method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
This is an interface to a tool used to register conditions objects in the Interval of Validity (IOV) ...
defines and typedefs for IOVSvc
#define IOVSVC_CALLBACK_ARGS_P(I, K)
short hand for IOVSvc call back argument list, to be used when access to formal arguments is needed,...
a Service to manage TRT alignment conditions
This is an Identifier helper class for the TRT subdetector.
#define ATLAS_NO_CHECK_FILE_THREAD_SAFETY
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
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.
Virtual base class of TRT readout elements.
virtual const double & strawLength() const =0
Active straw length.
virtual Identifier identify() const override final
identifier of this detector element:
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
std::vector< Amg::Transform3D * > m_amgTransformCache
StatusCode setAlignTransformL1(Identifier ident, const Amg::Transform3D &trans)
set Level 1 AlignableTransform for an identifier
virtual StatusCode initialize()
tool initialize
const TRT_ID * m_trtid
trt id helper
const Amg::Transform3D * getAlignmentTransformL2Ptr(Identifier const &ident) const
get Level L2 Transform for an identifier
ToolHandle< IAthenaOutputStreamTool > m_streamer
OutputStreamTool.
AlignableTransform * getTransPtr(const std::string &key) const
get AlignableTransform pointer for an object key
const Amg::Transform3D * getAlignmentTransformL1Ptr(Identifier const &ident) const
get Level L1 Transform for an identifier
virtual StatusCode finalize()
tool finalize
StatusCode writeGlobalFolderFile(const std::string &file) const
std::vector< std::string > m_alignobjs
folder names
StatusCode tweakAlignTransformL1(Identifier ident, const Amg::Transform3D &trans)
tweak Level 1 AlignableTransform for an identifier
static void printTransform(const std::string &thisName, const Amg::Transform3D &transform)
Output the transform to the cout, for debugging.
StatusCode registerAlignObjects(const std::string &tag, int run1, int event1, int run2, int event2) const
register alignment objects with the IoV service
const Amg::Transform3D getAlignmentTransformL2(Identifier const &ident) const
get Level 2 AlignableTransform for an identifier
StatusCode createAlignObjects() const
Create an empty set of AlignableTransforms for the GeoModel setup.
StatusCode writeStrawAlignTextFile(const std::string &file) const
void printCondObjects() const
Output the conditions objects currently in memory.
StatusCode tweakAlignTransformL3(Identifier ident, Amg::Transform3D trans)
tweak Level 3 AlignableTransform for an identifier
StatusCode writeAlignTextFile(const std::string &file) const
write AlignableTransforms to flat text file
StatusCode readAlignTextFile(const std::string &file)
read AlignableTransforms from text file into TDS
std::string m_alignString
alignment string searched for
ServiceHandle< ITRT_StrawAlignDbSvc > m_trtStrawAlignDbSvc
const Amg::Transform3D * getAlignmentTransformPtr(const Identifier &ident, unsigned int level) const
get Level L2 Transform for an identifier
std::string findkey(const Identifier &ident, const std::string &type) const
Return the object key for a given identifier and data type.
StatusCode tweakAlignTransformL2(Identifier ident, const Amg::Transform3D &trans)
tweak Level 2 AlignableTransform for an identifier
const Amg::Transform3D getAlignmentTransform(const Identifier &ident, unsigned int level) const
get AlignableTransform for an identifier
std::string m_par_alitextfile
input text file
const AlignableTransformContainer * getContainer() const
Return the container.
StatusCode setAlignTransformL3(Identifier ident, Amg::Transform3D trans)
set Level 3 AlignableTransform for an identifier
virtual ~TRT_AlignDbSvc()
destructor
const Amg::Transform3D getAlignmentTransformL1(Identifier const &ident) const
get Level 1 AlignableTransform for an identifier
StatusCode setAlignTransformL2(Identifier ident, Amg::Transform3D trans)
set Level 2 AlignableTransform for an identifier
StatusCode setAlignTransform(Identifier ident, Amg::Transform3D trans, unsigned int level)
set AlignableTransform for an identifier
static std::string intToString(int input)
Convert from an int to a string.
const InDetDD::TRT_DetectorManager * m_trtman
detector manager
static std::string prefixtag(const std::string &key)
Return the prefix tag for a given calibration folder.
static int getRingForStrawLayer(int strawlayer)
Returns the ring for a given strawLayer.
StatusCode streamOutAlignObjects() const
write the alignment objects to output
const AlignableTransform * cgetTransPtr(const std::string &key) const
get const AlignableTransform pointer for an object key
ServiceHandle< StoreGateSvc > m_detStore
std::vector< int > m_alignchans
channels
const DataHandle< AlignableTransformContainer > m_aligncontainerhandle
StatusCode tweakGlobalFolder(Identifier ident, const Amg::Transform3D &trans)
tweak L1 DB for global folders for an identifier
std::string m_alignDBprefix
TRT_AlignDbSvc(const std::string &name, ISvcLocator *pSvcLocator)
constructor
StatusCode tweakAlignTransform(Identifier ident, Amg::Transform3D trans, unsigned int level)
tweak AlignableTransform for an identifier
StatusCode createAlignObjectsWhichDoNotAlreadyExist()
Create an empty set of AlignableTransforms for the transforms which are not created by XXXXXXX from t...
bool isOldKey(const std::string &input) const
Returns the true if the input key is from the old endcap scheme.
StatusCode IOVCallBack(IOVSVC_CALLBACK_ARGS)
Call back function for alignment folders.
std::string m_alignroot
root alignment folder
std::string find(const std::string &s)
return a remapped string
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
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