1#ifndef CGEMCLUSTERCREATE
2#define CGEMCLUSTERCREATE
4#include "GaudiKernel/Algorithm.h"
5#include "RawDataProviderSvc/RawDataProviderSvc.h"
6#include "CgemRawEvent/CgemDigi.h"
8#include "MdcGeomSvc/IMdcGeomSvc.h"
9#include "MdcGeomSvc/MdcGeomSvc.h"
10#include "MdcGeomSvc/MdcGeoWire.h"
11#include "MdcGeomSvc/MdcGeoLayer.h"
13#include "CgemGeomSvc/ICgemGeomSvc.h"
14#include "CgemGeomSvc/CgemGeomSvc.h"
16#include "GaudiKernel/NTuple.h"
17#include "GaudiKernel/INTupleSvc.h"
18#include "CgemCalibFunSvc/CgemCalibFunSvc.h"
21#include "CgemRecEvent/RecCgemCluster.h"
23#include "NTupleHelper/NTupleHelper.h"
48 int myMotherParticleID;
74 NTuple::Item<int> m_evt1;
75 NTuple::Item<long> m_ncluster;
76 NTuple::Array<int> m_layerid,m_sheetid,m_flag,m_clusterid;
77 NTuple::Array<double> m_energy,m_recphi,m_recv;
80 NTuple::Item<int> m_evt2;
81 NTuple::Item<long> m_nxvcluster;
82 NTuple::Array<double> m_pphi,m_pv;
83 NTuple::Array<int> m_player,m_psheet;
84 NTuple::Array<int> m_nxstrip,m_nvstrip;
87 NTuple::Item<int> m_evt3;
88 NTuple::Item<long> m_ntruth;
89 NTuple::Array<int> m_layer,m_sheet;
90 NTuple::Array<double> m_phipre,m_zpre,m_phipost,m_zpost,m_tphi,m_tv;
93 NTuple::Item<int> m_evt;
94 NTuple::Item<double> m_evttime;
97 NTuple::Item<int> m_evt6;
98 NTuple::Item<long> m_ndtruth;
99 NTuple::Array<int> m_tlayer,m_tsheet;
100 NTuple::Array<double> m_dtphi,m_dtv;
102 NTuple::Tuple* m_nt7;
103 NTuple::Item<int> m_evt7;
104 NTuple::Item<long> m_ndrec;
105 NTuple::Array<int> m_dlayer,m_dsheet,m_dcluster;
106 NTuple::Array<double> m_drecphi,m_drecv;
108 int m_strip[3][2][2][1500];
110 double m_edep[3][2][2][1500];
116 typedef pair<ClusterFlag,ClusterFlag> flagxv;
117 std::vector<ClusterFlag> m_x_group;
118 std::vector<ClusterFlag> m_v_group;
120 std::vector<flagxv> m_xv_group;
121 std::vector<ClusterFlag> m_mid_group;
122 std::vector<int> m_sameID;
125 typedef pair<int,int> keytype;
126 typedef pair<double,double> postype;
127 map<keytype,RecCgemCluster*> m_x_map;
128 map<keytype,RecCgemCluster*>::iterator m_x_map_it;
129 map<keytype,RecCgemCluster*> m_v_map;
130 map<keytype,RecCgemCluster*>::iterator m_v_map_it;
131 map<keytype,RecCgemCluster*> m_xv_map;
132 map<keytype,RecCgemCluster*>::iterator m_xv_map_it;
133 map<keytype,flagxv> m_trans_map;
134 map<keytype,flagxv>::iterator m_trans_map_it;
135 map<keytype,postype> m_driftrec_map;
136 map<keytype,postype>::iterator m_driftrec_map_it;
137 map<keytype,keytype> m_strip_map;
138 map<keytype,keytype>::iterator m_strip_map_it;
139 map<keytype,postype> m_pos_map;
140 map<keytype,postype>::iterator m_pos_map_it;
149 bool isGoodDigi(CgemDigiCol::iterator
iter);
150 bool selDigi(CgemDigiCol::iterator
iter,
int sel=1);
152 double m_minDigiTime;
153 double m_maxDigiTime;
160 void processstrips(
int k);
169 void fillMCTruth(
int run,
int evt);
170 void fillRecData(
int run,
int evt);
172 StatusCode method0();
173 StatusCode method1();
174 StatusCode method2();
175 StatusCode toyCluster();
176 void checkRecCgemClusterCol(
void);
179 map<int,CgemDigiCol::iterator> myFiredStripMap[3][2][2];
180 void resetFiredStripMap();
203 NTuple::Tuple* m_rec_nt;
204 NTuple::Item<int> m_rec_run;
205 NTuple::Item<int> m_rec_evt;
206 NTuple::Item<int> m_rec_ncluster;
207 NTuple::Array<int> m_rec_clusterid;
208 NTuple::Array<int> m_rec_layerid;
209 NTuple::Array<int> m_rec_sheetid;
210 NTuple::Array<int> m_rec_flag;
211 NTuple::Array<double> m_rec_energydeposit;
212 NTuple::Array<double> m_rec_recphi;
213 NTuple::Array<double> m_rec_recv;
214 NTuple::Array<double> m_rec_recZ;
215 NTuple::Array<int> m_rec_clusterflagb;
216 NTuple::Array<int> m_rec_clusterflage;
218 NTuple::Tuple* m_mc_nt;
219 NTuple::Item<int> m_mc_run;
220 NTuple::Item<int> m_mc_evt;
221 NTuple::Item<int> m_mc_nhit;
222 NTuple::Array<int> m_mc_trackID;
223 NTuple::Array<int> m_mc_layerID;
224 NTuple::Array<int> m_mc_pdg;
225 NTuple::Array<int> m_mc_parentID;
226 NTuple::Array<double> m_mc_E_deposit;
227 NTuple::Array<double> m_mc_XYZ_pre_x;
228 NTuple::Array<double> m_mc_XYZ_pre_y;
229 NTuple::Array<double> m_mc_XYZ_pre_z;
230 NTuple::Array<double> m_mc_XYZ_post_x;
231 NTuple::Array<double> m_mc_XYZ_post_y;
232 NTuple::Array<double> m_mc_XYZ_post_z;
233 NTuple::Array<double> m_mc_P_pre_x;
234 NTuple::Array<double> m_mc_P_pre_y;
235 NTuple::Array<double> m_mc_P_pre_z;
236 NTuple::Array<double> m_mc_P_post_x;
237 NTuple::Array<double> m_mc_P_post_y;
238 NTuple::Array<double> m_mc_P_post_z;
CgemClusterCreate(const std::string &name, ISvcLocator *pSvcLocator)