CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
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"
8#include <stdio.h>
11#include "GaudiKernel/DataSvc.h"
21
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
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;
57 int m_debug;
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;
75
76 // private:
77 // static evtime * _evtprt;
78 bool m_useXT;
80 bool m_useSw;
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
std::vector< double > Vdouble
Definition EsTimeAlg.h:26
double offset_dt
Definition EsTimeAlg.h:55
bool m_useXT
Definition EsTimeAlg.h:78
int m_optCosmic
Definition EsTimeAlg.h:48
int m_ntupleflag
Definition EsTimeAlg.h:45
bool m_useTimeFactor
Definition EsTimeAlg.h:84
int m_cosmicScheme
Definition EsTimeAlg.h:49
bool m_useSw
Definition EsTimeAlg.h:80
double m_bunchtime_MC
Definition EsTimeAlg.h:44
double m_TofOpt_Cut
Definition EsTimeAlg.h:83
int m_beforrec
Definition EsTimeAlg.h:58
double toffset_rawtime_e
Definition EsTimeAlg.h:54
EsTimeAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition EsTimeAlg.cxx:88
double m_ebeam
Definition EsTimeAlg.h:61
double offset_dt_end
Definition EsTimeAlg.h:56
int m_userawtime_opt
Definition EsTimeAlg.h:52
bool m_mdcopt
Definition EsTimeAlg.h:81
StatusCode finalize()
bool m_TofOpt
Definition EsTimeAlg.h:82
StatusCode initialize()
int _MDC_Inner
Definition EsTimeAlg.h:74
int m_evtNo
Definition EsTimeAlg.h:60
int m_flag
Definition EsTimeAlg.h:39
int m_nbunch
Definition EsTimeAlg.h:42
double toffset_rawtime
Definition EsTimeAlg.h:53
bool m_useT0cal
Definition EsTimeAlg.h:79
StatusCode execute()
int m_debug
Definition EsTimeAlg.h:57