1#ifndef CGEMCLUSTERCREATE
2#define CGEMCLUSTERCREATE
4#include "GaudiKernel/Algorithm.h"
16#include "GaudiKernel/NTuple.h"
17#include "GaudiKernel/INTupleSvc.h"
48 int myMotherParticleID;
75 NTuple::Item<int> m_evt1;
76 NTuple::Item<long> m_ncluster;
77 NTuple::Array<int> m_layerid,m_sheetid,m_flag,m_clusterid;
78 NTuple::Array<double> m_energy,m_recphi,m_recv;
81 NTuple::Item<int> m_evt2;
82 NTuple::Item<long> m_nxvcluster;
83 NTuple::Array<double> m_pphi,m_pv;
84 NTuple::Array<int> m_player,m_psheet;
85 NTuple::Array<int> m_nxstrip,m_nvstrip;
88 NTuple::Item<int> m_evt3;
89 NTuple::Item<long> m_ntruth;
90 NTuple::Array<int> m_layer,m_sheet;
91 NTuple::Array<double> m_phipre,m_zpre,m_phipost,m_zpost,m_tphi,m_tv;
94 NTuple::Item<int> m_evt;
95 NTuple::Item<double> m_evttime;
98 NTuple::Item<int> m_evt6;
99 NTuple::Item<long> m_ndtruth;
100 NTuple::Array<int> m_tlayer,m_tsheet;
101 NTuple::Array<double> m_dtphi,m_dtv;
103 NTuple::Tuple* m_nt7;
104 NTuple::Item<int> m_evt7;
105 NTuple::Item<long> m_ndrec;
106 NTuple::Array<int> m_dlayer,m_dsheet,m_dcluster;
107 NTuple::Array<double> m_drecphi,m_drecv;
109 int m_strip[3][2][2][1500];
111 double m_edep[3][2][2][1500];
117 typedef pair<ClusterFlag,ClusterFlag> flagxv;
118 std::vector<ClusterFlag> m_x_group;
119 std::vector<ClusterFlag> m_v_group;
121 std::vector<flagxv> m_xv_group;
122 std::vector<ClusterFlag> m_mid_group;
123 std::vector<int> m_sameID;
126 typedef pair<int,int> keytype;
127 typedef pair<double,double> postype;
128 map<keytype,RecCgemCluster*> m_x_map;
129 map<keytype,RecCgemCluster*>::iterator m_x_map_it;
130 map<keytype,RecCgemCluster*> m_v_map;
131 map<keytype,RecCgemCluster*>::iterator m_v_map_it;
132 map<keytype,RecCgemCluster*> m_xv_map;
133 map<keytype,RecCgemCluster*>::iterator m_xv_map_it;
134 map<keytype,flagxv> m_trans_map;
135 map<keytype,flagxv>::iterator m_trans_map_it;
136 map<keytype,postype> m_driftrec_map;
137 map<keytype,postype>::iterator m_driftrec_map_it;
138 map<keytype,keytype> m_strip_map;
139 map<keytype,keytype>::iterator m_strip_map_it;
140 map<keytype,postype> m_pos_map;
141 map<keytype,postype>::iterator m_pos_map_it;
150 bool isGoodDigi(CgemDigiCol::iterator
iter);
151 bool selDigi(CgemDigiCol::iterator
iter,
int sel=1);
153 double m_minDigiTime;
154 double m_maxDigiTime;
161 void processstrips(
int k);
170 void fillMCTruth(
int run,
int evt);
171 void fillRecData(
int run,
int evt);
173 StatusCode method0();
174 StatusCode method1();
175 StatusCode method2();
176 StatusCode toyCluster();
177 void checkRecCgemClusterCol(
void);
179 float get_Time(CgemDigiCol::iterator iDigiCol);
180 float get_TimeWalk(CgemDigiCol::iterator iDigiCol);
181 float get_TimeRising(CgemDigiCol::iterator iDigiCol);
182 float get_TimeReference(CgemDigiCol::iterator iDigiCol);
185 map<int,CgemDigiCol::iterator> myFiredStripMap[3][2][2];
186 void resetFiredStripMap();
209 NTuple::Tuple* m_rec_nt;
210 NTuple::Item<int> m_rec_run;
211 NTuple::Item<int> m_rec_evt;
212 NTuple::Item<int> m_rec_ncluster;
213 NTuple::Array<int> m_rec_clusterid;
214 NTuple::Array<int> m_rec_layerid;
215 NTuple::Array<int> m_rec_sheetid;
216 NTuple::Array<int> m_rec_flag;
217 NTuple::Array<double> m_rec_energydeposit;
218 NTuple::Array<double> m_rec_recphi;
219 NTuple::Array<double> m_rec_recv;
220 NTuple::Array<double> m_rec_recZ;
221 NTuple::Array<int> m_rec_clusterflagb;
222 NTuple::Array<int> m_rec_clusterflage;
224 NTuple::Tuple* m_mc_nt;
225 NTuple::Item<int> m_mc_run;
226 NTuple::Item<int> m_mc_evt;
227 NTuple::Item<int> m_mc_nhit;
228 NTuple::Array<int> m_mc_trackID;
229 NTuple::Array<int> m_mc_layerID;
230 NTuple::Array<int> m_mc_pdg;
231 NTuple::Array<int> m_mc_parentID;
232 NTuple::Array<double> m_mc_E_deposit;
233 NTuple::Array<double> m_mc_XYZ_pre_x;
234 NTuple::Array<double> m_mc_XYZ_pre_y;
235 NTuple::Array<double> m_mc_XYZ_pre_z;
236 NTuple::Array<double> m_mc_XYZ_post_x;
237 NTuple::Array<double> m_mc_XYZ_post_y;
238 NTuple::Array<double> m_mc_XYZ_post_z;
239 NTuple::Array<double> m_mc_P_pre_x;
240 NTuple::Array<double> m_mc_P_pre_y;
241 NTuple::Array<double> m_mc_P_pre_z;
242 NTuple::Array<double> m_mc_P_post_x;
243 NTuple::Array<double> m_mc_P_post_y;
244 NTuple::Array<double> m_mc_P_post_z;