Skip to content

Commit d43b949

Browse files
Elros60javiereccalibuild
authored
MCH standalone alignment module (AliceO2Group#12583)
* MCH standalone alignment module with a common part(for both MCH and MTF) of mathematics basic codes moved to a common path under O2/Detectors/ForwardAlign Co-Authored-By: javierecc <javier.castillo.castellanos@cern.ch> * Please consider the following formatting changes (#4) * Removed from PR * Fixing formatting issue * Add missing header for filesystem * Fix warning with dereferenced iterator * Remove re-initialisation of magfield for trackfitter and move residual QA plots to O2Physics task * Update comment for track selection * Remove unused function * Remove re-definition of magfield which is set already with CCDB finalisation * Fixing CI build errors --------- Co-authored-by: javierecc <javier.castillo.castellanos@cern.ch> Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent dc4c7dd commit d43b949

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3645
-187
lines changed

Detectors/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ add_subdirectory(Calibration)
4747
add_subdirectory(DCS)
4848

4949
add_subdirectory(Align)
50+
add_subdirectory(ForwardAlign)
51+
5052

5153
if(BUILD_SIMULATION)
5254
add_subdirectory(gconfig)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
# All rights not expressly granted are reserved.
4+
#
5+
# This software is distributed under the terms of the GNU General Public
6+
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
#
8+
# In applying this license CERN does not waive the privileges and immunities
9+
# granted to it by virtue of its status as an Intergovernmental Organization
10+
# or submit itself to any jurisdiction.
11+
12+
o2_add_library(ForwardAlign
13+
SOURCES src/MatrixSparse.cxx
14+
src/MatrixSq.cxx
15+
src/MillePede2.cxx
16+
src/MillePedeRecord.cxx
17+
src/MilleRecordReader.cxx
18+
src/MilleRecordWriter.cxx
19+
src/MinResSolve.cxx
20+
src/RectMatrix.cxx
21+
src/SymBDMatrix.cxx
22+
src/SymMatrix.cxx
23+
src/VectorSparse.cxx
24+
PUBLIC_LINK_LIBRARIES O2::CCDB
25+
O2::Steer
26+
ROOT::TreePlayer)
27+
28+
o2_target_root_dictionary(ForwardAlign
29+
HEADERS include/ForwardAlign/MatrixSparse.h
30+
include/ForwardAlign/MatrixSq.h
31+
include/ForwardAlign/MillePede2.h
32+
include/ForwardAlign/MillePedeRecord.h
33+
include/ForwardAlign/MilleRecordReader.h
34+
include/ForwardAlign/MilleRecordWriter.h
35+
include/ForwardAlign/MinResSolve.h
36+
include/ForwardAlign/RectMatrix.h
37+
include/ForwardAlign/SymBDMatrix.h
38+
include/ForwardAlign/SymMatrix.h
39+
include/ForwardAlign/VectorSparse.h
40+
LINKDEF src/ForwardAlignLinkDef.h)

Detectors/ITSMFT/MFT/alignment/include/MFTAlignment/MatrixSparse.h renamed to Detectors/ForwardAlign/include/ForwardAlign/MatrixSparse.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
/// \brief Sparse matrix class (from AliROOT), used as a global matrix for MillePede2
1414
/// \author ruben.shahoyan@cern.ch
1515

16-
#ifndef ALICEO2_MFT_MATRIXSPARSE_H
17-
#define ALICEO2_MFT_MATRIXSPARSE_H
16+
#ifndef ALICEO2_FWDALIGN_MATRIXSPARSE_H
17+
#define ALICEO2_FWDALIGN_MATRIXSPARSE_H
1818

19-
#include "MFTAlignment/MatrixSq.h"
20-
#include "MFTAlignment/VectorSparse.h"
19+
#include "ForwardAlign/MatrixSq.h"
20+
#include "ForwardAlign/VectorSparse.h"
2121

2222
namespace o2
2323
{
24-
namespace mft
24+
namespace fwdalign
2525
{
2626

2727
/// \class MatrixSparse
@@ -157,7 +157,7 @@ inline Double_t& MatrixSparse::DiagElem(Int_t row)
157157
}
158158
}
159159

160-
} // namespace mft
160+
} // namespace fwdalign
161161
} // namespace o2
162162

163163
#endif

Detectors/ITSMFT/MFT/alignment/include/MFTAlignment/MatrixSq.h renamed to Detectors/ForwardAlign/include/ForwardAlign/MatrixSq.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
/// \brief Abstract class (from AliROOT) for square matrix used for millepede2 operation
1414
/// \author ruben.shahoyan@cern.ch
1515

16-
#ifndef ALICEO2_MFT_MATRIXSQ_H
17-
#define ALICEO2_MFT_MATRIXSQ_H
16+
#ifndef ALICEO2_FWDALIGN_MATRIXSQ_H
17+
#define ALICEO2_FWDALIGN_MATRIXSQ_H
1818

1919
#include <TMatrixDBase.h>
2020
#include <TVectorD.h>
2121

2222
namespace o2
2323
{
24-
namespace mft
24+
namespace fwdalign
2525
{
2626

2727
/// \class MatrixSq
@@ -153,7 +153,7 @@ inline void MatrixSq::MultiplyByVec(const TVectorD& vecIn, TVectorD& vecOut) con
153153
MultiplyByVec(vecIn.GetMatrixArray(), vecOut.GetMatrixArray());
154154
}
155155

156-
} // namespace mft
156+
} // namespace fwdalign
157157
} // namespace o2
158158

159159
#endif

Detectors/ITSMFT/MFT/alignment/include/MFTAlignment/MillePede2.h renamed to Detectors/ForwardAlign/include/ForwardAlign/MillePede2.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
/// Based on the original milliped2 by Volker Blobel
1717
/// http://www.desy.de/~blobel/mptalks.html
1818

19-
#ifndef ALICEO2_MFT_MILLEPEDE2_H
20-
#define ALICEO2_MFT_MILLEPEDE2_H
19+
#ifndef ALICEO2_FWDALIGN_MILLEPEDE2_H
20+
#define ALICEO2_FWDALIGN_MILLEPEDE2_H
2121

2222
#include <vector>
2323
#include <TString.h>
2424
#include <TTree.h>
25-
#include "MFTAlignment/MinResSolve.h"
26-
#include "MFTAlignment/MillePedeRecord.h"
27-
#include "MFTAlignment/SymMatrix.h"
28-
#include "MFTAlignment/RectMatrix.h"
29-
#include "MFTAlignment/MatrixSparse.h"
30-
#include "MFTAlignment/MatrixSq.h"
31-
#include "MFTAlignment/MilleRecordWriter.h"
32-
#include "MFTAlignment/MilleRecordReader.h"
25+
#include "ForwardAlign/MinResSolve.h"
26+
#include "ForwardAlign/MillePedeRecord.h"
27+
#include "ForwardAlign/SymMatrix.h"
28+
#include "ForwardAlign/RectMatrix.h"
29+
#include "ForwardAlign/MatrixSparse.h"
30+
#include "ForwardAlign/MatrixSq.h"
31+
#include "ForwardAlign/MilleRecordWriter.h"
32+
#include "ForwardAlign/MilleRecordReader.h"
3333

3434
class TFile;
3535
class TStopwatch;
@@ -38,7 +38,7 @@ class TArrayF;
3838

3939
namespace o2
4040
{
41-
namespace mft
41+
namespace fwdalign
4242
{
4343

4444
class MillePede2
@@ -256,17 +256,17 @@ class MillePede2
256256
/// \brief write tree and close file where are stored chi2 from LocalFit()
257257
void EndChi2Storage();
258258

259-
o2::mft::MillePedeRecord* GetRecord() const { return fRecord; }
259+
o2::fwdalign::MillePedeRecord* GetRecord() const { return fRecord; }
260260
long GetSelFirst() const { return fSelFirst; }
261261
long GetSelLast() const { return fSelLast; }
262262
void SetSelFirst(long v) { fSelFirst = v; }
263263
void SetSelLast(long v) { fSelLast = v; }
264264

265-
void SetRecord(o2::mft::MillePedeRecord* aRecord) { fRecord = aRecord; }
266-
void SetRecordWriter(o2::mft::MilleRecordWriter* myP) { fRecordWriter = myP; }
267-
void SetConstraintsRecWriter(o2::mft::MilleRecordWriter* myP) { fConstraintsRecWriter = myP; }
268-
void SetRecordReader(o2::mft::MilleRecordReader* myP) { fRecordReader = myP; }
269-
void SetConstraintsRecReader(o2::mft::MilleRecordReader* myP) { fConstraintsRecReader = myP; }
265+
void SetRecord(o2::fwdalign::MillePedeRecord* aRecord) { fRecord = aRecord; }
266+
void SetRecordWriter(o2::fwdalign::MilleRecordWriter* myP) { fRecordWriter = myP; }
267+
void SetConstraintsRecWriter(o2::fwdalign::MilleRecordWriter* myP) { fConstraintsRecWriter = myP; }
268+
void SetRecordReader(o2::fwdalign::MilleRecordReader* myP) { fRecordReader = myP; }
269+
void SetConstraintsRecReader(o2::fwdalign::MilleRecordReader* myP) { fConstraintsRecReader = myP; }
270270

271271
/// \brief return the limit in chi^2/nd for n sigmas stdev authorized
272272
///
@@ -340,11 +340,11 @@ class MillePede2
340340
std::vector<int> fCGlo2Glo; ///< [fNGloPar] compressed ID to global ID buffer
341341

342342
// Matrices
343-
o2::mft::SymMatrix* fMatCLoc; ///< Matrix C local
344-
o2::mft::MatrixSq* fMatCGlo; ///< Matrix C global
345-
o2::mft::RectMatrix* fMatCGloLoc; ///< Rectangular matrix C g*l
346-
std::vector<int> fFillIndex; ///< [fNGloPar] auxilary index array for fast matrix fill
347-
std::vector<double> fFillValue; ///< [fNGloPar] auxilary value array for fast matrix fill
343+
o2::fwdalign::SymMatrix* fMatCLoc; ///< Matrix C local
344+
o2::fwdalign::MatrixSq* fMatCGlo; ///< Matrix C global
345+
o2::fwdalign::RectMatrix* fMatCGloLoc; ///< Rectangular matrix C g*l
346+
std::vector<int> fFillIndex; ///< [fNGloPar] auxilary index array for fast matrix fill
347+
std::vector<double> fFillValue; ///< [fNGloPar] auxilary value array for fast matrix fill
348348

349349
TFile* fRecChi2File;
350350
TString fRecChi2FName;
@@ -354,7 +354,7 @@ class MillePede2
354354
bool fIsChi2BelowLimit;
355355
int fRecNDoF;
356356

357-
o2::mft::MillePedeRecord* fRecord; ///< Buffer of measurements records
357+
o2::fwdalign::MillePedeRecord* fRecord; ///< Buffer of measurements records
358358

359359
long fCurrRecDataID; ///< ID of the current data record
360360
long fCurrRecConstrID; ///< ID of the current constraint record
@@ -380,15 +380,15 @@ class MillePede2
380380
static int fgNKrylovV; ///< size of Krylov vectors buffer in FGMRES
381381

382382
// processed data record bufferization
383-
o2::mft::MilleRecordWriter* fRecordWriter; ///< data record writer
384-
o2::mft::MilleRecordWriter* fConstraintsRecWriter; ///< constraints record writer
385-
o2::mft::MilleRecordReader* fRecordReader; ///< data record reader
386-
o2::mft::MilleRecordReader* fConstraintsRecReader; ///< constraints record reader
383+
o2::fwdalign::MilleRecordWriter* fRecordWriter; ///< data record writer
384+
o2::fwdalign::MilleRecordWriter* fConstraintsRecWriter; ///< constraints record writer
385+
o2::fwdalign::MilleRecordReader* fRecordReader; ///< data record reader
386+
o2::fwdalign::MilleRecordReader* fConstraintsRecReader; ///< constraints record reader
387387

388388
ClassDef(MillePede2, 0);
389389
};
390390

391-
} // namespace mft
391+
} // namespace fwdalign
392392
} // namespace o2
393393

394394
#endif

Detectors/ITSMFT/MFT/alignment/include/MFTAlignment/MillePedeRecord.h renamed to Detectors/ForwardAlign/include/ForwardAlign/MillePedeRecord.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
/// The records for all processed tracks are stored in the temporary tree in orgder to be
1717
/// reused for multiple iterations of MillePede
1818

19-
#ifndef ALICEO2_MFT_MILLEPEDERECORD_H
20-
#define ALICEO2_MFT_MILLEPEDERECORD_H
19+
#ifndef ALICEO2_FWDALIGN_MILLEPEDERECORD_H
20+
#define ALICEO2_FWDALIGN_MILLEPEDERECORD_H
2121

2222
#include <TObject.h>
2323

2424
namespace o2
2525
{
26-
namespace mft
26+
namespace fwdalign
2727
{
2828
/// \brief Store residuals and local/global deriavtives from a single track processing
2929
///
@@ -152,7 +152,7 @@ inline Bool_t MillePedeRecord::IsGroupPresent(Int_t id) const
152152
return kFALSE;
153153
}
154154

155-
} // namespace mft
155+
} // namespace fwdalign
156156
} // namespace o2
157157

158158
#endif

Detectors/ITSMFT/MFT/alignment/include/MFTAlignment/MilleRecordReader.h renamed to Detectors/ForwardAlign/include/ForwardAlign/MilleRecordReader.h

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@
1313
/// \author arakotoz@cern.ch
1414
/// \brief Class dedicated to read MillePedeRecords from ROOT files
1515

16-
#ifndef ALICEO2_MFT_MILLERECORD_READER_H
17-
#define ALICEO2_MFT_MILLERECORD_READER_H
16+
#ifndef ALICEO2_FWDALIGN_MILLERECORD_READER_H
17+
#define ALICEO2_FWDALIGN_MILLERECORD_READER_H
1818

1919
#include <Rtypes.h>
2020
#include <TString.h>
2121
#include <TChain.h>
2222
#include <TFile.h>
2323
#include <TTree.h>
2424

25-
#include "MFTAlignment/MillePedeRecord.h"
25+
#include "ForwardAlign/MillePedeRecord.h"
2626

2727
namespace o2
2828
{
29-
namespace mft
29+
namespace fwdalign
3030
{
3131

3232
class MilleRecordReader
@@ -51,7 +51,7 @@ class MilleRecordReader
5151
bool isReadEntryOk() const { return mIsReadEntryOk; }
5252

5353
/// \brief return the record
54-
o2::mft::MillePedeRecord* getRecord() { return mRecord; };
54+
o2::fwdalign::MillePedeRecord* getRecord() { return mRecord; };
5555

5656
/// \brief return the ID of the current record in the TTree
5757
long getCurrentDataID() const { return mCurrentDataID; }
@@ -65,20 +65,23 @@ class MilleRecordReader
6565
/// \brief return the number of entries
6666
Long64_t getNEntries() const { return mNEntries; }
6767

68+
/// \brief return the name of record data tree
69+
TString getDataTreeName() const { return mDataTreeName; }
70+
6871
protected:
69-
TChain* mDataTree; ///< TChain container that stores the records
70-
bool mIsSuccessfulInit; ///< boolean to monitor the success of the initialization
71-
bool mIsConstraintsRec; ///< boolean to know if these are data records or constraints records
72-
bool mIsReadEntryOk; ///< boolean to know if the last operation readNextEntry() was ok
73-
TString mDataTreeName; ///< name of the record TTree/TChain
74-
TString mDataBranchName; ///< name of the branch where records will be stored
75-
o2::mft::MillePedeRecord* mRecord; ///< the running record
76-
Long64_t mCurrentDataID; ///< counter indicating the ID of the current record in the tree
77-
Long64_t mNEntries; ///< number of entries in the read TChain
72+
TChain* mDataTree; ///< TChain container that stores the records
73+
bool mIsSuccessfulInit; ///< boolean to monitor the success of the initialization
74+
bool mIsConstraintsRec; ///< boolean to know if these are data records or constraints records
75+
bool mIsReadEntryOk; ///< boolean to know if the last operation readNextEntry() was ok
76+
TString mDataTreeName; ///< name of the record TTree/TChain
77+
TString mDataBranchName; ///< name of the branch where records will be stored
78+
o2::fwdalign::MillePedeRecord* mRecord; ///< the running record
79+
Long64_t mCurrentDataID; ///< counter indicating the ID of the current record in the tree
80+
Long64_t mNEntries; ///< number of entries in the read TChain
7881

7982
ClassDef(MilleRecordReader, 0);
8083
};
81-
} // namespace mft
84+
} // namespace fwdalign
8285
} // namespace o2
8386

8487
#endif

Detectors/ITSMFT/MFT/alignment/include/MFTAlignment/MilleRecordWriter.h renamed to Detectors/ForwardAlign/include/ForwardAlign/MilleRecordWriter.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111

1212
/// \file MilleRecordWriter.h
1313
/// \author arakotoz@cern.ch
14-
/// \brief Class dedicated to write MillePedeRecords to output file for MFT
14+
/// \brief Class dedicated to write MillePedeRecords to output file for FWDALIGN
1515

16-
#ifndef ALICEO2_MFT_MILLERECORD_WRITER_H
17-
#define ALICEO2_MFT_MILLERECORD_WRITER_H
16+
#ifndef ALICEO2_FWDALIGN_MILLERECORD_WRITER_H
17+
#define ALICEO2_FWDALIGN_MILLERECORD_WRITER_H
1818

1919
#include <Rtypes.h>
2020
#include <TString.h>
2121

22-
#include "MFTAlignment/MillePedeRecord.h"
22+
#include "ForwardAlign/MillePedeRecord.h"
2323

2424
class TFile;
2525
class TTree;
2626
namespace o2
2727
{
28-
namespace mft
28+
namespace fwdalign
2929
{
3030

3131
class MilleRecordWriter
@@ -53,7 +53,7 @@ class MilleRecordWriter
5353
bool isInitOk() const { return mIsSuccessfulInit; }
5454

5555
/// \brief return the record
56-
o2::mft::MillePedeRecord* getRecord() { return mRecord; };
56+
o2::fwdalign::MillePedeRecord* getRecord() { return mRecord; };
5757

5858
/// \brief return the ID of the current record in the TTree
5959
Long64_t getCurrentDataID() const { return mCurrentDataID; }
@@ -71,20 +71,20 @@ class MilleRecordWriter
7171
void setRecordWeight(double wgh);
7272

7373
protected:
74-
TTree* mDataTree; ///< TTree container that stores the records
75-
TFile* mDataFile; ///< output file where the records are written
76-
bool mIsSuccessfulInit; ///< boolean to monitor the success of the initialization
77-
bool mIsConstraintsRec; ///< boolean to know if these are data records or constraints records
78-
long mNEntriesAutoSave; ///< max entries in the buffer after which TTree::AutoSave() is automatically used
79-
TString mDataFileName; ///< name of the output file that will store the record TTree
80-
TString mDataTreeName; ///< name of the record TTree
81-
TString mDataBranchName; ///< name of the branch where records will be stored
82-
o2::mft::MillePedeRecord* mRecord; ///< the running record
83-
Long64_t mCurrentDataID; ///< counter increasing when adding a record to the tree
74+
TTree* mDataTree; ///< TTree container that stores the records
75+
TFile* mDataFile; ///< output file where the records are written
76+
bool mIsSuccessfulInit; ///< boolean to monitor the success of the initialization
77+
bool mIsConstraintsRec; ///< boolean to know if these are data records or constraints records
78+
long mNEntriesAutoSave; ///< max entries in the buffer after which TTree::AutoSave() is automatically used
79+
TString mDataFileName; ///< name of the output file that will store the record TTree
80+
TString mDataTreeName; ///< name of the record TTree
81+
TString mDataBranchName; ///< name of the branch where records will be stored
82+
o2::fwdalign::MillePedeRecord* mRecord; ///< the running record
83+
Long64_t mCurrentDataID; ///< counter increasing when adding a record to the tree
8484

8585
ClassDef(MilleRecordWriter, 0);
8686
};
87-
} // namespace mft
87+
} // namespace fwdalign
8888
} // namespace o2
8989

9090
#endif

0 commit comments

Comments
 (0)