added macros to create and read TOF TriggerMask
authorrpreghen <rpreghen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Nov 2010 09:43:19 +0000 (09:43 +0000)
committerrpreghen <rpreghen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Nov 2010 09:43:19 +0000 (09:43 +0000)
TOF/MakeCDBEntryTriggerMask.C [new file with mode: 0644]
TOF/ReadCDBEntryTriggerMask.C [new file with mode: 0644]

diff --git a/TOF/MakeCDBEntryTriggerMask.C b/TOF/MakeCDBEntryTriggerMask.C
new file mode 100644 (file)
index 0000000..5de029a
--- /dev/null
@@ -0,0 +1,25 @@
+MakeCDBEntryTriggerMask(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity())
+{
+
+  UInt_t triggerMask[72];
+  for (Int_t i = 0; i < 72; i++)
+    triggerMask[i] = 0xffffff;
+
+  /* create object */
+  AliTOFTriggerMask *obj = new AliTOFTriggerMask();
+  obj->SetTriggerMaskArray(triggerMask);
+
+  /* create cdb info */
+  AliCDBId id("TRIGGER/TOF/TriggerMask", startRun, endRun);
+  AliCDBMetaData *md = new AliCDBMetaData();
+  md->SetResponsible("Roberto Preghenella");
+  md->SetComment("TOF Trigger Mask");
+  md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+  md->SetBeamPeriod(0);
+
+  /* put object in cdb */
+  AliCDBManager *cdb = AliCDBManager::Instance();
+  cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  cdb->GetDefaultStorage()->Put(obj, id, md);
+
+}
diff --git a/TOF/ReadCDBEntryTriggerMask.C b/TOF/ReadCDBEntryTriggerMask.C
new file mode 100644 (file)
index 0000000..aa45415
--- /dev/null
@@ -0,0 +1,13 @@
+AliTOFTriggerMask *
+ReadCDBEntryTriggerMask(Int_t run, const Char_t *defaultStorage = "raw://", const Char_t *specificStorage = NULL)
+{
+  AliCDBManager *cdb = AliCDBManager::Instance();
+  cdb->SetDefaultStorage(defaultStorage);
+  if (specificStorage)
+    cdb->SetSpecificStorage("TRIGGER/TOF/TriggerMask", specificStorage);
+  cdb->SetRun(run);
+  AliCDBEntry *cdbe = cdb->Get("TRIGGER/TOF/TriggerMask");
+  AliTOFTriggerMask *triggerMaskObj = (AliTOFTriggerMask *)cdbe->GetObject();
+
+  return triggerMaskObj;
+}