2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * All rights reserved. *
7 * Artur Szostak <artursz@iafrica.com> *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
20 * \file CreateTriggerMenuCDBEntry.C
21 * \brief Macro for generating the trigger menu CDB entry for the HLT global trigger.
23 * This macro is used to generate a default CDB entry for the HLT global trigger.
24 * The trigger menu is used by the HLT global trigger as a configuration object.
25 * It is an experts macro so make sure you know what you are doing.
27 * You can run this macro with defaults using the following shell command:
29 * > aliroot -b -q $ALICE_ROOT/HLT/trigger/CreateTriggerMenuCDBEntry.C
32 * \author Artur Szostak <artursz@iafrica.com>
35 #if !defined(__CINT__) || defined(__MAKECINT__)
36 #include "AliCDBManager.h"
37 #include "AliCDBStorage.h"
38 #include "AliCDBEntry.h"
39 #include "AliHLTTriggerMenu.h"
40 #include "AliHLTGlobalTriggerConfig.h"
41 #include "TObjString.h"
44 #include "Riostream.h"
50 * Generates a default CDB entry for the trigger menu in the given CDB storage
52 * \param cdbPath The path to the default CDB storage.
54 void CreateTriggerMenuCDBEntry(
55 const char* cdbPath = "local://$ALICE_ROOT/OCDB",
58 Int_t lastRun = AliCDBRunRange::Infinity()
61 gSystem->Load("libAliHLTUtil.so");
62 gSystem->Load("libAliHLTTRD.so");
63 gSystem->Load("libAliHLTMUON.so");
64 gSystem->Load("libAliHLTTrigger.so");
66 // Setup the CDB default storage and run number.
67 AliCDBManager* cdbManager = AliCDBManager::Instance();
68 if (cdbManager == NULL)
70 cerr << "ERROR: Global CDB manager object does not exist." << endl;
73 AliCDBStorage* storage = cdbManager->GetStorage(cdbPath);
76 cerr << "ERROR: Could not get storage for: " << cdbPath << endl;
80 ///////////////////////////////////////////////////////////////////////////////////////////
81 // Create the trigger menu.
82 AliHLTGlobalTriggerConfig config("Default Global Trigger Config");
85 //config.AddSymbol("triggerClasses", "AliHLTUInt64_t", "this->GetTriggerClasses()", "0x0", "AliHLTEventSummary");
86 //config.AddItem("triggerClasses != 0x0", "domainAll", "CTP triggered");
88 config.AddSymbol("domainAll", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"*******:***\")");
90 ///////////////////////////////////////////////////////////////////////////////////////////
91 // the domain definitions for the global HLT output and the HLT DDLs
92 config.AddSymbol("domainHLTOUT", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"*******:HLT \")");
93 config.AddSymbol("domainHLTDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:HLT\\0\")");
94 config.AddSymbol("domainALLDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:***\\0\")");
96 ///////////////////////////////////////////////////////////////////////////////////////////
97 // NOTE: always make sure that the global HLT output and the HLT DDLs are included
98 // in the readout, i.e. add domainHLTOUT|domainHLTDDL to the trigger domain
99 config.AddItem("BarrelMultiplicityTrigger", "BarrelMultiplicityTrigger|domainHLTOUT|domainALLDDL", "charged barrel track multiplicity triggered");
100 config.AddItem("MuonSpectroTrigger", "MuonSpectroTrigger|domainHLTOUT|domainALLDDL", "Muon spectrometer triggered");
102 ///////////////////////////////////////////////////////////////////////////////////////////
103 // default domain in case there is no global trigger
104 // readout the output of the reconstruction
105 // this refers to the domain domainHLTOUT|domainHLTDDL
106 config.SetDefaultTriggerDescription("No HLT global trigger");
107 config.DefaultTriggerDomain().Add("*******", "HLT ");
108 AliHLTReadoutList readoutlist;
109 readoutlist.Enable(AliHLTReadoutList::kHLT);
110 config.DefaultTriggerDomain().Add(readoutlist);
112 TObject* menu = AliHLTGlobalTriggerConfig::Menu()->Clone();
115 ///////////////////////////////////////////////////////////////////////////////////////////
116 // Write the trigger menu object to the CDB.
117 AliCDBId id("HLT/ConfigHLT/HLTGlobalTrigger", firstRun, lastRun, version);
118 AliCDBMetaData* metaData = new AliCDBMetaData();
119 metaData->SetResponsible("HLT");
120 metaData->SetComment("Default trigger menu for HLT global trigger.");
121 storage->Put(menu, id, metaData);