1#ifndef HOUGHVALIDUPDATE_H
2#define HOUGHVALIDUPDATE_H
3#include "GaudiKernel/Algorithm.h"
4#include "GaudiKernel/NTuple.h"
5#include "GaudiKernel/INTupleSvc.h"
6#include "MdcGeomSvc/IMdcGeomSvc.h"
7#include "MdcGeomSvc/MdcGeoWire.h"
8#include "MdcGeomSvc/MdcGeoLayer.h"
9#include "MdcPrintSvc/MdcPrintSvc.h"
10#include "RawDataProviderSvc/RawDataProviderSvc.h"
19#include "CLHEP/Alist/AList.h"
20#include "MdcGeom/MdcDetector.h"
21#include "BField/BField.h"
22#include "TrkBase/TrkRecoTrk.h"
23#include "TrkFitter/TrkContextEv.h"
24#include "MdcCalibFunSvc/MdcCalibFunSvc.h"
25#include "MdcUtilitySvc/MdcUtilitySvc.h"
26#include "MdcPrintSvc/MdcPrintSvc.h"
27#include "HepPDT/ParticleDataTable.hh"
28#include "MdcData/MdcHit.h"
36 typedef std::map<int, int>
M2;
37 typedef std::map<int, M2>
M1;
51 int digiToHots(
MdcDigiVec mdcDigiVec,
TrkRecoTrk* newTrack,vector<bool> vec_truthHit,uint32_t getDigiFlag,vector<double> vec_flt_truth,map<int,double> hit_to_circle1,vector<MdcHit*>&);
52 int digiToHots2(
MdcDigiVec mdcDigiVec,
TrkRecoTrk* newTrack,vector<bool> vec_truthHit,vector<double> vec_flt_truth,uint32_t getDigiFlag, vector<int> vec_slant,vector<double> vec_l_Calcu,vector<double> vec_l_axial,vector<double> vec_theta_ontrack,vector<int>& vec_hitbeforefit,map<int,double> hit_to_circle2,vector<MdcHit*>&,
double );
53 double CFtrans(
double x,
double y);
54 int SlantId(
int layer);
55 int LeastSquare(
int n,vector<double> n_x,vector<double> n_y, vector<int> n_slant,vector<int> n_layer,vector<bool> vec_truthHit,
double &d0,
double &phi0,
double &omega,
double& circleX,
double& circleY,
double& circleR);
56 int Zposition(
int n,vector<int> n_slant,
double x_cirtemp,
double y_cirtemp,
double r_temp,vector<double> n_x_east,vector<double> n_x_west,vector<double> n_y_east,vector<double> n_y_west,vector<double> n_z_east,vector<double> n_z_west,vector<int> n_layer,vector<int> n_wire,vector<double> n_z,vector<double>& z_stereo_aver,vector<double>& l,vector<bool> vec_truthHit);
58 void Linefit(
int z_stereoNum,vector<double> z_stereo_aver,vector<double> l,
double& tanl,
double& z0);
59 void Multi_array(
int binX,
int binY);
61 void FillCells(TH2D *h1,
int n,
int binX,
int binY,vector<double> vec_u,vector<double> vec_v,vector<int> vec_layer,vector<int> vec_wire,vector< vector <int> >& countij,vector< vector < vector<int> > >& vec_selectNum,vector< vector < vector<int> > >& vec_selectHit);
62 void RhoTheta(
int m_nHit,vector<double> vec_u,vector<double> vec_v,vector<double>& vec_rho,vector<double>& vec_theta,vector< vector<int> >& vec_hitNum, vector<int> vec_digitruth);
63 void RhoThetaAxial(vector<int> vec_slant,
int nHit,vector<double> vec_u,vector<double> vec_v,vector<double>& vec_rho,vector<double>& vec_theta,vector< vector<int> >& vec_hitNum,vector<int> vec_digitruth);
64 void FillHist(TH2D *h1,vector<double> vec_u,vector<double> vec_v,
int m_nHit,vector< vector < vector<int> > > &vec_selectNum);
65 void FillRhoTheta(TH2D *h1 ,vector<double> vec_theta,vector<double> vec_rho);
66 int zPosition(
MdcHit& h,
double t0,
double x_cirtemp,
double y_cirtemp,
double r_temp,
int digiId,
double& delta_z,
double& delta_l,
double& l_Calcu_Left,
double& l_Calcu_Right,
double& z_Calcu_Left,
double& z_Calcu_Right,
double& z_Calcu,
double& l_Calcu,
int& i_q);
67 void AmbigChoose(vector< vector< vector<double> > > point,
int n_use,vector<int>& ambigList,
double& tanl,
double& z0);
68 void Combine(TH2D *h1,
int widthX,
int widthY,vector< vector < vector<int> > > vec_selectNum,
M1 &hit_combine,
M2 &peak_combine_num,
int &ntrack,vector<int> peakList1[]);
69 void Combine_two_cell(TH2D *h1,
int xPeakCell,
int yPeakCell,
int xAround,
int yaround,vector< vector < vector<int> > > vec_selectNum,
int m,
M1 &hit_combine,
M2 &peak_combine_num);
70 int LeastLine(
int ,
double x[] ,
double y[] ,
double& ,
double& ,
double&);
87 std::string m_pdtFile;
91 double m_nHitcut_high;
114 uint32_t m_getDigiFlag;
121 double m_dropTrkDrCut;
122 double m_dropTrkDzCut;
123 double m_dropTrkPtCut;
124 double m_dropTrkChi2Cut;
126 std::string m_configFile;
128 HepPDT::ParticleDataTable* m_particleTable;
140 bool m_combineTracking;
141 std::vector<float> m_helixHitsSigma;
142 double m_qualityFactor;
143 bool m_removeBadTrack;
144 int m_dropTrkNhitCut;
145 double m_dropTrkChi2NdfCut;
149 NTuple::Tuple* ntuplehit;
150 NTuple::Item<int> m_eventNum;
151 NTuple::Item<int> m_eventTime;
152 NTuple::Item<int> m_runNum;
153 NTuple::Item<int> m_nHit_Mc;
154 NTuple::Item<int> m_nHitAxial_Mc;
155 NTuple::Array<int> m_layer_Mc;
156 NTuple::Array<int> m_cell_Mc;
159 NTuple::Item<int> m_nTrkMC;
160 NTuple::Array<double> m_pidTruth;
161 NTuple::Array<double> m_costaTruth;
162 NTuple::Array<double> m_ptTruth;
163 NTuple::Array<double> m_pzTruth;
164 NTuple::Array<double> m_pTruth;
165 NTuple::Array<double> m_qTruth;
166 NTuple::Array<double> m_drTruth;
167 NTuple::Array<double> m_phi0Truth;
168 NTuple::Array<double> m_omegaTruth;
169 NTuple::Array<double> m_dzTruth;
170 NTuple::Array<double> m_tanl_mc;
172 NTuple::Item<int> m_nHit;
173 NTuple::Item<int> m_nHitDigi;
174 NTuple::Item<int> m_nHitAxial;
175 NTuple::Item<int> m_nHitStereo;
176 NTuple::Array<int> m_layer;
177 NTuple::Array<int> m_cell;
178 NTuple::Array<double> m_x_east;
179 NTuple::Array<double> m_y_east;
180 NTuple::Array<double> m_x_west;
181 NTuple::Array<double> m_y_west;
182 NTuple::Array<double> m_z_east;
183 NTuple::Array<double> m_z_west;
184 NTuple::Array<double> m_x;
185 NTuple::Array<double> m_y;
186 NTuple::Array<double> m_z;
187 NTuple::Array<double> m_u;
188 NTuple::Array<double> m_v;
189 NTuple::Array<double> m_p;
190 NTuple::Array<int> m_slant;
191 NTuple::Item<int> m_layer_max;
192 NTuple::Array<int> m_layerNhit;
193 NTuple::Array<double> m_ltruth;
194 NTuple::Array<double> m_ztruth;
195 NTuple::Array<double> m_postruth;
196 NTuple::Array<int> m_digi_truth;
197 NTuple::Item<int> m_e_delta;
199 NTuple::Item<int> m_nCross;
200 NTuple::Array<double> m_rho;
201 NTuple::Array<double> m_theta;
202 NTuple::Item<int> m_xybinNum;
203 NTuple::Array<int> m_xybin;
204 NTuple::Item<double> m_xsigma;
205 NTuple::Item<double> m_ysigma;
211 NTuple::Item<int> m_npeak_1;
212 NTuple::Item<int> m_npeak_2;
213 NTuple::Item<int> m_trackFailure;
214 NTuple::Item<int> m_npeak_after_tracking;
215 NTuple::Array<int> m_nHitSelect;
216 NTuple::Array<int> m_nHitAxialSelect;
217 NTuple::Array<int> m_nHitStereoSelect;
218 NTuple::Array<int> m_axiallose;
219 NTuple::Array<int> m_stereolose;
221 NTuple::Item<int> m_trackNum_Mc;
222 NTuple::Item<int> m_trackNum;
223 NTuple::Item<int> m_trackNum_fit;
224 NTuple::Item<int> m_trackNum_tds;
225 NTuple::Array<double> m_x_circle;
226 NTuple::Array<double> m_y_circle;
227 NTuple::Array<double> m_r;
228 NTuple::Array<double> m_chis_pt;
229 NTuple::Array<double> m_d0;
230 NTuple::Array<double> m_phi0;
231 NTuple::Array<double> m_omega;
232 NTuple::Array<double> m_z0;
233 NTuple::Array<double> m_tanl;
234 NTuple::Array<double> m_pt;
235 NTuple::Array<double> m_pt2;
236 NTuple::Array<double> m_pz;
237 NTuple::Array<double> m_pxyz;
239 NTuple::Array<int> m_nFitFailure;
240 NTuple::Array<int> m_2d_nFit;
241 NTuple::Array<int> m_2dFit;
242 NTuple::Array<int> m_3d_nFit;
243 NTuple::Array<int> m_3dFit;
244 NTuple::Array<double> m_pt2_rec_final;
245 NTuple::Array<double> m_p_rec_final;
246 NTuple::Array<double> m_d0_final;
247 NTuple::Array<double> m_phi0_final;
248 NTuple::Array<double> m_omega_final;
249 NTuple::Array<double> m_z0_final;
250 NTuple::Array<double> m_tanl_final;
251 NTuple::Array<double> m_chis_3d_final;
252 NTuple::Array<int> m_Q;
254 NTuple::Array<double> m_pt2_rec_tds;
255 NTuple::Array<double> m_p_rec_tds;
256 NTuple::Array<double> m_d0_tds;
257 NTuple::Array<double> m_phi0_tds;
258 NTuple::Array<double> m_omega_tds;
259 NTuple::Array<double> m_z0_tds;
260 NTuple::Array<double> m_tanl_tds;
261 NTuple::Array<double> m_chis_3d_tds;
262 NTuple::Array<int> m_Q_tds;
265 double m_truthPos[43][288][3];
267 NTuple::Array<double> m_dist_to_circle;
270 NTuple::Item<int> m_nHitStereo_use;
271 NTuple::Array<double> m_lCalcuLeft;
272 NTuple::Array<double> m_lCalcuRight;
273 NTuple::Array<double> m_zCalcuLeft;
274 NTuple::Array<double> m_zCalcuRight;
275 NTuple::Array<double> m_zCalcu;
276 NTuple::Array<double> m_lCalcu;
277 NTuple::Array<double> m_delta_z;
278 NTuple::Array<double> m_delta_l;
279 NTuple::Array<int> m_amb;
280 NTuple::Item<int> m_ambig_no_match;
281 NTuple::Item<double> m_tanl_Cal;
282 NTuple::Item<double> m_z0_Cal;
283 NTuple::Item<double> m_ambig_no_match_propotion;
285 NTuple::Item<int> m_nhitdis0;
286 NTuple::Item<int> m_nhitdis1;
287 NTuple::Item<int> m_nhitdis2;
288 NTuple::Array<double> m_hit_dis0;
289 NTuple::Array<double> m_hit_dis1;
290 NTuple::Array<double> m_hit_dis2;
291 NTuple::Array<double> m_hit_dis1_3d;
292 NTuple::Array<double> m_hit_dis2_3d;
301 NTuple::Item<bool> m_decay;
302 NTuple::Item<int> m_outputTrk;
303 NTuple::Array<int> m_hitOnTrk;
305 NTuple::Item<int> m_track_use_intrk1;
306 NTuple::Item<int> m_noise_intrk1;
std::vector< MdcDigi * > MdcDigiVec
bool compare(const HoughValidUpdate::Mytrack &a, const HoughValidUpdate::Mytrack &b)
HoughValidUpdate(const std::string &name, ISvcLocator *pSvcLocator)
vector< int > vec_hit_on_trk