1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
6 * Artur Szostak <artursz@iafrica.com> *
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 **************************************************************************/
19 * \file CreateTriggerMenuCDBEntry.C
20 * \brief Macro for generating the trigger menu CDB entry for the HLT global trigger.
22 * This macro is used to generate a default CDB entry for the HLT global trigger.
23 * The trigger menu is used by the HLT global trigger as a configuration object.
24 * It is an experts macro so make sure you know what you are doing.
26 * You can run this macro with defaults using the following shell command:
28 * > aliroot -b -q $ALICE_ROOT/HLT/trigger/CreateTriggerMenuCDBEntry.C
31 * \author Artur Szostak <artursz@iafrica.com>
34 #if !defined(__CINT__) || defined(__MAKECINT__)
35 #include "AliCDBManager.h"
36 #include "AliCDBStorage.h"
37 #include "AliCDBEntry.h"
38 #include "AliHLTTriggerMenu.h"
39 #include "AliHLTGlobalTriggerConfig.h"
40 #include "TObjString.h"
43 #include "Riostream.h"
49 * Generates a default CDB entry for the trigger menu in the given CDB storage
51 * \param cdbPath The path to the default CDB storage.
53 void CreateTriggerMenuCDBEntry(
54 const char* cdbPath = "local://$ALICE_ROOT/OCDB",
57 Int_t lastRun = AliCDBRunRange::Infinity()
60 gSystem->Load("libAliHLTTrigger.so");
62 // Setup the CDB default storage and run number.
63 AliCDBManager* cdbManager = AliCDBManager::Instance();
64 if (cdbManager == NULL)
66 cerr << "ERROR: Global CDB manager object does not exist." << endl;
69 AliCDBStorage* storage = cdbManager->GetStorage(cdbPath);
72 cerr << "ERROR: Could not get storage for: " << cdbPath << endl;
76 // Create the trigger menu.
77 AliHLTGlobalTriggerConfig config("Default Global Trigger Config");
78 //config.AddSymbol("triggerClasses", "AliHLTUInt64_t", "this->GetTriggerClasses()", "0x0", "AliHLTEventSummary");
79 //config.AddItem("triggerClasses != 0x0", "domainAll", "CTP triggered");
81 config.AddSymbol("domainAll", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"*******:***\")");
82 config.AddItem("BarrelMultiplicityTrigger", "BarrelMultiplicityTrigger", "charged barrel track multiplicity triggered");
84 // readout the output of the reconstruction
85 config.SetDefaultTriggerDescription("No HLT global trigger");
86 config.DefaultTriggerDomain().Add("*******", "HLT ");
87 AliHLTReadoutList readoutlist;
88 readoutlist.Enable(AliHLTReadoutList::kHLT);
89 config.DefaultTriggerDomain().Add(readoutlist);
91 TObject* menu = AliHLTGlobalTriggerConfig::Menu()->Clone();
94 // Write the trigger menu object to the CDB.
95 AliCDBId id("HLT/ConfigHLT/HLTGlobalTrigger", firstRun, lastRun, version);
96 AliCDBMetaData* metaData = new AliCDBMetaData();
97 metaData->SetResponsible("HLT");
98 metaData->SetComment("Default trigger menu for HLT global trigger.");
99 storage->Put(menu, id, metaData);