31#include "GaudiKernel/MsgStream.h"
32#include "GaudiKernel/AlgFactory.h"
33#include "GaudiKernel/ISvcLocator.h"
34#include "GaudiKernel/SmartDataPtr.h"
35#include "GaudiKernel/IDataProviderSvc.h"
36#include "GaudiKernel/PropertyMgr.h"
37#include "GaudiKernel/DataObject.h"
39#include "CLHEP/Vector/ThreeVector.h"
42using CLHEP::Hep3Vector;
45#include "GaudiKernel/MsgStream.h"
60 :Algorithm(name, pSvcLocator),
62 m_inputFileDir("../InputData/"),
63 m_fileDir("/home/besdata/public/liucx/Calib/"),
69 declareProperty(
"fileExt", m_fileExt);
70 declareProperty(
"inputFileDir", m_inputFileDir);
71 declareProperty(
"fileDir", m_fileDir);
72 declareProperty(
"deadIxtal", m_deadIxtal);
73 declareProperty(
"hotIxtal", m_hotIxtal);
75 m_oldConstants =
new double[6240];
76 m_IxtalNumber=
new int[6240];
84 if ( 0 != m_oldConstants) {
85 delete [] m_oldConstants;
88 if ( 0 != m_IxtalNumber) {
89 delete [] m_IxtalNumber;
97 MsgStream log(
msgSvc(), name());
98 log << MSG::INFO <<
"in initialize()" << endreq;
102 scCalib = Gaudi::svcLocator() -> service(
"EmcCalibConstSvc", m_emcCalibConstSvc);
103 if( scCalib != StatusCode::SUCCESS){
104 log << MSG::ERROR <<
"can not use EmcCalibConstSvc" << endreq;
107 std::cout <<
"Test EmcCalibConstSvc DigiCalibConst(0)= "
108 << m_emcCalibConstSvc -> getDigiCalibConst(0) << std::endl;
115 SetModLowHighChannel();
117 return StatusCode::SUCCESS;
123 MsgStream log(
msgSvc(), name());
124 log << MSG::DEBUG <<
"in execute()" << endreq;
126 return StatusCode::SUCCESS;
132 MsgStream log(
msgSvc(), name());
135 log << MSG::INFO <<
"in endRun()" << endreq;
138 return StatusCode::SUCCESS;
145EmcCalibModLowHigh::initCalibConst( ) {
148 MsgStream log(
msgSvc(), name());
152 nConstEmc= m_emcCalibConstSvc -> getDigiCalibConstNo() ;
154 if ( nConstEmc!=6240) cout<<
"number of calibconst="<< nConstEmc<<endl;
156 for (
int i = 0; i< nConstEmc; i++ ) {
158 m_oldConstants[i]=m_emcCalibConstSvc -> getDigiCalibConst(i);
159 m_IxtalNumber[i]=m_emcCalibConstSvc -> getIxtalNumber(i);
191EmcCalibModLowHigh::SetModLowHighChannel() {
212 double DigiConst[6240];
213 int IxtalNumber[6240];
215 for(
int ind=0; ind < Nxtals; ind++ ) {
218 DigiConst[ind]=m_oldConstants[ind];
221 IxtalNumber[ind]=m_IxtalNumber[ind];
266 if (ind==2884) DigiConst[ind]=m_oldConstants[ind]*1.6923;
271 TFile fconst(
"EmcCalibConst_ModLowHigh.root",
"recreate");
274 TTree* constr=
new TTree(
"DigiCalibConst",
"DigiCalibConst");
275 constr->Branch(
"DigiCalibConst",DigiConst,
"DigiConst[6240]/D");
276 constr->Branch(
"IxtalNumber",IxtalNumber,
"IxtalNumber[6240]/I");
virtual ~EmcCalibModLowHigh()