X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=SHUTTLE%2FTestShuttle%2FTestPreprocessor.C;h=c9eeaa18307945edace75c0efc6b482fd9415d72;hp=07811532985adb877c43aa58b413517921c4dbcc;hb=87968cd5ea8f6632c30d8514da8642f4a6330ddf;hpb=84090f85e438d2803f0eb0bfa38d61b5acfcb6eb diff --git a/SHUTTLE/TestShuttle/TestPreprocessor.C b/SHUTTLE/TestShuttle/TestPreprocessor.C index 07811532985..c9eeaa18307 100644 --- a/SHUTTLE/TestShuttle/TestPreprocessor.C +++ b/SHUTTLE/TestShuttle/TestPreprocessor.C @@ -13,13 +13,22 @@ void TestPreprocessor() // load library gSystem->Load("libTestShuttle.so"); - // initialize location of CDB - AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB"); - - // create AliTestShuttle instance + // create AliTestShuttle instance // The parameters are run, startTime, endTime AliTestShuttle* shuttle = new AliTestShuttle(7, 0, 1); + + printf("Test Shuttle temp dir: %s\n", AliShuttleInterface::GetShuttleTempDir()); + + // TODO if needed, change location of OCDB and Reference test folders + // by default they are set to $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB and TestReference + AliTestShuttle::SetMainCDB("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB"); + AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestReference"); + + printf("Test OCDB storage Uri: %s\n", AliShuttleInterface::GetMainCDB().Data()); + printf("Test Reference storage Uri: %s\n", AliShuttleInterface::GetMainRefStorage().Data()); + + // TODO(1) // // The shuttle can read DCS data, if the preprocessor should be tested to process DCS data, @@ -52,32 +61,72 @@ void TestPreprocessor() // AddInputFile(, , , , ) // In this example we add a file originating from the GDC with the id PEDESTALS // Three files originating from different LDCs but with the same id are also added - shuttle->AddInputFile(AliTestShuttle::kDAQ, "DET", "PEDESTALS", "GDC", "file1.root"); - shuttle->AddInputFile(AliTestShuttle::kDAQ, "DET", "DRIFTVELOCITY", "LDC0", "file2a.root"); - shuttle->AddInputFile(AliTestShuttle::kDAQ, "DET", "DRIFTVELOCITY", "LDC1", "file2b.root"); - shuttle->AddInputFile(AliTestShuttle::kDAQ, "DET", "DRIFTVELOCITY", "LDC2", "file2b.root"); + // 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", "GDC0", "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", "file2c.root"); + shuttle->AddInputFile(AliShuttleInterface::kHLT, "TPC", "HLTData", "source1", "hlt_file1.root"); + shuttle->AddInputFile(AliShuttleInterface::kHLT, "TPC", "HLTData", "source2", "hlt_file2.root"); // TODO(3) + // + // The shuttle can read run type stored in the DAQ logbook. + // To test it, we must provide the run type manually. They will be retrieved in the preprocessor + // using GetRunType function. + shuttle->SetInputRunType("PHYSICS"); + + // TODO(4) + // + // 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"); + + // TODO(5) + // + // 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"); + + // 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 + // + + Bool_t hltStatus=kTRUE; + shuttle->SetInputHLTStatus(hltStatus); + + + // TODO(7) // Create the preprocessor that should be tested, it registers itself automatically to the shuttle - AliPreprocessor* pp = new AliTestPreprocessor("DET", shuttle); + AliPreprocessor* test = new AliTestPreprocessor(shuttle); // Test the preprocessor shuttle->Process(); - // TODO(4) + // 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 // // Check the file which should have been created - AliCDBEntry* entry = AliCDBManager::Instance()->Get("DET/SHUTTLE/Data", 7); - if (!entry) + AliCDBEntry* chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB()) + ->Get("TPC/Calib/Data", 7); + if (!chkEntry) { printf("The file is not there. Something went wrong.\n"); return; } - AliTestDataDCS* output = dynamic_cast (entry->GetObject()); + AliTestDataDCS* output = dynamic_cast (chkEntry->GetObject()); // If everything went fine, draw the result if (output) output->Draw(); @@ -130,7 +179,8 @@ TMap* ReadDCSAliasMap() // The file contains an AliCDBEntry that contains a TMap with the DCS structure. // An explanation of the structure can be found in CreateDCSAliasMap() - AliCDBEntry *entry = AliCDBManager::Instance()->Get("DET/DCS/Data", 0); + AliCDBEntry *entry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB()) + ->Get("DET/DCS/Data", 0); return dynamic_cast (entry->GetObject()); } @@ -147,8 +197,8 @@ void WriteDCSAliasMap() AliCDBId id("DET/DCS/Data", 0, 0); - // initialize location of CDB - AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB"); + // look into AliTestShuttle's CDB main folder - AliCDBManager::Instance()->Put(dcsAliasMap, id, &metaData); + AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB()) + ->Put(dcsAliasMap, id, &metaData); }