forked from JeffersonLab/EVe_HallC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CStransform.cxx
67 lines (55 loc) · 1.19 KB
/
CStransform.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//*************************************************************************
// CSTransform.cxx - 4/14/2008
//
// by miham
//
// We use this class to transform real coordinate values from MWDC and
// Scintillators (that we get from data) to pixels inside a canvas, where we
// want to draw out data.
//
//
//*************************************************************************
#include "CStransform.h"
#include "TMath.h"
#include <cstring>
#include <cstdio>
#include <iostream>
#include <sstream>
using namespace std;
CStransform::~CStransform()
{
}
CStransform::CStransform (double A, double cX0, double cY0)
{
// A is length in meters
alpha = 1.0/A;
CX0 = cX0;
CY0 = cY0;
}
CStransform::CStransform (double A, double cX0, double cY0, int rotation)
{
alpha = 1.0/A; // A is length in meters
if (rotation == 1) {
CX0 = cX0;
CY0 = cY0;
} else {
CX0 = -cY0;
CY0 = cX0;
}
}
double CStransform::transXtoCX(double x)
{
return alpha*x+CX0;
}
double CStransform::transYtoCY(double y)
{
return alpha*y+CY0;
}
double CStransform::transLtoCL(double l)
{
return alpha*l;
}
double CStransform::GetAlpha()
{
return alpha;
}