/*
$Log$
+Revision 1.2 2007/10/12 13:36:27 cvetan
+Coding convention fixes from Stefan
+
Revision 1.1 2007/09/17 10:23:31 cvetan
New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder.
*/
-////////////////////////////////////////////////////////////////////////
-//
-// AliTPCMonitorConfig class
-//
-// Configuration handler class for AliTPCMonitor
-//
-// The basic configuration will be read from the file AliTPCMonitorConfig.txt
-// and can be changed online via the Button "Conf. Ranges"
-// Basic configuration settings are e.g. the range for the determination
-// of the baseline, maximum adc value and the settings for the pedestal calculation.
-//
-// Author: Stefan Kniege, IKF, Frankfurt
-//
-//
+//////////////////////////////////////////////////////////////////////////
+////
+//// AliTPCMonitorConfig class
+////
+//// Configuration handler class for AliTPCMonitor
+////
+//// The basic configuration will be read from the file AliTPCMonitorConfig.txt
+//// and can be changed online via the Button "Conf. Ranges"
+//// Basic configuration settings are e.g. the range for the determination
+//// of the baseline, maximum adc value and the settings for the pedestal calculation.
+////
+//// Author: Stefan Kniege, IKF, Frankfurt
+////
+////
/////////////////////////////////////////////////////////////////////////
fSectorLast(-1),
fSectorLastDisplayed(-1),
fSectorArr(new Int_t[36]),
- fFileLast(new Char_t[256]),
+ fFileLast(),
fFileLastSet(0),
- fFileCurrent(new Char_t[256]),
+ fFileCurrent(),
fEventNext(1),
fEventNextID(1),
fEventProcessed(0),
fTimeBins(1024),
fMaxHwAddr(24000),
fFitPulse(1),
- fProcOneSector(1)
+ fProcOneSector(0)
{
// Constructor
for(Int_t i =0; i<36; i++) { fSectorArr[i] = 0;}
fSectorLast(config.fSectorLast),
fSectorLastDisplayed(config.fSectorLastDisplayed),
fSectorArr(new Int_t[36]),
- fFileLast(new Char_t[strlen(config.fFileLast)+1]),
+ fFileLast(config.fFileLast),
fFileLastSet(config.fFileLastSet),
- fFileCurrent(new Char_t[strlen(config.fFileCurrent)+1]),
+ fFileCurrent(config.fFileCurrent),
fEventNext(config.fEventNext),
fEventNextID(config.fEventNextID),
fEventProcessed(config.fEventProcessed),
fProcOneSector(config.fProcOneSector)
{
// copy constructor
- strcpy(fFileLast,config.fFileLast);
- strcpy(fFileCurrent,config.fFileCurrent);
for(Int_t i =0; i<36; i++) { fSectorArr[i] = 0;}
for(Int_t i =0; i<10;i++) { fComponents[i] =0.0;}
fFitPulse=config.fFitPulse;
fProcOneSector=config.fProcOneSector;
- fFileLast = new Char_t[strlen(config.fFileLast)+1];
- strcpy(fFileLast,config.fFileLast);
-
-
- fFileCurrent = new Char_t[strlen(config.fFileCurrent)+1];
- strcpy(fFileCurrent,config.fFileCurrent);
+ fFileLast = config.fFileLast;
+ fFileCurrent = config.fFileCurrent;
fSectorArr = new Int_t[36]; for(Int_t i =0; i<36; i++) { fSectorArr[i] = 0;}
fComponents = new Float_t[10]; for(Int_t i =0; i<10;i++) { fComponents[i] =0.0;}
AliTPCMonitorConfig::~AliTPCMonitorConfig()
{
// Destructor
- delete[] fFileLast;
- delete[] fFileCurrent;
delete[] fSectorArr;
delete[] fComponents;
}
}
//_______________________________________________________________________________________________________________
-void AliTPCMonitorConfig::ReadConfig(Char_t* nameconf)
+void AliTPCMonitorConfig::ReadConfig(const Char_t* nameconf)
{
// Read base configuration from file
// Update main window size
- string line;
+ // string line;
ifstream datin;
datin.open(nameconf);
cout << " Data Format :: " << fFormat << endl;
cout << " File current :: " << fFileCurrent << endl;
- if(fFileLastSet) { cout << " File last :: " << fFileLast << endl; }
+ if(fFileLastSet) { cout << " File last :: " << fFileLast.Data() << endl; }
return;
}
//______________________________________________________________________________________________________________
-Char_t* AliTPCMonitorConfig::GetLastProcFile()
+const Char_t* AliTPCMonitorConfig::GetLastProcFile()
{
// Return name of last processed file
// Get from file if written
if(!fFileLastSet)
{
- Char_t fnlast[256];
- sprintf(fnlast,"AliTPCMonitorLastFile.txt");
- ifstream datin(fnlast);
- if(!datin) { AliWarning("Could not read file containing name of last processed file: Check permissions and path");}
+ ifstream datin("AliTPCMonitorLastFile.txt");
+ if(!datin.is_open()) {
+ AliWarning("Could not read file containing name of last processed file: Check permissions and path");
+ fFileLast="";
+ fFileLastSet=0;
+ return fFileLast.Data();
+ }
datin >> fFileLast;
datin.close();
fFileLastSet=1;
}
//_______________________________________________________________________________________________________________
-void AliTPCMonitorConfig::SetLastProcFile(Char_t* file)
+void AliTPCMonitorConfig::SetLastProcFile(const Char_t* file)
{
// Set name of last processed file
// Write name to a file
- sprintf(fFileLast,file);
- Char_t fnlast[256];
- sprintf(fnlast,"AliTPCMonitorLastFile.txt");
- ofstream datout(fnlast);
+ fFileLast=file;
+ ofstream datout("AliTPCMonitorLastFile.txt");
if(!datout) { AliWarning("Could not write file containing name of last processed file: Check permissions and path");}
datout << fFileLast << endl;
datout.close();