]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/macros/CreateDefaultCDBEntries.C
Added the dimuon trigger decision component, its default configuration CDB entries...
[u/mrichter/AliRoot.git] / HLT / MUON / macros / CreateDefaultCDBEntries.C
1 /**************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project        *
3  * All rights reserved.                                                   *
4  *                                                                        *
5  * Primary Authors:                                                       *
6  *   Artur Szostak <artursz@iafrica.com>                                  *
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     *
13  * about the suitability of this software for any purpose. It is          *
14  * provided "as is" without express or implied warranty.                  *
15  **************************************************************************/
16
17 /* $Id: $ */
18
19 /**
20  * \ingroup macros
21  * \file CreateDefaultCDBEntries.C
22  * \brief Macro for generating default CDB entries for dHLT.
23  *
24  * This macro is used to generate some default CDB entries for the dHLT.
25  * It is an experts macro so make sure you know what you are doing.
26  *
27  * The simplest way to run this macro with defaults is to copy "rootlogon.C" from
28  * $ALICE_ROOT/HLT/MUON/macros into your current working directory, then from
29  * the shell command prompt run the following command:
30  * \code
31  *   > aliroot -b -q -l $ALICE_ROOT/HLT/MUON/macros/CreateDefaultCDBEntries.C+
32  * \endcode
33  *
34  * \author Artur Szostak <artursz@iafrica.com>
35  */
36
37 #if !defined(__CINT__) || defined(__MAKECINT__)
38 #include "AliCDBManager.h"
39 #include "AliCDBStorage.h"
40 #include "AliCDBEntry.h"
41 #include "AliHLTMUONConstants.h"
42 #include "TMap.h"
43 #include "TObjString.h"
44 #include "TString.h"
45 #include <iostream>
46 using std::cerr;
47 using std::endl;
48 #endif
49
50 /**
51  * Generates default CDB entries in the given CDB storage (local by default)
52  * \param cdbPath  The path to the local storage.
53  */
54 void CreateDefaultCDBEntries(const char* cdbPath = "local://$ALICE_ROOT")
55 {
56         // Setup the CDB default storage and run number.
57         AliCDBManager* cdbManager = AliCDBManager::Instance();
58         if (cdbManager == NULL)
59         {
60                 cerr << "ERROR: Global CDB manager object does not exist." << endl;
61                 return;
62         }
63         
64         AliCDBStorage* storage = cdbManager->GetStorage(cdbPath);
65         if (storage == NULL)
66         {
67                 cerr << "ERROR: Could not get storage for: " << cdbPath << endl;
68                 return;
69         }
70         
71         Int_t verison = 0;
72         Int_t firstRun = 0;
73         Int_t lastRun = AliCDBRunRange::Infinity();
74         
75         // Create and store the configuration parameters for the trigger decision cuts.
76         TMap* cuts = new TMap;
77         cuts->SetOwner(kTRUE);
78         cuts->Add(new TObjString("lowptcut"), new TObjString("1"));
79         cuts->Add(new TObjString("highptcut"), new TObjString("2"));
80         cuts->Add(new TObjString("lowmasscut"), new TObjString("2.5"));
81         cuts->Add(new TObjString("highmasscut"), new TObjString("7"));
82         
83         const char* path = AliHLTMUONConstants::DecisionComponentCDBPath();
84         AliCDBId id(path, firstRun, lastRun, verison);
85         AliCDBMetaData* metaData = new AliCDBMetaData();
86         metaData->SetResponsible("dimuon HLT");
87         metaData->SetComment("Trigger decision cuts for dimuon HLT.");
88         storage->Put(cuts, id, metaData);
89 }