]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/MUON/macros/CreateTriggerRecoLookupTables.C
Extacting the OCDB in a separate module. The detectors have write permission in the...
[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.
162637e4 54 * (Default = local://$ALICE_ROOT/OCDB)
c95cf30c 55 * \param run This is the run number to use for the CDB (Default = 0).
2b7af22a 56 * \param useCrateId Indicates if the crate ID should be used for the lookup table
57 * indexing rather than just a sequencial number (Default = true).
c95cf30c 58 */
2b7af22a 59void CreateTriggerRecoLookupTables(
162637e4 60 const char* CDBPath = "local://$ALICE_ROOT/OCDB",
2b7af22a 61 Int_t run = 0,
62 bool useCrateId = true
63 )
b39b98c8 64{
c95cf30c 65 gSystem->Load("libAliHLTMUON.so");
86665942 66
c95cf30c 67 for (Int_t ddl = 20; ddl < 22; ddl++)
b39b98c8 68 {
c95cf30c 69 Char_t filename[64];
70 sprintf(filename, "Lut%d.dat", ddl+1);
71 cout << "Generating LUT for DDL " << ddl+1
72 << " and writing output to file " << filename << endl;
73 bool ok = AliHLTMUONTriggerReconstructorComponent::GenerateLookupTable(
2b7af22a 74 ddl, filename, CDBPath, run, useCrateId
c95cf30c 75 );
76 if (! ok) return;
b39b98c8 77 }
78
c95cf30c 79 cout << "Lookup tables have been generated successfully." << endl;
86665942 80}