]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding helper function HLTSpecificationFromDdlID (Lars)
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Jan 2011 21:13:55 +0000 (21:13 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Jan 2011 21:13:55 +0000 (21:13 +0000)
HLT/BASE/AliHLTDAQ.cxx
HLT/BASE/AliHLTDAQ.h

index 1f02a48969be6fe07a77cd76eb0ed0a6a26a6ef2..b1824e51bd632cc4335f4325cb53fdccfa99d7cc 100644 (file)
@@ -249,6 +249,35 @@ string AliHLTDAQ::HLTOrigin(Int_t detectorID)
   return origin;
 }
 
+string AliHLTDAQ::HLTSpecificationFromDdlID(Int_t ddlID)
+{
+  string result = "";
+  Int_t ddlIndex;
+  Int_t detectorID = DetectorIDFromDdlID(ddlID, ddlIndex);
+  if (detectorID < 0)
+    return result;
+  Int_t TPCID = DetectorID("TPC");
+  char* strtmp = new char[11];
+  if (detectorID != TPCID) {
+    sprintf(strtmp, "0x%08x", 0x1 << ddlIndex);
+    result = strtmp;
+  }
+  else { // TPC
+    int partition;
+    int slice;
+    if (ddlID < 840) {
+      partition = ddlID % 2;
+      slice = (ddlID - 768) / 2;
+    } else {
+      partition = (ddlID % 4) + 2;
+      slice = (ddlID - 840) / 4;
+    }
+    sprintf(strtmp, "0x%02x%02x%02x%02x", slice, slice, partition, partition);
+    result = strtmp;
+  }
+  return result;
+}
+
 AliHLTDAQ* AliHLTDAQ::GetInstance()
 {
   // see header file for class documentation
index 37ea3d68d6a84461149e566ceaf50d47f576c847..b7f9bef5f1b4aea3bc544cc8ab8e77bacd7371b8 100644 (file)
@@ -60,6 +60,8 @@ class AliHLTDAQ {
 
   static std::string HLTOrigin(const char *detectorName);
   static std::string HLTOrigin(Int_t detectorID);
+  
+  static std::string HLTSpecificationFromDdlID(Int_t ddlID);
 
   static AliHLTDAQ* GetInstance();