BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
Utilities/MeasuredEcmsSvc/MeasuredEcmsSvc-00-01-04/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/IDataProviderSvc.h"
15#include "GaudiKernel/Kernel.h"
16#include "GaudiKernel/Service.h"
17#include "GaudiKernel/IService.h"
18#include "GaudiKernel/IInterface.h"
19#include "GaudiKernel/Incident.h"
20#include "GaudiKernel/IIncidentSvc.h"
21#include "GaudiKernel/IIncidentListener.h"
22#include "GaudiKernel/ISvcLocator.h"
23#include "GaudiKernel/StatusCode.h"
24#include "GaudiKernel/PropertyMgr.h"
25#include "GaudiKernel/MsgStream.h"
26#include "GaudiKernel/SmartDataPtr.h"
27#include "GaudiKernel/AlgFactory.h"
28#include "GaudiKernel/Bootstrap.h"
29#include "GaudiKernel/Algorithm.h"
30#include "GaudiKernel/IHistogramSvc.h"
31#include "EventModel/EventModel.h"
32#include "EventModel/EventHeader.h"
33#include "DatabaseSvc/IDatabaseSvc.h"
34
35#include <iostream>
36#include <fstream>
37#include <string>
38#include <iomanip>
39#include <mysql.h>
40#include <cstdlib>
41
42static 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
50 public:
51
52 static const InterfaceID& interfaceID()
53 {
54 return IID_IMeasuredEcmsSvc;
55 }
56
57 // static const std::string& serviceInUse() { return g_serviceInUse;}
58
59 virtual ~IMeasuredEcmsSvc() {}
60
61 /** Return true or false for runNo */
62 virtual bool isRunNoValid() = 0;
63
64 /** Return Ecms ( Ecms = beam_energy * 2 ) */
65 virtual double getEcms() = 0;
66
67 /** Return beam energy */
68 virtual double getBeamEnergy() = 0;
69
70 /** Return error for Ecms */
71 virtual double getEcmsError() = 0;
72
73 /** Return average Ecms */
74 virtual double getAverageEcms() = 0;
75
76 /** Return average Ecms error */
77 virtual double getAverageEcmsError() = 0;
78
79 /** Return sample name */
80 virtual double getSampleName() = 0;
81
82 /** Return x momentum */
83 virtual double getPx() = 0;
84
85 /** Return y momentum */
86 virtual double getPy() = 0;
87
88 /** Return z momentum */
89 virtual double getPz() = 0;
90
91 /** Return Ecms depend on runNo only.
92 * Here RunNo. can be set independ on event.
93 */
94 virtual double getEcms(int runNo) = 0;
95
96 /** Return the string depend on the parameters */
97 virtual std::string getRecord(int runNo, char *tab, char *col, char *min_col, char *max_col) = 0;
98
99 protected:
100
101 /** Read database table */
102 virtual void readDBTable(int runNo) = 0;
103
104 /** trigger based on runNo
105 * @option 1 MeasuredEcms2 table for XYZ (Charmonium data)
106 * @option 2 RunParams table for 3773, 4180 (Charm data)
107 */
108 virtual int triggerDBTable(int runNo) = 0;
109
110 // static std::string g_serviceInUse;
111
112 private:
113
114
115};
116#endif
int runNo
Definition: DQA_TO_DB.cxx:12
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
virtual double getEcmsError()=0
virtual double getBeamEnergy()=0
virtual void readDBTable(int runNo)=0
virtual double getEcms(int runNo)=0