BOSS 7.0.6
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_phase; // Detector Version, 1 ETOF->96Scin, 2 ETOF->2MRPC+92Scin, 3->72MRPC
53 int m_userawtime_opt; //1: use raw tdc time of TOF; 0: use TOF calibration TDC time
54 double toffset_rawtime;//offset for barrel using rawtime of TOF
55 double toffset_rawtime_e;//offset for endcap using rawtime of TOF
56 double offset_dt;
58 int m_debug;
60 // double m_t0shift; //TOF event start time need abstract m_t0shift when do MDC calibration
61 int m_evtNo; //1: cout event Number; 0: don't
62 double m_ebeam; // beam energy;
63 // void doMDCMatching( int * ){}; // Simple hit matching
64 // int _doMatch;
65 //int _optCosmic, _cosmicScheme;
66 //int _SkipMC,_Skip;
67 //double _ptCut, _drCut, _dzCut;
68 //double _pathlCut, _ztofCutmin, _ztofCutmax;
69 //double _timeOfs;
70 //int _MDC_Skip;
71 //double _MDC_ptCut, _MDC_drCut, _MDC_dzCut;
72 //int _MDC_Tof, _MDC_Prop, _MDC_Walk;
73 //int _MDC_Debug;
74 //int _MDC_Xt;
76
77 // private:
78 // static evtime * _evtprt;
79 bool m_useXT;
81 bool m_useSw;
86
87 private:
88
89 StatusCode storeTDS(double tEst, int tEstFlag, double quality);//yzhang add
90 double Opt_new(const double arr[],const int size,const double sigma_cut);
91 double EST_Trimmer(double t0_original,double t0_offset,double raw_offset,double offset_dt,double bunchTime);
92 // double Opt_new( vector<double>::iterator beg,vector<double>::iterator end);
93 int ndriftt;
94 int ntrkMC;
95 int ntrk;
96 int m_pass[5];
97
98 IDataProviderSvc* m_pCalibDataSvc;
99 ICalibRootSvc* m_pRootSvc;
100 IEstTofCaliSvc* tofCaliSvc;
101 ITofQElecSvc* tofQElecSvc;
102 IMdcCalibFunSvc* imdcCalibSvc;
103 MdcCalibFunSvc* m_mdcCalibFunSvc;
104 MdcUtilitySvc* m_mdcUtilitySvc;
105
106 HepPDT::ParticleDataTable* m_particleTable;
107 IRawDataProviderSvc* m_rawDataProviderSvc;
108 NTuple::Tuple* m_tuple2;
109 //NTuple::Tuple* m_tuple9;
110
111 NTuple::Item<int> g_eventNo, g_runNo;
112 //MCTruth
113
114 NTuple::Item<int> g_ntrkMC;
115 NTuple::Array<double> g_theta0MC, g_phi0MC;
116 NTuple::Array<double> g_pxMC, g_pyMC, g_pzMC, g_ptMC;
117
118 //recon
119 NTuple::Item <double> g_nmatchbarrel,g_nmatchend;
120 NTuple::Item <double> g_nmatchbarrel_1,g_nmatchbarrel_2;
121 NTuple::Item <int> g_nmatch_tot;
122 NTuple::Item <int> g_ntrk,g_trigtiming;
123 NTuple::Array<double> g_ttof;
124 NTuple::Array<double> g_vel;
125 NTuple::Array<double> g_abmom;
126 NTuple::Array<int> g_pid;
127 NTuple::Array<double> g_t0for,g_t0back;
128 NTuple::Item <double> g_meant0,g_t0less,g_t0barrelTof;
129 NTuple::Item <double> g_ndriftt,g_nmatchmdc,g_EstimeMdc;
130 NTuple::Item <double> g_t0mean,g_T0,g_t0,g_mcTestime;
131 NTuple::Item <double> g_meantdc, g_Testime_fzisan, g_Testime;
132 NTuple::Item <int> g_ntofup,g_ntofdown,g_ntofup1,g_ntofdown1;
133 NTuple::Item <double> g_difftof_b, g_difftof_e;
134 NTuple::Array <double> g_meantevup,g_meantevdown;
135 NTuple::Item<int> m_estFlag;
136 NTuple::Item<double>m_estTime;
137
138 NTuple::Tuple* m_tuple9;
139 NTuple::Array<double> g_meantev;
140 NTuple::Item<int> g_nmatch;
141
142 NTuple::Tuple* m_tuple3;
143 NTuple::Item <double> g_t0offset_b;
144 NTuple::Item <double> g_t0offset_e;
145 NTuple::Item <int> g_bunchtime;
146};
147
148
149#endif
std::vector< double > Vdouble
Definition: EsTimeAlg.h:26
double offset_dt
Definition: EsTimeAlg.h:56
bool m_useXT
Definition: EsTimeAlg.h:79
int m_optCosmic
Definition: EsTimeAlg.h:48
int m_ntupleflag
Definition: EsTimeAlg.h:45
bool m_useTimeFactor
Definition: EsTimeAlg.h:85
int m_cosmicScheme
Definition: EsTimeAlg.h:49
bool m_useSw
Definition: EsTimeAlg.h:81
double m_bunchtime_MC
Definition: EsTimeAlg.h:44
double m_TofOpt_Cut
Definition: EsTimeAlg.h:84
int m_beforrec
Definition: EsTimeAlg.h:59
double toffset_rawtime_e
Definition: EsTimeAlg.h:55
double m_ebeam
Definition: EsTimeAlg.h:62
double offset_dt_end
Definition: EsTimeAlg.h:57
int m_userawtime_opt
Definition: EsTimeAlg.h:53
bool m_mdcopt
Definition: EsTimeAlg.h:82
StatusCode finalize()
Definition: EsTimeAlg.cxx:2668
bool m_TofOpt
Definition: EsTimeAlg.h:83
int m_phase
Definition: EsTimeAlg.h:52
StatusCode initialize()
Definition: EsTimeAlg.cxx:122
int _MDC_Inner
Definition: EsTimeAlg.h:75
int m_evtNo
Definition: EsTimeAlg.h:61
int m_flag
Definition: EsTimeAlg.h:39
int m_nbunch
Definition: EsTimeAlg.h:42
double toffset_rawtime
Definition: EsTimeAlg.h:54
bool m_useT0cal
Definition: EsTimeAlg.h:80
StatusCode execute()
Definition: EsTimeAlg.cxx:306
int m_debug
Definition: EsTimeAlg.h:58