From 87968cd5ea8f6632c30d8514da8642f4a6330ddf Mon Sep 17 00:00:00 2001 From: acolla Date: Mon, 6 Aug 2007 12:25:47 +0000 Subject: [PATCH] Function Bool_t GetHLTStatus added to preprocessor. It returns the status of HLT read from the run logbook. TestShuttle setup updated. TRD data point configuration updated. --- SHUTTLE/TestShuttle/AliTestPreprocessor.cxx | 68 ++++++++++++++++++--- SHUTTLE/TestShuttle/AliTestShuttle.cxx | 9 ++- SHUTTLE/TestShuttle/AliTestShuttle.h | 3 + SHUTTLE/TestShuttle/TestPreprocessor.C | 28 ++++++--- SHUTTLE/schema/TRD.ldif | 9 +-- 5 files changed, 92 insertions(+), 25 deletions(-) diff --git a/SHUTTLE/TestShuttle/AliTestPreprocessor.cxx b/SHUTTLE/TestShuttle/AliTestPreprocessor.cxx index 835953e21c8..5ae4ef1b30d 100644 --- a/SHUTTLE/TestShuttle/AliTestPreprocessor.cxx +++ b/SHUTTLE/TestShuttle/AliTestPreprocessor.cxx @@ -72,7 +72,7 @@ UInt_t AliTestPreprocessor::Process(TMap* dcsAliasMap) Log("ERROR: No DCS map provided by SHUTTLE!"); return 1; } - + // The processing of the DCS input data is forwarded to AliTestDataDCS fData->ProcessData(*dcsAliasMap); @@ -84,13 +84,25 @@ UInt_t AliTestPreprocessor::Process(TMap* dcsAliasMap) // Example of how to retrieve the list of sources that produced the file with id DRIFTVELOCITY TList* sourceList = GetFileSources(kDAQ, "DRIFTVELOCITY"); + sourceList = GetFileSources(kHLT, "HLTData"); if (!sourceList) { - Log("Error: No sources found for id DRIFTVELOCITY!"); - return 1; + Log("Error retrieving list of sources from FXS!"); + return 1; } - - // TODO We have the list of sources that produced the files with Id DRIFTVELOCITY. + + if (sourceList->GetEntries() == 0) + { + Log("No sources found for id HLTData!"); + // TODO What to do now depends on the expected behaviour of the + // online DA: if it expected to produce data for the FXS every run, then + // if no sources are found it means a problem happened and you should return error; + // if DA may or may not send files to FXS, then you shouldn't return error + // and go on with the analysis! + return 1; + } + + // TODO We have the list of sources that produced the files with Id DRIFTVELOCITY. // Now we will loop on the list and we'll query the files one by one. Log("The following sources produced files with the id DRIFTVELOCITY"); sourceList->Print(); @@ -105,6 +117,48 @@ UInt_t AliTestPreprocessor::Process(TMap* dcsAliasMap) delete sourceList; + // Example of retrieving files from HLT, including how to query HLT status + + Bool_t hltStatus = GetHLTStatus(); // 1 = HLT ON (=> Query HLT), 0 = HLT OFF (=> skip HLT query) + + if (hltStatus) + { + Log("HLT is ON, let's query our files"); + sourceList = GetFileSources(kHLT, "HLTData"); + if (!sourceList) + { + Log("Error retrieving list of sources from FXS!"); + return 1; + } + + if (sourceList->GetEntries() == 0) + { + Log("No sources found for id HLTData!"); + // TODO What to do now depends on the expected behaviour of the + // online DA: if it expected to produce data for the FXS every run, then + // if no sources are found it means a problem happened and you should return error; + // if DA may or may not send files to FXS, then you shouldn't return error + // and go on with the analysis! + return 1; + } + Log("The following sources produced files with the id HLTData"); + + sourceList->Print(); + + TIter iter(sourceList); + TObjString *source = 0; + while((source=dynamic_cast (iter.Next()))){ + TString fileName = GetFile(kHLT, "HLTData", source->GetName()); + if (fileName.Length() > 0) + Log(Form("Got the file %s from HLT, now we can extract some values.", fileName.Data())); + } + + delete sourceList; + + } else { + Log("HLT is OFF, skipping query..."); + } + // Example of how to retrieve the list of sources that produced files sourceList = GetFileSources(kDAQ); if (!sourceList) @@ -155,8 +209,8 @@ UInt_t AliTestPreprocessor::Process(TMap* dcsAliasMap) { Log("No object found in OCDB!"); } else { - TObjString *obj = dynamic_cast (entry->GetObject()); - Log(Form("Got TPC/Calib/Data object from OCDB. The object says: %s",obj->GetName())); + Log("Got TPC/Calib/Data object from OCDB. The object's metadata is: "); + entry->PrintMetaData(); } diff --git a/SHUTTLE/TestShuttle/AliTestShuttle.cxx b/SHUTTLE/TestShuttle/AliTestShuttle.cxx index b9e4409fc6a..6817e87063f 100644 --- a/SHUTTLE/TestShuttle/AliTestShuttle.cxx +++ b/SHUTTLE/TestShuttle/AliTestShuttle.cxx @@ -15,6 +15,13 @@ /* $Log$ +Revision 1.13 2007/05/30 06:35:21 jgrosseo +Adding functionality to the Shuttle/TestShuttle: +o) Function to retrieve list of sources from a given system (GetFileSources with id=0) +o) Function to retrieve list of IDs for a given source (GetFileIDs) +These functions are needed for dealing with the tag files that are saved for the GRP preprocessor +Example code has been added to the TestProcessor in TestShuttle + Revision 1.12 2007/04/27 07:06:48 jgrosseo GetFileSources returns empty list in case of no files, but successful query No mails sent in testmode @@ -520,7 +527,7 @@ const char* AliTestShuttle::GetRunType() // get a run parameter // - return fRunType; + return fRunType.Data(); } //______________________________________________________________________________________________ diff --git a/SHUTTLE/TestShuttle/AliTestShuttle.h b/SHUTTLE/TestShuttle/AliTestShuttle.h index 654cc79ac6d..32f98aa1b3b 100644 --- a/SHUTTLE/TestShuttle/AliTestShuttle.h +++ b/SHUTTLE/TestShuttle/AliTestShuttle.h @@ -29,6 +29,7 @@ class AliTestShuttle : public AliShuttleInterface void SetDCSInput(TMap* dcsAliasMap) { fDcsAliasMap = dcsAliasMap; } void AddInputRunParameter(const char* key, const char* value); void SetInputRunType(const char* runType) { fRunType = runType; } + void SetInputHLTStatus(Bool_t status) { fHLTStatus = status; } Bool_t AddInputCDBEntry(AliCDBEntry* entry); void Process(); @@ -44,6 +45,7 @@ class AliTestShuttle : public AliShuttleInterface virtual const char* GetRunParameter(const char* key); virtual AliCDBEntry* GetFromOCDB(const char* detector, const AliCDBPath& path); virtual const char* GetRunType(); + virtual Bool_t GetHLTStatus() {return fHLTStatus;} virtual void Log(const char* detector, const char* message); virtual void RegisterPreprocessor(AliPreprocessor* preprocessor); @@ -66,6 +68,7 @@ class AliTestShuttle : public AliShuttleInterface TMap* fInputFiles; // files for GetFile, GetFileSources TMap* fRunParameters; // run parameters TString fRunType; // run type + Bool_t fHLTStatus; // HLT status for current run (on=1/off=0) TObjArray* fPreprocessors; // list of preprocessors that are to be tested TMap* fDcsAliasMap; // DCS data for testing diff --git a/SHUTTLE/TestShuttle/TestPreprocessor.C b/SHUTTLE/TestShuttle/TestPreprocessor.C index 7f277e166a9..c9eeaa18307 100644 --- a/SHUTTLE/TestShuttle/TestPreprocessor.C +++ b/SHUTTLE/TestShuttle/TestPreprocessor.C @@ -67,6 +67,8 @@ void TestPreprocessor() shuttle->AddInputFile(AliShuttleInterface::kDAQ, "TPC", "DRIFTVELOCITY", "LDC0", "file2a.root"); shuttle->AddInputFile(AliShuttleInterface::kDAQ, "TPC", "DRIFTVELOCITY", "LDC1", "file2b.root"); shuttle->AddInputFile(AliShuttleInterface::kDAQ, "TPC", "DRIFTVELOCITY", "LDC2", "file2c.root"); + shuttle->AddInputFile(AliShuttleInterface::kHLT, "TPC", "HLTData", "source1", "hlt_file1.root"); + shuttle->AddInputFile(AliShuttleInterface::kHLT, "TPC", "HLTData", "source2", "hlt_file2.root"); // TODO(3) // @@ -85,26 +87,32 @@ void TestPreprocessor() // TODO(5) // - // The shuttle can query condition parameters valid from the current run from the OCDB - // To test it, we must first store the object into the OCDB. It will be retrieved in the preprocessor - // using GetFromOCDB function. + // The shuttle can read run parameters stored in the DAQ run logbook. + // To test it, we must provide the run parameters manually. They will be retrieved in the preprocessor + // using GetRunParameter function. + shuttle->AddInputRunParameter("totalEvents", "30000"); + shuttle->AddInputRunParameter("NumberOfGDCs", "15"); - TObjString obj("This is a condition parameter stored in OCDB"); - AliCDBId id("TPC/Calib/Data", 0, AliCDBRunRange::Infinity()); - AliCDBMetaData md; - AliCDBEntry entry(&obj, id, &md); + // TODO(6) NEW! + // + // This is for preprocessor that require data from HLT. + // Since HLT may be switched off, the preprocessor should first query the Run logbook where + // the HLT status is stored. SHUTTLE implements a shortcut function (GetHLTStatus) that returns + // a bool directly. 1 = HLT ON, 0 = HLT OFF + // - shuttle->AddInputCDBEntry(&entry); + Bool_t hltStatus=kTRUE; + shuttle->SetInputHLTStatus(hltStatus); - // TODO(6) + // TODO(7) // Create the preprocessor that should be tested, it registers itself automatically to the shuttle AliPreprocessor* test = new AliTestPreprocessor(shuttle); // Test the preprocessor shuttle->Process(); - // TODO(7) + // TODO(8) // In the preprocessor AliShuttleInterface::Store should be called to put the final // data to the CDB. To check if all went fine have a look at the files produced in // $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB//SHUTTLE/Data diff --git a/SHUTTLE/schema/TRD.ldif b/SHUTTLE/schema/TRD.ldif index 6cec0044dae..608f9570637 100644 --- a/SHUTTLE/schema/TRD.ldif +++ b/SHUTTLE/schema/TRD.ldif @@ -3,13 +3,12 @@ dn: det=TRD,o=alice,dc=cern,dc=ch objectClass: AliShuttleDetector det: TRD StrictRunOrder: 0 -responsible: not_yet_set +responsible: r.bailhache@gsi.de DCSHost: aldcs052.cern.ch DCSPort: 4242 DCSalias: trd_chamberByteStatus[000..539] DCSalias: trd_goofyHv -DCSalias: trd_goofyPeakPos00 -DCSalias: trd_goofyPeakPos01 +DCSalias: trd_goofyPeakPos[00..01] DCSalias: trd_goofyPeakArea[00..01] DCSalias: trd_goofyTemp[00..01] DCSalias: trd_goofyPressure @@ -25,7 +24,3 @@ DCSalias: trd_hvDriftImon[000..539] DCSalias: trd_hvAnodeUmon[000..539] DCSalias: trd_hvDriftUmon[000..539] DCSalias: trd_adcClkPhase -DCSalias: trd_atmPressure -DCSalias: trd_luminosity -DCSalias: trd_magneticField -#DCSalias: trd_preTrigger -- 2.39.3