CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
TestClusterWithHit.h
Go to the documentation of this file.
1#ifndef TESTCLUSTERWITHHIT
2#define TESTCLUSTERWITHHIT
3
8
11#include <vector>
12#include <string>
13#include "TFile.h"
14#include "TTree.h"
15#include "TString.h"
17#include "TH1F.h"
18
19
20class IDataProviderSvc;
21#define MAXNOFCLUSTERS 10000
22#define MAXNOFHITS 2400
23
24class TestClusterWithHit : public Algorithm{
25public:
26 // Constructor
27 TestClusterWithHit(const std::string& name, ISvcLocator* pSvcLocator);
29 // Executable
30 StatusCode initialize();
31 StatusCode execute ();
32 StatusCode finalize ();
33
34 void reset();
35 void reset_hit();
36 void reset_cluster_1d();
37 void reset_cluster_2d();
38 void reset_map();
39
40private:
41
42 bool selDigi(CgemDigiCol::iterator iter, int sel);
43 void DefineClusterTree();
44 void DefineHitTree();
45
46 std::map<int, std::vector< int > > *GetStripToHitMap(int ilayer, int isheet, int iview);
47 std::map<int, int> *GetStripToCounterMap(int ilayer, int isheet, int iview);
48
49 // A data server
50 IDataProviderSvc* m_evtSvc;
51
52 map<int,CgemDigiCol::iterator> myFiredStripMap[3][2][2];//[layer][sheet][XV]
53 StatusCode setDigiMap();
54 void resetFiredStripMap();
55
56 CgemLUTReader *lutreader;
57 string lutfile;
58
59 int m_selGoodDigi; // 0: no selection, 1: select good digi, -1: noisy digi
60 // time window for digi [ns]
61 double m_minDigiTime;
62 double m_maxDigiTime;
63 // min charge for digi
64 double myQMin;
65
66
67
68 // output
70
71 int nXClusterLay1;
72 double m_charge[MAXNOFCLUSTERS];
73 double m_time[MAXNOFCLUSTERS];
74 int m_plane[MAXNOFCLUSTERS];
75 int m_view[MAXNOFCLUSTERS];
76 int m_strip[MAXNOFCLUSTERS];
77
78
79 string Dir_file;
80 string TreeCluster;
81 string CosmicRayDataSetID;
82 TFile *f;
83 TTree *Tdigi;
84 int No_Entries_D;
85 int Ind_Entry_D;
86
87 // strip maps
88 std::map<int, std::vector< int > > map_L1_S1_stripx_to_hit;
89 std::map<int, std::vector< int > > map_L2_S1_stripx_to_hit;
90 std::map<int, std::vector< int > > map_L2_S2_stripx_to_hit;
91 std::map<int, std::vector< int > > map_L1_S1_stripv_to_hit;
92 std::map<int, std::vector< int > > map_L2_S1_stripv_to_hit;
93 std::map<int, std::vector< int > > map_L2_S2_stripv_to_hit;
94
95 // -------- output -------
96 TFile* output;
97 TTree *tree;
98
99 // hit
100 int event;
101 int nhit;
102 int hit_strip[MAXNOFHITS];
103 int hit_view[MAXNOFHITS];
104 int hit_layer[MAXNOFHITS];
105 int hit_sheet[MAXNOFHITS];
106
107 // cluster
108 int ncluster;
109 int ncluster_1d;
110 int ncluster_2d;
111 int ncluster_2d_L1_S1;
112 int ncluster_2d_L2_S1;
113 int ncluster_2d_L2_S2;
114 int ncluster_1d_L1_S1_x;
115 int ncluster_1d_L2_S1_x;
116 int ncluster_1d_L2_S2_x;
117 int ncluster_1d_L1_S1_v;
118 int ncluster_1d_L2_S1_v;
119 int ncluster_1d_L2_S2_v;
120
121 double anode_radius_L1_x;
122 double anode_radius_L1_v;
123 double anode_mid_gap_L1;
124 double anode_radius_L2_x;
125 double anode_radius_L2_v;
126 double anode_mid_gap_L2;
127
128 // 1D cluster
129 double cluster_1d_t[MAXNOFCLUSTERS];
130 double cluster_1d_q[MAXNOFCLUSTERS];
131 double cluster_1d_r[MAXNOFCLUSTERS];
132 double cluster_1d_phi[MAXNOFCLUSTERS];
133 double cluster_1d_v[MAXNOFCLUSTERS];
134 double cluster_1d_v_cc[MAXNOFCLUSTERS];
135 double cluster_1d_phi_cc[MAXNOFCLUSTERS];
136 double cluster_1d_v_tpc[MAXNOFCLUSTERS];
137 double cluster_1d_phi_tpc[MAXNOFCLUSTERS];
138 double cluster_1d_a_tpc[MAXNOFCLUSTERS];
139 double cluster_1d_b_tpc[MAXNOFCLUSTERS];
140 int cluster_1d_layerid[MAXNOFCLUSTERS];
141 int cluster_1d_sheetid[MAXNOFCLUSTERS];
142 int cluster_1d_view[MAXNOFCLUSTERS];
143 int cluster_1d_ID[MAXNOFCLUSTERS];
144 int cluster_1d_strip1[MAXNOFCLUSTERS];
145 int cluster_1d_strip2[MAXNOFCLUSTERS];
146 int cluster_1d_size[MAXNOFCLUSTERS];
147 int cluster_1d_hitindex[MAXNOFCLUSTERS][50];
148
149 // 2D cluster
150 double cluster_2d_t[MAXNOFCLUSTERS];
151 double cluster_2d_q[MAXNOFCLUSTERS];
152 double cluster_2d_r[MAXNOFCLUSTERS];
153 double cluster_2d_phi[MAXNOFCLUSTERS];
154 double cluster_2d_z[MAXNOFCLUSTERS];
155 double cluster_2d_z_cc[MAXNOFCLUSTERS];
156 double cluster_2d_phi_cc[MAXNOFCLUSTERS];
157 double cluster_2d_z_tpc[MAXNOFCLUSTERS];
158 double cluster_2d_phi_tpc[MAXNOFCLUSTERS];
159 int cluster_2d_layerid[MAXNOFCLUSTERS];
160 int cluster_2d_sheetid[MAXNOFCLUSTERS];
161 int cluster_2d_view[MAXNOFCLUSTERS];
162 int cluster_2d_ID[MAXNOFCLUSTERS];
163 int cluster_2d_idx[MAXNOFCLUSTERS];
164 int cluster_2d_idv[MAXNOFCLUSTERS];
165 int cluster_2d_highest[MAXNOFCLUSTERS];
166
167
168 ICgemGeomSvc *m_SvcCgem;
169
170
171
172};
173#endif
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
#define MAXNOFCLUSTERS
#define MAXNOFHITS