1 |
lethuill |
1.1 |
#ifndef TRootBeamSpot_h
|
2 |
|
|
#define TRootBeamSpot_h
|
3 |
|
|
|
4 |
|
|
#include <string>
|
5 |
|
|
#include <iostream>
|
6 |
|
|
#include <iomanip>
|
7 |
|
|
|
8 |
|
|
#include "Rtypes.h"
|
9 |
|
|
#include "TVector3.h"
|
10 |
|
|
|
11 |
|
|
using namespace std;
|
12 |
|
|
|
13 |
|
|
class TRootBeamSpot : public TVector3
|
14 |
|
|
{
|
15 |
lethuill |
1.2 |
|
16 |
|
|
public:
|
17 |
|
|
|
18 |
|
|
TRootBeamSpot() :
|
19 |
|
|
TVector3(-999999.,-999999.,-999999.)
|
20 |
|
|
,error_(-1.,-1.,-1.)
|
21 |
|
|
,sigmaZ_(-1.)
|
22 |
|
|
,sigmaZError_(-1.)
|
23 |
lethuill |
1.3 |
,beamWidthX_(-1.)
|
24 |
|
|
,beamWidthXError_(-1.)
|
25 |
|
|
,beamWidthY_(-1.)
|
26 |
|
|
,beamWidthYError_(-1.)
|
27 |
lethuill |
1.2 |
{;}
|
28 |
|
|
|
29 |
|
|
TRootBeamSpot(const TRootBeamSpot& spot) :
|
30 |
|
|
TVector3(spot)
|
31 |
|
|
,error_(spot.error_)
|
32 |
|
|
,sigmaZ_(spot.sigmaZ_)
|
33 |
|
|
,sigmaZError_(spot.sigmaZError_)
|
34 |
lethuill |
1.3 |
,beamWidthX_(spot.beamWidthX_)
|
35 |
|
|
,beamWidthXError_(spot.beamWidthXError_)
|
36 |
|
|
,beamWidthY_(spot.beamWidthY_)
|
37 |
|
|
,beamWidthYError_(spot.beamWidthYError_)
|
38 |
lethuill |
1.2 |
{;}
|
39 |
|
|
|
40 |
|
|
TRootBeamSpot(Double_t vx, Double_t vy, Double_t vz) :
|
41 |
|
|
TVector3(vx,vy,vz)
|
42 |
|
|
,error_(-1.,-1.,-1.)
|
43 |
|
|
,sigmaZ_(-1.)
|
44 |
|
|
,sigmaZError_(-1.)
|
45 |
lethuill |
1.3 |
,beamWidthX_(-1.)
|
46 |
|
|
,beamWidthXError_(-1.)
|
47 |
|
|
,beamWidthY_(-1.)
|
48 |
|
|
,beamWidthYError_(-1.)
|
49 |
lethuill |
1.2 |
{;}
|
50 |
|
|
|
51 |
|
|
TRootBeamSpot(Double_t vx, Double_t vy, Double_t vz, Double_t evx, Double_t evy, Double_t evz) :
|
52 |
|
|
TVector3(vx,vy,vz)
|
53 |
|
|
,error_(evx,evy,evz)
|
54 |
|
|
,sigmaZ_(-1.)
|
55 |
|
|
,sigmaZError_(-1.)
|
56 |
lethuill |
1.3 |
,beamWidthX_(-1.)
|
57 |
|
|
,beamWidthXError_(-1.)
|
58 |
|
|
,beamWidthY_(-1.)
|
59 |
|
|
,beamWidthYError_(-1.)
|
60 |
lethuill |
1.2 |
{;}
|
61 |
|
|
|
62 |
|
|
TRootBeamSpot(const TVector3 &vertex) :
|
63 |
|
|
TVector3(vertex)
|
64 |
|
|
,error_(-1.,-1.,-1.)
|
65 |
|
|
,sigmaZ_(-1.)
|
66 |
|
|
,sigmaZError_(-1.)
|
67 |
lethuill |
1.3 |
,beamWidthX_(-1.)
|
68 |
|
|
,beamWidthXError_(-1.)
|
69 |
|
|
,beamWidthY_(-1.)
|
70 |
|
|
,beamWidthYError_(-1.)
|
71 |
lethuill |
1.2 |
{;}
|
72 |
|
|
|
73 |
|
|
TRootBeamSpot( const TVector3 &vertex, const TVector3 &vertex_error) :
|
74 |
|
|
TVector3(vertex)
|
75 |
|
|
,error_(vertex_error)
|
76 |
|
|
,sigmaZ_(-1.)
|
77 |
|
|
,sigmaZError_(-1.)
|
78 |
lethuill |
1.3 |
,beamWidthX_(-1.)
|
79 |
|
|
,beamWidthXError_(-1.)
|
80 |
|
|
,beamWidthY_(-1.)
|
81 |
|
|
,beamWidthYError_(-1.)
|
82 |
lethuill |
1.2 |
{;}
|
83 |
|
|
|
84 |
lethuill |
1.3 |
TRootBeamSpot(Double_t vx, Double_t vy, Double_t vz, Double_t evx, Double_t evy, Double_t evz, Float_t sigmaZ, Float_t sigmaZError, Float_t beamWidthX, Float_t beamWidthXError, Float_t beamWidthY, Float_t beamWidthYError) :
|
85 |
lethuill |
1.2 |
TVector3(vx,vy,vz)
|
86 |
|
|
,error_(evx,evy,evz)
|
87 |
|
|
,sigmaZ_(sigmaZ)
|
88 |
|
|
,sigmaZError_(sigmaZError)
|
89 |
lethuill |
1.3 |
,beamWidthX_(beamWidthX)
|
90 |
|
|
,beamWidthXError_(beamWidthXError)
|
91 |
|
|
,beamWidthY_(beamWidthY)
|
92 |
|
|
,beamWidthYError_(beamWidthYError)
|
93 |
lethuill |
1.2 |
{;}
|
94 |
|
|
|
95 |
|
|
~TRootBeamSpot() {;}
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
TVector3 error() const { return error_;}
|
99 |
|
|
Double_t xError() const { return error_.x(); }
|
100 |
|
|
Double_t yError() const { return error_.y(); }
|
101 |
|
|
Double_t zError() const { return error_.z(); }
|
102 |
|
|
Float_t sigmaZ() const { return sigmaZ_;}
|
103 |
|
|
Float_t sigmaZError() const { return sigmaZError_;}
|
104 |
lethuill |
1.3 |
Float_t beamWidthX() const { return beamWidthX_;}
|
105 |
|
|
Float_t beamWidthXError() const { return beamWidthXError_;}
|
106 |
|
|
Float_t beamWidthY() const { return beamWidthY_;}
|
107 |
|
|
Float_t beamWidthYError() const { return beamWidthYError_;}
|
108 |
lethuill |
1.2 |
|
109 |
|
|
TString typeName() const { return "TRootBeamSpot"; }
|
110 |
|
|
|
111 |
|
|
void setError(TVector3 error) { error_ = error; }
|
112 |
|
|
void setXerror(Double_t xerr) { error_.SetX(xerr); }
|
113 |
|
|
void setYerror(Double_t yerr) { error_.SetY(yerr); }
|
114 |
|
|
void setZerror(Double_t zerr) { error_.SetZ(zerr); }
|
115 |
|
|
void setSigmaZ(Float_t sigmaZ) { sigmaZ_ = sigmaZ; }
|
116 |
|
|
void setSigmaZError(Float_t sigmaZError) { sigmaZError_ = sigmaZError; }
|
117 |
lethuill |
1.3 |
void setBeamWidthX(Float_t beamWidthX) { beamWidthX_ = beamWidthX; }
|
118 |
|
|
void setBeamWidthXError(Float_t beamWidthXError) { beamWidthXError_ = beamWidthXError; }
|
119 |
|
|
void setBeamWidthY(Float_t beamWidthY) { beamWidthY_ = beamWidthY; }
|
120 |
|
|
void setBeamWidthYError(Float_t beamWidthYError) { beamWidthYError_ = beamWidthYError; }
|
121 |
lethuill |
1.2 |
|
122 |
lethuill |
1.3 |
void fill(Double_t vx, Double_t vy, Double_t vz, Double_t evx, Double_t evy, Double_t evz, Float_t sigmaZ, Float_t sigmaZError, Float_t beamWidthX, Float_t beamWidthXError, Float_t beamWidthY, Float_t beamWidthYError)
|
123 |
lethuill |
1.2 |
{
|
124 |
|
|
this->SetXYZ(vx,vy,vz);
|
125 |
|
|
error_.SetXYZ(evx,evy,evz);
|
126 |
|
|
sigmaZ_ = sigmaZ;
|
127 |
|
|
sigmaZError_ = sigmaZError;
|
128 |
lethuill |
1.3 |
beamWidthX_ = beamWidthX;
|
129 |
|
|
beamWidthXError_ = beamWidthXError;
|
130 |
|
|
beamWidthY_ = beamWidthY;
|
131 |
|
|
beamWidthYError_ = beamWidthYError;
|
132 |
lethuill |
1.2 |
}
|
133 |
|
|
|
134 |
|
|
void clear()
|
135 |
|
|
{
|
136 |
|
|
this->SetXYZ(-999999.,-999999.,-999999.);
|
137 |
|
|
error_.SetXYZ(-1.,-1.,-1.);
|
138 |
|
|
sigmaZ_ = -1.;
|
139 |
|
|
sigmaZError_ = -1.;
|
140 |
lethuill |
1.3 |
beamWidthX_ = -1.;
|
141 |
|
|
beamWidthXError_ = -1.;
|
142 |
|
|
beamWidthY_ = -1.;
|
143 |
|
|
beamWidthYError_ = -1.;
|
144 |
lethuill |
1.2 |
}
|
145 |
|
|
|
146 |
|
|
friend std::ostream& operator<< (std::ostream& stream, const TRootBeamSpot& spot) {
|
147 |
|
|
stream << "TRootBeamSpot - (x,y,z)=(" << spot.x() << ","<< spot.y() << ","<< spot.z() << ")"
|
148 |
|
|
<< " error=(" << spot.xError() << ","<< spot.yError() << ","<< spot.zError() << ")"
|
149 |
|
|
<< " sigmaZ=" << spot.sigmaZ() << " +- "<< spot.sigmaZError()
|
150 |
lethuill |
1.3 |
<< " Beam width: sigmaX=" << spot.beamWidthX() << " +- "<< spot.beamWidthXError()
|
151 |
|
|
<< " sigmaY=" << spot.beamWidthY() << " +- "<< spot.beamWidthYError();
|
152 |
lethuill |
1.2 |
return stream;
|
153 |
|
|
};
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
private:
|
157 |
|
|
|
158 |
|
|
TVector3 error_; // Error on (x,y,z) beam position
|
159 |
|
|
Float_t sigmaZ_; // RMS bunch length
|
160 |
|
|
Float_t sigmaZError_; // RMS bunch length error
|
161 |
lethuill |
1.3 |
Float_t beamWidthX_; // Average beam width in x
|
162 |
|
|
Float_t beamWidthXError_; // Error on average beam x width
|
163 |
|
|
Float_t beamWidthY_; // Average beam width in y
|
164 |
|
|
Float_t beamWidthYError_; // Error on average beam y width
|
165 |
lethuill |
1.2 |
|
166 |
lethuill |
1.3 |
ClassDef (TRootBeamSpot,2);
|
167 |
lethuill |
1.2 |
|
168 |
lethuill |
1.1 |
};
|
169 |
|
|
|
170 |
|
|
#endif
|