CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemCalibFunSvc.h
Go to the documentation of this file.
1#ifndef CGEMCALIBFUNSVC_H_
2#define CGEMCALIBFUNSVC_H_
3
4#include "GaudiKernel/IInterface.h"
5#include "GaudiKernel/Kernel.h"
6#include "GaudiKernel/Service.h"
7#include "GaudiKernel/IIncidentListener.h"
8
9#include "GaudiKernel/IDataProviderSvc.h"
10#include "GaudiKernel/SmartDataPtr.h"
11#include "GaudiKernel/DataSvc.h"
13/* #include "CalibData/Cgem/CgemCalibData.h" */
15
19
20#include <string>
21#include <vector>
22
23class CgemCalibFunSvc: public Service, virtual public ICgemCalibFunSvc, virtual public IIncidentListener{
24public:
25 CgemCalibFunSvc( const std::string& name, ISvcLocator* svcloc );
27
28 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvUnknown);
29 virtual StatusCode initialize();
30 virtual StatusCode finalize();
31
32 // Incident handler
33 void handle(const Incident&);
34
35 /* Access by users */
36
37 /* xvFlag: 0 -> x, 1 -> v; readoutMode: 0 -> charge centroid, 1 -> micro-TPC */
38 double getSigma(int layer, int xvFlag, int readoutMode, double angle, double Q, double T) const;
39
40 /* xvFlag: 0 -> x, 1 -> v; */
41 double getTimeRising(int layer, int xvFlag, int sheet, int stripID, double Q=100., double z=0.) const;
42
43 /* xvFlag: 0 -> x, 1 -> v; */
44 double getTimeFalling(int layer, int xvFlag, int sheet, int stripID, double Q=100., double z=0.) const;
45
46 double getTimeWalk(int layer, int xvFlag, int sheet, int stripID, double Q) const;
47 double getTimeWalk(double Q, double threshold) const;
48private:
49 bool initCalibConst();
50
51 int m_run;
52 bool m_getRunNo;
53 ICgemGeomSvc* m_pCgemGeomSvc;
54 IDataProviderSvc* m_pCalDataSvc;
55 ICalibRootSvc* m_pRootSvc;
56
57 static const int NLAYER = 3;
58 static const int NXV = 2;
59 static const int NSHEET = 2;
60 static const int NTHRESHODS = 20;
61
62 bool m_printInfo;
63 std::string m_timeFitFile;
64 std::string m_timeFitFilePath;
65 double m_tRising[NLAYER][NXV][NSHEET];
66 double m_tFalling[NLAYER][NXV][NSHEET];
67
68 std::string m_timeWalkFileName;
69 std::vector<double> m_tw;
70 std::vector<double> m_charge;
71 std::vector<double> m_threshold;
72
73 int m_readLUT;
74 std::string m_fileLUT;
75 CgemLUTReader* m_cgemLUTReader;
76 std::vector<double> m_valThreshold;
77 std::vector<int> m_thIdFrom;
78 std::vector<int> m_thIdEnd;
79};
80
81#endif /* CGEMCALIBFUNSVC_H_ */
virtual StatusCode initialize()
double getTimeWalk(int layer, int xvFlag, int sheet, int stripID, double Q) const
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
double getSigma(int layer, int xvFlag, int readoutMode, double angle, double Q, double T) const
virtual StatusCode finalize()
void handle(const Incident &)
double getTimeFalling(int layer, int xvFlag, int sheet, int stripID, double Q=100., double z=0.) const
double getTimeRising(int layer, int xvFlag, int sheet, int stripID, double Q=100., double z=0.) const