1 |
pam-fi |
1.1 |
/** |
2 |
|
|
* \file TrkLevel1.h |
3 |
|
|
* \author Elena Vannuccini |
4 |
|
|
*/ |
5 |
|
|
#ifndef trklevel1_h |
6 |
|
|
#define trklevel1_h |
7 |
|
|
|
8 |
|
|
#include <TObject.h> |
9 |
|
|
#include <TClonesArray.h> |
10 |
|
|
#include <TRef.h> |
11 |
pam-fi |
1.11 |
#include <TROOT.h> |
12 |
|
|
#include <TSystem.h> |
13 |
pam-fi |
1.1 |
|
14 |
pam-fi |
1.11 |
//#include <TrkStruct.h> |
15 |
|
|
#include <TrkParams.h> |
16 |
pam-fi |
1.1 |
|
17 |
pam-fi |
1.2 |
#define INC_CUT 4. |
18 |
pam-fi |
1.1 |
/** |
19 |
|
|
* \brief Class to describe tracker clusters. |
20 |
|
|
* |
21 |
pam-fi |
1.2 |
* A cluster is defined as a group of adjacent strips whose signals exceed noise by INC_CUT sigma, and at least one strip has signal/noise > SEED_CUT. Tipical values are SEED_CUT = 7 and INC_CUT = 4. |
22 |
|
|
* |
23 |
pam-fi |
1.1 |
*/ |
24 |
|
|
// ================================================================== |
25 |
|
|
class TrkCluster : public TObject { |
26 |
|
|
|
27 |
|
|
private: |
28 |
|
|
|
29 |
|
|
|
30 |
|
|
public: |
31 |
|
|
|
32 |
pam-fi |
1.5 |
int view; ///< view |
33 |
|
|
int maxs; ///< strip number (1-3072) of cluster center |
34 |
|
|
int indmax; |
35 |
|
|
|
36 |
|
|
Int_t CLlength; ///< number of stored strip info (signal+sigma+adc+bad) |
37 |
|
|
Float_t *clsignal; //[CLlength] |
38 |
|
|
Float_t *clsigma; //[CLlength] |
39 |
|
|
Int_t *cladc; //[CLlength] |
40 |
|
|
Bool_t *clbad; //[CLlength] |
41 |
|
|
|
42 |
pam-fi |
1.1 |
TrkCluster(); |
43 |
pam-fi |
1.8 |
~TrkCluster(){Clear();}; |
44 |
pam-fi |
1.1 |
TrkCluster(const TrkCluster&); |
45 |
|
|
|
46 |
|
|
void Dump(); |
47 |
pam-fi |
1.7 |
void Clear(); |
48 |
pam-fi |
1.8 |
void Clear(Option_t *option){Clear();}; |
49 |
|
|
void Delete(){Clear();}; |
50 |
pam-fi |
1.3 |
|
51 |
pam-fi |
1.4 |
Float_t GetSignal(Int_t, Float_t); ///< cluster signal |
52 |
|
|
Float_t GetSignal(Float_t cut) { return GetSignal( (Int_t)0, cut); }; |
53 |
|
|
Float_t GetSignal(Int_t nstrip) { return GetSignal( nstrip, (Float_t)(-1000) ); }; |
54 |
|
|
Float_t GetSignal() { return GetSignal( (Int_t)0,(Float_t)INC_CUT); }; |
55 |
|
|
|
56 |
|
|
Float_t GetSignalToNoise(Int_t,Float_t); ///< cluster signal/noise |
57 |
|
|
Float_t GetSignalToNoise(Float_t cut) { return GetSignalToNoise( (Int_t)0, cut); }; |
58 |
|
|
Float_t GetSignalToNoise(Int_t nstrip) { return GetSignalToNoise( nstrip, (Float_t)(-1000) ); }; |
59 |
|
|
Float_t GetSignalToNoise() { return GetSignalToNoise( (Int_t)0, (Float_t)INC_CUT); }; |
60 |
|
|
|
61 |
|
|
|
62 |
|
|
Int_t GetMultiplicity(Float_t); ///< cluster multiplicity |
63 |
|
|
Int_t GetMultiplicity() { return GetMultiplicity(INC_CUT); }; |
64 |
|
|
|
65 |
pam-fi |
1.11 |
void GetLevel1Struct(cTrkLevel1* l1); |
66 |
|
|
void GetLevel1Struct(){GetLevel1Struct(&level1event_);}; |
67 |
pam-fi |
1.4 |
|
68 |
|
|
Float_t GetCOG(Int_t); |
69 |
pam-fi |
1.5 |
Float_t GetCOG(Float_t angle); |
70 |
pam-fi |
1.4 |
Float_t GetCOG(){ return GetCOG(0); }; |
71 |
pam-fi |
1.14 |
Float_t GetETA(Int_t,float,bool); |
72 |
|
|
// Float_t GetETA(float angle){ return GetETA(0,angle); }; |
73 |
|
|
Float_t GetPositionPU(float); |
74 |
|
|
|
75 |
|
|
|
76 |
pam-fi |
1.4 |
Bool_t IsBad(Int_t); ///< bad-cluster flag |
77 |
pam-fi |
1.8 |
Bool_t IsSaturated(Int_t); ///< saturated-cluster flag |
78 |
pam-fi |
1.6 |
|
79 |
|
|
Int_t GetPlane() { return (Int_t)((view+1)/2);}; ///< plane number (1-6) |
80 |
|
|
Int_t GetLadder(){ return 1+(Int_t)((maxs-1)/1024); }; ///< ladder number (1-3) |
81 |
|
|
Bool_t IsY(){ return (Bool_t)view%2; }; |
82 |
|
|
Bool_t IsX(){ return !((Bool_t)view%2); }; |
83 |
pam-fi |
1.2 |
|
84 |
|
|
TrkCluster* GetTrkCluster(){ return this; }; |
85 |
pam-fi |
1.1 |
|
86 |
|
|
friend class TrkLevel1; |
87 |
|
|
|
88 |
pam-fi |
1.2 |
ClassDef(TrkCluster,2); |
89 |
pam-fi |
1.1 |
|
90 |
|
|
}; |
91 |
|
|
|
92 |
|
|
/** |
93 |
|
|
* \brief Class to describe tracker LEVEL1 data. |
94 |
|
|
* |
95 |
pam-fi |
1.2 |
* A Level1 tracker event is defined as a collection of clusters ( TrkCluster objects ). |
96 |
|
|
* The result of common-noise computation for each viking is also stored ( cnev[24][12] ). |
97 |
|
|
* A general flag summarize the event status (missing sections, crc failures, decoding errors ans so on...). |
98 |
pam-fi |
1.1 |
*/ |
99 |
|
|
class TrkLevel1 : public TObject { |
100 |
|
|
|
101 |
|
|
private: |
102 |
pam-fi |
1.5 |
|
103 |
pam-fi |
1.1 |
public: |
104 |
|
|
|
105 |
pam-fi |
1.5 |
Int_t good[12]; ///< event status |
106 |
|
|
Float_t cn[24][12]; ///< CN |
107 |
|
|
// Float_t cnrms[24][12]; ///< CN RMS |
108 |
|
|
Int_t cnn[24][12]; ///< number of strips for CN computation |
109 |
pam-fi |
1.7 |
|
110 |
pam-fi |
1.2 |
|
111 |
pam-fi |
1.1 |
TClonesArray *Cluster; ///< clusters |
112 |
pam-fi |
1.7 |
|
113 |
pam-fi |
1.1 |
TrkLevel1(); |
114 |
pam-fi |
1.5 |
~TrkLevel1(){Delete();}; |
115 |
|
|
|
116 |
|
|
int nclstr() {return Cluster->GetEntries();} ///< number of stored clusters |
117 |
|
|
|
118 |
pam-fi |
1.1 |
void Dump(); |
119 |
pam-fi |
1.11 |
// void SetFromLevel1Struct(cTrkLevel1 *, Bool_t); |
120 |
pam-fi |
1.3 |
// void GetLevel1Struct(cTrkLevel1 *) const; |
121 |
pam-fi |
1.11 |
void GetLevel1Struct(cTrkLevel1 *l1); |
122 |
|
|
void SetFromLevel1Struct(cTrkLevel1 *l1, Bool_t full); |
123 |
|
|
void GetLevel1Struct(){GetLevel1Struct(&level1event_);}; |
124 |
|
|
void SetFromLevel1Struct(Bool_t full){SetFromLevel1Struct(&level1event_,full);}; |
125 |
|
|
void SetFromLevel1Struct(){SetFromLevel1Struct(true);}; |
126 |
|
|
|
127 |
pam-fi |
1.5 |
void Clear(); |
128 |
|
|
void Delete(); |
129 |
pam-fi |
1.9 |
void Set(); |
130 |
pam-fi |
1.5 |
|
131 |
pam-fi |
1.1 |
TrkCluster* GetCluster(int); |
132 |
|
|
|
133 |
|
|
TrkLevel1* GetTrkLevel1(){return this;} |
134 |
pam-fi |
1.3 |
TClonesArray* GetClusters(){return Cluster;}; ///< returns pointer to the cluster array |
135 |
pam-fi |
1.1 |
|
136 |
pam-fi |
1.11 |
/* int LoadPfaParam(TString); */ |
137 |
|
|
/* int LoadFieldParam(TString); */ |
138 |
|
|
/* int LoadChargeParam(TString); */ |
139 |
|
|
/* int LoadAlignmentParam(TString); */ |
140 |
|
|
/* int LoadMipParam(TString); */ |
141 |
|
|
/* int LoadVKMaskParam(TString); */ |
142 |
|
|
/* int LoadPfaParam(){return LoadPfaParam("");}; */ |
143 |
|
|
/* int LoadFieldParam(){return LoadFieldParam("");}; */ |
144 |
|
|
/* int LoadChargeParam(){return LoadChargeParam("");}; */ |
145 |
|
|
/* int LoadAlignmentParam(){return LoadAlignmentParam("");}; */ |
146 |
|
|
/* int LoadMipParam(){return LoadMipParam("");}; */ |
147 |
|
|
/* int LoadVKMaskParam(){return LoadVKMaskParam("");}; */ |
148 |
|
|
/* int LoadParams(); */ |
149 |
|
|
|
150 |
pam-fi |
1.13 |
// int ProcessEvent(int); |
151 |
|
|
// int ProcessEvent(){return ProcessEvent();}; |
152 |
|
|
int ProcessEvent(); |
153 |
pam-fi |
1.11 |
|
154 |
|
|
int GetPfaNbinsAngle(); |
155 |
|
|
int GetPfaNbinsETA(); |
156 |
pam-fi |
1.10 |
int GetPfaNbinsCharge(){return 0;}; |
157 |
|
|
float* GetPfaCoord(TString pfa, int nview, int nladder, int nang); |
158 |
|
|
float* GetPfaAbs(TString pfa, int nang); |
159 |
|
|
|
160 |
pam-fi |
1.12 |
void StatusDump(int view); |
161 |
|
|
Bool_t StatusCheck(int view, int flagmask); |
162 |
|
|
|
163 |
pam-fi |
1.13 |
|
164 |
|
|
void SetPFA(int pfaid){ sw_.pfaid = pfaid; }; |
165 |
|
|
int GetPFA(){ return sw_.pfaid; }; |
166 |
|
|
|
167 |
pam-fi |
1.11 |
|
168 |
pam-fi |
1.5 |
ClassDef(TrkLevel1,2); |
169 |
pam-fi |
1.1 |
|
170 |
|
|
}; |
171 |
|
|
|
172 |
|
|
|
173 |
|
|
#endif |