 |
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, V, H > &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 |
|
|
AlignableTransform * | getTransPtr (const std::string &key) const |
|
const AlignableTransform * | cgetTransPtr (const std::string &key) const |
|
void | fakeGeom (const int nbpix, const int necpix, const int nbsct, const int necsct) |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
const PixelID * | m_pixid {} |
|
const SCT_ID * | m_sctid {} |
|
const InDetDD::PixelDetectorManager * | m_pixman {} |
|
const InDetDD::SCT_DetectorManager * | m_sctman {} |
|
bool | m_dynamicDB {false} |
|
std::vector< const InDetDD::SiDetectorManager * > | m_managers |
|
std::vector< std::string > | m_alignobjs |
|
std::vector< int > | m_alignchans |
|
CondAttrListCollection * | m_attrListCollection {} |
|
std::string | m_par_dbkey |
|
Gaudi::Property< bool > | m_par_newdb {this, "NewDB", true, "create database using new (collection) format"} |
|
Gaudi::Property< bool > | m_par_scttwoside {this, "SCTTwoSide", false, "create structures with separated SCT module sides"} |
|
Gaudi::Property< int > | m_par_fake {this, "FakeDB", 0, "set to 1 to fake full ATLAS geom, 2 to fake CTB geom"} |
|
ToolHandle< IAthenaOutputStreamTool > | m_par_condstream {this, "CondStream", "AthenaOutputStreamTool/AthenaOutputStreamTool"} |
|
Gaudi::Property< std::string > | m_par_dbroot { this, "DBRoot", "/Indet/Align", "Root folder for alignment" } |
| name of the root folder for constants, which can be set via the <key> syntax. More...
|
|
Gaudi::Property< bool > | m_par_oldTextFile {this, "OldTextFile", false, "Input text file using old format"} |
|
Gaudi::Property< bool > | m_forceUserDBConfig {this, "forceUserDBConfig", false, "Set to true to override any DB auto-configuration"} |
|
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" } |
|
Gaudi::Property< bool > | m_doPix {this, "AlignPixel", true, "Include Pixel" } |
|
Gaudi::Property< bool > | m_doStrip {this, "AlignStrip", true, "Include SCT/ITkStrip" } |
|
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 233 of file InDetAlignDBTool.cxx.
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) {
311 std::vector<std::string>::const_iterator ix =
find(level2.begin(),level2.end(),
key);
312 if (ix==level2.end()) {
313 level2.push_back(
key);
341 globshift.setIdentity();
363 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 477 of file InDetAlignDBTool.cxx.
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.));
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;
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();
557 }
else if (
level==2) {
567 std::vector<Identifier>::const_iterator ix=
568 find(lvl12id.begin(),lvl12id.end(),ident2);
569 if (ix==lvl12id.end()) {
570 lvl12id.push_back(ident2);
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");
608 <<
bec <<
"," <<
layer <<
" [" << rphidisp <<
"," << rdisp
609 <<
"," << zdisp <<
"]"
610 <<
" 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 1408 of file InDetAlignDBTool.cxx.
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));
◆ 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 1340 of file InDetAlignDBTool.cxx.
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) {
◆ 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 1215 of file InDetAlignDBTool.cxx.
1224 SmartIF<IIOVRegistrationSvc> regsvc{Gaudi::svcLocator()->service(
"IOVRegistrationSvc")};
1225 if (!regsvc.isValid()) {
1232 if (StatusCode::SUCCESS==regsvc->registerIOV(
1241 for (std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
1243 if (StatusCode::SUCCESS==regsvc->registerIOV(
"AlignableTransform",
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" );
◆ 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 1085 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 1140 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 1116 of file InDetAlignDBTool.cxx.
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 ;
◆ 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 70 of file InDetAlignDBTool.cxx.
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;
150 std::string man_name;
154 if (element!=
nullptr) {
158 std::string
level[3];
159 for (
int i=TransfLevel_low;
i<3;++
i) {
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++){
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;
◆ 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 1153 of file InDetAlignDBTool.cxx.
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;
◆ printDB()
void InDetAlignDBTool::printDB |
( |
const int |
level | ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 1255 of file InDetAlignDBTool.cxx.
1259 for (std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
1266 cit!=
pat->end();++cit) {
1277 "," << ring <<
"," << sector <<
"," <<
side <<
"] Trans:(" <<
1278 shift.x() <<
"," << shift.y() <<
"," << shift.z() <<
") Rot:{"
1286 ATH_MSG_DEBUG(
"Object contains " << nobj <<
" transforms" );
1288 ATH_MSG_ERROR(
"AlignableTransform " << *iobj <<
" not found" );
◆ readNtuple()
void InDetAlignDBTool::readNtuple |
( |
const std::string & |
file | ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 940 of file InDetAlignDBTool.cxx.
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");
◆ readTextFile()
void InDetAlignDBTool::readTextFile |
( |
const std::string & |
file | ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 817 of file InDetAlignDBTool.cxx.
820 ATH_MSG_DEBUG(
"readTextFile - set alignment constants from text file: " <<
file );
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);
878 if (datastream.fail()) {
889 }
else if (dettype==2) {
895 if (!
ident.is_valid()) {
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" );
◆ 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 1480 of file InDetAlignDBTool.cxx.
1490 const unsigned int DBident=
det*10000+2*
bec*1000+
layer*100+ring*10+sector;
1497 if (atrlistcol2!=
nullptr){
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>()
1511 <<
" ,Tx: " << atrlist2[
"Tx"].data<float>()
1512 <<
" ,Ty: " << atrlist2[
"Ty"].data<
float>()
1513 <<
" ,Tz: " << atrlist2[
"Tz"].data<float>()
1514 <<
" ,Rx: " << atrlist2[
"Rx"].data<
float>()
1515 <<
" ,Ry: " << atrlist2[
"Ry"].data<float>()
1516 <<
" ,Rz: " << atrlist2[
"Rz"].data<
float>() <<
endmsg;
1520 Amg::Translation3D oldtranslation(atrlist2[
"Tx"].data<float>(),atrlist2[
"Ty"].data<float>(),atrlist2[
"Tz"].data<float>());
1521 Amg::Transform3D oldtrans = oldtranslation * Amg::RotationMatrix3D::Identity();
1534 atrlist2[
"Tx"].data<
float>() = shift.x();
1535 atrlist2[
"Ty"].data<
float>() = shift.y();
1536 atrlist2[
"Tz"].data<
float>() = shift.z();
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>()
1548 <<
" ,Tx: " << atrlist2[
"Tx"].data<float>()
1549 <<
" ,Ty: " << atrlist2[
"Ty"].data<
float>()
1550 <<
" ,Tz: " << atrlist2[
"Tz"].data<float>()
1551 <<
" ,Rx: " << atrlist2[
"Rx"].data<
float>()
1552 <<
" ,Ry: " << atrlist2[
"Ry"].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 );
◆ 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 1433 of file InDetAlignDBTool.cxx.
1439 if (StatusCode::SUCCESS==
detStore()->
retrieve(atrlistcol1,
"/Indet/IBLDist")) {
1442 if (atrlistcol2!=
nullptr){
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>()
1452 <<
" ,mag: " << atrlist2[
"mag"].data<float>()
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>()
1459 <<
" ,mag: " << atrlist2[
"mag"].data<float>()
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" );
◆ 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 613 of file InDetAlignDBTool.cxx.
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");
649 "Error booking ntuple 9002 contents" );
656 for (std::vector<std::string>::const_iterator iobj=
m_alignobjs.begin();
661 if (!ntuple) *
outfile << *iobj << std::endl;
663 cit!=
pat->end();++cit) {
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" );
716 " " << ring <<
" " <<
side <<
" " <<
dx <<
" " <<
dy <<
" "
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" );
◆ writeGlobalFolderFile()
void InDetAlignDBTool::writeGlobalFolderFile |
( |
const std::string & |
file | ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 768 of file InDetAlignDBTool.cxx.
770 std::ofstream*
outfile=
nullptr;
775 std::vector<std::string> folder_list = {
"/Indet/AlignL1/ID",
"/Indet/AlignL2/PIX",
"/Indet/AlignL2/SCT"};
787 *
outfile << atrlist[
"subsystem"].data<
int>()
788 <<
" " << atrlist[
"det"].data<int>()
789 <<
" " << atrlist[
"bec"].data<
int>()
790 <<
" " << atrlist[
"layer"].data<int>()
791 <<
" " << atrlist[
"ring"].data<
int>()
792 <<
" " << atrlist[
"sector"].data<int>()
793 <<
" " << atrlist[
"side"].data<
int>()
794 <<
" " << atrlist[
"Tx"].data<float>()
795 <<
" " << atrlist[
"Ty"].data<
float>()
796 <<
" " << atrlist[
"Tz"].data<float>()
797 <<
" " << atrlist[
"Rx"].data<
float>()
798 <<
" " << atrlist[
"Ry"].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 );
◆ writeIBLDistFile()
void InDetAlignDBTool::writeIBLDistFile |
( |
const std::string & |
file | ) |
const |
|
overridevirtual |
Implements IInDetAlignDBTool.
Definition at line 736 of file InDetAlignDBTool.cxx.
738 std::ofstream*
outfile=
nullptr;
742 *
outfile <<
"/Indet/IBLDist" << std::endl;
745 if (StatusCode::SUCCESS==
detStore()->
retrieve(atrlistcol,
"/Indet/IBLDist")) {
750 *
outfile << citr->first <<
" " << atrlist[
"stave"].data<
int>()
751 <<
" " << atrlist[
"eta"].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;
◆ m_alignchans
std::vector<int> InDetAlignDBTool::m_alignchans |
|
private |
◆ m_alignobjs
std::vector<std::string> InDetAlignDBTool::m_alignobjs |
|
private |
◆ m_attrListCollection
◆ m_detStore
◆ m_doPix
Gaudi::Property<bool> InDetAlignDBTool::m_doPix {this, "AlignPixel", true, "Include Pixel" } |
|
private |
◆ m_doStrip
Gaudi::Property<bool> InDetAlignDBTool::m_doStrip {this, "AlignStrip", true, "Include SCT/ITkStrip" } |
|
private |
◆ m_dynamicDB
bool InDetAlignDBTool::m_dynamicDB {false} |
|
private |
◆ m_evtStore
◆ m_forceUserDBConfig
Gaudi::Property<bool> InDetAlignDBTool::m_forceUserDBConfig {this, "forceUserDBConfig", false, "Set to true to override any DB auto-configuration"} |
|
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, "DBRoot", "/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 201 of file InDetAlignDBTool.h.
◆ m_par_fake
Gaudi::Property<int> InDetAlignDBTool::m_par_fake {this, "FakeDB", 0, "set to 1 to fake full ATLAS geom, 2 to fake CTB geom"} |
|
private |
◆ m_par_newdb
Gaudi::Property<bool> InDetAlignDBTool::m_par_newdb {this, "NewDB", true, "create database using new (collection) format"} |
|
private |
◆ m_par_oldTextFile
Gaudi::Property<bool> InDetAlignDBTool::m_par_oldTextFile {this, "OldTextFile", false, "Input text file using old format"} |
|
private |
◆ m_par_scttwoside
Gaudi::Property<bool> InDetAlignDBTool::m_par_scttwoside {this, "SCTTwoSide", false, "create structures with separated SCT module sides"} |
|
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)
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 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.
virtual void setOwner(IDataHandleHolder *o)=0
virtual const SiDetectorElementCollection * getDetectorElementCollection() const override
access to whole collectiom
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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
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, 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.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.