]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
don't write by default stat object to local run db file.
authorrdm <rdm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Dec 2003 04:49:07 +0000 (04:49 +0000)
committerrdm <rdm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Dec 2003 04:49:07 +0000 (04:49 +0000)
RAW/AliRawEvent.cxx
RAW/AliRawEvent.h

index 0593f0ba549219d669d32bd2f44b5f6c40a5e004..3feb88bbae36fca9a39a3d05563b5efa39f05f44 100644 (file)
@@ -377,7 +377,7 @@ void AliStats::WriteToDB(AliRawDB *rawdb)
    ds->cd();
 
    // Write stats also in the bookkeeping RunDB
-   AliRunDB *rundb = new AliRunDB;
+   AliRunDB *rundb = new AliRunDB(kTRUE);
    rundb->Update(this);
    rundb->UpdateRDBMS(this);
    rundb->UpdateAliEn(this);
@@ -1034,10 +1034,14 @@ void AliTagNullDB::Close()
 
 
 //______________________________________________________________________________
-AliRunDB::AliRunDB()
+AliRunDB::AliRunDB(Bool_t noLocalDB)
 {
    // Open run database, and get or create tree.
 
+   fRunDB = 0;
+
+   if (noLocalDB) return;
+
    // Get hostname
    char hostname[64], filename[64];
    const char *fs = kRunDBFS;
@@ -1064,6 +1068,8 @@ void AliRunDB::Update(AliStats *stats)
 {
    // Add stats object to database.
 
+   if (!stats || !fRunDB) return;
+
    TDirectory *ds = gDirectory;
    fRunDB->cd();
 
@@ -1087,6 +1093,8 @@ void AliRunDB::UpdateRDBMS(AliStats *stats)
 {
    // Add stats object to central MySQL DB.
 
+   if (!stats) return;
+
    char sql[4096];
    char bt[25], et[25];
 
@@ -1127,6 +1135,8 @@ void AliRunDB::UpdateAliEn(AliStats *stats)
 {
    // Record file in AliEn catalog.
 
+   if (!stats) return;
+
    TGrid *g = TGrid::Connect(kAlienHost, "");
 
    TString lfn = kAlienDir;
@@ -1146,7 +1156,7 @@ void AliRunDB::Close()
 {
    // Close run database.
 
-   fRunDB->Close();
+   if (fRunDB) fRunDB->Close();
    delete fRunDB;
 }
 
index f28380190c035772e19ff571c2719181672f20ce..64edef3b8104531b9b00d137ab6fa583f49859b4 100644 (file)
@@ -401,7 +401,7 @@ private:
    TFile  *fRunDB;     // run database
 
 public:
-   AliRunDB();
+   AliRunDB(Bool_t noLocalDB = kFALSE);
    ~AliRunDB() { Close(); }
 
    void Update(AliStats *stats);