PandaRoot
RhoLorentzVectorErr.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef RHOLORENTZVECTORERR_H
14 #define RHOLORENTZVECTORERR_H
15 // //
17 // RhoLorentzVectorErr //
18 // //
19 // LorentzVector w/ error //
20 // //
21 // Author: Marcel Kunze, RUB, Nov. 99 //
22 // Copyright (C) 1999-2001, Ruhr-University Bochum. //
23 // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) //
24 // //
26 
27 class RhoVector3Err;
28 
29 #include <iostream>
30 
31 #include "RhoError.h"
32 #include "TLorentzVector.h"
33 #include "TLorentzRotation.h"
34 
35 class RhoLorentzVectorErr : public TLorentzVector {
36  public:
37  enum MPolarCoordinateIndex { Mom = 0, Theta = 1, Phi = 2, Mass = 3, NUM_MPCOORDINATES = 4 };
38  enum EPolarCoordinateIndex { Energy = 0, ETheta = 1, EPhi = 2, EMom = 3, NUM_EPCOORDINATES = 4 };
39  // argumentless constructor:
41 
42  // auto casting constructor
43  RhoLorentzVectorErr(const TLorentzVector &p);
44 
45  RhoLorentzVectorErr(const TLorentzVector &p, const RhoError &covMat);
46 
47  // Useful constructor for tracks:
48  RhoLorentzVectorErr(const RhoVector3Err &p3, Double_t mass);
49 
50  // copy constructor
52 
53  // destructor MAY be needed later
55  {
56  if (fCovMatrix)
57  delete fCovMatrix;
58  }
59 
60  // assignment operator:
62 
63  // mathematical modifiers:
65 
67 
69 
70  // can't implement this since there is no
71  // TLorentzVector::transform(const HepTranslation):
72  //
73  // RhoLorentzVectorErr& transform(const HepTranslation& trans){
74  // TLorentzVector::transform(trans);
75  // return *this;
76  // }
77 
78  RhoLorentzVectorErr &Transform(const TRotation &rot);
79 
80  RhoLorentzVectorErr &Transform(const TLorentzRotation &rot);
81 
82  // can't implement this since there is no
83  // TLorentzVector::transform(const HepTransformation):
84  //
85  // RhoLorentzVectorErr& transform(const HepTransformation& transf){
86  // TLorentzVector::transform(transf);
87  // fCovMatrix = fCovMatrix.similarity(transf.rot_mat());
88  // return *this;
89  // }
90 
91  Double_t DetermineChisq(const TLorentzVector &refVector);
92  // returns Chisquare
93  // refVector refers to the same origin as the LorentzVector of this
94  // ie refVector is not relative to this Vector
95 
96  // TError covMRTPMatrix() const;
97  // returns the covariance Matrix in spherical coordinate and mass
98  // use MPolarCoordinateIndex enum to get the components
99  // TError covETPRMatrix() const;
100  // returns the covariance Matrix in spherical coordinate and mass
101  // use EPolarCoordinateIndex enum to get the components
102  // note: it is different from the others because of the different EMC convention
103 
104  inline const RhoError &CovMatrix() const { return *fCovMatrix; }
105  inline void SetCovMatrix(const RhoError &v)
106  {
107  if (fCovMatrix)
108  delete fCovMatrix;
109  fCovMatrix = new RhoError(v);
110  }
111 
112  void PrintOn(std::ostream &o = std::cout) const;
113 
114  private:
115  RhoError *fCovMatrix;
116 
117  public:
118  ClassDef(RhoLorentzVectorErr, 1) // Add errors to a LorentzVector
119 };
120 
121 // globals:
123 
125 
126 std::ostream &operator<<(std::ostream &stream, const RhoLorentzVectorErr &verr);
127 
128 #endif
RhoLorentzVectorErr & operator-=(const RhoLorentzVectorErr &v)
void PrintOn(std::ostream &o=std::cout) const
const RhoError & CovMatrix() const
RhoLorentzVectorErr & operator+=(const RhoLorentzVectorErr &v)
std::ostream & operator<<(std::ostream &stream, const RhoLorentzVectorErr &verr)
RhoLorentzVectorErr operator+(const RhoLorentzVectorErr &, const RhoLorentzVectorErr &)
__m128 v
Definition: P4_F32vec4.h:15
RhoLorentzVectorErr & Transform(const TRotation &rot)
void SetCovMatrix(const RhoError &v)
RhoLorentzVectorErr & operator=(const RhoLorentzVectorErr &v)
Double_t DetermineChisq(const TLorentzVector &refVector)
RhoLorentzVectorErr & operator-()