1 |
/** @file |
/** @file |
2 |
* $Source: /home/cvspamela/yoda/techmodel/TechmodelPamelaRun.cpp,v $ |
* $Source: /home/cvsmanager/yoda/techmodel/TechmodelPamelaRun.cpp,v $ |
3 |
* $Id: TechmodelPamelaRun.cpp,v 1.7 2004/04/28 09:01:27 nagni Exp $ |
* $Id: TechmodelPamelaRun.cpp,v 5.1 2006/02/04 12:37:45 kusanagi Exp $ |
4 |
* $Author: nagni $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the TechmodelPamelaRun class. |
* Implementation of the TechmodelPamelaRun class. |
7 |
*/ |
*/ |
|
#include <string> |
|
|
#include <exception> |
|
|
#include <iostream> |
|
|
#include <fstream.h> |
|
|
#include <log4cpp/Category.hh> |
|
8 |
|
|
9 |
|
|
10 |
|
#include <log4cxx/logger.h> |
11 |
#include "TechmodelPamelaRun.h" |
#include "TechmodelPamelaRun.h" |
12 |
|
|
13 |
using namespace pamela; |
using namespace pamela; |
14 |
using namespace pamela::techmodel; |
using namespace pamela::techmodel; |
15 |
|
|
16 |
|
|
17 |
|
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.TechmodelPamelaRun")); |
|
static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.TechmodelPamelaRun"); |
|
18 |
|
|
19 |
/** |
/** |
20 |
* Create a new Pamela run structure to write the data from the |
* Create a new Pamela run structure to write the data from the |
21 |
* techmodel data files into the ROOT TTrees. |
* techmodel data files into the ROOT TTrees. |
22 |
* @param run Run number |
* @param run Run number |
23 |
*/ |
*/ |
24 |
TechmodelPamelaRun::TechmodelPamelaRun(std::string fileName, std::string path) : |
TechmodelPamelaRun::TechmodelPamelaRun(std::string fileName, std::string path, bool multiFile, short compression) : |
25 |
PamelaRun(fileName, path) { |
PamelaRun(fileName, path, multiFile, compression) { |
26 |
InputFile = new ifstream(fileName.c_str(), std::ios::binary); //inserito ios::binary maurizio 01/03/2004 |
InputFile = new ifstream(fileName.c_str(), std::ios::binary); //inserito ios::binary maurizio 01/03/2004 |
27 |
if (!*InputFile){ |
if (!*InputFile){ |
28 |
cat << log4cpp::Priority::ERROR |
std::stringstream oss; |
29 |
<< "Cannot open file " + fileName |
oss.str(""); |
30 |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
oss << "Cannot open file " << fileName; |
31 |
|
logger->error(oss.str().c_str()); |
32 |
throw std::exception(); |
throw std::exception(); |
33 |
} |
} |
34 |
else |
else |