ATLAS Offline Software
Loading...
Searching...
No Matches
Derivt.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <iostream>
7namespace Trk {
8
9std::ostream& operator<<(std::ostream& out, const VKConstraintBase& cnst) {
10 int NTRK = cnst.f0t.size();
11 out.precision(7);
12 out << std::defaultfloat;
13 out << " Base constraint derivatives for NTRK=" << NTRK
14 << " CNST dim=" << cnst.NCDim << "\n";
15 out << " Momentum derivatives " << "\n";
16 for (int ic = 0; ic < cnst.NCDim; ic++) {
17 out << " d(...)/dTheta d(...)/dPhi d(...)/dInvR NC=" << ic
18 << "\n";
19 for (int i = 0; i < NTRK; i++) {
20 out << cnst.f0t[i][ic].X << ", " << cnst.f0t[i][ic].Y << ", "
21 << cnst.f0t[i][ic].Z << "\n";
22 }
23 out << " d(...)/dXv d(...)/dYy d(...)/Zv\n";
24 out << cnst.h0t[ic].X << ", " << cnst.h0t[ic].Y << ", " << cnst.h0t[ic].Z
25 << "\n";
26 out << " aa=" << cnst.aa[ic] << std::endl;
27 }
28 out.precision(6); // restore default
29 return out;
30}
31
32std::ostream& operator<<(std::ostream& out, const VKMassConstraint& cnst) {
33 const VKVertex* vk = cnst.getOriginVertex();
34 int NP = cnst.m_usedParticles.size();
35 out.precision(7);
36 out << std::defaultfloat;
37 out << " Mass constraint (total NTRK=" << vk->TrackList.size() << ")"
38 << "\n";
39 out << " * target mass: " << cnst.getTargetMass() << "\n";
40 out << " * particle indexes: ";
41 for (int i = 0; i < NP; i++) {
42 out << cnst.m_usedParticles[i] << ", ";
43 }
44 out << "\n";
45 out << " * particle masses: ";
46 for (int i = 0; i < NP; i++) {
47 out << vk->TrackList[cnst.m_usedParticles[i]]->getMass() << ", ";
48 }
49 out << "\n";
50 out << dynamic_cast<const VKConstraintBase&>(cnst) << "\n";
51 out.precision(6); // restore default
52 return out;
53}
54std::ostream& operator<<(std::ostream& out, const VKPhiConstraint& cnst) {
55 const VKVertex* vk = cnst.getOriginVertex();
56 out.precision(7);
57 out << std::defaultfloat;
58 out << " Phi constraint (total NTRK=" << vk->TrackList.size() << ")"
59 << "\n";
60 out << dynamic_cast<const VKConstraintBase&>(cnst) << "\n";
61 out.precision(6); // restore default
62 return out;
63}
64
65std::ostream& operator<<(std::ostream& out, const VKThetaConstraint& cnst) {
66 const VKVertex* vk = cnst.getOriginVertex();
67 out.precision(7);
68 out << std::defaultfloat;
69 out << " Theta constraint (total NTRK=" << vk->TrackList.size() << ")"
70 << "\n";
71 out << dynamic_cast<const VKConstraintBase&>(cnst) << "\n";
72 out.precision(6); // restore default
73 return out;
74}
75
76std::ostream& operator<<(std::ostream& out, const VKPointConstraint& cnst) {
77 const VKVertex* vk = cnst.getOriginVertex();
78 out.precision(7);
79 out << std::defaultfloat;
80 if (!cnst.onlyZ()) {
81 out << " Point constraint (total NTRK=" << vk->TrackList.size() << ")"
82 << "\n";
83 } else {
84 out << " Z point constraint (total NTRK=" << vk->TrackList.size() << ")"
85 << "\n";
86 }
87 out << " target vertex=" << cnst.getTargetVertex()[0] << ", "
88 << cnst.getTargetVertex()[1] << ", " << cnst.getTargetVertex()[2]
89 << "\n";
90 out << dynamic_cast<const VKConstraintBase&>(cnst) << "\n";
91 out.precision(6); // restore default
92 return out;
93}
94
95std::ostream& operator<<(std::ostream& out, const VKPlaneConstraint& cnst) {
96 const VKVertex* vk = cnst.getOriginVertex();
97 out.precision(7);
98 out << std::defaultfloat;
99 out << " Vertex in plane constraint (total NTRK=" << vk->TrackList.size()
100 << ")" << "\n";
101 out << " Plane(A,B,C,D):" << cnst.getA() << ", " << cnst.getB() << ", "
102 << cnst.getC() << ", " << cnst.getD() << "\n";
103 out << dynamic_cast<const VKConstraintBase&>(cnst) << "\n";
104 out.precision(6); // restore default
105 return out;
106}
107
108std::ostream& operator<<(std::ostream& out, const VKRadiusConstraint& cnst) {
109 const VKVertex* vk = cnst.getOriginVertex();
110 out.precision(7);
111 out << std::defaultfloat;
112 out << " Vertex in radius constraint (total NTRK=" << vk->TrackList.size()
113 << ")\n" ;
114 out << " Fixed Radius:" << cnst.getRC() << "\n";
115 out << dynamic_cast<const VKConstraintBase&>(cnst) << "\n";
116 out.precision(6); // restore default
117 return out;
118}
119
120} // namespace Trk
std::vector< std::vector< Vect3DF > > f0t
Definition Derivt.h:39
const VKVertex * getOriginVertex() const
Definition Derivt.h:32
std::vector< Vect3DF > h0t
Definition Derivt.h:40
std::vector< double > aa
Definition Derivt.h:38
std::vector< int > m_usedParticles
Definition Derivt.h:63
VKMassConstraint(int, double, VKVertex *)
Definition Derivt.h:157
double getTargetMass() const
Definition Derivt.h:59
VKPhiConstraint(int, VKVertex *)
Definition Derivt.h:176
VKPlaneConstraint(int, double, double, double, double, VKVertex *)
Definition Derivt.h:201
double getB() const
Definition Derivt.h:117
double getC() const
Definition Derivt.h:118
double getA() const
Definition Derivt.h:116
double getD() const
Definition Derivt.h:119
bool onlyZ() const
Definition Derivt.h:94
const double * getTargetVertex() const
Definition Derivt.h:100
VKPointConstraint(int, const double[3], VKVertex *, bool)
Definition Derivt.h:189
VKRadiusConstraint(int, double, double[2], VKVertex *)
Definition Derivt.h:212
double getRC() const
Definition Derivt.h:134
VKThetaConstraint(int, VKVertex *)
Definition Derivt.h:182
std::vector< std::unique_ptr< VKTrack > > TrackList
Ensure that the ATLAS eigen extensions are properly loaded.
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition dumpNPs.cxx:34