]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RALICE/icepack/iceconvert/macros/icef2k.cc
Adding a commented line demsostrating how to switch off
[u/mrichter/AliRoot.git] / RALICE / icepack / iceconvert / macros / icef2k.cc
1 /////////////////////////////////////////////////
2 // Macro to test the IceF2k conversion job class
3 //
4 // To run this macro in batch, just do
5 //
6 // root -b -q icef2k.cc
7 //
8 // For more details and a more user friendly
9 // output file setting, see the docs of class IceF2k
10 //
11 // NvE 11-mar-2005 Utrecht University
12 /////////////////////////////////////////////////
13 {
14  gSystem->Load("ralice");
15  gSystem->Load("icepack");
16  gSystem->Load("iceconvert");
17
18  IceF2k q("IceF2k","Test of IceF2k conversion job");
19
20  // Limit the number of entries for testing
21  q.SetMaxEvents(100);
22
23  // Print frequency to produce a short summary print every printfreq events
24  q.SetPrintFreq(10);
25
26  // The F2K input filename(s)
27  q.AddInputFile("run7825.f2k");
28
29  // Output file for the event structures
30  TFile* ofile=new TFile("events.root","RECREATE","F2K data in IceEvent structure");
31  q.SetOutputFile(ofile);
32
33  ///////////////////////////////////////////////////////////////////
34  // Here the user can specify his/her sub-tasks to be executed
35  // on an event-by-event basis after the IceEvent structure
36  // has been filled and before the data is written out.
37  // Sub-tasks (i.e. a user classes derived from TTask) are entered
38  // as follows :
39  //
40  //    MyXtalk task1("task1","Cross talk correction");
41  //    MyClean task2("task2","Hit cleaning");
42  //    q.Add(&task1);
43  //    q.Add(&task2);
44  //
45  // The sub-tasks will be executed in the order as they are entered.
46  ///////////////////////////////////////////////////////////////////
47
48  // Perform the conversion
49  q.ExecuteJob();
50
51  // Select various objects to be added to the output file
52
53  ofile->cd(); // Switch to the output file directory
54
55  AliObjMatrix* omdb=q.GetOMdbase();
56  if (omdb) omdb->Write();
57
58  AliDevice* fitdefs=q.GetFitdefs();
59  if (fitdefs) fitdefs->Write();
60
61  TDatabasePDG* pdg=q.GetPDG();
62  if (pdg) pdg->Write();
63
64  // Flush additional objects to the output file.
65  // The output file is not explicitly closed here
66  // to allow interactive investigation of the data tree
67  // when this macro is run in an interactive ROOT/CINT session.
68  ofile->Write();
69 }