CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/EsTimeAlg/EsTimeAlg-00-02-52/EsTimeAlg/EsTimeAlg.h
Go to the documentation of this file.
1#ifndef ESTIME_FLAG_
2#define ESTIME_FLAG_
3#include <vector>
4#include "GaudiKernel/Algorithm.h"
5#include "GaudiKernel/NTuple.h"
6#include "HepPDT/ParticleDataTable.hh"
7#include "RawDataProviderSvc/IRawDataProviderSvc.h"
8#include <stdio.h>
9#include "CalibData/EsTime/EsTimeCalibData.h"
10#include "CalibData/CalibModel.h"
11#include "GaudiKernel/DataSvc.h"
12#include "CalibDataSvc/ICalibRootSvc.h"
13#include "CalibData/CalibModel.h"
14#include "CalibData/CalibBase1.h"
15#include "EstTofCaliSvc/IEstTofCaliSvc.h"
16#include "CalibData/Tof/TofCalibData.h"
17#include "TofQElecSvc/ITofQElecSvc.h"
18#include "MdcUtilitySvc/MdcUtilitySvc.h"
19#include "MdcCalibFunSvc/MdcCalibFunSvc.h"
20#include "MdcCalibFunSvc/IMdcCalibFunSvc.h"
21
22#include "EsTimeAlg/EstParameter.h"
23#include <iostream>
24#include <fstream>
25
26typedef std::vector<double> Vdouble;
27
28class EsTimeAlg :public Algorithm{
29
30 public:
31
32 EsTimeAlg(const std::string& name, ISvcLocator* pSvcLocator);
33
34 StatusCode initialize();
35 StatusCode execute();
36 StatusCode finalize();
37
38 public:
39 int m_flag; //1: use segment linear fitting method
40 //2: use fasttrk and mdc hit
41
42 int m_nbunch; //3: 3 bunches,0ns,8ns,16ns
43 //6: 6 bunches,0,4,8,12,16,20ns
44 double m_bunchtime_MC;
45 int m_ntupleflag; //0: donot draw ntuple
46 //1: add ntuple
47
48 int m_optCosmic; // optCosmic = 1: employ cosmic correction, 0: don't
49 int m_cosmicScheme; // cosmicScheme to decide incoming and outgoing legs
50 // 0: 2hits+TDCdiff 1: 2hits+Phi 2: All hits+Phi
51
52 int m_userawtime_opt; //1: use raw tdc time of TOF; 0: use TOF calibration TDC time
53 double toffset_rawtime;//offset for barrel using rawtime of TOF
54 double toffset_rawtime_e;//offset for endcap using rawtime of TOF
55 double offset_dt;
56 double offset_dt_end;
57 int m_debug;
58 int m_beforrec;
59 // double m_t0shift; //TOF event start time need abstract m_t0shift when do MDC calibration
60 int m_evtNo; //1: cout event Number; 0: don't
61 double m_ebeam; // beam energy;
62 // void doMDCMatching( int * ){}; // Simple hit matching
63 // int _doMatch;
64 //int _optCosmic, _cosmicScheme;
65 //int _SkipMC,_Skip;
66 //double _ptCut, _drCut, _dzCut;
67 //double _pathlCut, _ztofCutmin, _ztofCutmax;
68 //double _timeOfs;
69 //int _MDC_Skip;
70 //double _MDC_ptCut, _MDC_drCut, _MDC_dzCut;
71 //int _MDC_Tof, _MDC_Prop, _MDC_Walk;
72 //int _MDC_Debug;
73 //int _MDC_Xt;
74 int _MDC_Inner;
75
76 // private:
77 // static evtime * _evtprt;
78 bool m_useXT;
79 bool m_useT0cal;
80 bool m_useSw;
81 bool m_mdcopt;
82 bool m_TofOpt;
83 double m_TofOpt_Cut;
84 bool m_useTimeFactor;
85 private:
86
87 StatusCode storeTDS(double tEst, int tEstFlag, double quality);//yzhang add
88 double Opt_new(const double arr[],const int size,const double sigma_cut);
89 double EST_Trimmer(double t0_original,double t0_offset,double raw_offset,double offset_dt,double bunchTime);
90 // double Opt_new( vector<double>::iterator beg,vector<double>::iterator end);
91 int ndriftt;
92 int ntrkMC;
93 int ntrk;
94 int m_pass[5];
95
96 IDataProviderSvc* m_pCalibDataSvc;
97 ICalibRootSvc* m_pRootSvc;
98 IEstTofCaliSvc* tofCaliSvc;
99 ITofQElecSvc* tofQElecSvc;
100 IMdcCalibFunSvc* imdcCalibSvc;
101 MdcCalibFunSvc* m_mdcCalibFunSvc;
102 MdcUtilitySvc* m_mdcUtilitySvc;
103
104 HepPDT::ParticleDataTable* m_particleTable;
105 IRawDataProviderSvc* m_rawDataProviderSvc;
106 NTuple::Tuple* m_tuple2;
107 //NTuple::Tuple* m_tuple9;
108
109 NTuple::Item<int> g_eventNo, g_runNo;
110 //MCTruth
111
112 NTuple::Item<int> g_ntrkMC;
113 NTuple::Array<double> g_theta0MC, g_phi0MC;
114 NTuple::Array<double> g_pxMC, g_pyMC, g_pzMC, g_ptMC;
115
116 //recon
117 NTuple::Item <double> g_nmatchbarrel,g_nmatchend;
118 NTuple::Item <double> g_nmatchbarrel_1,g_nmatchbarrel_2;
119 NTuple::Item <int> g_nmatch_tot;
120 NTuple::Item <int> g_ntrk,g_trigtiming;
121 NTuple::Array<double> g_ttof;
122 NTuple::Array<double> g_vel;
123 NTuple::Array<double> g_abmom;
124 NTuple::Array<double> g_t0for,g_t0back;
125 NTuple::Item <double> g_meant0,g_t0less,g_t0barrelTof;
126 NTuple::Item <double> g_ndriftt,g_nmatchmdc,g_EstimeMdc;
127 NTuple::Item <double> g_t0mean,g_T0,g_t0,g_mcTestime;
128 NTuple::Item <double> g_meantdc, g_Testime_fzisan, g_Testime;
129 NTuple::Item <int> g_ntofup,g_ntofdown,g_ntofup1,g_ntofdown1;
130 NTuple::Item <double> g_difftof_b, g_difftof_e;
131 NTuple::Array <double> g_meantevup,g_meantevdown;
132 NTuple::Item<int> m_estFlag;
133 NTuple::Item<double>m_estTime;
134
135 NTuple::Tuple* m_tuple9;
136 NTuple::Array<double> g_meantev;
137 NTuple::Item<int> g_nmatch;
138
139 NTuple::Tuple* m_tuple3;
140 NTuple::Item <double> g_t0offset_b;
141 NTuple::Item <double> g_t0offset_e;
142 NTuple::Item <int> g_bunchtime;
143};
144
145
146#endif
EsTimeAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode finalize()
StatusCode initialize()
StatusCode execute()