]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliDetectorTag.cxx
Bug fix in return code
[u/mrichter/AliRoot.git] / STEER / AliDetectorTag.cxx
index f497408f54ae59ee4f98d1dc29be21ccee5808f5..eb384e57c95f8b7c8bac947b0ce164d1a996a1b7 100644 (file)
@@ -21,6 +21,8 @@
 //   Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
 //-----------------------------------------------------------------
 
+#include "TMath.h"
+
 #include "AliDetectorTag.h"
 #include "AliLog.h"
 #include "TObjString.h"
@@ -125,6 +127,16 @@ void AliDetectorTag::Int2Bin() {
   SetDetectorConfiguration();
 }
 
+//___________________________________________________________________________
+UInt_t AliDetectorTag::GetIntDetectorMask() {
+  // Returns the detector mask UInt_t
+  UInt_t mask = 0;
+  for(Int_t k = 0; k < 20; k++) 
+    if(fDetectors[k] == 1) mask += (UInt_t)TMath::Power(2,k);
+  
+  return mask;
+}
+
 //___________________________________________________________________________
 void AliDetectorTag::SetDetectorConfiguration() {
   //sets the detector configuration