-
Notifications
You must be signed in to change notification settings - Fork 3
/
SIDISKalTrackFinder.h
117 lines (98 loc) · 3.42 KB
/
SIDISKalTrackFinder.h
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef ROOT_SIDIS_KAL_TRACK_FINDER
#define ROOT_SIDIS_KAL_TRACK_FINDER
//c++
#include <iostream>
#include <map>
#include <cassert>
#include <vector>
//ROOT
#include "TClonesArray.h"
#include "TSeqCollection.h"
#include "TMath.h"
#include "TVector3.h"
#include "TVector2.h"
//Hall A analyzer
#include "THaAnalysisObject.h"
//SoLIDTracking
#include "SoLIDTrack.h"
#include "SoLIDGEMHit.h"
#include "SoLIDUtility.h"
#include "SoLIDFieldMap.h"
#include "SoLIDGEMTracker.h"
#include "SoLIDGEMChamber.h"
#include "SoLIDECal.h"
#include "SoLKalMatrix.h"
#include "SoLKalFieldStepper.h"
#include "SoLKalTrackFinder.h"
using namespace std;
class SIDISKalTrackFinder : public SoLKalTrackFinder, public THaAnalysisObject
{
public:
SIDISKalTrackFinder() {;}
SIDISKalTrackFinder(bool isMC, const char* name = "SIDISTrackFinder", int detConf = 0);
~SIDISKalTrackFinder();
void ProcessHits(TClonesArray* theTracks);
void Clear( Option_t* opt="" );
Int_t ReadDatabase (const TDatime& date);
#ifdef MCDATA
bool GetSeedEfficiency(int i) const { return fSeedEfficiency[i]; }
bool GetMCTrackEfficiency(int i) const { return fMcTrackEfficiency[i]; }
#endif
protected:
//Main analysis functions
void FindDoubletSeed(Int_t planej, Int_t planek, ECType type = kFAEC);
void MergeSeed();
void TrackFollow();
void CoarseCheckVertex();
void FindandAddVertex();
void FinalSelection(TClonesArray* theTracks);
void CopyTrack(SoLIDTrack* soltrack, SoLKalTrackSystem* kaltrack);
void ECalFinalMatch();
//assistent functions
double CalDeltaPhi(const double & phi1, const double & phi2);
double CalDeltaR(const double & r1, const double & r2);
SoLKalTrackSite & SiteInitWithSeed(DoubletSeed* thisSeed);
bool TriggerCheck(SoLIDGEMHit* theHit, ECType type, Double_t& matchEnergy);
SoLIDGEMHit* FindCloestHitInWindow(double &x, double &y);
double PredictR(Int_t &plane, SoLIDGEMHit* hit1, SoLIDGEMHit* hit2);
int GetHitsInWindow(int plane, double x, double wx, double y, double wy, bool flag = false);
Double_t FindVertexZ(SoLKalTrackState* thisState);
Bool_t CheckChargeAsy(SoLKalTrackSystem* theSystem);
void GetHitChamberList(vector<Int_t> &theList, Int_t thisChamber, Int_t size);
Int_t GetChamIDFromPos(Double_t &x, Double_t &y, Int_t TrackerID);
Bool_t CalInitParForPair(SoLIDGEMHit* hita, SoLIDGEMHit* hitb, Double_t &charge,
Double_t& mom, Double_t& theta, Double_t& phi, ECType& type);
Int_t BinarySearchForR(TSeqCollection* array, Double_t &lowr);
bool fIsMC;
bool fSeedEfficiency[2];
bool fMcTrackEfficiency[2];
vector<SoLIDGEMHit*> fWindowHits;
map< Int_t, vector<SoLIDGEMHit*> > fGoodHits;
Int_t fNGoodTrack;
Int_t fDetConf;
Double_t fMomMinCut[3];
Double_t fMomMaxCut[3];
Double_t fThetaMinCut[3];
Double_t fThetaMaxCut[3];
Double_t fCellEdgeCut[2];
Double_t fCoarseCellEdgeCut[3];
Double_t fRlimitMin[3][3];
Double_t fRlimitMax[3][3];
Double_t fDeltaRMin[3][3];
Double_t fDeltaRMax[3][3];
Double_t fDeltaRMinBC[2][6];
Double_t fDeltaRMaxBC[2][6];
Double_t fDeltaPhiMin[3][3];
Double_t fDeltaPhiMax[3][3];
Double_t fDeltaPhiMinBC[2][6];
Double_t fDeltaPhiMaxBC[2][6];
Double_t fCoarseECPosCut[2];
Double_t fCoarseSPDRCut[4];
Double_t fCoarseSPDPhiCut[4];
Double_t fECPosCut;
Int_t fECEnergyMatch[3];
bool fHadronFlag;
Double_t fElectronVertexZ;
ClassDef(SIDISKalTrackFinder,0)
};
#endif