From b7d09bb3044de03a5d6fe6bf48c25374c2a1c3b7 Mon Sep 17 00:00:00 2001 From: tkuhr Date: Mon, 25 Oct 2004 11:18:49 +0000 Subject: [PATCH] AliMDC and DB classes moved from library to alimdc executable --- RAW/AliMDC.cxx | 15 ++++++++++----- RAW/AliRawDB.cxx | 20 ++++++++++++++++++++ RAW/AliRawDB.h | 3 +++ RAW/AliRawEvent.h | 4 ++++ RAW/AliRunDB.cxx | 12 ++++++++++++ RAW/AliRunDB.h | 2 ++ RAW/AliStats.cxx | 26 -------------------------- RAW/AliStats.h | 2 -- RAW/MDCLinkDef.h | 17 +++++++++++++++++ RAW/RAWLinkDef.h | 9 --------- RAW/binalimdc.pkg | 11 ++++++++++- RAW/libRAW.pkg | 9 +++------ 12 files changed, 81 insertions(+), 49 deletions(-) create mode 100644 RAW/MDCLinkDef.h diff --git a/RAW/AliMDC.cxx b/RAW/AliMDC.cxx index e4250c381df..a05580de3fa 100644 --- a/RAW/AliMDC.cxx +++ b/RAW/AliMDC.cxx @@ -82,6 +82,7 @@ #include "AliRawRootdDB.h" #include "AliRawNullDB.h" #include "AliTagDB.h" +#include "AliRunDB.h" #include "AliMDC.h" @@ -250,9 +251,11 @@ Int_t AliMDC::Run() ALIDEBUG(3) AliL3Log::fgLevel=AliL3Log::kNone; #endif - if (!AliL3Transform::Init("./", kFALSE)) { - Error("Run","HLT initialization failed!"); - return 1; + if (fUseFilter) { + if (!AliL3Transform::Init("./", kFALSE)) { + Error("Run","HLT initialization failed!"); + return 1; + } } AliESD *esd = new AliESD; @@ -537,7 +540,8 @@ Int_t AliMDC::Run() rawdb->GetBytesWritten() / timer.RealTime() / 1000000.); // Write stats object to raw db, run db, MySQL and AliEn - stats->WriteToDB(rawdb); + rawdb->WriteStats(stats); + AliRunDB::WriteStats(stats); delete stats; if (!rawdb->NextFile()) { @@ -581,7 +585,8 @@ Int_t AliMDC::Run() rawdb->GetBytesWritten() / timer.RealTime() / 1000000.); // Write stats to raw db and run db and delete stats object - stats->WriteToDB(rawdb); + rawdb->WriteStats(stats); + AliRunDB::WriteStats(stats); delete stats; // Close the raw DB diff --git a/RAW/AliRawDB.cxx b/RAW/AliRawDB.cxx index 49ff7a9d11c..28a128e5adf 100644 --- a/RAW/AliRawDB.cxx +++ b/RAW/AliRawDB.cxx @@ -32,6 +32,7 @@ #include "AliRawEvent.h" #include "AliRawEventHeader.h" +#include "AliStats.h" #include "AliMDC.h" #ifdef USE_HLT @@ -280,6 +281,25 @@ void AliRawDB::Close() fRawDB = 0; } +//______________________________________________________________________________ +void AliRawDB::WriteStats(AliStats* stats) +{ + // Write stats to raw DB, local run DB and global MySQL DB. + + AliRawEventHeader &header = *GetEvent()->GetHeader(); + + // Write stats into RawDB + TDirectory *ds = gDirectory; + GetDB()->cd(); + stats->SetEvents(GetEvents()); + stats->SetLastId(header.GetRunNumber(), header.GetEventInRun()); + stats->SetFileSize(GetBytesWritten()); + stats->SetCompressionFactor(GetCompressionFactor()); + stats->SetEndTime(); + stats->Write("stats"); + ds->cd(); +} + //______________________________________________________________________________ Bool_t AliRawDB::NextFile() { diff --git a/RAW/AliRawDB.h b/RAW/AliRawDB.h index e8c7283e22d..bfc182502a9 100644 --- a/RAW/AliRawDB.h +++ b/RAW/AliRawDB.h @@ -27,6 +27,7 @@ // Forward class declarations class AliRawEvent; +class AliStats; class TFile; #ifdef USE_HLT @@ -52,6 +53,8 @@ public: Bool_t FileFull() { return (fRawDB->GetBytesWritten() > fMaxSize) ? kTRUE : kFALSE; } + void WriteStats(AliStats* stats); + Bool_t NextFile(); Double_t GetBytesWritten() const { return fRawDB->GetBytesWritten(); } diff --git a/RAW/AliRawEvent.h b/RAW/AliRawEvent.h index a6133ca07b4..30d7628a4c7 100644 --- a/RAW/AliRawEvent.h +++ b/RAW/AliRawEvent.h @@ -35,6 +35,10 @@ #include #endif +#ifndef ROOT_TObjArray +#include +#endif + // Forward class declarations class AliRawEventHeader; diff --git a/RAW/AliRunDB.cxx b/RAW/AliRunDB.cxx index c0899cd2123..450c16ac861 100644 --- a/RAW/AliRunDB.cxx +++ b/RAW/AliRunDB.cxx @@ -203,3 +203,15 @@ void AliRunDB::Close() if (fRunDB) fRunDB->Close(); delete fRunDB; } + + +//______________________________________________________________________________ +void AliRunDB::WriteStats(AliStats* stats) +{ + // Write stats also in the bookkeeping RunDB + AliRunDB *rundb = new AliRunDB(kTRUE); + rundb->Update(stats); + rundb->UpdateRDBMS(stats); + rundb->UpdateAliEn(stats); + delete rundb; +} diff --git a/RAW/AliRunDB.h b/RAW/AliRunDB.h index bde84ac2a0f..74faac74447 100644 --- a/RAW/AliRunDB.h +++ b/RAW/AliRunDB.h @@ -33,6 +33,8 @@ public: void UpdateAliEn(AliStats *stats); void Close(); + static void WriteStats(AliStats* stats); + private: TFile *fRunDB; // run database diff --git a/RAW/AliStats.cxx b/RAW/AliStats.cxx index 3b938a0548f..d89a49e86a8 100644 --- a/RAW/AliStats.cxx +++ b/RAW/AliStats.cxx @@ -109,29 +109,3 @@ void AliStats::Fill(Float_t time) fRTHist->Fill(fChunk, time); fChunk += 1.0; } - -//______________________________________________________________________________ -void AliStats::WriteToDB(AliRawDB *rawdb) -{ - // Write stats to raw DB, local run DB and global MySQL DB. - - AliRawEventHeader &header = *rawdb->GetEvent()->GetHeader(); - - // Write stats into RawDB - TDirectory *ds = gDirectory; - rawdb->GetDB()->cd(); - SetEvents(rawdb->GetEvents()); - SetLastId(header.GetRunNumber(), header.GetEventInRun()); - SetFileSize(rawdb->GetBytesWritten()); - SetCompressionFactor(rawdb->GetCompressionFactor()); - SetEndTime(); - Write("stats"); - ds->cd(); - - // Write stats also in the bookkeeping RunDB - AliRunDB *rundb = new AliRunDB(kTRUE); - rundb->Update(this); - rundb->UpdateRDBMS(this); - rundb->UpdateAliEn(this); - delete rundb; -} diff --git a/RAW/AliStats.h b/RAW/AliStats.h index ff2953ea84f..4ba975e8a81 100644 --- a/RAW/AliStats.h +++ b/RAW/AliStats.h @@ -26,7 +26,6 @@ // Forward class declarations -class AliRawDB; class TH1F; @@ -46,7 +45,6 @@ public: void SetFileSize(Double_t size) { fFileSize = size; } void SetCompressionFactor(Float_t comp) { fCompFactor = comp; } void Fill(Float_t time); - void WriteToDB(AliRawDB *rawdb); Int_t GetEvents() const { return fEvents; } Int_t GetFirstRun() const { return fFirstRun; } diff --git a/RAW/MDCLinkDef.h b/RAW/MDCLinkDef.h new file mode 100644 index 00000000000..c8b0419b688 --- /dev/null +++ b/RAW/MDCLinkDef.h @@ -0,0 +1,17 @@ +#ifdef __CINT__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class AliRawDB; +#pragma link C++ class AliRawRFIODB; +#pragma link C++ class AliRawCastorDB; +#pragma link C++ class AliRawRootdDB; +#pragma link C++ class AliRawNullDB; +#pragma link C++ class AliTagDB; +#pragma link C++ class AliTagNullDB; +#pragma link C++ class AliRunDB; +#pragma link C++ class AliMDC; + +#endif diff --git a/RAW/RAWLinkDef.h b/RAW/RAWLinkDef.h index 3067d6cf256..35f065b026c 100644 --- a/RAW/RAWLinkDef.h +++ b/RAW/RAWLinkDef.h @@ -10,15 +10,6 @@ #pragma link C++ class AliRawEquipment; #pragma link C++ class AliRawData; #pragma link C++ class AliStats; -#pragma link C++ class AliRawDB; -#pragma link C++ class AliRawRFIODB; -#pragma link C++ class AliRawCastorDB; -#pragma link C++ class AliRawRootdDB; -#pragma link C++ class AliRawNullDB; -#pragma link C++ class AliTagDB; -#pragma link C++ class AliTagNullDB; -#pragma link C++ class AliRunDB; -#pragma link C++ class AliMDC; #pragma link C++ class AliRawReader+; #pragma link C++ class AliRawReaderFile+; #pragma link C++ class AliRawReaderRoot+; diff --git a/RAW/binalimdc.pkg b/RAW/binalimdc.pkg index f37dca1bd4c..ffece3b66ad 100644 --- a/RAW/binalimdc.pkg +++ b/RAW/binalimdc.pkg @@ -7,7 +7,16 @@ PACKCXXFLAGS := ${HLTCXXFLAGS} PACKCFLAGS := ${HLTCLFAGS} PACKDCXXFLAGS:= ${HLTDCXXFLAGS} -SRCS:=alimdc_main.cxx +ESRCS:= AliMDC.cxx AliRawDB.cxx \ + AliRawRFIODB.cxx AliRawCastorDB.cxx AliRawRootdDB.cxx \ + AliRawNullDB.cxx AliTagDB.cxx AliTagNullDB.cxx \ + AliRunDB.cxx + +SRCS:= alimdc_main.cxx ${ESRCS} + +HDRS:= $(ESRCS:.cxx=.h) + +DHDR:=MDCLinkDef.h EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp EDEFINE+= -DUSE_RDM -DUSE_HLT diff --git a/RAW/libRAW.pkg b/RAW/libRAW.pkg index 97a96eee957..30bc6ddd0fe 100644 --- a/RAW/libRAW.pkg +++ b/RAW/libRAW.pkg @@ -1,3 +1,5 @@ +#-*- Mode: Makefile -*- + include HLT/hlt.conf EDEFINE := ${HLTDEFS} @@ -7,10 +9,7 @@ PACKDCXXFLAGS:= ${HLTDCXXFLAGS} SRCS:= AliRawEventHeader.cxx AliRawEquipmentHeader.cxx \ AliRawData.cxx AliRawEquipment.cxx AliRawEvent.cxx \ - AliStats.cxx AliRawDB.cxx \ - AliRawRFIODB.cxx AliRawCastorDB.cxx AliRawRootdDB.cxx \ - AliRawNullDB.cxx AliTagDB.cxx AliTagNullDB.cxx \ - AliRunDB.cxx AliMDC.cxx \ + AliStats.cxx \ AliRawReader.cxx AliRawReaderFile.cxx AliRawReaderRoot.cxx \ AliRawReaderDate.cxx \ AliBitPacking.cxx AliAltroBuffer.cxx \ @@ -26,8 +25,6 @@ EHDRS:=$(shell root-config --incdir)/TH1F.h EINCLUDE+=HLT/src HLT/hough HLT/comp -EDEFINE+= -DUSE_RDM -DUSE_HLT - DHDR:= RAWLinkDef.h ifdef DATE_ROOT -- 2.43.0