]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliCTPRawData.cxx
Protection when setting geometry to be loaded from file (Andrei)
[u/mrichter/AliRoot.git] / STEER / AliCTPRawData.cxx
index 864be8345757cf89b0e4c3def9ea282c8b4cf107..83d59bc4c928d95b3f429d2c436f776e4e9e25d4 100644 (file)
@@ -25,9 +25,9 @@
 #include "AliCTPRawData.h"
 #include "AliRunLoader.h"
 #include "AliCentralTrigger.h"
-#include "AliDAQConfig.h"
 #include "AliRawDataHeader.h"
 #include "AliLog.h"
+#include "AliDAQ.h"
 
 ClassImp(AliCTPRawData)
 ////////////////////////////////////////////////////////////////////////////////////////
@@ -61,7 +61,7 @@ void AliCTPRawData::RawData()
   // This method writes the CTP (trigger)
   // raw data in a DDL file
   ULong64_t l2class = 0;
-  UInt_t l2cluster = 0;
+  UChar_t l2cluster = 0;
   AliInfo("Storing the CTP DDL raw data...");
   AliRunLoader *runloader = AliRunLoader::GetRunLoader();
   if (runloader) {
@@ -72,15 +72,7 @@ void AliCTPRawData::RawData()
       // First get the trigger mask
       l2class = aCTP->GetClassMask();
       // Then get the detector cluster to be read out
-      TString detectorCluster = aCTP->GetDetectors();
-      if (detectorCluster.Contains("START")) {
-       if (detectorCluster.Contains("MUON"))
-         l2cluster |= 1;
-       else
-         l2cluster |= 1 << 1;
-      }
-      else
-       l2cluster |= 1 << 2;
+      l2cluster = aCTP->GetClusterMask();
     }
     else
       AliWarning("No trigger can be loaded! Putting empty trigger class into the CTP raw data !");
@@ -92,7 +84,7 @@ void AliCTPRawData::RawData()
   AliDebug(1,Form("CTP detector cluster = 0x%x",l2cluster));
 
   char  fileName[15];
-  sprintf(fileName,"%s_%d.ddl",kDetectors[kCTPIndex],kCTPIndex*0x100);
+  strcpy(fileName,AliDAQ::DdlFileName("TRG",0));
   AliInfo(Form("Storing CTP raw data in %s",fileName));
   ofstream outfile;         // logical name of the output file 
  #ifndef __DECCXX
@@ -119,18 +111,18 @@ void AliCTPRawData::RawData()
   // First 3 words here - Bunch-crossing and orbit numbers
   UInt_t word = 0;
   word |= 0 << 13; // BlockID = 0 in case of CTP readout
-  word |= bunchCross && 0xFFF;
+  word |= bunchCross & 0xFFF;
   AliDebug(1,Form("CTP word1 = 0x%x",word));
   outfile.write((char*)(&word),sizeof(UInt_t));
 
   word = 0;
   word |= 0 << 13; // BlockID = 0 in case of CTP readout
-  word |= (orbitId >> 12) && 0xFFF;
+  word |= (orbitId >> 12) & 0xFFF;
   AliDebug(1,Form("CTP word2 = 0x%x",word));
   outfile.write((char*)(&word),sizeof(UInt_t));
   word = 0;
   word |= 0 << 13; // BlockID = 0 in case of CTP readout
-  word |= orbitId && 0xFFF;
+  word |= orbitId & 0xFFF;
   AliDebug(1,Form("CTP word3 = 0x%x",word));
   outfile.write((char*)(&word),sizeof(UInt_t));
 
@@ -139,30 +131,30 @@ void AliCTPRawData::RawData()
   word |= 0 << 13; // BlockID = 0 in case of CTP readout
   word |= ((UInt_t)esr) << 10;
   word |= 0 << 8; // L2SwC - physics trigger
-  word |= (l2cluster && 0x3F) << 2; // L2Cluster
-  word |= (l2class >> 48) && 0x3;
+  word |= (l2cluster & 0x3F) << 2; // L2Cluster
+  word |= (UInt_t)((l2class >> 48) & 0x3);
   AliDebug(1,Form("CTP word4 = 0x%x",word));
   outfile.write((char*)(&word),sizeof(UInt_t));
 
   // Then the last 4 words with the trigger classes
   word = 0;
   word |= 0 << 13; // BlockID = 0 in case of CTP readout
-  word |= (l2class >> 36) && 0xFFF;
+  word |= (UInt_t)((l2class >> 36) & 0xFFF);
   AliDebug(1,Form("CTP word5 = 0x%x",word));
   outfile.write((char*)(&word),sizeof(UInt_t));
   word = 0;
   word |= 0 << 13; // BlockID = 0 in case of CTP readout
-  word |= (l2class >> 24) && 0xFFF;
+  word |= (UInt_t)((l2class >> 24) & 0xFFF);
   AliDebug(1,Form("CTP word6 = 0x%x",word));
   outfile.write((char*)(&word),sizeof(UInt_t));
   word = 0;
   word |= 0 << 13; // BlockID = 0 in case of CTP readout
-  word |= (l2class >> 12) && 0xFFF;
+  word |= (UInt_t)((l2class >> 12) & 0xFFF);
   AliDebug(1,Form("CTP word7 = 0x%x",word));
   outfile.write((char*)(&word),sizeof(UInt_t));
   word = 0;
   word |= 0 << 13; // BlockID = 0 in case of CTP readout
-  word |= l2class && 0xFFF;
+  word |= (UInt_t)(l2class & 0xFFF);
   AliDebug(1,Form("CTP word8 = 0x%x",word));
   outfile.write((char*)(&word),sizeof(UInt_t));