1 /* $Id: TestPreprocessor.C 21848 2007-10-29 18:07:14Z acolla $ */
3 // This class runs the test preprocessor
4 // It uses AliTestShuttle to simulate a full Shuttle process
6 // The input data is created in the functions
7 // CreateDCSAliasMap() creates input that would in the same way come from DCS
8 // ReadDCSAliasMap() reads from a file
9 // CreateInputFilesMap() creates a list of local files, that can be accessed by the shuttle
11 void TestPreprocessor(const int physics = 1)
14 // [compiled with: cd $ALICE_ROOT/SHUTTLE/TestShuttle/; make; cd -]
15 gSystem->Load("$ALICE_ROOT/SHUTTLE/TestShuttle/libTestShuttle.so");
17 // create AliTestShuttle instance
18 // The parameters are run, startTime, endTime
19 AliTestShuttle* shuttle = new AliTestShuttle(7, 0, 1);
21 // TODO if needed, change location of OCDB and Reference test folders
22 // by default they are set to $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB and TestReference
23 AliTestShuttle::SetMainCDB("local://$ALICE_ROOT/OCDB");
24 AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/OCDB");
26 printf("Test OCDB storage Uri: %s\n", AliShuttleInterface::GetMainCDB().Data());
27 printf("Test Reference storage Uri: %s\n", AliShuttleInterface::GetMainRefStorage().Data());
31 // The shuttle can also process files that originate from DCS, DAQ and HLT.
32 // To test it, we provide some local files and locations where these would be found when
33 // the online machinery would be there.
34 // In real life this functions would be produces by the sub-detectors
35 // calibration programs in DCS, DAQ or HLT. These files can then be retrieved using the Shuttle.
37 // Files are added with the function AliTestShuttle::AddInputFile. The syntax is:
38 // AddInputFile(<system>, <detector>, <id>, <source>, <local-file>)
39 // In this example we add a file originating from the GDC with the id PEDESTALS
40 // Three files originating from different LDCs but with the same id are also added
41 // Note that the test preprocessor name is TPC. The name of the detector's preprocessor must follow
42 // the "online" naming convention ALICE-INT-2003-039.
44 // For now, we only check the files from DAQ
46 shuttle->AddInputFile(AliShuttleInterface::kDAQ, "EMC", "signal", "MON0", "EMCALLED.root");
47 printf("EMCALLED.root added\n");
50 shuttle->AddInputFile(AliShuttleInterface::kDAQ, "EMC", "pedestals", "MON0", "EMCALPED.root");
51 printf("EMCALPED.root added\n");
56 // The shuttle can read run type stored in the DAQ logbook.
57 // To test it, we must provide the run type manually. They will be retrieved in the preprocessor
58 // using GetRunType function.
60 shuttle->SetInputRunType("PHYSICS");
61 printf("RunType PHYSICS\n");
64 shuttle->SetInputRunType("PEDESTAL");
65 printf("RunType PEDESTAL\n");
69 // Create the preprocessor that should be tested, it registers itself automatically to the shuttle
70 AliPreprocessor* test = new AliEMCALPreprocessor(shuttle);
71 printf("AliEMCALPreprocessor created\n");
73 // Test the preprocessor
75 printf("shuttle->Process() done\n");
78 // In the preprocessor AliShuttleInterface::Store should be called to put the final
79 // data to the CDB. To check if all went fine have a look at the files produced in
80 // $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB/<detector>/SHUTTLE/Data
82 // Check the file which should have been created
83 AliCDBEntry* chkEntry;
86 chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
87 ->Get("EMCAL/Calib/LED", 7);
90 chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainRefStorage())
91 ->Get("EMCAL/Calib/Pedestals", 7);
96 printf("The file is not there. Something went wrong.\n");