Moving the generation of the LUTs to the component class and adding default loading...
[u/mrichter/AliRoot.git] / HLT / MUON / macros / CreateTriggerRecoLookupTables.C
CommitLineData
86665942 1/**************************************************************************
c95cf30c 2 * This file is property of and copyright by the ALICE HLT Project *
86665942 3 * All rights reserved. *
4 * *
5 * Primary Authors: *
b39b98c8 6 * Artur Szostak <artursz@iafrica.com> *
86665942 7 * *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
c95cf30c 13 * about the suitability of this software for any purpose. It is *
86665942 14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
16
c95cf30c 17/* $Id$ */
18
b39b98c8 19/**
c95cf30c 20 * \ingroup macros
21 * \file CreateTriggerRecoLookupTables.C
22 * \brief Macro used to generate lookup tables for the trigger reconstructor components.
23 *
b39b98c8 24 * This macro is used to generate the lookup tables for the trigger reconstructor
25 * component. All alignment and geometry data is taken from the CDB.
c95cf30c 26 *
27 * \note The LUT files must be generated on the same platform / machine on which
28 * they will be used, since they may not be binary compatible across platforms.
29 *
30 * To run this macro copy "rootlogon.C" from $ALICE_ROOT/HLT/MUON/macros
31 * into the current directory, then from the shell command prompt run one of
32 * the following commands:
33 * \code
34 * > aliroot $ALICE_ROOT/HLT/MUON/macros/CreateTriggerRecoLookupTables.C
35 * \endcode
36 * or
37 * \code
38 * > aliroot -b -q -l $ALICE_ROOT/HLT/MUON/macros/CreateTriggerRecoLookupTables.C+
39 * \endcode
40 *
41 * \author Artur Szostak <artursz@iafrica.com>
b39b98c8 42 */
86665942 43
c95cf30c 44#if !defined(__CINT__) || defined(__MAKECINT__)
45#include "Riostream.h"
46#include "AliHLTMUONTriggerReconstructorComponent.h"
47#include "TSystem.h"
48#endif
86665942 49
c95cf30c 50/**
51 * Generates the lookup tables for the AliHLTMUONTriggerReconstructorComponent
52 * components. The tables are generated from the CDB database information.
53 * \param CDBPath This is the CDB path to use as the DB storage.
54 * (Default = local://$ALICE_ROOT)
55 * \param run This is the run number to use for the CDB (Default = 0).
56 */
57void CreateTriggerRecoLookupTables(const char* CDBPath = "local://$ALICE_ROOT", Int_t run = 0)
b39b98c8 58{
c95cf30c 59 gSystem->Load("libAliHLTMUON.so");
86665942 60
c95cf30c 61 for (Int_t ddl = 20; ddl < 22; ddl++)
b39b98c8 62 {
c95cf30c 63 Char_t filename[64];
64 sprintf(filename, "Lut%d.dat", ddl+1);
65 cout << "Generating LUT for DDL " << ddl+1
66 << " and writing output to file " << filename << endl;
67 bool ok = AliHLTMUONTriggerReconstructorComponent::GenerateLookupTable(
68 ddl, filename, CDBPath, run
69 );
70 if (! ok) return;
b39b98c8 71 }
72
c95cf30c 73 cout << "Lookup tables have been generated successfully." << endl;
86665942 74}