]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliDetectorTag.cxx
Leak detected by Coverity fixed
[u/mrichter/AliRoot.git] / STEER / AliDetectorTag.cxx
index 1482f2663dba37694e79e874af7c08cb7f42e399..5888ca6d57841fb768733c02e0ada06d0d2ba77b 100644 (file)
 //   Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
 //-----------------------------------------------------------------
 
+#include "TMath.h"
+
 #include "AliDetectorTag.h"
+#include "AliLog.h"
+#include "TObjString.h"
 
 ClassImp(AliDetectorTag)
 
 //___________________________________________________________________________
-  AliDetectorTag::AliDetectorTag() :
-    TObject(),
-    fITS(kFALSE),
-    fTPC(kFALSE),
-    fTRD(kFALSE),
-    fTOF(kFALSE),
-    fHMPID(kFALSE),
-    fPHOS(kFALSE),
-    fZDC(kFALSE),
-    fMUON(kFALSE),
-    fPMD(kFALSE),
-    fEMCAL(kFALSE),
-    fVZERO(kFALSE),
-    fTZERO(kFALSE)
+AliDetectorTag::AliDetectorTag() :
+  TObject(),
+  fMaskDAQ(0),
+  fMaskReco(0),
+  fDetectorValidityRange(),
+  fDetectorStatus()
 {
   // Default constructor
+  for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
+    fDetectorValidityRange[iter] = 0;
+    fDetectorStatus[iter] = "";
+  }
 }
 
 //___________________________________________________________________________
-AliDetectorTag::AliDetectorTag(const AliDetectorTag & detTag) : TObject(detTag) {
+AliDetectorTag::AliDetectorTag(const AliDetectorTag & detTag) :
+  TObject(detTag),
+  fMaskDAQ(detTag.fMaskDAQ),
+  fMaskReco(detTag.fMaskReco),
+  fDetectorValidityRange(),
+  fDetectorStatus() 
+{
   // DetectorTag copy constructor
-  SetITS();
-  SetTPC();
-  SetTRD();
-  SetTOF();
-  SetHMPID();
-  SetPHOS();
-  SetZDC();
-  SetMUON();
-  SetPMD();
-  SetEMCAL();
-  SetVZERO();
-  SetTZERO();
+  
+  for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
+    fDetectorValidityRange[iter] = detTag.GetDetectorValidityRange(iter);
+    fDetectorStatus[iter] = detTag.GetDetectorStatus(iter);
+  }
 }
 
 //___________________________________________________________________________
@@ -67,24 +66,81 @@ AliDetectorTag & AliDetectorTag::operator=(const AliDetectorTag &detTag) {
   if (this != &detTag) {
     TObject::operator=(detTag);
     
-    SetITS();
-    SetTPC();
-    SetTRD();
-    SetTOF();
-    SetHMPID();
-    SetPHOS();
-    SetZDC();
-    SetMUON();
-    SetPMD();
-    SetEMCAL();
-    SetVZERO();
-    SetTZERO();
+    fMaskDAQ = detTag.fMaskDAQ;   
+    fMaskReco = detTag.fMaskReco;   
+    for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
+      fDetectorValidityRange[iter] = detTag.GetDetectorValidityRange(iter);
+      fDetectorStatus[iter] = detTag.GetDetectorStatus(iter);
+    }
   }
   return *this;
 }
 
-
 //___________________________________________________________________________
 AliDetectorTag::~AliDetectorTag() {
   // Destructor
 }
+
+void AliDetectorTag::UpdateFromRunTable(AliDetectorTag &detTag)
+{
+  for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
+    fDetectorValidityRange[iter] = detTag.GetDetectorValidityRange(iter);
+    fDetectorStatus[iter] = detTag.GetDetectorStatus(iter);
+  }
+}
+
+
+//___________________________________________________________________________
+// void AliDetectorTag::SetDetectorConfiguration() {
+//   //sets the detector configuration
+//   if(fDetectors[0] == 1) {
+//     SetITSSPD(); fDetectorArray->Add(new TObjString("SPD"));}
+//   if(fDetectors[1] == 1) {
+//     SetITSSDD(); fDetectorArray->Add(new TObjString("SDD"));}
+//   if(fDetectors[2] == 1) {
+//     SetITSSSD(); fDetectorArray->Add(new TObjString("SSD"));}
+//   if(fDetectors[3] == 1) {
+//     SetTPC(); fDetectorArray->Add(new TObjString("TPC"));}
+//   if(fDetectors[4] == 1) {
+//     SetTRD(); fDetectorArray->Add(new TObjString("TRD"));}
+//   if(fDetectors[5] == 1) {
+//     SetTOF(); fDetectorArray->Add(new TObjString("TOF"));}
+//   if(fDetectors[6] == 1) {
+//     SetHMPID();fDetectorArray->Add(new TObjString("HMPID"));}
+//   if(fDetectors[7] == 1) {
+//     SetPHOS(); fDetectorArray->Add(new TObjString("PHOS"));}
+//   if(fDetectors[9] == 1) {
+//     SetPMD(); fDetectorArray->Add(new TObjString("PMD"));}
+//   if(fDetectors[10] == 1) {
+//     SetMUON(); fDetectorArray->Add(new TObjString("MUON"));}
+//   if(fDetectors[12] == 1) {
+//     SetFMD(); fDetectorArray->Add(new TObjString("FMD"));}
+//   if(fDetectors[13] == 1) {
+//     SetTZERO(); fDetectorArray->Add(new TObjString("T0"));}
+//   if(fDetectors[14] == 1) {
+//     SetVZERO(); fDetectorArray->Add(new TObjString("VZERO"));}
+//   if(fDetectors[15] == 1) {
+//     SetZDC(); fDetectorArray->Add(new TObjString("ZDC"));}
+//   if(fDetectors[18] == 1) {
+//     SetEMCAL(); fDetectorArray->Add(new TObjString("EMCAL"));}
+// }
+
+//___________________________________________________________________________
+void AliDetectorTag::PrintDetectorMask() {
+  //prints the detector mask
+  AliInfo( Form( "ITS-SPD: %d", GetITSSPD()) );
+  AliInfo( Form( "ITS-SDD: %d", GetITSSDD()) );
+  AliInfo( Form( "ITS-SSD: %d", GetITSSSD()) );
+  AliInfo( Form( "TPC: %d", GetTPC()) );
+  AliInfo( Form( "TRD: %d", GetTRD()) );
+  AliInfo( Form( "TOF: %d", GetTOF()) );
+  AliInfo( Form( "HMPID: %d", GetHMPID()) );
+  AliInfo( Form( "PHOS: %d", GetPHOS()) );
+  AliInfo( Form( "PMD: %d", GetPMD()) );
+  AliInfo( Form( "MUON: %d", GetMUON()) );
+  AliInfo( Form( "FMD: %d", GetFMD()) );
+  AliInfo( Form( "TZERO: %d", GetTZERO()) );
+  AliInfo( Form( "VZERO: %d", GetVZERO()) );
+  AliInfo( Form( "ZDC: %d", GetZDC()) );
+  AliInfo( Form( "EMCAL: %d", GetEMCAL()) );
+}