source: SuperB-LAL/trunk/slacExperiment_USBWC-CRT/mergeCRTandUSB/src/crtTrk.cpp

Last change on this file was 14, checked in by narnaud, 14 years ago

Initial commit

File size: 1.2 KB
Line 
1//my
2#include "crtTrk.hh"
3#include "crtConst.hh"
4
5//root
6#include <TH2.h>
7#include <TH1D.h>
8#include <TStyle.h>
9#include <TCanvas.h>
10#include <TPad.h>
11#include <TMath.h>
12#include <TLine.h>
13#include <TVector3.h>
14
15//C, C++
16#include <time.h>
17#include <stdio.h>
18#include <assert.h>
19#include <stdlib.h>
20#include <iostream>
21#include <fstream>
22#include <string>
23#include <iomanip>
24#include <math.h>
25
26crtTrk::crtTrk(Double_t x1,Double_t y1, Double_t x2,Double_t y2){
27  _x1 = x1;
28  _y1 = y1;
29  _z1 = 0.0;
30  _x2 = x2;
31  _y2 = y2;
32  _z2 = crtConst::hodo_hight;
33
34  TVector3 r1(_x1,_y1,_z1);
35  TVector3 r2(_x2,_y2,_z2);
36  //TVector3 r2(_x1,_y1,_z1);
37  //TVector3 r1(_x2,_y2,_z2);
38
39  TVector3 dr = (r1 - r2);
40
41  if(dr.Z()>0.0){
42    dr.SetX(-1.0*dr.X());
43    dr.SetY(-1.0*dr.Y());
44    dr.SetZ(-1.0*dr.Z());
45  }
46
47  Double_t magdr = dr.Mag();
48  dr.SetXYZ(dr.x()/magdr,dr.y()/magdr,dr.z()/magdr);
49  _a = dr;
50  _r1 = r1;
51
52  _Theta = _a.Theta()*180.0/TMath::Pi();
53  _Phi = _a.Phi()*180.0/TMath::Pi();
54
55  _Momid = -999;
56  //cout<<"_u.Theta()   "<<_u.Theta()*180.0/TMath::Pi()<<endl;
57 
58}
59
60crtTrk::~crtTrk(){
61}
62
63Double_t crtTrk::getTrkTheta(){
64  return _Theta;
65}
66
67Double_t crtTrk::getTrkPhi(){
68  return _Phi;
69}
Note: See TracBrowser for help on using the repository browser.