2. Added missing dependency in test preprocessors.
3. in AliShuttle.cxx: processing time and memory consumption info on a single line.
/*
$Log$
+Revision 1.34 2007/04/04 10:33:36 jgrosseo
+1) Storing of files to the Grid is now done _after_ your preprocessors succeeded. This is transparent, which means that you can still use the same functions (Store, StoreReferenceData) to store files to the Grid. However, the Shuttle first stores them locally and transfers them after the preprocessor finished. The return code of these two functions has changed from UInt_t to Bool_t which gives you the success of the storing.
+In case of an error with the Grid, the Shuttle will retry the storing later, the preprocessor does not need to be run again.
+
+2) The meaning of the return code of the preprocessor has changed. 0 is now success and any other value means failure. This value is stored in the log and you can use it to keep details about the error condition.
+
+3) New function StoreReferenceFile to _directly_ store a file (without opening it) to the reference storage.
+
+4) The memory usage of the preprocessor is monitored. If it exceeds 2 GB it is terminated.
+
+5) New function AliPreprocessor::ProcessDCS(). If you do not need to have DCS data in all cases, you can skip the processing by implemting this function and returning kFALSE under certain conditions. E.g. if there is a certain run type.
+If you always need DCS data (like before), you do not need to implement it.
+
+6) The run type has been added to the monitoring page
+
Revision 1.33 2007/04/03 13:56:01 acolla
Grid Storage at the end of preprocessing. Added virtual method to disable DCS query according to the
run type.
}
else
{
- if (expiredTime % 60 == 0)
- Log("SHUTTLE", Form("Checked process. Run time: %d seconds.",
- expiredTime));
gSystem->Sleep(1000);
TString checkStr;
}
if (expiredTime % 60 == 0)
- Log("SHUTTLE", Form("The process consumes %d KB of memory.", mem));
+ Log("SHUTTLE", Form("%s: Checking process. Run time: %d seconds - Memory consumption: %d KB",
+ fCurrentDetector.Data(), expiredTime, mem));
if (mem > fConfig->GetPPMaxMem())
{
// Fills data into a AliTestDataDCS object
if (!dcsAliasMap)
- return 1;
-
+ {
+ Log("ERROR: No DCS map provided by SHUTTLE!");
+ return 1;
+ }
+
// The processing of the DCS input data is forwarded to AliTestDataDCS
fData->ProcessData(*dcsAliasMap);
TString runType = GetRunType();
Log(Form("Run type for run %d: %s", fRun, runType.Data()));
- TString fileName = GetFile(kDAQ, "PEDESTALS", "GDC");
- if (fileName.Length() > 0)
- Log(Form("Got the file %s, now we can extract some values.", fileName.Data()));
- //TODO here the file could be opened, some values extracted and written to e.g. fData
+ // Example of how to retrieve the list of sources that produced the file with id DRIFTVELOCITY
+ TList* sourceList = GetFileSources(kDAQ, "DRIFTVELOCITY");
+ if (!sourceList)
+ {
+ Log("Error: No sources found for id DRIFTVELOCITY!");
+ 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();
+
+ TIter iter(sourceList);
+ TObjString *source = 0;
+ while((source=dynamic_cast<TObjString*> (iter.Next()))){
+ TString fileName = GetFile(kDAQ, "DRIFTVELOCITY", source->GetName());
+ if (fileName.Length() > 0)
+ Log(Form("Got the file %s, now we can extract some values.", fileName.Data()));
+ }
- //Example to store a file directly to the reference storage
- if (!StoreReferenceFile(fileName, "InputData.root"))
+ delete sourceList;
+
+ // Example to store a file directly to the reference storage
+ // Suppose we have queried the file from the FXS. Now the file is available locally and is called "file1.root".
+ const char* refFileName="file1.root";
+ if (!StoreReferenceFile(refFileName, "InputData.root"))
return 1;
- TList* list = GetFileSources(kDAQ, "DRIFTVELOCITY");
- if (list)
- {
- Log("The following sources produced files with the id DRIFTVELOCITY");
- list->Print();
- delete list;
- }
- //TODO here the files could be opened, some values extracted and written to e.g. fData
// Example of how to retrieve a run parameter using GetRunParameter function
// TODO Here the parameter must be set manually with SetInputRunParameter function,
// Three files originating from different LDCs but with the same id are also added
// Note that the test preprocessor name is TPC. The name of the detector's preprocessor must follow
// the "online" naming convention ALICE-INT-2003-039.
- shuttle->AddInputFile(AliShuttleInterface::kDAQ, "TPC", "PEDESTALS", "GDC", "file1.root");
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", "file2b.root");
+ shuttle->AddInputFile(AliShuttleInterface::kDAQ, "TPC", "DRIFTVELOCITY", "LDC2", "file2c.root");
// TODO(3)
//
#include <TTimeStamp.h>
#include <TObjString.h>
#include <TSystem.h>
+#include <TList.h>
ClassImp(TestHMPIDPreprocessor)
fEndTime = endTime;
}
+//________________________________________________________________________________________
+Bool_t TestHMPIDPreprocessor::ProcessDCS()
+{
+// Initialize preprocessor
+
+ TString runType = GetRunType();
+ if(runType == "LED") return kFALSE;
+ return kTRUE;
+}
+
+
//________________________________________________________________________________________
UInt_t TestHMPIDPreprocessor::Process(TMap* /*valueMap*/)
{
// process data retrieved by the Shuttle
- UInt_t result = kFALSE;
+ Bool_t result = kFALSE;
// Get run type and start the processing algorithm accordingly
TString runType = GetRunType();
if (runType.Length()==0)
{
Log("Undefined run type!");
- return 0;
+ return 1;
}
Log(Form("Run type: %s", runType.Data()));
if(!filesources) {
AliError(Form("No sources found for thresholds.txt for run %d !", fRun));
- return 0;
+ return 2;
}
AliInfo("Here's the list of sources for thresholds.txt");
while((source=dynamic_cast<TObjString*> (iter.Next()))){
printf("\n\n Getting file #%d\n",++i);
//if(i==1) continue;
- TString filename = GetFile(AliShuttleInterface::kDAQ, "DAQFile", source->GetName());
+ //TString filename = GetFile(AliShuttleInterface::kDAQ, "DAQFile", source->GetName());
+ TString filename = "DAQfile.txt";
if(!filename.Length()) {
AliError(Form("Error: retrieval of file from source %s failed!", source->GetName()));
delete filesources;
- return 0;
+ return 3;
}
TString command = Form("more %s",filename.Data());
gSystem->Exec(command.Data());
TString filename = GetFile(AliShuttleInterface::kDCS, "DCSFile", 0);
if(!filename.Length()) {
AliError(Form("Error: retrieval of file from DCS failed!"));
- return 0;
+ return 4;
}
TString command = Form("more %s", filename.Data());
gSystem->Exec(command.Data());
AliCDBMetaData metaData;
result = Store("Calib", "DCSData", &filenameObj, &metaData);
- } else if (runType == "GAINS")
+ } else if (runType == "LED")
{
// HLT
if(!filesources) {
Log(Form("No sources found for HLTFile for run %d !", fRun));
- return 0;
+ return 5;
}
AliInfo("Here's the list of sources for HLTFile");
while((source=dynamic_cast<TObjString*> (iter.Next()))){
printf("\n\n Getting file #%d\n",++i);
//if(i==1) continue;
- TString filename = GetFile(AliShuttleInterface::kHLT, "HLTFile", source->GetName());
+ //TString filename = GetFile(AliShuttleInterface::kHLT, "HLTFile", source->GetName());
+ TString filename="HLTfile.txt";
if(!filename.Length()) {
AliError(Form("Error: retrieval of file from source %s failed!", source->GetName()));
delete filesources;
- return 0;
+ return 6;
}
TString command = Form("more %s",filename.Data());
gSystem->Exec(command.Data());
} else {
Log(Form("Unknown run type: %s", runType.Data()));
}
-
- AliInfo(Form("result = %d",result));
- return result;
+
+ if(!result)
+ {
+ Log("Storage error!");
+ return 100;
+ }
+
+ return 0;
}
UInt_t endTime);
virtual UInt_t Process(TMap* valueSet);
+
+ virtual Bool_t ProcessDCS();
ClassDef(TestHMPIDPreprocessor, 0);
};
#include <TTimeStamp.h>
#include <TObjString.h>
#include <TH2F.h>
+#include <TList.h>
ClassImp(TestTPCPreprocessor)
#include <TTimeStamp.h>
#include <TObjString.h>
#include <TSystem.h>
+#include <TList.h>
ClassImp(TestTRDPreprocessor)
#include <TTimeStamp.h>
#include <TObjString.h>
#include <TSystem.h>
+#include <TList.h>
ClassImp(TestZDCPreprocessor)