ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalChi2AlignTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRKGLOBALCHI2ALIGNTOOLS_GLOBALCHI2ALIGNTOOL_H
6#define TRKGLOBALCHI2ALIGNTOOLS_GLOBALCHI2ALIGNTOOL_H
7
8#include "GaudiKernel/ToolHandle.h"
10
14
15//#include "TMatrixD.h"
16
17#include <string>
18
31
32class TFile;
33class TTree;
34
35namespace Trk {
36 class Track;
37
38 class GlobalChi2AlignTool : virtual public IAlignTool, public AthAlgTool {
39 public:
40
42 GlobalChi2AlignTool(const std::string& type, const std::string& name,
43 const IInterface* parent);
44
46 virtual ~GlobalChi2AlignTool();
47
49 virtual StatusCode initialize();
50
52 virtual StatusCode finalize();
53
55 virtual StatusCode firstEventInitialize();
56
58 virtual StatusCode solve();
59
61 bool accumulate(AlignTrack* alignTrack);
62
65
67 unsigned int nAccumulatedTracks() { return m_ntracks; };
68
70 void setNtuple(TFile* ntuple) { m_ntuple=ntuple; }
71
73 void setLogStream(std::ostream * os);
74
76 StatusCode fillNtuple();
77
78 private:
79
80 double getMaterialOnTrack(const Trk::Track* track);
81
83 ToolHandle<Trk::IMatrixTool> m_matrixTool{this, "MatrixTool", "Trk::MatrixTool",
84 "tool for storing and inverting matrix"};
85
87 PublicToolHandle<Trk::IAlignModuleTool> m_alignModuleTool{this,
88 "AlignModuleTool", "Trk::AlignModuleTool/AlignModuleTool"};
89
90 std::string m_pathbin;
91 std::string m_pathtxt;
92 std::string m_prefixName;
93
94 unsigned int m_ntracks = 0;
95 unsigned int m_nmeas = 0;
96 unsigned int m_nhits = 0;
97 double m_chi2 = 0.;
98 unsigned int m_nDoF = 0;
99
100 Gaudi::Property<double> m_secondDerivativeCut{this, "SecondDerivativeCut", -1e5};
101 Gaudi::Property<bool> m_doTree{this, "DoTree", false};
102 Gaudi::Property<bool> m_writeActualSecDeriv{this, "WriteActualSecDeriv", false};
103 Gaudi::Property<bool> m_storeLocalDerivOnly{this, "StoreLocalDerivOnly", false};
104
105 static constexpr int MAXNCHAMBERS=50;
106 static constexpr int MAXNINDICES =50*6;
107
109 TFile* m_ntuple = nullptr;
110 TTree* m_tree = nullptr;
111 int m_run{};
112 int m_event{};
114 double m_momentum{};
115 int m_nChambers = 0;
116 int* m_chamberIds = new int[MAXNCHAMBERS];
120 double* m_secndDeriv = new double[MAXNINDICES*MAXNINDICES];
121 double* m_firstDeriv = new double[MAXNINDICES];
122 double* m_actualSecndDeriv = new double[MAXNINDICES];
123 double m_eta{};
124 double m_phi{};
125 double m_perigee_x{};
126 double m_perigee_y{};
127 double m_perigee_z{};
135
136 bool m_fromFiles = false;
137
138 }; // end of class
139
140} // End of namespace
141
142#endif // TRKALIGNGENTOOLS_MATRIXTOOL_H
143
144
145
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
std::string m_pathtxt
path ascii files (in/out)
PublicToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
Pointer to AlignModuleTool.
unsigned int m_nhits
number of accumulated hits
bool accumulate(AlignTrack *alignTrack)
accumulates information from an AlignTrack
Gaudi::Property< bool > m_storeLocalDerivOnly
void setLogStream(std::ostream *os)
sets the output stream for the logfile
std::string m_prefixName
prefix string to filenames
virtual ~GlobalChi2AlignTool()
Virtual destructor.
Gaudi::Property< bool > m_writeActualSecDeriv
StatusCode fillNtuple()
writes tree to ntuple
virtual StatusCode initialize()
initialize
unsigned int nAccumulatedTracks()
returns total number of accumulated tracks
TFile * m_ntuple
output ntuple
bool accumulateFromFiles()
accumulates information from binary files
static constexpr int MAXNINDICES
unsigned int m_ntracks
number of accumulated tracks
double getMaterialOnTrack(const Trk::Track *track)
virtual StatusCode solve()
solves for alignment parameters
Gaudi::Property< double > m_secondDerivativeCut
static constexpr int MAXNCHAMBERS
ToolHandle< Trk::IMatrixTool > m_matrixTool
Pointer to MatrixTool, used to write to and solve matrix.
void setNtuple(TFile *ntuple)
set ntuple
GlobalChi2AlignTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Gaudi::Property< bool > m_doTree
unsigned int m_nmeas
number of accumulated measurements
std::string m_pathbin
path binary files (in/out)
virtual StatusCode finalize()
finalize
virtual StatusCode firstEventInitialize()
sets up matrix
unsigned int m_nDoF
number of degrees of freedom
Ensure that the ATLAS eigen extensions are properly loaded.