1 |
kusanagi |
1.1 |
/** @file |
2 |
kusanagi |
1.2 |
* $Source: /home/cvsmanager/yoda/techmodel/TechmodelPamelaRun.cpp,v $ |
3 |
kusanagi |
2.1 |
* $Id: TechmodelPamelaRun.cpp,v 2.0 2004/09/21 20:50:54 kusanagi Exp $ |
4 |
kusanagi |
1.2 |
* $Author: kusanagi $ |
5 |
kusanagi |
1.1 |
* |
6 |
|
|
* Implementation of the TechmodelPamelaRun class. |
7 |
|
|
*/ |
8 |
|
|
#include <string> |
9 |
|
|
#include <exception> |
10 |
|
|
#include <iostream> |
11 |
kusanagi |
1.2 |
#include <fstream> |
12 |
|
|
#include <log4cxx/logger.h> |
13 |
kusanagi |
1.1 |
|
14 |
|
|
#include "TechmodelPamelaRun.h" |
15 |
|
|
|
16 |
|
|
using namespace pamela; |
17 |
|
|
using namespace pamela::techmodel; |
18 |
|
|
|
19 |
|
|
|
20 |
kusanagi |
1.2 |
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.TechmodelPamelaRun")); |
21 |
kusanagi |
1.1 |
|
22 |
|
|
/** |
23 |
|
|
* Create a new Pamela run structure to write the data from the |
24 |
|
|
* techmodel data files into the ROOT TTrees. |
25 |
|
|
* @param run Run number |
26 |
|
|
*/ |
27 |
|
|
TechmodelPamelaRun::TechmodelPamelaRun(std::string fileName, std::string path) : |
28 |
|
|
PamelaRun(fileName, path) { |
29 |
|
|
InputFile = new ifstream(fileName.c_str(), std::ios::binary); //inserito ios::binary maurizio 01/03/2004 |
30 |
|
|
if (!*InputFile){ |
31 |
kusanagi |
1.2 |
std::stringstream oss; |
32 |
kusanagi |
2.1 |
oss.str(""); |
33 |
kusanagi |
1.2 |
oss << "Cannot open file " << fileName; |
34 |
|
|
logger->error(oss.str().c_str()); |
35 |
kusanagi |
1.1 |
throw std::exception(); |
36 |
|
|
} |
37 |
|
|
else |
38 |
|
|
{ |
39 |
|
|
// :TODO: InputFile should be a dervived class for cross-checking of |
40 |
|
|
// packet lengths. |
41 |
|
|
} |
42 |
|
|
|
43 |
|
|
} |
44 |
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|