Skip to content
Snippets Groups Projects
Commit 8ee8d4f3 authored by BaM's avatar BaM
Browse files

git-svn-id: svn+ssh://svn.in2p3.fr/class@313 0e7d625b-0364-4367-a6be-d5be4a48d228
parent a663fddb
No related branches found
No related tags found
No related merge requests found
......@@ -131,9 +131,9 @@ public:
\name Constructor/Desctructor
*/
//@{
CLASSLogger();
CLASSLogger(string CLASSLoggerName = "CLASS_OUTPUT.log", int VerboseLvl = 0, int OutputLvl = 1 ); //!< Normal Constructor
CLASSLogger(string CLASSLoggerName, int VerboseLvl = 0, int OutputLvl = 1 ); //!< Normal Constructor
~CLASSLogger(); //!< Normal Destructor
......
......@@ -49,15 +49,18 @@ public :
\name Constructor/Desctructor
*/
//@{
Scenario(); ///< Normal Constructor.
Scenario(CLASSLogger* Log= new CLASSLogger(), cSecond abstime = 0); ///< Log Constructor.
Scenario(CLASSLogger* Log, cSecond abstime = 0); ///< Log Constructor.
/*!
Use to load a CLASSLogger
\param CLASSLogger: CLASSLogger used for the log...
*/
Scenario(cSecond abstime); ///< Time Constructor.
Scenario(cSecond abstime, CLASSLogger* log = new CLASSLogger()); ///< Time Constructor.
Scenario(cSecond abstime, CLASSLogger* log); ///< Time Constructor.
/*!
Use to set the starting time of the Parc
\param abstime: Starting time of the Parc in second
......
......@@ -14,6 +14,98 @@ using namespace std;
//
//
//________________________________________________________________________
CLASSLogger::CLASSLogger()
{
string CLASSLoggerName = "CLASS_OUTPUT.log";
int VerboseLvl = 0;
int OutputLvl = 1;
fCLASSLoggerName = CLASSLoggerName;
fOutPutFile.open(CLASSLoggerName.c_str());
fVerboseLVL = VerboseLvl;
if(!fOutPutFile)
{
cout << "Could not open the CLASSLogger: " << CLASSLoggerName << " !" << endl;
exit(-1);
}
else
cout << "CLASSLogger: " << CLASSLoggerName << " opened." << endl;
fError = 0;
fWarning = 0;
fDebug = 0;
fInfo = 0;
if (VerboseLvl <= OutputLvl)
fMaxOutPutLVL = OutputLvl;
else
fMaxOutPutLVL = VerboseLvl;
if(VerboseLvl >= 0)
{
if (!fError)
fError = new LogType(std::cout);
else
fError->SetSecondOutput(std::cout);
}
if(VerboseLvl >= 1)
{
if (!fWarning)
fWarning = new LogType(std::cout);
else
fWarning->SetSecondOutput(std::cout);
}
if(VerboseLvl >= 2)
{
if (!fInfo)
fInfo = new LogType(std::cout);
else
fInfo->SetSecondOutput(std::cout);
}
if(VerboseLvl >= 3)
{
if (!fDebug)
fDebug = new LogType(std::cout);
else
fDebug->SetSecondOutput(std::cout);
}
if(OutputLvl >= 0)
{
if (!fError)
fError = new LogType(fOutPutFile);
else
fError->SetSecondOutput(fOutPutFile);
}
if(OutputLvl >= 1)
{
if (!fWarning)
fWarning = new LogType(fOutPutFile);
else
fWarning->SetSecondOutput(fOutPutFile);
}
if(OutputLvl >= 2)
{
if (!fInfo)
fInfo = new LogType(fOutPutFile);
else
fInfo->SetSecondOutput(fOutPutFile);
}
if(OutputLvl >= 3)
{
if (!fDebug)
fDebug = new LogType(fOutPutFile);
else
fDebug->SetSecondOutput(fOutPutFile);
}
}
CLASSLogger::CLASSLogger(string CLASSLoggerName, int VerboseLvl, int OutputLvl )
{
......
......@@ -43,6 +43,62 @@ string dtoa(double num)
return os.str();
}
//________________________________________________________________________
Scenario::Scenario():CLASSObject(new CLASSLogger())
{
fNewTtree = true;
fPrintStep = (cSecond)(3600*24*365.25); // One Step per Year
fAbsoluteTime = 0;
fStartingTime = fAbsoluteTime;
fStockManagement = true;
fOutputFileName = "CLASS_Default.root";
fOutputTreeName = "Data";
fOutFile = 0;
fOutT = 0;
fParcPower = 0;
// Warning
INFO << "!!INFO!! !!!Scenario!!! Parc has been define :" << endl;
INFO << "\t Print set at : " << (double)(fPrintStep/3600/24/365.25) << " year" << endl;
INFO << "\t StockManagement set at : true" << endl;
INFO << "\t OutPut will be in \"" << fOutputFileName << "\" File and \"" << fOutputTreeName << "\" TTree" << endl;
INFO << "\t Log will be in " << GetLog()->GetCLASSLoggerName() << endl;
}
//________________________________________________________________________
Scenario::Scenario(cSecond abstime):CLASSObject(new CLASSLogger())
{
fNewTtree = true;
fPrintStep = (cSecond)(3600*24*365.25); // One Step per Year
fAbsoluteTime = abstime;
fStartingTime = fAbsoluteTime;
fStockManagement = true;
fOutputFileName = "CLASS_Default.root";
fOutputTreeName = "Data";
fOutFile = 0;
fOutT = 0;
fParcPower = 0;
// Warning
INFO << "!!INFO!! !!!Scenario!!! Parc has been define :" << endl;
INFO << "\t Print set at : " << (double)(fPrintStep/3600/24/365.25) << " year" << endl;
INFO << "\t StockManagement set at : true" << endl;
INFO << "\t OutPut will be in \"" << fOutputFileName << "\" File and \"" << fOutputTreeName << "\" TTree" << endl;
INFO << "\t Log will be in " << GetLog()->GetCLASSLoggerName() << endl;
}
//________________________________________________________________________
Scenario::Scenario(CLASSLogger* log, cSecond abstime):CLASSObject(log)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment