CMake: removing qpythia from the depedencies
[u/mrichter/AliRoot.git] / TOF / TOFCalibPass0.C
CommitLineData
3c8efc07 1//___________________________________________________________________________
2
3LoadLibraries()
4{
5 gSystem->Load("libANALYSIS");
6 gSystem->Load("libANALYSISalice");
7 gSystem->Load("libTOFcalib");
8}
9
10//___________________________________________________________________________
11
12MakeOCDB(const Char_t *filename = "TOFCalibPass0.root", const Char_t *dbString = "local://$HOME/OCDB")
13{
14 LoadLibraries();
15 AliTOFAnalysisTaskCalibPass0 calibTask;
16 calibTask.ProcessOutput(filename, dbString);
07901ecf 17 printf("TOF calibration status code: %d\n", calibTask.GetStatus());
3c8efc07 18}
19
20//___________________________________________________________________________
21
22SteerTask(const Char_t *inputfilename, Int_t maxFiles = kMaxInt, Int_t maxEv = kMaxInt)
23{
24
25 LoadLibraries();
26
27 /* setup input chain */
28 TString str = inputfilename;
29 const Char_t *filename;
30 TChain *chain = new TChain("esdTree");
31 if (str.EndsWith(".xml")) {
32 TGrid::Connect("alien://");
33 Info("SteerTaskEventTime", "reading data list from collection:");
34 TAlienCollection coll(inputfilename, maxFiles);
35 coll.Reset();
36 while (coll.Next()) {
37 filename = coll.GetTURL();
38 Info("SteerTaskEventTime", Form("%s", filename));
39 chain->Add(filename);
40 }
41 }
42 else if (str.EndsWith(".txt")) {
43 Info("SteerTaskEventTime", "reading data list from text file:");
44 ifstream is(inputfilename);
45 Char_t buf[4096];
46 while(!is.eof()) {
47 is.getline(buf, 4096);
48 if (is.eof()) break;
49 chain->Add(buf);
50 Info("SteerTaskEventTime", Form("%s", buf));
51 }
52 is.close();
53 }
54 else {
55 Info("SteerTaskEventTime", "single file:");
56 filename = inputfilename;
57 Info("SteerTaskEventTime", Form("%s", filename));
58 chain->Add(filename);
59 }
60 Info("SteerTaskEventTime", Form("chain is ready: %d events", chain->GetEntries()));
61
62 /* create analysis manager */
63 AliAnalysisManager *mgr = new AliAnalysisManager("EventTime");
64
65 /* define input event handler */
66 AliESDInputHandler *esdh = new AliESDInputHandler();
67 esdh->SetReadFriends(kFALSE);
68 mgr->SetInputEventHandler(esdh);
69
70 /* add tasks */
71 gROOT->LoadMacro("$ALICE_ROOT/TOF/AddTOFAnalysisTaskCalibPass0.C");
72 AliTOFAnalysisTaskCalibPass0 *thisTask = AddTOFAnalysisTaskCalibPass0();
73
74 /* start analysis */
75 mgr->SetDebugLevel(0);
76 if (!mgr->InitAnalysis()) return;
77 mgr->PrintStatus();
78 mgr->StartAnalysis("local", chain, maxEv);
79
80 /* create dummy file to tell we are done */
81 gSystem->Exec("touch done");
82
83}