-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathFitLayer.h
More file actions
102 lines (82 loc) · 1.87 KB
/
Copy pathFitLayer.h
File metadata and controls
102 lines (82 loc) · 1.87 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef FITLAYER_H
#define FITLAYER_H
#include "util.h"
#include "TString.h"
#include "TFile.h"
#include "TH1.h"
#include "TNtuple.h"
#include <iostream>
#include "TrackModelPhysical.h"
struct Tracker;
using namespace std;
struct FitLayerHit{
double x;
double y;
double z;
double r;
double phi;
double searchPhi;
double t;
double BzFwd;
double BzMid;
double BzBck;
bool isClone;
int id;
int module;
int timeMark;
void Print() const;
};
struct FitLayerBin{
int firstHit;
int nHits;
};
struct FitLayer
{
// phi + t (== z or r) coordinates
void Create( int layerID, bool phiWindowInCm, double searchWindowPhi, double searchWindowT, bool prn=0 );
int getBinPhi( double phi ){ // get bin for phi with searchWindowPhi/2 marging
int bin = int ( 0.5 + (phi - mPhiMin) * mBinPhiInv );
if( bin < 0 || bin >= mNbinsPhi-1 ){
cout<<"Wrong bin Phi : phi "<<phi<<" bin "<< bin <<" out of "<< mNbinsPhi <<endl;
return -1;//exit(0);
}
return bin;
}
int getBinT( double t ){// get bin for t with searchWindowT/2 marging
int bin = int ( 0.5 + (t-mTmin) * mBinTInv );
// TODO: can be removed later
if( bin < 0 ) bin=0;
if( bin > mNbinsT-2 ) bin = mNbinsT-2;
if( bin < 0 || bin > mNbinsT-2 ){
cout<<"Wrong bin T "<< bin <<" out of "<< mNbinsT <<endl;
return -1;//exit(0);
}
return bin;
}
int getBin( double phi, double t ){
int it = getBinT(t);
int iphi = getBinPhi( phi );
return it*mNbinsPhi + iphi;
}
void Print();
Tracker *mTracker = 0;
int mType;
int mVolume;
int mLayer;
double mBinPhi;
double mBinT;
double mBinPhiInv;
double mBinTInv;
int mNbinsPhi;
int mNbinsT;
int mNbinsTotal;
double mTmin;
double mTmax;
double mPhiMin;
double mR;
double mZ;
int mTimeMark;
vector<FitLayerBin> mBins;
vector<FitLayerHit> mFitHits;
};
#endif