ATLAS Offline Software
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 
17 #include "TrkAlgebraUtils/IPCMat.h"
18 
19 #include <string>
20 
21 namespace Trk {
22 
23  //_______________________________________________________________________
24  IPCMatrixTool::IPCMatrixTool(const std::string& type, const std::string& name,
25  const IInterface* 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  //_______________________________________________________________________
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  //_______________________________________________________________________
106  {
107  }
108 
109  //________________________________________________________________________
111  {
112  }
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
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::IPCMat::allocate
StatusCode allocate(int)
Definition: IPCMat.cxx:238
IPCMat.h
Trk::AlVec
Definition: AlVec.h:23
Trk::IPCMatrixTool::accumulateFromFiles
bool accumulateFromFiles()
accumulates from files
Definition: IPCMatrixTool.cxx:91
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::AlSymMatBase
Definition: AlSymMatBase.h:38
Trk::IPCMatrixTool::allocateMatrix
StatusCode allocateMatrix(int nDoF)
allocates memory for IPC matrix and vector
Definition: IPCMatrixTool.cxx:63
Trk::IPCMat::init
StatusCode init(void)
Definition: IPCMat.cxx:177
Trk::IPCMatrixTool::addSecondDerivatives
void addSecondDerivatives(AlSymMatBase *matrix)
adds second derivatives to matrix
Definition: IPCMatrixTool.cxx:110
Trk::IPCMatrixTool::solve
int solve()
solves for alignment parameters
Definition: IPCMatrixTool.cxx:98
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::IPCMatrixTool::addFirstDerivatives
void addFirstDerivatives(AlVec *vector)
adds first derivative to vector
Definition: IPCMatrixTool.cxx:105
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
Trk::IPCMatrixTool::finalize
StatusCode finalize()
initialize
Definition: IPCMatrixTool.cxx:55
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::IPCMatrixTool::m_ipcmatMatName
std::string m_ipcmatMatName
IPC binary matrix filename.
Definition: IPCMatrixTool.h:81
Trk::IMatrixTool::m_logStream
std::ostream * m_logStream
logfile output stream
Definition: IMatrixTool.h:98
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Trk::IPCMatrixTool::m_IPCremoval
bool m_IPCremoval
remove spurious + align.
Definition: IPCMatrixTool.h:85
Trk::IPCMatrixTool::m_ipcmatVecName
std::string m_ipcmatVecName
IPC binary vector filename.
Definition: IPCMatrixTool.h:82
Trk::IPCMatrixTool::IPCMatrixTool
IPCMatrixTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: IPCMatrixTool.cxx:24
Trk::IPCMatrixTool::~IPCMatrixTool
virtual ~IPCMatrixTool()
Virtual destructor.
Definition: IPCMatrixTool.cxx:39
Trk::IPCMat
Definition: IPCMat.h:37
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Trk::IPCMatrixTool::m_ipcmat
IPCMat * m_ipcmat
Pointer to IPCMat, used for parallel processing.
Definition: IPCMatrixTool.h:79
IPCMatrixTool.h
Trk::IPCMatrixTool::prepareBinaryFiles
void prepareBinaryFiles(int solveOption)
reads/writes matrix entries from/to binary files as necessary
Definition: IPCMatrixTool.cxx:85
AthAlgTool
Definition: AthAlgTool.h:26
Trk::IPCMatrixTool::initialize
StatusCode initialize()
initialize
Definition: IPCMatrixTool.cxx:47