BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Utilities/MeasuredEcmsSvc/include/MeasuredEcmsSvc/IMeasuredEcmsSvc.h
Go to the documentation of this file.
1/***********************************************************************
2 * BES III Software *
3 * Copyright(C) - BES III Collaboration *
4 * *
5 * Author: The BESIII Collaboration *
6 * Contributor: Lianjin Wu *
7 * *
8 ***********************************************************************/
9
10#pragma once
11#ifndef Utilities_IMeasuredEcmsSvc_H
12# define Utilities_IMeasuredEcmsSvc_H
13
14# include "GaudiKernel/Algorithm.h"
15# include "GaudiKernel/Bootstrap.h"
16# include "GaudiKernel/IDataProviderSvc.h"
17# include "GaudiKernel/IHistogramSvc.h"
18# include "GaudiKernel/IIncidentListener.h"
19# include "GaudiKernel/IIncidentSvc.h"
20# include "GaudiKernel/IInterface.h"
21# include "GaudiKernel/IService.h"
22# include "GaudiKernel/ISvcLocator.h"
23# include "GaudiKernel/Incident.h"
24# include "GaudiKernel/Kernel.h"
25# include "GaudiKernel/MsgStream.h"
26# include "GaudiKernel/PropertyMgr.h"
27# include "GaudiKernel/Service.h"
28# include "GaudiKernel/SmartDataPtr.h"
29# include "GaudiKernel/StatusCode.h"
30
31# include "DatabaseSvc/IDatabaseSvc.h"
32# include "EventModel/EventHeader.h"
33# include "EventModel/EventModel.h"
34
35# include <cstdlib>
36# include <fstream>
37# include <iomanip>
38# include <iostream>
39# include <mysql.h>
40# include <string>
41
42// static const InterfaceID IID_IMeasuredEcmsSvc("IMeasuredEcmsSvc", 1, 0);
43
44/** Class to read the data information from database,
45 * such as ECMS, ECMS Error ... ( beam_energy = ECMS / 2.0).
46 * Access to almost all the XYZ, 3773, and 4180 data.
47 */
48class IMeasuredEcmsSvc : virtual public IService {
49
50public:
51 /*static const InterfaceID& interfaceID()
52 {
53 return IID_IMeasuredEcmsSvc;
54 }*/
56 // static const std::string& serviceInUse() { return g_serviceInUse;}
57
58 virtual ~IMeasuredEcmsSvc() {}
59
60 /** Return true or false for runNo */
61 virtual bool isRunNoValid() = 0;
62
63 /** Return Ecms ( Ecms = beam_energy * 2 ) */
64 virtual double getEcms() = 0;
65
66 /** Return beam energy */
67 virtual double getBeamEnergy() = 0;
68
69 /** Return error for Ecms */
70 virtual double getEcmsError() = 0;
71
72 /** Return average Ecms */
73 virtual double getAverageEcms() = 0;
74
75 /** Return average Ecms error */
76 virtual double getAverageEcmsError() = 0;
77
78 /** Return sample name */
79 virtual double getSampleName() = 0;
80
81 /** Return x momentum */
82 virtual double getPx() = 0;
83
84 /** Return y momentum */
85 virtual double getPy() = 0;
86
87 /** Return z momentum */
88 virtual double getPz() = 0;
89
90 /** Return Ecms depend on runNo only.
91 * Here RunNo. can be set independ on event.
92 */
93 virtual double getEcms( int runNo ) = 0;
94
95 /** Return the string depend on the parameters */
96 virtual std::string getRecord( int runNo, char* tab, char* col, char* min_col,
97 char* max_col ) = 0;
98
99protected:
100 /** Read database table */
101 virtual void readDBTable( int runNo ) = 0;
102
103 /** trigger based on runNo
104 * @option 1 MeasuredEcms2 table for XYZ (Charmonium data)
105 * @option 2 RunParams table for 3773, 4180 (Charm data)
106 */
107 virtual int triggerDBTable( int runNo ) = 0;
108
109 // static std::string g_serviceInUse;
110
111private:
112};
113#endif
int runNo
Definition DQA_TO_DB.cxx:13
virtual double getPz()=0
virtual double getPy()=0
virtual double getAverageEcmsError()=0
virtual double getAverageEcms()=0
virtual double getSampleName()=0
virtual int triggerDBTable(int runNo)=0
virtual double getPx()=0
virtual std::string getRecord(int runNo, char *tab, char *col, char *min_col, char *max_col)=0
virtual double getEcms()=0
virtual bool isRunNoValid()=0
DeclareInterfaceID(IMeasuredEcmsSvc, 1, 0)
virtual double getEcmsError()=0
virtual double getBeamEnergy()=0
virtual void readDBTable(int runNo)=0
virtual double getEcms(int runNo)=0