|
ATLAS Offline Software
|
#include <InDetAlignDBTool.h>
|
| InDetAlignDBTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~InDetAlignDBTool () |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
virtual void | createDB () const override |
|
virtual void | dispGroup (const int dettype, const int bec, const int layer, const int ring, const int sector, const float rphidisp, const float rdisp, const float zdisp, const int syst, const int level, const int skip) const override |
|
virtual void | writeFile (const bool ntuple, const std::string &file) const override |
|
virtual void | writeIBLDistFile (const std::string &file) const override |
|
virtual void | writeGlobalFolderFile (const std::string &file) const override |
|
virtual void | readTextFile (const std::string &file) const override |
|
virtual void | readNtuple (const std::string &file) const override |
|
virtual bool | idToDetSet (const Identifier ident, int &det, int &bec, int &layer, int &ring, int §or, int &side) const override |
|
virtual std::string | dirkey (const Identifier &, const int) const override |
|
virtual std::string | dirkey (const int, const int, const int, const int) const override |
|
virtual std::string | dirkey (const int, const int, const int, const int, const int) const override |
|
virtual std::string | DBMkey (const int, const int, const int, const int) const override |
|
virtual bool | setTrans (const Identifier &ident, const int level, const Amg::Transform3D &trans) const override |
|
virtual bool | setTrans (const Identifier &ident, const int level, const Amg::Vector3D &translate, double alpha, double beta, double gamma) const override |
|
virtual bool | tweakTrans (const Identifier &ident, const int level, const Amg::Transform3D &trans) const override |
|
virtual bool | tweakTrans (const Identifier &ident, const int level, const Amg::Vector3D &translate, double alpha, double beta, double gamma) const override |
|
virtual bool | tweakIBLDist (const int, const float) const override |
| This is the tweak function for the IBLDist DB. More...
|
|
virtual bool | tweakGlobalFolder (const Identifier &ident, const int level, const Amg::Transform3D &trans) const |
| This is the tweak function for the GlobalFolder DB. More...
|
|
virtual Identifier | getL1L2fromL3Identifier (const Identifier &ident, const int &level) const override |
| convert L3 module identifier to L1 or L2 More...
|
|
virtual Amg::Transform3D | getTransL123 (const Identifier &ident) const override |
| get cumulative L1, L2, L3 trafo for (L3-) module. More...
|
|
virtual Amg::Transform3D | getTrans (const Identifier &ident, const int level) const override |
| return value of particular transform specified by identifier and level calculates L1 and L2 identifiers automatically by getL1L2fromL3Identifier if L3 identifier passed. More...
|
|
virtual StatusCode | outputObjs () override |
|
virtual void | fillDB (const std::string &tag, const unsigned int run1, const unsigned int event1, const unsigned int run2, const unsigned int event2) const override |
|
virtual void | printDB (const int level) const override |
|
virtual void | sortTrans () const override |
|
void | extractAlphaBetaGamma (const Amg::Transform3D &trans, double &alpha, double &beta, double &gamma) const override |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
const PixelID * | m_pixid |
|
const SCT_ID * | m_sctid |
|
const InDetDD::PixelDetectorManager * | m_pixman |
|
const InDetDD::SCT_DetectorManager * | m_sctman |
|
std::vector< const InDetDD::SiDetectorManager * > | m_managers |
|
std::vector< std::string > | m_alignobjs |
|
std::vector< int > | m_alignchans |
|
CondAttrListCollection * | m_attrListCollection |
|
bool | m_par_newdb |
|
bool | m_par_scttwoside |
|
int | m_par_fake |
|
ToolHandle< IAthenaOutputStreamTool > | m_par_condstream |
|
Gaudi::Property< std::string > | m_par_dbroot { this, "AlignmentRootFolder", "/Indet/Align", "Root folder for alignment" } |
| name of the root folder for constants, which can be set via the <key> syntax. More...
|
|
std::string | m_par_dbkey |
| the base part of the key for loading AlignableTransform objects from the Transient Data Store. More...
|
|
bool | m_par_oldTextFile |
|
bool | m_dynamicDB |
|
bool | m_forceUserDBConfig |
|
Gaudi::Property< std::string > | m_pixmanName {this, "PixelManager", "Pixel", "Pixel manager name" } |
|
Gaudi::Property< std::string > | m_sctmanName {this, "SCT_Manager", "SCT", "SCT manager name" } |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 53 of file InDetAlignDBTool.h.
◆ StoreGateSvc_t
◆ InDetAlignDBTool()
InDetAlignDBTool::InDetAlignDBTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~InDetAlignDBTool()
InDetAlignDBTool::~InDetAlignDBTool |
( |
| ) |
|
|
virtual |
◆ cgetTransPtr()
◆ createDB()
void InDetAlignDBTool::createDB |
( |
| ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 253 of file InDetAlignDBTool.cxx.
259 ATH_MSG_FATAL(
"Cannot create new database when geometry is faked");
270 ATH_MSG_ERROR(
"createDB: AlignableTransformContainer already exists");
274 ATH_MSG_DEBUG(
"Setup database structures in AlignableTransformContainer");
278 ATH_MSG_DEBUG(
"Setup separate AlignableTransform for each layer");
283 else ATH_MSG_DEBUG(
"Treat both sides of SCT module as single entity" );
308 ATH_MSG_ERROR(
"Could not record AlignableTransformContainer");
313 std::vector<std::string> level2;
320 if (element!=
nullptr) {
332 std::vector<std::string>::const_iterator ix =
find(level2.begin(),level2.end(),
key);
333 if (ix==level2.end()) {
334 level2.push_back(
key);
362 globshift.setIdentity();
384 ATH_MSG_DEBUG(
"Dumping size of created AlignableTransform objects");
◆ DBMkey()
std::string InDetAlignDBTool::DBMkey |
( |
const int |
det, |
|
|
const int |
bec, |
|
|
const int |
level, |
|
|
const int |
sector |
|
) |
| const |
|
overridevirtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ dirkey() [1/3]
◆ dirkey() [2/3]
std::string InDetAlignDBTool::dirkey |
( |
const int |
det, |
|
|
const int |
bec, |
|
|
const int |
layer, |
|
|
const int |
level |
|
) |
| const |
|
overridevirtual |
◆ dirkey() [3/3]
std::string InDetAlignDBTool::dirkey |
( |
const int |
det, |
|
|
const int |
bec, |
|
|
const int |
layer, |
|
|
const int |
level, |
|
|
const int |
sector |
|
) |
| const |
|
overridevirtual |
◆ dispGroup()
void InDetAlignDBTool::dispGroup |
( |
const int |
dettype, |
|
|
const int |
bec, |
|
|
const int |
layer, |
|
|
const int |
ring, |
|
|
const int |
sector, |
|
|
const float |
rphidisp, |
|
|
const float |
rdisp, |
|
|
const float |
zdisp, |
|
|
const int |
syst, |
|
|
const int |
level, |
|
|
const int |
skip |
|
) |
| const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 496 of file InDetAlignDBTool.cxx.
504 SmartIF<IRndmGenSvc> randsvc{Gaudi::svcLocator()->service(
"RndmGenSvc")};
505 if(!randsvc.isValid())
ATH_MSG_ERROR(
"Cannot find RndmGenSvc" );
507 Rndm::Numbers
gauss(randsvc,Rndm::Gauss(0.,1.));
513 float rpd=0,rd=0,zd=0;
515 rpd=rphidisp*
gauss();
520 std::vector<Identifier> lvl12id;
523 for (
int idet=1;idet<3;++idet) {
525 if (element!=
nullptr) {
527 int mdet,mbec,mlayer,mring,msector,mside;
530 if ((dettype==-1 || mdet==dettype) && (
bec==-1 || std::abs(2*mbec)==
bec) &&
531 (
layer==-1 || mlayer==
layer) && (ring==-1 || mring==ring) &&
532 (sector== -1 || msector==sector) && mside==0) {
539 if (dettype!=2 || mside!=1) {
540 if (syst==2 || syst==4 || (syst==6 && mring==-6)) {
541 rpd=rphidisp*
gauss();
545 mlayer <<
" " << mring <<
" z " << zd );
554 if (syst<=2 || syst==6) {
557 float dx=modcent.x();
558 float dy=modcent.y();
576 }
else if (
level==2) {
586 std::vector<Identifier>::const_iterator ix=
587 find(lvl12id.begin(),lvl12id.end(),ident2);
588 if (ix==lvl12id.end()) {
589 lvl12id.push_back(ident2);
601 std::vector<Identifier>::const_iterator ix=
602 find(lvl12id.begin(),lvl12id.end(),ident2);
603 if (ix==lvl12id.end()) {
604 lvl12id.push_back(ident2);
615 <<
"," << mlayer <<
"," << mring <<
"," << msector <<
" to xyz" <<
616 xd <<
"," << yd <<
"," << zd );
626 ATH_MSG_DEBUG(
"Added displacement to " << nmod <<
" modules " << dettype <<
","
627 <<
bec <<
"," <<
layer <<
" [" << rphidisp <<
"," << rdisp
628 <<
"," << zdisp <<
"]"
629 <<
" type " << syst );
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extractAlphaBetaGamma()
void InDetAlignDBTool::extractAlphaBetaGamma |
( |
const Amg::Transform3D & |
trans, |
|
|
double & |
alpha, |
|
|
double & |
beta, |
|
|
double & |
gamma |
|
) |
| const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 1424 of file InDetAlignDBTool.cxx.
1427 double siny = trans(0,2);
1435 if ((trans(1,2) == 0) && (trans(2,2) == 0)) {
1439 alpha = atan2(trans(1,1),trans(2,1));
1441 alpha = atan2(-trans(1,2),trans(2,2));
1442 gamma = atan2(-trans(0,1),trans(0,0));
1443 if (alpha == 0) alpha = 0;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ fakeGeom()
void InDetAlignDBTool::fakeGeom |
( |
const int |
nbpix, |
|
|
const int |
necpix, |
|
|
const int |
nbsct, |
|
|
const int |
necsct |
|
) |
| |
|
private |
Definition at line 1356 of file InDetAlignDBTool.cxx.
1369 if (nbpix!=0 || necpix!=0) {
1376 for (
int i=0;
i<necpix;++
i) {
1381 for (
int i=0;
i<nbpix;++
i) {
1386 for (
int i=0;
i<necpix;++
i) {
1391 if (nbsct!=0 || necsct!=0) {
1397 for (
int i=0;
i<necsct;++
i) {
1402 for (
int i=0;
i<nbsct;++
i) {
1407 for (
int i=0;
i<necsct;++
i) {
◆ fillDB()
void InDetAlignDBTool::fillDB |
( |
const std::string & |
tag, |
|
|
const unsigned int |
run1, |
|
|
const unsigned int |
event1, |
|
|
const unsigned int |
run2, |
|
|
const unsigned int |
event2 |
|
) |
| const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 1231 of file InDetAlignDBTool.cxx.
1240 SmartIF<IIOVRegistrationSvc> regsvc{Gaudi::svcLocator()->service(
"IOVRegistrationSvc")};
1241 if (!regsvc.isValid()) {
1248 if (StatusCode::SUCCESS==regsvc->registerIOV(
1257 for (std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
1259 if (StatusCode::SUCCESS==regsvc->registerIOV(
"AlignableTransform",
1261 ATH_MSG_DEBUG(
"Stored AlignableTransform object " << *iobj );
1264 ATH_MSG_ERROR(
"Failed (registerIOV) to store object " << *iobj );
1268 ATH_MSG_DEBUG(
" Written " << nobj <<
" AlignableTransform objects to conditions database" );
◆ finalize()
StatusCode InDetAlignDBTool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getL1L2fromL3Identifier()
convert L3 module identifier to L1 or L2
< no translation needed
check whether PIX
< Whole pixel det. at L1
check whether SCT
< barrel + 2 x EC at L1
< take care of the case where level != 1,2,3 or ident neither pix nor sct
Implements IInDetAlignDBTool.
Definition at line 1101 of file InDetAlignDBTool.cxx.
◆ getTrans()
return value of particular transform specified by identifier and level calculates L1 and L2 identifiers automatically by getL1L2fromL3Identifier if L3 identifier passed.
return value of particular transform specified by identifier and level calculates L1 and L2 identifiers automatically by getL1L2fromL3Identifier if L3 identifier passed
L1, L2 are in global, L3 in local frame.
Implements IInDetAlignDBTool.
Definition at line 1156 of file InDetAlignDBTool.cxx.
◆ getTransL123()
get cumulative L1, L2, L3 trafo for (L3-) module.
get cumulative L1, L2, L3 trafo for (L3-) module
Result is in local frame.
Implements IInDetAlignDBTool.
Definition at line 1132 of file InDetAlignDBTool.cxx.
1140 ATH_MSG_ERROR(
"getTransL123(): Module not found in PIX or SCT!" );
1146 ATH_MSG_FATAL(
"Code needs to corrected otherwise you will get nonsensical results-- IndetAlignDBTool:2060");
1149 result = trfL1 * trfL2 * trfL3 ;
◆ getTransPtr()
◆ idToDetSet()
bool InDetAlignDBTool::idToDetSet |
( |
const Identifier |
ident, |
|
|
int & |
det, |
|
|
int & |
bec, |
|
|
int & |
layer, |
|
|
int & |
ring, |
|
|
int & |
sector, |
|
|
int & |
side |
|
) |
| const |
|
overridevirtual |
◆ initialize()
StatusCode InDetAlignDBTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 92 of file InDetAlignDBTool.cxx.
104 return StatusCode::FAILURE;
139 ATH_MSG_FATAL(
"Pixel and SCT Managers have different alignfolder type registered --> Check ");
140 return StatusCode::FAILURE;
148 return StatusCode::FAILURE;
153 return StatusCode::FAILURE;
166 int TransfLevel_low = 0;
170 std::string man_name;
174 if (element!=
nullptr) {
178 std::string
level[3];
179 for (
int i=TransfLevel_low;
i<3;++
i) {
182 std::vector<std::string>::const_iterator ix=
191 ATH_MSG_ERROR(
"Si detector element type " << idet <<
" has no detset conversion" );
198 ATH_MSG_INFO(
"Geometry initialisation sees " << ndet[0] <<
199 " pixel and " << ndet[1] <<
" SCT modules giving " <<
m_alignobjs.size()
200 <<
" alignment keys" );
205 " pixel and " << ndet[1] <<
" SCT modules giving " <<
m_alignobjs.size()
206 <<
" alignment keys" );
213 ATH_MSG_DEBUG(
"Assuming new COOL alignment DB model based on AlignableTransformContainer");
216 ATH_MSG_DEBUG(
"Assuming old (Lisbon) alignment DB model based on separate AlignableTransforms");
223 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
224 spec->extend(
"stave",
"int");
225 spec->extend(
"eta",
"int");
226 spec->extend(
"mag",
"float");
227 spec->extend(
"base",
"float");
228 spec->extend(
"free",
"float");
230 const int ibl_stave_max = 14;
232 for (
int this_stave=0; this_stave<ibl_stave_max; this_stave++){
236 atrlist[
"stave" ].data<
int>()=this_stave;
237 atrlist[
"eta" ].data<
int>()=0;
238 atrlist[
"mag" ].data<
float>()=0;
239 atrlist[
"base" ].data<
float>()=0;
240 atrlist[
"free" ].data<
float>()=0;
244 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
const InterfaceID & IInDetAlignDBTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ outputObjs()
StatusCode InDetAlignDBTool::outputObjs |
( |
| ) |
|
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 1169 of file InDetAlignDBTool.cxx.
1176 return StatusCode::FAILURE;
1208 ATH_MSG_DEBUG(
"starting to register typeKey for IBLDist" );
1211 typekeys_IBLDist[0] = pair;
1214 if (StatusCode::SUCCESS!=
m_par_condstream->streamObjects(typekeys_IBLDist)) {
1216 return StatusCode::FAILURE;
1228 return StatusCode::SUCCESS;
◆ printDB()
void InDetAlignDBTool::printDB |
( |
const int |
level | ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 1271 of file InDetAlignDBTool.cxx.
1275 for (std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
1282 cit!=
pat->end();++cit) {
1293 "," << ring <<
"," << sector <<
"," <<
side <<
"] Trans:(" <<
1294 shift.x() <<
"," << shift.y() <<
"," << shift.z() <<
") Rot:{"
1295 << alpha <<
"," <<
beta <<
"," <<
gamma <<
"}");
1302 ATH_MSG_DEBUG(
"Object contains " << nobj <<
" transforms" );
1304 ATH_MSG_ERROR(
"AlignableTransform " << *iobj <<
" not found" );
◆ readNtuple()
void InDetAlignDBTool::readNtuple |
( |
const std::string & |
file | ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 956 of file InDetAlignDBTool.cxx.
957 ATH_MSG_DEBUG(
"readNtuple - set alignment constants from ntuple path: " <<
file );
958 SmartIF<INTupleSvc> ntsvc{Gaudi::svcLocator()->service(
"NTupleSvc")};
959 if(!ntsvc.isValid())
ATH_MSG_ERROR(
"Cannot find NTupleSvc" );
960 const std::string
path=
file+
"/9002";
961 NTuplePtr
nt(ntsvc.get(),
path);
979 "Error booking ntuple 9002 contents" );
981 while (
nt->read().isSuccess()) {
993 Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
1001 ATH_MSG_DEBUG(
"Read " << ntrans <<
" transforms from ntuple");
◆ readTextFile()
void InDetAlignDBTool::readTextFile |
( |
const std::string & |
file | ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 833 of file InDetAlignDBTool.cxx.
836 ATH_MSG_DEBUG(
"readTextFile - set alignment constants from text file: " <<
file );
848 std::string channelName;
853 std::getline(
infile, tmpline);
857 if ((tmpline.substr(0,2) ==
"//") || (tmpline.substr(0,1) ==
"#"))
continue;
859 std::istringstream instring(tmpline);
864 if (tmpstr.empty())
continue;
866 if (tmpstr[0] ==
'/') {
868 channelName = tmpstr;
869 ATH_MSG_DEBUG(
"Read in AlignableTransform data, key " << channelName );
873 ATH_MSG_ERROR(
"Cannot find AlignableTransform object for key"
887 std::istringstream datastream(tmpline);
894 if (datastream.fail()) {
905 }
else if (dettype==2) {
911 if (!
ident.is_valid()) {
914 phiModule <<
"," << etaModule <<
"," <<
side <<
"] key " << channelName <<
915 " shift [" <<
dx <<
"," <<
dy <<
"," << dz <<
"]" );
922 Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
934 while ((itr->identify()!=
ident) && (itr!=pat2->
mend())) ++itr;
935 if (itr!=pat2->
mend()) {
944 " shift [" <<
dx <<
"," <<
dy <<
"," << dz <<
"]" );
952 ATH_MSG_DEBUG(
"Read " << nobj <<
" objects from file with " << ntrans <<
" transforms" );
◆ renounce()
◆ renounceArray()
◆ setTrans() [1/2]
◆ setTrans() [2/2]
◆ sortTrans()
void InDetAlignDBTool::sortTrans |
( |
| ) |
const |
|
overridevirtual |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ tweakGlobalFolder()
This is the tweak function for the GlobalFolder DB.
Definition at line 1496 of file InDetAlignDBTool.cxx.
1506 const unsigned int DBident=
det*10000+2*
bec*1000+
layer*100+ring*10+sector;
1513 if (atrlistcol2!=
nullptr){
1519 if(citr->first!=DBident)
continue;
1521 msg(
MSG::DEBUG) <<
"Tweak Old global DB -- channel: " << citr->first
1522 <<
" ,det: " << atrlist2[
"det"].data<
int>()
1523 <<
" ,bec: " << atrlist2[
"bec"].data<int>()
1524 <<
" ,layer: " << atrlist2[
"layer"].data<
int>()
1525 <<
" ,ring: " << atrlist2[
"ring"].data<int>()
1526 <<
" ,sector: " << atrlist2[
"sector"].data<
int>()
1527 <<
" ,Tx: " << atrlist2[
"Tx"].data<float>()
1528 <<
" ,Ty: " << atrlist2[
"Ty"].data<
float>()
1529 <<
" ,Tz: " << atrlist2[
"Tz"].data<float>()
1530 <<
" ,Rx: " << atrlist2[
"Rx"].data<
float>()
1531 <<
" ,Ry: " << atrlist2[
"Ry"].data<float>()
1532 <<
" ,Rz: " << atrlist2[
"Rz"].data<
float>() <<
endmsg;
1536 Amg::Translation3D oldtranslation(atrlist2[
"Tx"].data<float>(),atrlist2[
"Ty"].data<float>(),atrlist2[
"Tz"].data<float>());
1537 Amg::Transform3D oldtrans = oldtranslation * Amg::RotationMatrix3D::Identity();
1550 atrlist2[
"Tx"].data<
float>() = shift.x();
1551 atrlist2[
"Ty"].data<
float>() = shift.y();
1552 atrlist2[
"Tz"].data<
float>() = shift.z();
1553 atrlist2[
"Rx"].data<
float>() = alpha/
CLHEP::mrad ;
1558 msg(
MSG::DEBUG) <<
"Tweak New global DB -- channel: " << citr->first
1559 <<
" ,det: " << atrlist2[
"det"].data<
int>()
1560 <<
" ,bec: " << atrlist2[
"bec"].data<int>()
1561 <<
" ,layer: " << atrlist2[
"layer"].data<
int>()
1562 <<
" ,ring: " << atrlist2[
"ring"].data<int>()
1563 <<
" ,sector: " << atrlist2[
"sector"].data<
int>()
1564 <<
" ,Tx: " << atrlist2[
"Tx"].data<float>()
1565 <<
" ,Ty: " << atrlist2[
"Ty"].data<
float>()
1566 <<
" ,Tz: " << atrlist2[
"Tz"].data<float>()
1567 <<
" ,Rx: " << atrlist2[
"Rx"].data<
float>()
1568 <<
" ,Ry: " << atrlist2[
"Ry"].data<float>()
1569 <<
" ,Rz: " << atrlist2[
"Rz"].data<
float>() <<
endmsg;
1575 ATH_MSG_ERROR(
"tweakGlobalFolder: cast fails for DBident " << DBident );
1580 ATH_MSG_ERROR(
"tweakGlobalFolder: cannot retrieve CondAttrListCollection for key " <<
key );
◆ tweakIBLDist()
bool InDetAlignDBTool::tweakIBLDist |
( |
const int |
stave, |
|
|
const float |
bowx |
|
) |
| const |
|
overridevirtual |
This is the tweak function for the IBLDist DB.
Implements IInDetAlignDBTool.
Definition at line 1449 of file InDetAlignDBTool.cxx.
1455 if (StatusCode::SUCCESS==
detStore()->
retrieve(atrlistcol1,
"/Indet/IBLDist")) {
1458 if (atrlistcol2!=
nullptr){
1464 if(atrlist2[
"stave"].data<int>()!=stave)
continue;
1466 msg(
MSG::DEBUG) <<
"IBLDist DB -- channel before update: " << citr->first
1467 <<
" ,stave: " << atrlist2[
"stave"].data<
int>()
1468 <<
" ,mag: " << atrlist2[
"mag"].data<float>()
1469 <<
" ,base: " << atrlist2[
"base"].data<
float>() <<
endmsg;
1471 atrlist2[
"mag"].data<
float>() += bowx;
1473 msg(
MSG::DEBUG) <<
"IBLDist DB -- channel after update: " << citr->first
1474 <<
" ,stave: " << atrlist2[
"stave"].data<
int>()
1475 <<
" ,mag: " << atrlist2[
"mag"].data<float>()
1476 <<
" ,base: " << atrlist2[
"base"].data<
float>() <<
endmsg;
1482 ATH_MSG_ERROR(
"tweakIBLDist: cast fails for stave " << stave );
1487 ATH_MSG_ERROR(
"tweakIBLDist: cannot retrieve CondAttrListCollection for key /Indet/IBLDist" );
◆ tweakTrans() [1/2]
◆ tweakTrans() [2/2]
◆ updateVHKA()
◆ writeFile()
void InDetAlignDBTool::writeFile |
( |
const bool |
ntuple, |
|
|
const std::string & |
file |
|
) |
| const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 632 of file InDetAlignDBTool.cxx.
634 std::ofstream*
outfile=
nullptr;
635 SmartIF<INTupleSvc> ntsvc{Gaudi::svcLocator()->service(
"NTupleSvc")};
636 if(!ntsvc.isValid())
ATH_MSG_ERROR(
"Cannot find NTupleSvc" );
637 const std::string
path=
file+
"/9002";
638 NTuplePtr
nt(ntsvc.get(),
path);
641 ATH_MSG_DEBUG(
"writeFile: Write AlignableTransforms on ntuple 9002, path: " <<
file );
647 nt=ntsvc->book(
file,ntid,CLID_ColumnWiseTuple,
"AlignDB");
668 "Error booking ntuple 9002 contents" );
675 for (std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
680 if (!ntuple) *
outfile << *iobj << std::endl;
682 cit!=
pat->end();++cit) {
718 std::string r3=iobj->substr(iobj->size()-3,3);
720 if (r3==
"SCT" || r3==
"PIX")
nt_level=2;
731 if (StatusCode::SUCCESS!=
nt->write())
ATH_MSG_ERROR(
"Problem filling ntuple 9002" );
734 " " << ring <<
" " <<
side <<
" " <<
dx <<
" " <<
dy <<
" "
748 ATH_MSG_DEBUG(
"Written " << nobj <<
" AlignableTransform objects" <<
" with " << ntrans <<
" transforms to text file" );
◆ writeGlobalFolderFile()
void InDetAlignDBTool::writeGlobalFolderFile |
( |
const std::string & |
file | ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 784 of file InDetAlignDBTool.cxx.
786 std::ofstream*
outfile=
nullptr;
791 std::vector<std::string> folder_list = {
"/Indet/AlignL1/ID",
"/Indet/AlignL2/PIX",
"/Indet/AlignL2/SCT"};
803 *
outfile << atrlist[
"subsystem"].data<
int>()
804 <<
" " << atrlist[
"det"].data<int>()
805 <<
" " << atrlist[
"bec"].data<
int>()
806 <<
" " << atrlist[
"layer"].data<int>()
807 <<
" " << atrlist[
"ring"].data<
int>()
808 <<
" " << atrlist[
"sector"].data<int>()
809 <<
" " << atrlist[
"side"].data<
int>()
810 <<
" " << atrlist[
"Tx"].data<float>()
811 <<
" " << atrlist[
"Ty"].data<
float>()
812 <<
" " << atrlist[
"Tz"].data<float>()
813 <<
" " << atrlist[
"Rx"].data<
float>()
814 <<
" " << atrlist[
"Ry"].data<float>()
815 <<
" " << atrlist[
"Rz"].data<
float>() << std::endl;
820 msg(MSG::INFO) <<
"Cannot find " << *
it <<
" Container - cannot write DB in text file " <<
endmsg;
827 ATH_MSG_DEBUG(
"writeFile: No dynamic Run2 DB structure is present --> skipping writing file " <<
file );
◆ writeIBLDistFile()
void InDetAlignDBTool::writeIBLDistFile |
( |
const std::string & |
file | ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 752 of file InDetAlignDBTool.cxx.
754 std::ofstream*
outfile=
nullptr;
758 *
outfile <<
"/Indet/IBLDist" << std::endl;
761 if (StatusCode::SUCCESS==
detStore()->
retrieve(atrlistcol,
"/Indet/IBLDist")) {
766 *
outfile << citr->first <<
" " << atrlist[
"stave"].data<
int>()
767 <<
" " << atrlist[
"eta"].data<int>()
768 <<
" " << atrlist[
"mag"].data<
float>()
769 <<
" " << atrlist[
"base"].data<float>() << std::endl;
774 msg(MSG::INFO) <<
"Cannot find IBLDist Container - cannot write IBLDist DB in text file " <<
endmsg;
◆ m_alignchans
std::vector<int> InDetAlignDBTool::m_alignchans |
|
private |
◆ m_alignobjs
std::vector<std::string> InDetAlignDBTool::m_alignobjs |
|
private |
◆ m_attrListCollection
◆ m_detStore
◆ m_dynamicDB
bool InDetAlignDBTool::m_dynamicDB |
|
private |
◆ m_evtStore
◆ m_forceUserDBConfig
bool InDetAlignDBTool::m_forceUserDBConfig |
|
private |
◆ m_managers
◆ m_par_condstream
◆ m_par_dbkey
std::string InDetAlignDBTool::m_par_dbkey |
|
private |
◆ m_par_dbroot
Gaudi::Property<std::string> InDetAlignDBTool::m_par_dbroot { this, "AlignmentRootFolder", "/Indet/Align", "Root folder for alignment" } |
|
private |
name of the root folder for constants, which can be set via the <key> syntax.
Default: /Indet/Align.
Definition at line 198 of file InDetAlignDBTool.h.
◆ m_par_fake
int InDetAlignDBTool::m_par_fake |
|
private |
◆ m_par_newdb
bool InDetAlignDBTool::m_par_newdb |
|
private |
◆ m_par_oldTextFile
bool InDetAlignDBTool::m_par_oldTextFile |
|
private |
◆ m_par_scttwoside
bool InDetAlignDBTool::m_par_scttwoside |
|
private |
◆ m_pixid
◆ m_pixman
◆ m_pixmanName
Gaudi::Property<std::string> InDetAlignDBTool::m_pixmanName {this, "PixelManager", "Pixel", "Pixel manager name" } |
|
private |
◆ m_sctid
◆ m_sctman
◆ m_sctmanName
Gaudi::Property<std::string> InDetAlignDBTool::m_sctmanName {this, "SCT_Manager", "SCT", "SCT manager name" } |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
bool is_pixel(Identifier id) const
const_iterator end() const
Const iterator class for DataVector/DataList.
path
python interpreter configuration --------------------------------------—
Scalar phi() const
phi method
std::string find(const std::string &s)
return a remapped string
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)
A CondMultChanCollection is a template class which can hold a collection of T* objects which are inte...
Scalar theta() const
theta method
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int phi_module(const Identifier &id) const
#define ATH_MSG_VERBOSE(x)
This class is a collection of AttributeLists where each one is associated with a channel number....
virtual 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.
virtual void setOwner(IDataHandleHolder *o)=0
virtual const SiDetectorElementCollection * getDetectorElementCollection() const override
access to whole collectiom
virtual const SiDetectorElementCollection * getDetectorElementCollection() const override
access to whole collection via Iterators
(Non-const) Iterator class for DataVector/DataList.
::StatusCode StatusCode
StatusCode definition for legacy code.
Eigen::Affine3d Transform3D
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void add(ChanNum chanNum)
Adding in channel numbers.
int layer_disk(const Identifier &id) const
int eta_module(const Identifier &id) const
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
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
#define ATH_MSG_WARNING(x)
ChanAttrListMap::const_iterator const_iterator
Amg::Transform3D CLHEPTransformToEigen(const HepGeom::Transform3D &CLHEPtransf)
Converts a CLHEP-based HepGeom::Transform3D into an Eigen Amg::Transform3D.
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
int eta_module(const Identifier &id) const
Eigen::Translation< double, 3 > Translation3D
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AlignFolderType m_alignfoldertype
int side(const Identifier &id) const
Eigen::AngleAxisd AngleAxis3D
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
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier