-
Notifications
You must be signed in to change notification settings - Fork 3
/
SoLIDGEMChamber.h
117 lines (102 loc) · 5.05 KB
/
SoLIDGEMChamber.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
117
#ifndef ROOT_SoLID_GEM_Chamber
#define ROOT_SoLID_GEM_Chamber
//c++
#include <vector>
#include <string>
//root
#include "TClonesArray.h"
#include "TVector2.h"
#include "TFile.h"
#include "TH2.h"
#include "TAxis.h"
//Hall A analyzer
#include "THaSubDetector.h"
//SoLID Tracking
#include "SoLIDGEMReadOut.h"
#include "SoLIDGEMTracker.h"
#include "SoLIDUtility.h"
class SoLIDGEMTracker;
class SoLIDGEMReadOut;
class SoLIDGEMChamber : public THaSubDetector{
public:
SoLIDGEMChamber(Int_t ichamber, const char* name, const char* description = "",
THaDetectorBase* parent = 0 );
SoLIDGEMChamber() : fHits(0) {}
virtual ~SoLIDGEMChamber();
virtual void Clear( Option_t* opt="" );
virtual Int_t Decode( const THaEvData& );
virtual EStatus Init( const TDatime& date );
virtual void Print( Option_t* opt="" ) const;
virtual void PrintDataBase(Int_t level) const;
virtual Int_t Begin( THaRunBase* r=0 );
virtual Int_t End( THaRunBase* r=0 );
void SetChamberID(Int_t i) { fChamberID = i; }
Int_t GetChamberID() const { return fChamberID; }
Double_t GetPhi() const { return fPhi; }//in rad from -pi to pi
Double_t GetPhiCover() const { return fPhiCover; }
Double_t GetPhiOffset() const { return fPhiOffset; }
TVector2 GetReference() const { return fReference; }
const TVector3& GetCenterPos() const { return fChamberCenter; }
Double_t GetZ() const { return fTrackerZ + fDz; }
Int_t GetNHits() const { return fHits->GetLast()+1; }
TSeqCollection* GetHits() const { return fHits; }
Double_t GetPhiInLab() { return fPhiInLab; }
void UVtoCartesian(Double_t upos, Double_t vpos,
Double_t& x, Double_t& y, Double_t& r, Double_t& phi);
Bool_t CartesianToUV(Double_t &x, Double_t &y, Double_t &u, Double_t &v);
//TSeqCollection* GetRawHits(Int_t i) const { return fGEMReadOut[i]->GetHits(); }
SoLIDGEMReadOut * GetReadOut(Int_t i) const {
if (i >=0 && i< fNReadOut) { return fGEMReadOut[i]; }
else { return 0; }
}
Double_t GetUOccupancy() const { return fUOccupancy; }
Double_t GetUHitOccupancy() const { return fUHitOccupancy; }
Double_t GetVOccupancy() const { return fVOccupancy; }
Double_t GetVHitOccupancy() const { return fVHitOccupancy; }
protected:
virtual Int_t ReadDatabase( const TDatime& date );
virtual Int_t ReadGeometry( FILE* file, const TDatime& date,
Bool_t required = kTRUE );
virtual Int_t DefineVariables( EMode mode = kDefine );
Int_t ProcessRawHits(TSeqCollection* uhits, TSeqCollection* vhits);
Bool_t CheckChargeAsymmetry(Double_t qu, Double_t qv);
void RotateToLab(Double_t *phi);
void RotateToChamber(Double_t *phi);
Bool_t Contains(Double_t *r, Double_t *phi);
Bool_t ContainsEdge(Double_t x, Double_t y);
Bool_t HasIntersect(Short_t uChanID, Short_t vChanID);
void GetStripEndPoint(int proj, int type, int chan, double* x, double* y);
Int_t fChamberID; //sector is the same as chamber, but chamber sounds nicer IMO
Int_t fParentTrackerID;
//for database
Int_t fNReadOut; //number of readout plane for in this chamber
Int_t fDo3DAmCorr; //whether we do charge amplitude correlation cut
Double_t f3DAmCorrCut; //cut on the charge amplitude correlation
Double_t fRMin; //inner radius of the chamber
Double_t fRMax; //outer radius of the chamber
Double_t fDz; //shift in z with respect to the parent tracker
//should be 0 for PVDIS, but not always for SIDIS due to overlap
Double_t fPhi; //the phi angle of this chamber with respect to the phi angle of
//the tracker system it belongs to
Double_t fPhiCover; //the phi coverage of this chamber with respect to the reference
Double_t fPhiOffset; //phi offset in addition to fPhi of this chamber
Double_t fPhiInLab; //the total phi angle with respect to the lab system
TVector2 fReference; //the reference point of this chamber, see comment in ReadGeometry
Double_t fPhiMin;
Double_t fPhiMax;
Double_t fTrackerZ;
TClonesArray* fHits; //collection for a pair of raw hits, checked by amplitude matching,
// whether inside active area of the GEM detector, and so on
Double_t fUOccupancy;
Double_t fVOccupancy;
Double_t fUHitOccupancy;
Double_t fVHitOccupancy;
TVector3 fChamberCenter;
TH2F* fAcceptHist;
Int_t fHasDivSeg;
Double_t fDivSegX[4];
Double_t fDivSegY[4];
std::vector<SoLIDGEMReadOut*> fGEMReadOut; //The readout plane that the chamber has, usually 2
ClassDef(SoLIDGEMChamber,0)
};
#endif