FairRoot/PandaRoot
PndCAGBHit.cxx
Go to the documentation of this file.
1 // $Id: PndCAGBHit.cxx,v 1.2 2010/09/01 10:38:27 ikulakov Exp $
2 //***************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project *
4 // ALICE Experiment at CERN, All rights reserved. *
5 // *
6 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
7 // Ivan Kisel <kisel@kip.uni-heidelberg.de> *
8 // for The ALICE HLT Project. *
9 // *
10 // Developed by: Igor Kulakov <I.Kulakov@gsi.de> *
11 // Maksym Zyzak <M.Zyzak@gsi.de> *
12 // *
13 // Permission to use, copy, modify and distribute this software and its *
14 // documentation strictly for non-commercial purposes is hereby granted *
15 // without fee, provided that the above copyright notice appears in all *
16 // copies and that both the copyright notice and this permission notice *
17 // appear in the supporting documentation. The authors make no claims *
18 // about the suitability of this software for any purpose. It is *
19 // provided "as is" without express or implied warranty. *
20 //***************************************************************************
21 
22 #include "PndCAGBHit.h"
23 #include "PndCAParameters.h"
24 #include "PndCADef.h"
25 
26 
27 void PndCAGBHit::GetLocalX0X1X2( float& x0, float& x1, float &x2 ) const {
28  double x0_, x1_, x2_;
29  PndCAParameters::GlobalToCALocal( fX, fY, fZ, fPhi, x0_, x1_, x2_ );
30  x0 = x0_;
31  x1 = x1_;
32  x2 = x2_;
33 }
34 
35 
37 {
38  double tmp=0;
39  out << a.fX << " " << a.fY << " " << a.fZ << " " << a.fR << std::endl;
40  out << a.fC[0][0] << " " << a.fC[0][1] << " " << a.fC[0][2] << std::endl;// in global c.s.!
41  out << a.fC[1][0] << " " << a.fC[1][1] << " " << a.fC[1][2] << std::endl;
42  out << a.fC[2][0] << " " << a.fC[2][1] << " " << a.fC[2][2] << std::endl;
43  out << a.fErr2R << std::endl;
44  out << a.fTubeR << " " << a.fHalfLength << std::endl;
45  out << tmp << " "<< tmp <<" " << tmp <<std::endl
46  //out << a.fEX << " "<< a.fEY <<" " << a.fEZ <<std::endl
47  << a.fIRow << " " << a.fID << " " << -a.fPhi << std::endl;
48  return out;
49 }
50 
52 {
53  double tmp;
54  UNUSED_PARAM1(tmp);
55  in >> a.fX >> a.fY >> a.fZ >> a.fR
56  >> a.fC[0][0] >> a.fC[0][1] >> a.fC[0][2] // in global c.s.!
57  >> a.fC[1][0] >> a.fC[1][1] >> a.fC[1][2]
58  >> a.fC[2][0] >> a.fC[2][1] >> a.fC[2][2]
59  >> a.fErr2R
60  >> a.fTubeR >> a.fHalfLength
61  >> tmp >> tmp >> tmp
62  //>> a.fEX >> a.fEY >> a.fEZ
63  >> a.fIRow >> a.fID >> a.fPhi;
64  a.fPhi = - a.fPhi; // TODO: fix input files
65  a.fXW = a.fX;
66  a.fYW = a.fY;
67  a.fZW = a.fZ;
68 
69  // cout << " T0 " << endl;
70  // cout << a.fC[0][0] << " " << a.fC[0][1] << " " << a.fC[0][2] << endl;
71  // cout << a.fC[1][0] << " " << a.fC[1][1] << " " << a.fC[1][2] << endl;
72  // cout << a.fC[2][0] << " " << a.fC[2][1] << " " << a.fC[2][2] << endl;
73 
74  const double s = sin(a.fPhi);
75  const double c = cos(a.fPhi);
76  // double T[3][3];
77  // T[0][0] = -s; T[0][1] = c; T[0][2] = 0;
78  // T[1][0] = c; T[1][1] = s; T[1][2] = 0;
79  // T[2][0] = 0; T[2][1] = 0; T[2][2] = -1;
80 
81  // double TC[3][3];
82  // TC[0][0] = T[0][0]*a.fC[0][0] + T[0][1]*a.fC[1][0] + T[0][2]*a.fC[2][0];
83  // TC[0][1] = T[0][0]*a.fC[0][1] + T[0][1]*a.fC[1][1] + T[0][2]*a.fC[2][1];
84  // TC[0][2] = T[0][0]*a.fC[0][2] + T[0][1]*a.fC[1][2] + T[0][2]*a.fC[2][2];
85  // TC[1][0] = T[1][0]*a.fC[0][0] + T[1][1]*a.fC[1][0] + T[1][2]*a.fC[2][0];
86  // TC[1][1] = T[1][0]*a.fC[0][1] + T[1][1]*a.fC[1][1] + T[1][2]*a.fC[2][1];
87  // TC[1][2] = T[1][0]*a.fC[0][2] + T[1][1]*a.fC[1][2] + T[1][2]*a.fC[2][2];
88  // TC[2][0] = T[2][0]*a.fC[0][0] + T[2][1]*a.fC[1][0] + T[2][2]*a.fC[2][0];
89  // TC[2][1] = T[2][0]*a.fC[0][1] + T[2][1]*a.fC[1][1] + T[2][2]*a.fC[2][1];
90  // TC[2][2] = T[2][0]*a.fC[0][2] + T[2][1]*a.fC[1][2] + T[2][2]*a.fC[2][2];
91 
92  // double TCT[3][3]; // local C
93  // // TCT'
94  // TCT[0][0] = TC[0][0]*T[0][0] + TC[0][1]*T[0][1] + TC[0][2]*T[0][2];
95  // TCT[0][1] = TC[0][0]*T[1][0] + TC[0][1]*T[1][1] + TC[0][2]*T[1][2];
96  // TCT[0][2] = TC[0][0]*T[2][0] + TC[0][1]*T[2][1] + TC[0][2]*T[2][2];
97  // TCT[1][0] = TC[1][0]*T[0][0] + TC[1][1]*T[0][1] + TC[1][2]*T[0][2];
98  // TCT[1][1] = TC[1][0]*T[1][0] + TC[1][1]*T[1][1] + TC[1][2]*T[1][2];
99  // TCT[1][2] = TC[1][0]*T[2][0] + TC[1][1]*T[2][1] + TC[1][2]*T[2][2];
100  // TCT[2][0] = TC[2][0]*T[0][0] + TC[2][1]*T[0][1] + TC[2][2]*T[0][2];
101  // TCT[2][1] = TC[2][0]*T[1][0] + TC[2][1]*T[1][1] + TC[2][2]*T[1][2];
102  // TCT[2][2] = TC[2][0]*T[2][0] + TC[2][1]*T[2][1] + TC[2][2]*T[2][2];
103 
104  // // cout << " T1 " << endl;
105  // // cout << TCT[0][0] << " " << TCT[0][1] << " " << TCT[0][2] << endl;
106  // // cout << TCT[1][0] << " " << TCT[1][1] << " " << TCT[1][2] << endl;
107  // // cout << TCT[2][0] << " " << TCT[2][1] << " " << TCT[2][2] << endl;
108 
109  // double x,y,z;
110  // PndCAParameters::GlobalToCALocal( a.fEX, a.fEY, a.fEZ, a.fPhi, x, y, z );
111  // // cout << " A " << x << " " << y << " " << z << endl;
112  // double T2[3][3];
113  // T2[0][0] = 1; T2[0][1] = 0; T2[0][2] = 0;
114  // T2[1][0] = 0; T2[1][1] = z; T2[1][2] = -y;
115  // T2[2][0] = 0; T2[2][1] = y; T2[2][2] = z;
116 
117  // TC[0][0] = T2[0][0]*TCT[0][0] + T2[0][1]*TCT[1][0] + T2[0][2]*TCT[2][0];
118  // TC[0][1] = T2[0][0]*TCT[0][1] + T2[0][1]*TCT[1][1] + T2[0][2]*TCT[2][1];
119  // TC[0][2] = T2[0][0]*TCT[0][2] + T2[0][1]*TCT[1][2] + T2[0][2]*TCT[2][2];
120  // TC[1][0] = T2[1][0]*TCT[0][0] + T2[1][1]*TCT[1][0] + T2[1][2]*TCT[2][0];
121  // TC[1][1] = T2[1][0]*TCT[0][1] + T2[1][1]*TCT[1][1] + T2[1][2]*TCT[2][1];
122  // TC[1][2] = T2[1][0]*TCT[0][2] + T2[1][1]*TCT[1][2] + T2[1][2]*TCT[2][2];
123  // TC[2][0] = T2[2][0]*TCT[0][0] + T2[2][1]*TCT[1][0] + T2[2][2]*TCT[2][0];
124  // TC[2][1] = T2[2][0]*TCT[0][1] + T2[2][1]*TCT[1][1] + T2[2][2]*TCT[2][1];
125  // TC[2][2] = T2[2][0]*TCT[0][2] + T2[2][1]*TCT[1][2] + T2[2][2]*TCT[2][2];
126 
127  // TCT[0][0] = TC[0][0]*T2[0][0] + TC[0][1]*T2[0][1] + TC[0][2]*T2[0][2];
128  // TCT[0][1] = TC[0][0]*T2[1][0] + TC[0][1]*T2[1][1] + TC[0][2]*T2[1][2];
129  // TCT[0][2] = TC[0][0]*T2[2][0] + TC[0][1]*T2[2][1] + TC[0][2]*T2[2][2];
130  // TCT[1][0] = TC[1][0]*T2[0][0] + TC[1][1]*T2[0][1] + TC[1][2]*T2[0][2];
131  // TCT[1][1] = TC[1][0]*T2[1][0] + TC[1][1]*T2[1][1] + TC[1][2]*T2[1][2];
132  // TCT[1][2] = TC[1][0]*T2[2][0] + TC[1][1]*T2[2][1] + TC[1][2]*T2[2][2];
133  // TCT[2][0] = TC[2][0]*T2[0][0] + TC[2][1]*T2[0][1] + TC[2][2]*T2[0][2];
134  // TCT[2][1] = TC[2][0]*T2[1][0] + TC[2][1]*T2[1][1] + TC[2][2]*T2[1][2];
135  // TCT[2][2] = TC[2][0]*T2[2][0] + TC[2][1]*T2[2][1] + TC[2][2]*T2[2][2];
136 
137  // cout << " T2 " << endl;
138  // cout << TCT[0][0] << " " << TCT[0][1] << " " << TCT[0][2] << endl;
139  // cout << TCT[1][0] << " " << TCT[1][1] << " " << TCT[1][2] << endl;
140  // cout << TCT[2][0] << " " << TCT[2][1] << " " << TCT[2][2] << endl;
141 
142  // const float s = y;
143  // const float c = z;
144 
145  // const float s = sin( a.fPhi );
146  // const float c = cos( a.fPhi );
147  // T = sA cA
148  // cA -sA
149  a.fErr2X0 = s*s*a.fC[0][0] + 2*s*c*a.fC[0][1] + c*c*a.fC[1][1];
150  //a.fErrX01 = c*s*(a.fC[1][1] - a.fC[0][0]) + (c*c - s*s)*a.fC[0][1];
151  a.fErr2X1 = c*c*a.fC[0][0] - 2*s*c*a.fC[0][1] + s*s*a.fC[1][1];
152  a.fErrX12 = -(c*a.fC[0][2] - s*a.fC[1][2]);
153 
154  a.fErr2X2 = a.fC[2][2];
155  return in;
156 }
157 
158 
159 //ClassImp(PndCAGBHit)
Double_t x0
Definition: checkhelixhit.C:70
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
double fX
Definition: PndCAGBHit.h:137
float fErrX12
Definition: PndCAGBHit.h:143
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
TLorentzVector s
Definition: Pnd2DStar.C:50
double fC[3][3]
Definition: PndCAGBHit.h:146
std::ostream & operator<<(std::ostream &o, const PndEventInfo &a)
double fY
Definition: PndCAGBHit.h:138
double fTubeR
Definition: PndCAGBHit.h:159
double fZW
Definition: PndCAGBHit.h:157
Int_t a
Definition: anaLmdDigi.C:126
double fXW
Definition: PndCAGBHit.h:155
void GetLocalX0X1X2(float &x0, float &x1, float &x2) const
Definition: PndCAGBHit.cxx:27
double fPhi
Definition: PndCAGBHit.h:151
double fErr2R
Definition: PndCAGBHit.h:153
TFile * out
Definition: reco_muo.C:20
float fErr2X0
Definition: PndCAGBHit.h:141
double fZ
Definition: PndCAGBHit.h:139
double fYW
Definition: PndCAGBHit.h:156
double fHalfLength
Definition: PndCAGBHit.h:159
TBuffer & operator>>(TBuffer &buf, PndAnaPidSelector *&obj)
static void GlobalToCALocal(T x, T y, T angle, T &x0, T &x1)
double fR
Definition: PndCAGBHit.h:153
float fErr2X1
Definition: PndCAGBHit.h:142
float fErr2X2
Definition: PndCAGBHit.h:144