// Fixed file system locations for the different DB's
#ifdef USE_RDM
-const char *kFifo = "/tmp/alimdc.fifo";
-const char *kRawDBFS[2] = { "/tmp/mdc1", "/tmp/mdc2" };
-const char *kTagDBFS = "/tmp/mdc1/tags";
-const char *kRunDBFS = "/tmp/mdc1/meta";
-const char *kRFIOFS = "rfio:/castor/cern.ch/user/r/rdm";
-const char *kCastorFS = "castor:/castor/cern.ch/user/r/rdm";
-const char *kRootdFS = "root://localhost//tmp/mdc1";
-const char *kAlienHost = "alien://aliens7.cern.ch:15000/?direct";
-const char *kAlienDir = "/alice_mdc/DC";
+const char* const kFifo = "/tmp/alimdc.fifo";
+const char* const kRawDBFS[2] = { "/tmp/mdc1", "/tmp/mdc2" };
+const char* const kTagDBFS = "/tmp/mdc1/tags";
+const char* const kRunDBFS = "/tmp/mdc1/meta";
+const char* const kRFIOFS = "rfio:/castor/cern.ch/user/r/rdm";
+const char* const kCastorFS = "castor:/castor/cern.ch/user/r/rdm";
+const char* const kRootdFS = "root://localhost//tmp/mdc1";
+const char* const kAlienHost = "alien://aliens7.cern.ch:15000/?direct";
+const char* const kAlienDir = "/alice_mdc/DC";
#else
-const char *kFifo = "/tmp/alimdc.fifo";
-const char *kRawDBFS[2] = { "/data1/mdc", "/data2/mdc" };
-const char *kTagDBFS = "/data1/mdc/tags";
-const char *kRunDBFS = "/data1/mdc/meta";
-const char *kRFIOFS = "rfio:/castor/cern.ch/lcg/dc5";
-const char *kCastorFS = "castor:/castor/cern.ch/lcg/dc5";
-const char *kRootdFS = "root://localhost//tmp/mdc1";
-const char *kAlienHost = "alien://aliens7.cern.ch:15000/?direct";
-const char *kAlienDir = "/alice_mdc/DC";
+const char* const kFifo = "/tmp/alimdc.fifo";
+const char* const kRawDBFS[2] = { "/data1/mdc", "/data2/mdc" };
+const char* const kTagDBFS = "/data1/mdc/tags";
+const char* const kRunDBFS = "/data1/mdc/meta";
+const char* const kRFIOFS = "rfio:/castor/cern.ch/lcg/dc5";
+const char* const kCastorFS = "castor:/castor/cern.ch/lcg/dc5";
+const char* const kRootdFS = "root://localhost//tmp/mdc1";
+const char* const kAlienHost = "alien://aliens7.cern.ch:15000/?direct";
+const char* const kAlienDir = "/alice_mdc/DC";
#endif
// Maximum size of tag db files
// raw data object, otherwise a private copy will be made.
fNSubEvents = 0;
- fEvtHdr = new AliRawEventHeader;
+ fEvtHdr = 0;
fEqpHdr = 0;
fRawData = 0;
fSubEvents = 0;
}
+//______________________________________________________________________________
+AliRawEventHeader *AliRawEvent::GetHeader()
+{
+ // Get event header part of AliRawEvent.
+
+ if (!fEvtHdr)
+ fEvtHdr = new AliRawEventHeader;
+
+ return fEvtHdr;
+}
+
//______________________________________________________________________________
AliRawEquipmentHeader *AliRawEvent::GetEquipmentHeader()
{
}
//______________________________________________________________________________
-Bool_t AliRawDB::FSHasSpace(const char *fs)
+Bool_t AliRawDB::FSHasSpace(const char *fs) const
{
// Check for at least fMaxSize bytes of free space on the file system.
// If the space is not available return kFALSE, kTRUE otherwise.
}
//______________________________________________________________________________
-const char *AliRawDB::GetFileName()
+const char *AliRawDB::GetFileName() const
{
// Return filename based on hostname and date and time. This will make
// each file unique. Also makes sure (via FSHasSpace()) that there is
{
// Create a new raw DB.
- const Int_t maxRetry = 10;
+ const Int_t kMaxRetry = 200;
+ const Int_t kMaxSleep = 1; // seconds
+ const Int_t kMaxSleepLong = 10; // seconds
Int_t retry = 0;
again:
retry++;
fRawDB = TFile::Open(fname, GetOpenOption(),
- Form("ALICE MDC%d raw DB", kMDC), fCompress);
+ Form("ALICE MDC%d raw DB", kMDC), fCompress,
+ GetNetopt());
if (!fRawDB) {
- if (retry < maxRetry) {
- Warning("Create", "failure to open file, sleeping 10 seconds before retrying...");
- gSystem->Sleep(10000);
+ if (retry < kMaxRetry) {
+ Warning("Create", "failure to open file, sleeping %d %s before retrying...",
+ kMaxSleep, kMaxSleep==1 ? "second" : "seconds");
+ gSystem->Sleep(kMaxSleep*1000);
goto again;
}
- Error("Create", "failure to open file %s after %d tries", fname, maxRetry);
+ Error("Create", "failure to open file %s after %d tries", fname, kMaxRetry);
return kFALSE;
}
if (fRawDB->IsZombie()) {
fRawDB->GetErrno() == 1027) { // SESYSERR
fRawDB->ResetErrno();
delete fRawDB;
- Warning("Create", "file is a zombie (no space), sleeping 10 seconds before retrying...");
- gSystem->Sleep(10000); // sleep 10 seconds before retrying
+ Warning("Create", "file is a zombie (no space), sleeping %d %s before retrying...",
+ kMaxSleepLong, kMaxSleepLong==1 ? "second" : "seconds");
+ gSystem->Sleep(kMaxSleepLong*1000); // sleep 10 seconds before retrying
goto again;
}
Error("Create", "file %s is zombie", fname);
fRawDB->ResetErrno();
delete fRawDB;
fRawDB = 0;
- if (retry < maxRetry) {
- Warning("Create", "file is a zombie, sleeping 10 seconds before retrying...");
- gSystem->Sleep(10000);
+ if (retry < kMaxRetry) {
+ Warning("Create", "file is a zombie, sleeping %d %s before retrying...",
+ kMaxSleep, kMaxSleep==1 ? "second" : "seconds");
+ gSystem->Sleep(kMaxSleep*1000);
goto again;
}
- Error("Create", "failure to open file %s after %d tries", fname, maxRetry);
+ Error("Create", "failure to open file %s after %d tries", fname, kMaxRetry);
return kFALSE;
}
}
//______________________________________________________________________________
-const char *AliRawRFIODB::GetFileName()
+const char *AliRawRFIODB::GetFileName() const
{
// Return filename based on hostname and date and time. This will make
// each file unique. Also the directory will be made unique for each
}
//______________________________________________________________________________
-const char *AliRawCastorDB::GetFileName()
+const char *AliRawCastorDB::GetFileName() const
{
// Return filename based on hostname and date and time. This will make
// each file unique. Also the directory will be made unique for each
}
//______________________________________________________________________________
-const char *AliRawRootdDB::GetFileName()
+const char *AliRawRootdDB::GetFileName() const
{
// Return filename based on hostname and date and time. This will make
// each file unique. Also the directory will be made unique for each
}
//______________________________________________________________________________
-const char *AliRawNullDB::GetFileName()
+const char *AliRawNullDB::GetFileName() const
{
// Return /dev/null as filename.
}
//______________________________________________________________________________
-const char *AliTagDB::GetFileName()
+const char *AliTagDB::GetFileName() const
{
// Return filename based on hostname and date and time. This will make
// each file unique. The tags will be stored in the /data1/tags directory.
}
//______________________________________________________________________________
-const char *AliTagNullDB::GetFileName()
+const char *AliTagNullDB::GetFileName() const
{
// Return /dev/null as filename.
TGrid *g = TGrid::Connect(kAlienHost, "");
TString lfn = kAlienDir;
+ TDatime dt;
+
+ // make a subdirectory for each day
+ lfn += "/adc-";
+ lfn += dt.GetDate();
+
+ // check if directory exists, if not create it
+ if (!g->OpenDir(lfn)) {
+ // directory does not exist, create it
+ if (g->Mkdir(lfn, kTRUE) == -1) {
+ Error("UpdateAliEn", "cannot create directory %s", lfn.Data());
+ lfn = kAlienDir;
+ }
+ }
+
lfn += "/";
lfn += gSystem->BaseName(stats->GetFileName());
//----------------- Use SIGUSR1 to interupt endless loop -----------------------
class AliMDCInterruptHandler : public TSignalHandler {
-private:
- AliMDC *fMDC; // alimdc to signal
public:
AliMDCInterruptHandler(AliMDC *mdc) : TSignalHandler(kSigUser1, kFALSE), fMDC(mdc) { }
+ AliMDCInterruptHandler(const AliMDCInterruptHandler& handler): TSignalHandler(handler)
+ {Fatal("AliMDCInterruptHandler", "copy constructor not implemented");};
+ AliMDCInterruptHandler& operator = (const AliMDCInterruptHandler& /*rawDB*/) {
+ Fatal("operator =", "assignment operator not implemented");
+ return *this;
+ };
Bool_t Notify() {
Info("Notify", "received a SIGUSR1 signal");
fMDC->SetStopLoop();
return kTRUE;
}
+private:
+ AliMDC *fMDC; // alimdc to signal
};
//______________________________________________________________________________