1#include "GaudiKernel/MsgStream.h"
2#include "CalibData/Tof/bTofCalibBase.h"
3#include "CalibData/Tof/bTofCommonCalibBase.h"
4#include "CalibData/Tof/eTofCalibBase.h"
5#include "CalibData/Tof/etfCalibBase.h"
6#include "CalibData/Tof/TofCalibData.h"
10 TofCalibData::TofCalibData(std::vector<bTofCalibBase>* bTofCal,std::vector<bTofCommonCalibBase>* bTofComCal,std::vector<eTofCalibBase>* eTofCal,std::vector<etfCalibBase>* etfCal,std::vector<etfBunchCalibBase>* etfBunchCal,std::vector<tofCalibInfoBase>* tofInfoCal){
12 m_bTofCalibData =
new std::vector<bTofCalibBase>(*bTofCal);
15 m_bTofCommonCalibData =
new std::vector<bTofCommonCalibBase>(*bTofComCal);
18 m_eTofCalibData =
new std::vector<eTofCalibBase>(*eTofCal);
22 m_etfCalibData = NULL;
23 if( etfCal->size() > 0 ) {
25 m_etfCalibData =
new std::vector<etfCalibBase>(*etfCal);
27 m_hasEtfBunch =
false;
28 m_etfBunchCalibData = NULL;
29 if( etfBunchCal->size() > 0 ) {
31 m_etfBunchCalibData =
new std::vector<etfBunchCalibBase>(*etfBunchCal);
35 m_tofCalibInfoData =
new std::vector<tofCalibInfoBase>(*tofInfoCal);
39 TofCalibData::TofCalibData(std::vector<bTofCalibBase>* bTofCal,std::vector<bTofCommonCalibBase>* bTofComCal,std::vector<eTofCalibBase>* eTofCal,std::vector<etfCalibBase>* etfCal,std::vector<tofCalibInfoBase>* tofInfoCal){
41 m_bTofCalibData =
new std::vector<bTofCalibBase>(*bTofCal);
44 m_bTofCommonCalibData =
new std::vector<bTofCommonCalibBase>(*bTofComCal);
47 m_eTofCalibData =
new std::vector<eTofCalibBase>(*eTofCal);
51 m_etfCalibData = NULL;
52 if( etfCal->size() > 0 ) {
54 m_etfCalibData =
new std::vector<etfCalibBase>(*etfCal);
56 m_hasEtfBunch =
false;
57 m_etfBunchCalibData = NULL;
60 m_tofCalibInfoData =
new std::vector<tofCalibInfoBase>(*tofInfoCal);
64 TofCalibData::TofCalibData(std::vector<bTofCalibBase>* bTofCal,std::vector<bTofCommonCalibBase>* bTofComCal,std::vector<eTofCalibBase>* eTofCal,std::vector<tofCalibInfoBase>* tofInfoCal){
66 m_bTofCalibData =
new std::vector<bTofCalibBase>(*bTofCal);
69 m_bTofCommonCalibData =
new std::vector<bTofCommonCalibBase>(*bTofComCal);
72 m_eTofCalibData =
new std::vector<eTofCalibBase>(*eTofCal);
75 m_tofCalibInfoData =
new std::vector<tofCalibInfoBase>(*tofInfoCal);
78 m_etfCalibData = NULL;
79 m_hasEtfBunch =
false;
80 m_etfBunchCalibData = NULL;
86 std::cout<<
"========================================"<<
"\n"<<
"here is the update in the TofCalibData"<<
"\n"<<
"========================================"<<std::endl;
88 delete m_bTofCalibData;
89 m_bTofCalibData =
new std::vector<bTofCalibBase>(*(other1.m_bTofCalibData));
90 delete m_bTofCommonCalibData;
91 m_bTofCommonCalibData =
new std::vector<bTofCommonCalibBase>(*(other1.m_bTofCommonCalibData));
92 delete m_eTofCalibData;
93 m_eTofCalibData =
new std::vector<eTofCalibBase>(*(other1.m_eTofCalibData));
94 delete m_tofCalibInfoData;
95 m_tofCalibInfoData =
new std::vector<tofCalibInfoBase>(*(other1.m_tofCalibInfoData));
97 if( m_etfCalibData ) {
delete m_etfCalibData; }
98 if( other1.m_etfCalibData ) {
99 if( (other1.m_etfCalibData)->size() > 0 ) {
100 m_etfCalibData =
new std::vector<etfCalibBase>(*(other1.m_etfCalibData));
105 m_etfCalibData = NULL;
109 if( m_etfBunchCalibData ) {
delete m_etfBunchCalibData; }
110 if( other1.m_etfBunchCalibData ) {
111 if( (other1.m_etfBunchCalibData)->size() > 0 ) {
112 m_etfBunchCalibData =
new std::vector<etfBunchCalibBase>(*(other1.m_etfBunchCalibData));
113 m_hasEtfBunch =
true;
117 m_etfBunchCalibData = NULL;
118 m_hasEtfBunch =
false;
121 return StatusCode::SUCCESS;
127 std::vector<bTofCalibBase>::iterator it = m_bTofCalibData->begin();
128 for(
int i=0;i!=cnt;i++,it++) {
134 std::vector<bTofCommonCalibBase>::iterator it = m_bTofCommonCalibData->begin();
139 std::vector<eTofCalibBase>::iterator it = m_eTofCalibData->begin();
140 for(
int i=0;i!=cnt;i++,it++) {
146 std::vector<etfCalibBase>::iterator it = m_etfCalibData->begin();
147 for(
int i=0;i!=cnt;i++) {
148 for(
int j=0;j!=12;j++,it++) {
151 for(
int j=0;j!=strip;j++,it++) {
157 std::vector<etfBunchCalibBase>::iterator it = m_etfBunchCalibData->begin();
162 std::vector<tofCalibInfoBase>::iterator it = m_tofCalibInfoData->begin();
178 return bTof.
getP1(pardex);
183 return bTof.
getP2(pardex);
263 return eTof.
getP(pardex);
268 return eTof.
getFP(pardex);
272 if( !m_hasEtf ) {
return 1.0; }
278 if( !m_hasEtf ) {
return 1.0; }
280 return etf.
getP(pardex);
284 if( !m_hasEtf ) {
return 1.0; }
286 return etf.
getP1(pardex);
290 if( !m_hasEtf ) {
return 1.0; }
292 return etf.
getP2(pardex);
296 if( !m_hasEtfBunch ) {
return 0.0; }
virtual StatusCode update(CalibBase1 &obj, MsgStream *)
double getETofFP(int index, int pardex)
etfBunchCalibBase getEtfBunch() const
double getBTofPoffleft_bunch1(int index, int pardex)
double getBTofPoffleft_bunch3(int index, int pardex)
double getBTofSpeed(int index, int pardex)
double getETofP(int index, int pardex)
double getBTofPoffright_bunch3(int index, int pardex)
bTofCommonCalibBase getBTofCom() const
double getBTofPoffright_bunch2(int index, int pardex)
double getBTofSigmaCorr(int pardex)
double getBTofFleft(int index, int pardex)
double getBTofPoffright_bunch0(int index, int pardex)
etfCalibBase getEtf(int cnt, int strip) const
eTofCalibBase getETof(int cnt) const
double getBTofPoffright_bunch1(int index, int pardex)
double getEtfSpeed(int index, int strip, int pardex)
tofCalibInfoBase getTofInfo() const
double getBTofFright(int index, int pardex)
double getBTofFcounter(int index, int pardex)
double getBTofPoffleft_bunch2(int index, int pardex)
double getEtfPleft(int index, int strip, int pardex)
double getEtfPcombine(int index, int strip, int pardex)
double getETofAtten(int index, int pardex)
double getBTofAtten(int index, int pardex)
virtual StatusCode update(CalibBase1 &other, MsgStream *log)
double getEtfPBunch(int pardex)
double getBTofPoffleft_bunch0(int index, int pardex)
double getEtfPright(int index, int strip, int pardex)
double getBTofPleft(int index, int pardex)
bTofCalibBase getBTof(int cnt) const
double getBTofOffset(int pardex)
double getETofSpeed(int index, int pardex)
double getBTofPright(int index, int pardex)
double getPoff1_bunch2(int No) const
double getFcounter(int No) const
double getP2(int No) const
double getPoff2_bunch3(int No) const
double getP1(int No) const
double getFleft(int No) const
double getFright(int No) const
double getPoff1_bunch1(int No) const
double getPoff1_bunch3(int No) const
double getAtten(int No) const
double getSpeed(int No) const
double getPoff2_bunch1(int No) const
double getPoff1_bunch0(int No) const
double getPoff2_bunch2(int No) const
double getPoff2_bunch0(int No) const
double getOffset(int No) const
double getSigmaCorr(int No) const
double getSpeed(int No) const
double getAtten(int No) const
double getFP(int No) const
double getP(int No) const
double getPBunch(int No) const
double getP(int No) const
double getP2(int No) const
double getP1(int No) const
double getSpeed(int No) const
int getBrEast(int No) const
int getBrWest(int No) const
int getEndcap(int No) const