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