83 MsgStream log(
msgSvc(), name());
84 log<<MSG::INFO<<
"tofcalgsec::initialize()!" <<endreq;
87 NTuplePtr nt1(
ntupleSvc(),
"TofCalib/btrk");
88 NTuplePtr nt2(
ntupleSvc(),
"TofCalib/etrk");
94 mtuple_barrel =
ntupleSvc()->book(
"TofCalib/btrk",CLID_ColumnWiseTuple,
"TofCalib");
95 mtuple_endcap =
ntupleSvc()->book(
"TofCalib/etrk",CLID_ColumnWiseTuple,
"TofCalib");
101 log << MSG::ERROR <<
"Cannot book N-tuple:" << long(mtuple_barrel) <<endmsg;
102 return StatusCode::FAILURE;
104 if( mtuple_endcap ) {
108 log << MSG::ERROR <<
"Cannot book N-tuple:" << long(mtuple_endcap) <<endmsg;
109 return StatusCode::FAILURE;
114 m_calibration =
true;
117 if( !m_online || m_calibration ) {
119 std::cout<<
" tofcalgsec checks your configurations ..."<<std::endl;
121 if((pdir=gSystem->OpenDirectory(m_workdir.c_str()))==0){
122 std::cerr<<
"WorkDir "<<m_workdir<<
" doesn't exist "<<std::endl;
123 if(gSystem->MakeDirectory(m_workdir.c_str())==-1){
124 std::cerr<<
" Fail to create directory : "<<m_workdir
125 <<
" Specify ./ as current work directory"<<std::endl;
130 gSystem->FreeDirectory(pdir);
137 if( (pdir=gSystem->OpenDirectory(m_datafile_dir.c_str())) ) {
139 std::vector<string>::iterator it = m_datafile_barrel.begin();
140 for( ; it!=m_datafile_barrel.end(); it++ ) {
141 if( (*it).size()>0 ) {
142 std::string thefile = (m_datafile_dir+
"/"+(*it));
143 if( gSystem->GetPathInfo(thefile.c_str(),fs)==0 ) {
144 m_barrelfile.push_back(thefile);
147 std::cerr<<
" File "<<thefile<<
" doesn't exist! "<<std::endl;
151 it = m_datafile_endcap.begin();
152 for( ; it!=m_datafile_endcap.end(); it++ ) {
153 if( (*it).size()>0 ) {
154 std::string thefile=(m_datafile_dir+
"/"+(*it));
155 if( gSystem->GetPathInfo(thefile.c_str(),fs)==0 ) {
156 m_endcapfile.push_back(thefile);
159 std::cerr<<
" File "<<thefile<<
" doesn't exist! "<<std::endl;
163 gSystem->FreeDirectory(pdir);
167 std::cerr<<
" Error : Please specify the InputDataDir which contains input data files for calibration "<<std::endl;
172 if( !m_online || m_calibration ) {
173 std::cout<<
"******************* Report of before Calibration ********************"<<std::endl
174 <<
"* WorkDir = "<<m_workdir<<
" [ results are save in this directory ] "<<std::endl
175 <<
"* WorkMode = "<<(m_online?
"OnLine":
"OffLine")<<
" [ run alone or with other algorithms ] "<<std::endl
176 <<
"* CalibItem = "<<m_calibItem<<
" [ which calibraions you perform ]"<<std::endl;
180 std::cout <<
"* ==> InputDataDir : "<<m_datafile_dir<<std::endl
181 <<
"* ===>Files of Barrel : ";
182 for( std::vector<std::string>::iterator it=m_barrelfile.begin(); it!=m_barrelfile.end(); it++ ) {
183 std::cout <<
"'" << (*it) <<
"' ";
185 std::cout << std::endl
186 <<
"* ===>Files of Endcap : ";
187 for( std::vector<std::string>::iterator it=m_endcapfile.begin(); it!=m_endcapfile.end(); it++ ) {
188 std::cout <<
"'" << (*it) <<
"' ";
190 std::cout << std::endl;
192 std::cout<<
"*********************************************************************"<<std::endl;
194 return StatusCode::SUCCESS;