3 #if !defined(__CINT__) || defined(__MAKECINT__)
5 #include "AliCDBManager.h"
6 #include "AliCDBEntry.h"
7 #include "AliGRPObject.h"
12 * @file EnableHLTInGRP.C
13 * @author Artur Szostak <artursz@iafrica.com>
14 * @ingroup alihlt_tutorial
15 * @brief Patches GRP to process recorded data with HT in mode A.
19 * aliroot -b -q 'EnableHLTInGRP.C(\<runNumber\>,\<grpPath\>)'
21 * Where \<runNumber\> is the number of the run the GRP corresponds to. This
22 * can be found from the file name of the GRP entry of interest in the CDB.
23 * \<grpPath\> is the path to the local GRP/GRP/Data directory where the GRP
24 * entry to be modified is stored. Setting a value for \<grpPath\> is optional
25 * and is the current working directory by default.
27 * Data recorded in mode A will not have the HT bit set in the GRP's active
28 * detector mask. Trying to process such data with the HT framework will fail.
29 * To be able to process such runs the GRP must be downloaded and patched with
30 * this macro. It will set the HT bit in the GRP and write a new version of
31 * the GRP with and incremented version number.
33 * @return true if the macro completed successfully and false otherwise.
35 bool EnableHLTInGRP(Int_t runNumber, const char* grpPath = "local://./")
37 AliCDBManager* cdb = AliCDBManager::Instance();
38 cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
39 cdb->SetSpecificStorage("GRP/GRP/Data", grpPath);
40 cdb->SetRun(runNumber);
41 AliCDBEntry* entry = (AliCDBEntry*)cdb->Get("GRP/GRP/Data")->Clone();
44 cerr << "ERROR: Could not fetch the GRP entry for run " << runNumber << " and path " << grpPath << endl;
47 AliGRPObject* grp = (AliGRPObject*)entry->GetObject();
50 cerr << "ERROR: Could not fetch the GRP object for run " << runNumber << " and path " << grpPath << endl;
53 grp->SetDetectorMask(grp->GetDetectorMask() | (0x1 << AliDAQ::kHLTId));
54 entry->SetVersion(entry->GetId().GetVersion() + 1);
59 /// Just print the usage if no parameters are given.
62 cout << "Usage: EnableHLTInGRP.C'(<runNumber> [, <grpPath>])'" << endl;
63 cout << "Where <runNumber> is the number of the run the GRP corresponds to." << endl;
64 cout << "This can be found from the file name of the GRP entry of interest in the CDB." << endl;
65 cout << "<grpPath> is the path to the local GRP/GRP/Data directory where the GRP entry to be modified is stored." << endl;
66 cout << "Setting a value for <grpPath> is optional and is the current working directory by default." << endl;