2c842e6e91c6e3b92f2c74a51467629d98f39993
[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 see the docs of class IceF2k
9 //
10 // NvE 11-mar-2005 Utrecht University
11 /////////////////////////////////////////////////
12 {
13  gSystem->Load("ralice");
14  gSystem->Load("icepack");
15  gSystem->Load("iceconvert");
16
17  IceF2k q("IceF2k","Test of IceF2k conversion job");
18
19  // Limit the number of entries for testing
20  q.SetMaxEvents(100);
21
22  // Print frequency to produce a short summary print every printfreq events
23  q.SetPrintFreq(10);
24
25  // The F2K input filename
26  q.SetInputFile("run7825.f2k");
27
28  // Output file for the event structures
29  TFile* ofile=new TFile("events.root","RECREATE","F2K data in IceEvent structure");
30  q.SetOutputFile(ofile);
31
32  ///////////////////////////////////////////////////////////////////
33  // Here the user can specify his/her sub-tasks to be executed
34  // on an event-by-event basis after the IceEvent structure
35  // has been filled and before the data is written out.
36  // Sub-tasks (i.e. a user classes derived from TTask) are entered
37  // as follows :
38  //
39  //    MyXtalk task1("task1","Cross talk correction");
40  //    MyClean task2("task2","Hit cleaning");
41  //    q.Add(&task1);
42  //    q.Add(&task2);
43  //
44  // The sub-tasks will be executed in the order as they are entered.
45  ///////////////////////////////////////////////////////////////////
46
47  // Perform the conversion
48  q.ExecuteJob();
49
50  // Select various objects to be added to the output file
51
52  AliObjMatrix* omdb=q.GetOMdbase();
53  if (omdb) omdb->Write();
54
55  AliDevice* fitdefs=q.GetFitdefs();
56  if (fitdefs) fitdefs->Write();
57
58  TDatabasePDG* pdg=q.GetPDG();
59  if (pdg) pdg->Write();
60
61  // Close output file
62  ofile->Write();
63  ofile->Close();
64 }