]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/UpdateCDBCTPConfig.C
Fixing minor bug recognizing diffractive events in simulation
[u/mrichter/AliRoot.git] / MUON / UpdateCDBCTPConfig.C
index a9b12c1922289810c235518b5414ee0753ad5889..91b3522c43ea0c80d09f6d805d5b924c6c1d6b83 100644 (file)
@@ -58,6 +58,8 @@
 #include "AliCDBId.h"
 #include "AliCDBMetaData.h"
 #include "AliTriggerConfiguration.h"
+#include "AliTriggerUtils.h"
+#include "AliSimulation.h"
 #include <TROOT.h>
 #include <TString.h>
 #include <TSystem.h>
 
 void UpdateCDBCTPConfig(Bool_t check = false) {
   
+  // AliSimulation object must exist, as it is used via AliMC
+  // which is used in AliTriggerUtils::CheckConfiguration()
+  AliSimulation sim;
+
   AliCDBManager* cdb = AliCDBManager::Instance();
-  cdb->SetDefaultStorage("local://$ALICE_ROOT");
+  cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
   cdb->SetRun(0);
 
   if (check) {
@@ -97,7 +103,8 @@ void UpdateCDBCTPConfig(Bool_t check = false) {
   }
 
   // check if Config.C is compatible with the trigger configuration requested
-  if (!trconfig->CheckConfiguration(cfgFile)) {
+  AliTriggerUtils tru;
+  if (!tru.CheckConfiguration(cfgFile,trconfig)) {
     Printf("CTP configuration is incompatible with the specified Config.C and AliRoot version! Exiting...");
     return;
   }
@@ -117,7 +124,7 @@ void UpdateCDBCTPConfig(Bool_t check = false) {
   md->SetAliRootVersion(av.Data());
   md->SetComment(Form("Default CTP configuration for MUON mode produced with root version %s and AliRoot version %s revision %d ",rootv,av.Data(),revnum));
 
-  AliCDBStorage* storage = cdb->GetStorage("local://$ALICE_ROOT");
+  AliCDBStorage* storage = cdb->GetStorage("local://$ALICE_ROOT/OCDB");
   storage->Put(trconfig,id,md);
   
 }