CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
TestTrack.h
Go to the documentation of this file.
1#ifndef TESTTRACK
2#define TESTTRACK
3
9
12#include <vector>
13#include <string>
14#include "TFile.h"
15#include "TTree.h"
16#include "TString.h"
18#include "TH1F.h"
19
20
21class IDataProviderSvc;
22#define MAXNOFCLUSTERS 500 // HACK THIS 10000
23#define MAXNOFHITS 2400
24#define MAXNOFFITPOINT 4
25#define MAXNOFLAYER 2
26#define MAXNOFSHEET 2
27
28class TestTrack : public Algorithm{
29public:
30 // Constructor
31 TestTrack(const std::string& name, ISvcLocator* pSvcLocator);
32 ~TestTrack();
33 // Executable
34 StatusCode initialize();
35 StatusCode execute ();
36 StatusCode finalize ();
37
38 void reset();
39 void reset_hit();
40 void reset_cluster_1d();
41 void reset_cluster_2d();
42 void reset_map();
43 void reset_track();
44
45private:
46
47 bool selDigi(CgemDigiCol::iterator iter, int sel);
48 void DefineHitTree();
49 void DefineClusterTree();
50 void DefineTrackTree();
51
52 std::map<int, std::vector< int > > *GetStripToHitMap(int ilayer, int isheet, int iview);
53 std::map<int, int> *GetStripToCounterMap(int ilayer, int isheet, int iview);
54
55 // computation of P.O.C.A. = Point Of Closest Approach of the found
56 // track to the origin (0, 0, 0,) in the global, aligned reference frame
57 // --> xP, yP, zP is in the aligned frame!
58 void ComputePOCA(double &xP, double &yP, double &zP);
59
60 // Compute the intersection of the fitted track on the layerid-ith layer
61 // * layerid = 0, 1, 2 means L1, L2, L3
62 // * if align flag is on --> the intersection x, y, z is in the alighed frame
63 // otherwise the intersection x, y, z are in the non aligned frame
64 // * phi1, v1 are always in the local frame of the layer
65 bool ComputeIntersection(int layerid,
66 double &x1, double &y1, double &z1, double& phi1, double &v1,
67 double &x2, double &y2, double &z2, double& phi2, double &v2,
68 double &angCR_xy, double &angCR_yz);
69
70 bool align_flag;
71
72 // A data server
73 IDataProviderSvc* m_evtSvc;
74
75 CgemLUTReader *lutreader;
76 string lutfile;
77
79 double anode_mid_gap_L1;
80 double anode_mid_gap_L2;
81
82 CgemMidDriftPlane* midplane;
83 CgemGeoAlign* alignment;
84
85
86 // strip maps
87 std::map<int, std::vector< int > > map_L1_S1_stripx_to_hit;
88 std::map<int, std::vector< int > > map_L2_S1_stripx_to_hit;
89 std::map<int, std::vector< int > > map_L2_S2_stripx_to_hit;
90 std::map<int, std::vector< int > > map_L1_S1_stripv_to_hit;
91 std::map<int, std::vector< int > > map_L2_S1_stripv_to_hit;
92 std::map<int, std::vector< int > > map_L2_S2_stripv_to_hit;
93
94 int m_selGoodDigi; // 0: no selection, 1: select good digi, -1: noisy digi
95 // time window for digi [ns]
96 double m_minDigiTime;
97 double m_maxDigiTime;
98 // min charge for digi
99 double myQMin;
100
101
102 TFile *output;
103 TTree *tree;
104
105 ICgemGeomSvc *m_SvcCgem;
106
107 // hit
108 int event;
109 int nhit;
110 int hit_strip[MAXNOFHITS];
111 int hit_view[MAXNOFHITS];
112 int hit_layer[MAXNOFHITS];
113 int hit_sheet[MAXNOFHITS];
114 double hit_length[MAXNOFHITS];
115 int hit_channel[MAXNOFHITS];
116 int hit_roc[MAXNOFHITS];
117 int hit_feb[MAXNOFHITS];
118 int hit_tiger[MAXNOFHITS];
119 int hit_chip[MAXNOFHITS];
120 double hit_t[MAXNOFHITS];
121 double hit_q[MAXNOFHITS];
122 int hit_quality[MAXNOFHITS];
123 int hit_selgooddigi[MAXNOFHITS];
124
125 // cluster
126 int ncluster;
127 int ncluster_1d;
128 int ncluster_2d;
129 int ncluster_2d_L1_S1;
130 int ncluster_2d_L2_S1;
131 int ncluster_2d_L2_S2;
132 int ncluster_1d_L1_S1_x;
133 int ncluster_1d_L2_S1_x;
134 int ncluster_1d_L2_S2_x;
135 int ncluster_1d_L1_S1_v;
136 int ncluster_1d_L2_S1_v;
137 int ncluster_1d_L2_S2_v;
138
139 // 1D cluster
140 double cluster_1d_t[MAXNOFCLUSTERS];
141 double cluster_1d_q[MAXNOFCLUSTERS];
142 double cluster_1d_r[MAXNOFCLUSTERS];
143 double cluster_1d_phi[MAXNOFCLUSTERS];
144 double cluster_1d_v[MAXNOFCLUSTERS];
145 double cluster_1d_v_cc[MAXNOFCLUSTERS];
146 double cluster_1d_phi_cc[MAXNOFCLUSTERS];
147 double cluster_1d_v_tpc[MAXNOFCLUSTERS];
148 double cluster_1d_phi_tpc[MAXNOFCLUSTERS];
149 double cluster_1d_a_tpc[MAXNOFCLUSTERS];
150 double cluster_1d_b_tpc[MAXNOFCLUSTERS];
151 int cluster_1d_layerid[MAXNOFCLUSTERS];
152 int cluster_1d_sheetid[MAXNOFCLUSTERS];
153 int cluster_1d_view[MAXNOFCLUSTERS];
154 int cluster_1d_ID[MAXNOFCLUSTERS];
155 int cluster_1d_strip1[MAXNOFCLUSTERS];
156 int cluster_1d_strip2[MAXNOFCLUSTERS];
157 int cluster_1d_size[MAXNOFCLUSTERS];
158 int cluster_1d_hitindex[MAXNOFCLUSTERS][50];
159
160 // 2D cluster
161 double cluster_2d_t[MAXNOFCLUSTERS];
162 double cluster_2d_q[MAXNOFCLUSTERS];
163 double cluster_2d_r[MAXNOFCLUSTERS];
164 double cluster_2d_phi[MAXNOFCLUSTERS];
165 double cluster_2d_z[MAXNOFCLUSTERS];
166 double cluster_2d_z_cc[MAXNOFCLUSTERS];
167 double cluster_2d_phi_cc[MAXNOFCLUSTERS];
168 double cluster_2d_z_tpc[MAXNOFCLUSTERS];
169 double cluster_2d_phi_tpc[MAXNOFCLUSTERS];
170 int cluster_2d_layerid[MAXNOFCLUSTERS];
171 int cluster_2d_sheetid[MAXNOFCLUSTERS];
172 int cluster_2d_view[MAXNOFCLUSTERS];
173 int cluster_2d_ID[MAXNOFCLUSTERS];
174 int cluster_2d_idx[MAXNOFCLUSTERS];
175 int cluster_2d_idv[MAXNOFCLUSTERS];
176 int cluster_2d_highest[MAXNOFCLUSTERS];
177
178 // track
179 double track_dr;
180 double track_phi0;
181 double track_dz;
182 double track_tanL;
183 double track_chi2;
184 int track_nfitpoint;
185 int track_clusterid[MAXNOFFITPOINT];
186 int track_layerid[MAXNOFFITPOINT];
187 int track_sheetid[MAXNOFFITPOINT];
188 int track_test_layerid;
189 int track_test_sheetid;
190 // poca
191 double track_xpoca_glo;
192 double track_ypoca_glo;
193 double track_zpoca_glo;
194 // L1 intersection
195 double track_x1top_glo;
196 double track_y1top_glo;
197 double track_z1top_glo;
198 double track_phi1top_loc;
199 double track_v1top_loc;
200 //
201 double track_x1bot_glo;
202 double track_y1bot_glo;
203 double track_z1bot_glo;
204 double track_phi1bot_loc;
205 double track_v1bot_loc;
206 // L2 intersection
207 double track_x2top_glo;
208 double track_y2top_glo;
209 double track_z2top_glo;
210 double track_phi2top_loc;
211 double track_v2top_loc;
212 //
213 double track_x2bot_glo;
214 double track_y2bot_glo;
215 double track_z2bot_glo;
216 double track_phi2bot_loc;
217 double track_v2bot_loc;
218
219 double ang_xy_L1;
220 double ang_yz_L1;
221 double ang_xy_L2;
222 double ang_yz_L2;
223
224
225};
226#endif
Double_t phi2
Double_t phi1
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
#define MAXNOFFITPOINT
Definition TestTrack.h:24
#define MAXNOFCLUSTERS
Definition TestTrack.h:22
#define MAXNOFHITS
Definition TestTrack.h:23
void reset_cluster_2d()
void reset_cluster_1d()
StatusCode finalize()
void reset()
TestTrack(const std::string &name, ISvcLocator *pSvcLocator)
Definition TestTrack.cxx:46
void reset_map()
void reset_track()
StatusCode initialize()
StatusCode execute()
void reset_hit()