ATLAS Offline Software
Loading...
Searching...
No Matches
IPCMatrixTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// IPCMatrixTool.cxx
6
7// AlgTool for creating big matrix and vector, manipulation of entries, and
8// solving for alignment parameters
9// Robert Harrington, started 1/5/08 based on SiGlobalChi2Align
10
11#include "GaudiKernel/StatusCode.h"
12#include "GaudiKernel/MsgStream.h"
13#include "GaudiKernel/AlgTool.h"
14
16
18
19#include <string>
20
21namespace Trk {
22
23 //_______________________________________________________________________
24 IPCMatrixTool::IPCMatrixTool(const std::string& type, const std::string& name,
25 const IInterface* parent)
26 : AthAlgTool(type,name,parent)
27 , m_ipcmat(nullptr)
28 {
29 declareInterface<IMatrixTool>(this);
30
31 declareProperty("IPCRemoval", m_IPCremoval = false);
32 declareProperty("IPCMatrixName", m_ipcmatMatName = "/tmp/ipcmat.dat");
33 declareProperty("IPCVectorName", m_ipcmatVecName = "/tmp/ipcvec.dat");
34
35 m_logStream = nullptr;
36 }
37
38 //_______________________________________________________________________
40 {
41 if (nullptr!=m_ipcmat) delete m_ipcmat;
42 m_ipcmat = nullptr;
43
44 }
45
46 //_______________________________________________________________________
48 {
49 msg(MSG::DEBUG) << "initialize() of IPCMatrixTool" << endmsg;
50
51 return StatusCode::SUCCESS;
52 }
53
54 //_______________________________________________________________________
56 {
57 msg(MSG::DEBUG) << "finalize() of IPCMatrixTool" << endmsg;
58
59 return StatusCode::SUCCESS;
60 }
61
62 //_______________________________________________________________________
63 StatusCode IPCMatrixTool::allocateMatrix(int nDoF)
64 {
65
66 if (nullptr!=m_ipcmat) ATH_MSG_ERROR("IPCMat already exists!");
67 m_ipcmat = new IPCMat(msgSvc());
68
69 if (m_ipcmat->init()!=StatusCode::SUCCESS) {
70 ATH_MSG_ERROR("Failed to initialize ipcmat ");
71 return StatusCode::FAILURE;
72 } else
73 ATH_MSG_INFO("Success allocating ipcmatrix");
74
75 if (m_ipcmat->allocate(nDoF)!=StatusCode::SUCCESS) {
76 ATH_MSG_ERROR("Failed to allocate matrix of size " << nDoF);
77 return StatusCode::FAILURE;
78 } else
79 ATH_MSG_INFO("Success allocating ipcvector");
80
81 return StatusCode::SUCCESS;
82 }
83
84 //_______________________________________________________________________
86 {
87
88 }
89
90 //_______________________________________________________________________
92 {
93
94 return false;
95 }
96
97 //_______________________________________________________________________
99 {
100
101 return -1;
102 }
103
104 //_______________________________________________________________________
108
109 //________________________________________________________________________
113
114 //________________________________________________________________________
115 void IPCMatrixTool::addFirstDerivatives(std::list<int,double>& )
116 {
117 }
118
119 //________________________________________________________________________
120 void IPCMatrixTool::addSecondDerivatives(std::list<std::pair<int,int>,double> & )
121 {
122 }
123
124} // end of namespace
#define endmsg
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
MsgStream & msg() const
contains the base implementation for handling symmertic matrices
std::ostream * m_logStream
logfile output stream
Definition IMatrixTool.h:98
void addSecondDerivatives(AlSymMatBase *matrix)
adds second derivatives to matrix
StatusCode initialize()
initialize
std::string m_ipcmatMatName
IPC binary matrix filename.
IPCMatrixTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
void addFirstDerivatives(AlVec *vector)
adds first derivative to vector
bool accumulateFromFiles()
accumulates from files
void prepareBinaryFiles(int solveOption)
reads/writes matrix entries from/to binary files as necessary
virtual ~IPCMatrixTool()
Virtual destructor.
int solve()
solves for alignment parameters
std::string m_ipcmatVecName
IPC binary vector filename.
bool m_IPCremoval
remove spurious + align.
IPCMat * m_ipcmat
Pointer to IPCMat, used for parallel processing.
StatusCode allocateMatrix(int nDoF)
allocates memory for IPC matrix and vector
StatusCode finalize()
initialize
Ensure that the ATLAS eigen extensions are properly loaded.