]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/scripts/RunSimpleChain.C
Build reco and log dir if needed
[u/mrichter/AliRoot.git] / FMD / scripts / RunSimpleChain.C
CommitLineData
e0afd551 1const char* path = "$ALICE_ROOT/FMD/scripts/";
2
3void
4RunAndDisplay(const char* script, bool show, const char* display)
5{
6 gROOT->Macro(Form("%s/%s", path, script));
7 if (show)
8 gSystem->Exec(Form("aliroot -q -l %s/%s &", path, display));
9}
10
11void
12RunSimpleChain(Int_t what=0x3b)
13{
14 if (what == 0) {
15 std::cout << "Usage: RunSimpleChain(MASK)\n\n"
16 << "MASK is a bit mask of things to do:\n\n"
17 << "\tBit | Job\n"
18 << "\t----+-----------------------\n"
19 << "\t 0 | Make fake hits\n"
20 << "\t 1 | Make digits from hits\n"
21 << "\t 2 | Make sdigits from hits\n"
22 << "\t 3 | Make raw DDL files from digits\n"
23 << "\t 4 | Make ESD from raw ddl files\n"
24 << "\t 5 | Display the data\n\n"
25 << "So a mask of 0x3f means do everything, while 0x2 means\n"
26 << "only make digits from hits, and 0x1F is all but display.\n"
27 << "\n" << std::endl;
28 return;
29 }
30 Bool_t display = (what & (1 << 5));
31
32 if (what & (1 << 0)) {
33 std::cout << "Making fake hits" << std::endl;
34 RunAndDisplay("MakeFakeHits.C", display, "PatternHits.C");
35 }
36
37 if (what & (1 << 1)) {
38 std::cout << "Converting hits to digits" << std::endl;
39 RunAndDisplay("Hits2Digits.C", display, "PatternDigits.C");
40 }
41
42 if (what & (1 << 2)) {
43 std::cout << "Converting hits to summable digits" << std::endl;
44 RunAndDisplay("Hits2SDigits.C", display, "PatternSDigits.C");
45 }
46
47 if (what & (1 << 3)) {
48 std::cout << "Converting digits to raw data" << std::endl;
49 gSystem->Exec("rm -rf raw0");
50 RunAndDisplay("Digits2Raw.C", false, "");
51
52 std::cout << "Moving ddl files" << std::endl;
53 gSystem->mkdir("raw0");
54 gSystem->Exec("mv FMD_*.ddl raw0/");
55 gSystem->Exec("touch raw0/run0");
56 if (display)
57 gSystem->Exec(Form("aliroot -q %s/PatternRaw.C\\(\\\"\\\"\\) &", path));
58 }
59
60 if (what & (1 << 4)) {
61 std::cout << "Making ESD from raw data" << std::endl;
62 RunAndDisplay("Raw2ESD.C", display, "PatternESD.C");
63 }
64
65 std::cout << "All done" << std::endl;
66}
67
68