shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC36", "$ALICE_ROOT/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc036_Period_LHC09c.Seq_0.tag.root");
shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC44", "$ALICE_ROOT/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc044_Period_LHC09c.Seq_0.tag.root");
shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC45", "$ALICE_ROOT/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc045_Period_LHC09c.Seq_0.tag.root");
+ shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SPD", "VertexDiamond", "gdc-GLOBAL-01", "$ALICE_ROOT/GRP/ShuttleInput/run000104892_SPD_mon-DA-SPD-0_VertexDiamond");
+ /*
// for example:
- //shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC35", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc035_Period_LHC09c.Seq_0.tag.root");
- //shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC36", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc036_Period_LHC09c.Seq_0.tag.root");
- //shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC44", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc044_Period_LHC09c.Seq_0.tag.root");
- //shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC45", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc045_Period_LHC09c.Seq_0.tag.root");
-
+ shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC35", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc035_Period_LHC09c.Seq_0.tag.root");
+ shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC36", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc036_Period_LHC09c.Seq_0.tag.root");
+ shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC44", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc044_Period_LHC09c.Seq_0.tag.root");
+ shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC45", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc045_Period_LHC09c.Seq_0.tag.root");
+ shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SPD", "VertexDiamond", "gdc-GLOBAL-01", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000104892_SPD_mon-DA-SPD-0_VertexDiamond");
+ */
}
// simulating input from DCS FXS
}
//______________________________________________________________________________________________
-void AliShuttle::Log(const char* detector, const char* message)
+void AliShuttle::Log(const char* detector, const char* message, UInt_t level)
{
//
// Fill log string with a message
toLog += Form("run %d - ", GetCurrentRun());
toLog += Form("%s", message);
- AliInfo(toLog.Data());
+ AliLog::Message(level, toLog, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__);
// if we redirect the log output already to the file, leave here
if (fOutputRedirected && strcmp(detector, "SHUTTLE") != 0)
virtual const char* GetTriggerConfiguration();
virtual const char* GetCTPTimeParams();
virtual const char* GetTriggerDetectorMask();
- virtual void Log(const char* detector, const char* message);
+ virtual void Log(const char* detector, const char* message, UInt_t level=3);
void SetLogbookEntry(AliShuttleLogbookEntry* entry) {fLogbookEntry=entry;}
}
//______________________________________________________________________________________________
-void AliTestShuttle::Log(const char* detector, const char* message)
+void AliTestShuttle::Log(const char* detector, const char* message, UInt_t level)
{
// test implementation of Log
// just prints to the screen
- AliInfo(Form("%s: %s", detector, message));
+ TString fullMessage = detector;
+ fullMessage.Append(Form(": %s",message));
+ AliLog::Message(level, fullMessage, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__);
}
//______________________________________________________________________________________________
virtual const char* GetTriggerConfiguration();
virtual const char* GetCTPTimeParams();
virtual const char* GetTriggerDetectorMask();
- virtual void Log(const char* detector, const char* message);
+ virtual void Log(const char* detector, const char* message, UInt_t level=3);
virtual void RegisterPreprocessor(AliPreprocessor* preprocessor);
#include <TObjArray.h>
#include <TGraph.h>
#include <TString.h>
+#include <TFile.h>
#include <float.h>
#include "AliCDBMetaData.h"
#include "AliLog.h"
+#include "AliESDVertex.h"
class AliDCSValue;
class AliShuttleInterface;
"(DCS data points ERROR)",
"(Trigger Configuration ERROR)",
"(DAQ logbook ERROR determining partition of the run)",
- "(CTP timing ERROR)"
+ "(CTP timing ERROR)",
+ "(SPD Mean Vertex ERROR)"
};
//_______________________________________________________________
result = Store("GRP", "Data", grpobj, &md);
delete grpobj;
+ //==================//
+ // SPD Mean Vertex //
+ //==================//
+ UInt_t iSPDMeanVertex = ProcessSPDMeanVertex();
+ if( iSPDMeanVertex == 1 ) {
+ Log(Form("SPD Mean Vertex, successful!"));
+ } else {
+ Log(Form("SPD Mean Vertex failed!!!"));
+ error |= 128;
+ }
+
if (result && !error ) {
Log("GRP Preprocessor Success");
return 0;
} else {
- Log( Form("GRP Preprocessor FAILS!!! %s%s%s%s%s%s%s",
+ Log( Form("GRP Preprocessor FAILS!!! %s%s%s%s%s%s%s%s",
kppError[(error&1)?1:0],
kppError[(error&2)?2:0],
kppError[(error&4)?3:0],
kppError[(error&8)?4:0],
kppError[(error&16)?5:0],
kppError[(error&32)?6:0],
- kppError[(error&64)?7:0]
+ kppError[(error&64)?7:0],
+ kppError[(error&128)?8:0]
));
return error;
}
}
+//_______________________________________________________________
+
+UInt_t AliGRPPreprocessor::ProcessSPDMeanVertex()
+{
+ //Getting the SPD Mean Vertex
+ TList* list = GetForeignFileSources("SPD", kDAQ, "VertexDiamond");
+ Bool_t storeResult = kTRUE;
+ if (list !=0x0 && list->GetEntries()!=0)
+ {
+ AliInfo("The following sources produced files with the id VertexDiamond from SPD");
+ list->Print();
+ for (Int_t jj=0;jj<list->GetEntries();jj++){
+ TObjString * str = dynamic_cast<TObjString*> (list->At(jj));
+ AliInfo(Form("found source %s", str->String().Data()));
+ TString fileNameRun = GetForeignFile("SPD", kDAQ, "VertexDiamond", str->GetName());
+ if (fileNameRun.Length()>0){
+ AliInfo(Form("Got the file %s", fileNameRun.Data()));
+ TFile daqFile(fileNameRun.Data(),"READ");
+ if (daqFile.IsOpen()) {
+ AliESDVertex* meanVtx = dynamic_cast<AliESDVertex*>(daqFile.Get("MeanVertexPos"));
+ if (meanVtx){
+ meanVtx->Print();
+ // storing in the OCDB
+ AliCDBMetaData md;
+ md.SetResponsible("Cvetan Cheshkov");
+ md.SetComment("SPD Mean Vertex");
+ storeResult = Store("GRP", "MeanVertexSPD", meanVtx, &md);
+ }
+ else{
+ AliWarning("No SPD Mean Vertex object found in file");
+ }
+ }
+ else {
+ AliError("Can't open file");
+ storeResult = kFALSE;
+ }
+ }
+ else{
+ AliWarning("No file found for current source for SPD Mean Vertex");
+ }
+ }
+ }
+ else {
+ AliWarning("No list found for SPD Mean Vertex");
+ }
+
+ if (list) delete list;
+
+ return storeResult;
+}
+
+
//_______________________________________________________________
Int_t AliGRPPreprocessor::ProcessDaqLB(AliGRPObject* grpObj)
Int_t ProcessDaqLB(AliGRPObject* grpobj);
UInt_t ProcessDaqFxs();
+ UInt_t ProcessSPDMeanVertex();
UInt_t ProcessDcsFxs(TString partition="", TString detector="");
Int_t ProcessDcsDPs(TMap* valueSet, AliGRPObject* grpobj);
Int_t ProcessLHCDPs(const TMap* valueSet, AliGRPObject* grpobj);
}
//______________________________________________________________________________________________
-void AliPreprocessor::Log(const char* message)
+void AliPreprocessor::Log(const char* message, UInt_t level)
{
// Adds a log message to the Shuttle log of this preprocessor
//
// The call is delegated to AliShuttleInterface
- fShuttle->Log(GetName(), message);
+ fShuttle->Log(GetName(), message, level);
}
//______________________________________________________________________________________________
return fShuttle->GetEndTimeDCSQuery();
}
+//______________________________________________________________________________________________
+const char* AliPreprocessor::GetForeignFile(const char* detector, Int_t system, const char* id, const char* source)
+{
+ // This function retrieves a file produced from the given detector (different from the
+ // current one) from the given system (kDAQ, kDCS, kHLT)
+ // with the given file id
+ // and from the given source in the system.
+ // The function returnes the path to the local file.
+ //
+ // The call is delegated to AliShuttleInterface
+ // The function can be called only from the GRP preprocessor
+
+ TString detName(GetName());
+ if (detName != "GRP")
+ {
+ Log("GetForeignFile - Only GRP can call this function.");
+ return 0;
+ }
+ return fShuttle->GetFile(system, detector, id, source);
+}
+
+//______________________________________________________________________________________________
+TList* AliPreprocessor::GetForeignFileSources(const char* detector, Int_t system, const char* id)
+{
+ // Returns the list of sources in a given system that produced the file
+ // with the given id for the foreign detector specified
+ //
+ // The call is delegated to AliShuttleInterface
+ // The function can be called only from the GRP preprocessor
+
+ TString detName(GetName());
+ if (detName != "GRP")
+ {
+ Log("GetForeignFileSources - Only GRP can call this function.");
+ return 0;
+ }
+ return fShuttle->GetFileSources(system, detector, id);
+}
+
const char* GetFile(Int_t system, const char* id, const char* source);
TList* GetFileSources(Int_t system, const char* id = 0);
+ const char* GetForeignFile(const char* detector, Int_t system, const char* id, const char* source);
+ TList* GetForeignFileSources(const char* detector, Int_t system, const char* id);
TList* GetFileIDs(Int_t system, const char* source);
const char* GetRunParameter(const char* param);
AliCDBEntry* GetFromOCDB(const char* pathLevel2, const char* pathLevel3);
const char* GetTriggerConfiguration();
const char* GetCTPTimeParams();
const char* GetTriggerDetectorMask();
- void Log(const char* message);
+ void Log(const char* message, UInt_t level=3);
UInt_t GetStartTimeDCSQuery();
UInt_t GetEndTimeDCSQuery();
virtual AliCDBEntry* GetFromOCDB(const char* detector, const AliCDBPath& path) = 0;
- virtual void Log(const char* detector, const char* message) = 0;
+ virtual void Log(const char* detector, const char* message, UInt_t level=3) = 0;
virtual void RegisterPreprocessor(AliPreprocessor* preprocessor) = 0;