ROOT logo
#ifndef ALIDETECTORTAG_H
#define ALIDETECTORTAG_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */


/* $Id$ */

//-------------------------------------------------------------------------
//                          Class AliDetectorTag
//   This is the class to deal with the tags for the detector level
//
//    Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
//-------------------------------------------------------------------------

#include "TObject.h"
#include "TObjArray.h"
#include "AliDAQ.h"

//___________________________________________________________________________
class AliDetectorTag : public TObject {
 public:
  AliDetectorTag();
  AliDetectorTag(const AliDetectorTag & t);

  AliDetectorTag &operator=(const AliDetectorTag &rhs);
  virtual ~AliDetectorTag();
  
  void UpdateFromRunTable(AliDetectorTag &detTag);

  //____________________________________________________//
  void SetDetectorMask(UInt_t mask)     {fMaskDAQ = mask; fMaskReco = mask; }
  void SetDetectorMaskDAQ(UInt_t mask)  {fMaskDAQ = mask;}
  void SetDetectorMaskReco(UInt_t mask) {fMaskReco = mask;}
  void SetDetectorValidityRange(UChar_t idet, UShort_t vr) {fDetectorValidityRange[idet] = vr; }
  void SetDetectorStatus(UChar_t idet, TString co) { fDetectorStatus[idet] = co; }
  TObjArray *GetDetectorMask() { return 0; } // {return fDetectorArray;}
  UInt_t GetIntDetectorMask() { return fMaskDAQ; }
  UInt_t GetIntDetectorMaskDAQ() { return fMaskDAQ; }
  UInt_t GetIntDetectorMaskReco() { return fMaskReco; }
  UShort_t GetDetectorValidityRange(UChar_t idet) const { return fDetectorValidityRange[idet]; }
  TString  GetDetectorStatus(UChar_t idet) const { return fDetectorStatus[idet]; }
  const char *GetDetectorMaskDAQ() { return AliDAQ::ListOfTriggeredDetectors(fMaskDAQ); }
  const char *GetDetectorMaskReco() { return AliDAQ::ListOfTriggeredDetectors(fMaskReco); }
  void PrintDetectorMask();

  //____________________________________________________//
  Bool_t GetITSSPD() const {return fMaskDAQ & AliDAQ::kSPD;}
  Bool_t GetITSSDD() const {return fMaskDAQ & AliDAQ::kSSD;}
  Bool_t GetITSSSD() const {return fMaskDAQ & AliDAQ::kSSD;}
  Bool_t GetTPC()    const {return fMaskDAQ & AliDAQ::kTPC;}
  Bool_t GetTRD()    const {return fMaskDAQ & AliDAQ::kTRD;}
  Bool_t GetTOF()    const {return fMaskDAQ & AliDAQ::kTOF;}
  Bool_t GetHMPID()  const {return fMaskDAQ & AliDAQ::kHMPID;}
  Bool_t GetPHOS()   const {return fMaskDAQ & AliDAQ::kPHOS;}
  Bool_t GetPMD()    const {return fMaskDAQ & AliDAQ::kPMD;}
  Bool_t GetMUON()   const {return fMaskDAQ & AliDAQ::kMUON;}
  Bool_t GetFMD()    const {return fMaskDAQ & AliDAQ::kFMD;}
  Bool_t GetTZERO()  const {return fMaskDAQ & AliDAQ::kT0;}
  Bool_t GetVZERO()  const {return fMaskDAQ & AliDAQ::kVZERO;}
  Bool_t GetZDC()    const {return fMaskDAQ & AliDAQ::kZDC;}
  Bool_t GetEMCAL()  const {return fMaskDAQ & AliDAQ::kEMCAL;}
  
  //____________________________________________________//
 private:
  //  void Int2Bin();
  //   void SetDetectorConfiguration();

  void SetITSSPD() {fMaskDAQ |= AliDAQ::kSPD  ;}
  void SetITSSDD() {fMaskDAQ |= AliDAQ::kSDD  ;}
  void SetITSSSD() {fMaskDAQ |= AliDAQ::kSSD  ;}
  void SetTPC()    {fMaskDAQ |= AliDAQ::kTPC  ;}
  void SetTRD()    {fMaskDAQ |= AliDAQ::kTRD  ;}
  void SetTOF()    {fMaskDAQ |= AliDAQ::kTOF  ;}
  void SetHMPID()  {fMaskDAQ |= AliDAQ::kHMPID;}
  void SetPHOS()   {fMaskDAQ |= AliDAQ::kPHOS ;}
  void SetPMD()    {fMaskDAQ |= AliDAQ::kPMD  ;}
  void SetMUON()   {fMaskDAQ |= AliDAQ::kMUON ;}
  void SetFMD()    {fMaskDAQ |= AliDAQ::kFMD  ;}
  void SetTZERO()  {fMaskDAQ |= AliDAQ::kT0   ;}
  void SetVZERO()  {fMaskDAQ |= AliDAQ::kVZERO;}
  void SetZDC()    {fMaskDAQ |= AliDAQ::kZDC  ;}
  void SetEMCAL()  {fMaskDAQ |= AliDAQ::kEMCAL;}
  
  //   TObjArray *fDetectorArray; //detectors' names - active
  UInt_t     fMaskDAQ;          //detector mask in DAQ
  UInt_t     fMaskReco;         //detector mask in Reco
  //   UInt_t     fDetectors[32]; //detector mask
  //   Bool_t     fITSSPD;        //ITS-SPD active = 1
  //   Bool_t     fITSSDD;        //ITS-SDD active = 1
  //   Bool_t     fITSSSD;        //ITS-SSD active = 1
  //   Bool_t     fTPC;           //TPC active = 1
  //   Bool_t     fTRD;           //TRD active = 1
  //   Bool_t     fTOF;           //TOF active = 1
  //   Bool_t     fHMPID;         //HMPID active = 1
  //   Bool_t     fPHOS;          //PHOS active = 1
  //   Bool_t     fPMD;           //PMD active = 1
  //   Bool_t     fMUON;          //MUON active = 1
  //   Bool_t     fFMD;           //FMD active = 1
  //   Bool_t     fTZERO;         //TZERO active = 1
  //   Bool_t     fVZERO;         //VZERO active = 1
  //   Bool_t     fZDC;           //ZDC active = 1
  //   Bool_t     fEMCAL;         //EMCAL active = 1

  UShort_t   fDetectorValidityRange[AliDAQ::kHLTId];
  TString    fDetectorStatus[AliDAQ::kHLTId];

  ClassDef(AliDetectorTag, 6)  //(ClassName, ClassVersion)
};
//______________________________________________________________________________

#endif
 AliDetectorTag.h:1
 AliDetectorTag.h:2
 AliDetectorTag.h:3
 AliDetectorTag.h:4
 AliDetectorTag.h:5
 AliDetectorTag.h:6
 AliDetectorTag.h:7
 AliDetectorTag.h:8
 AliDetectorTag.h:9
 AliDetectorTag.h:10
 AliDetectorTag.h:11
 AliDetectorTag.h:12
 AliDetectorTag.h:13
 AliDetectorTag.h:14
 AliDetectorTag.h:15
 AliDetectorTag.h:16
 AliDetectorTag.h:17
 AliDetectorTag.h:18
 AliDetectorTag.h:19
 AliDetectorTag.h:20
 AliDetectorTag.h:21
 AliDetectorTag.h:22
 AliDetectorTag.h:23
 AliDetectorTag.h:24
 AliDetectorTag.h:25
 AliDetectorTag.h:26
 AliDetectorTag.h:27
 AliDetectorTag.h:28
 AliDetectorTag.h:29
 AliDetectorTag.h:30
 AliDetectorTag.h:31
 AliDetectorTag.h:32
 AliDetectorTag.h:33
 AliDetectorTag.h:34
 AliDetectorTag.h:35
 AliDetectorTag.h:36
 AliDetectorTag.h:37
 AliDetectorTag.h:38
 AliDetectorTag.h:39
 AliDetectorTag.h:40
 AliDetectorTag.h:41
 AliDetectorTag.h:42
 AliDetectorTag.h:43
 AliDetectorTag.h:44
 AliDetectorTag.h:45
 AliDetectorTag.h:46
 AliDetectorTag.h:47
 AliDetectorTag.h:48
 AliDetectorTag.h:49
 AliDetectorTag.h:50
 AliDetectorTag.h:51
 AliDetectorTag.h:52
 AliDetectorTag.h:53
 AliDetectorTag.h:54
 AliDetectorTag.h:55
 AliDetectorTag.h:56
 AliDetectorTag.h:57
 AliDetectorTag.h:58
 AliDetectorTag.h:59
 AliDetectorTag.h:60
 AliDetectorTag.h:61
 AliDetectorTag.h:62
 AliDetectorTag.h:63
 AliDetectorTag.h:64
 AliDetectorTag.h:65
 AliDetectorTag.h:66
 AliDetectorTag.h:67
 AliDetectorTag.h:68
 AliDetectorTag.h:69
 AliDetectorTag.h:70
 AliDetectorTag.h:71
 AliDetectorTag.h:72
 AliDetectorTag.h:73
 AliDetectorTag.h:74
 AliDetectorTag.h:75
 AliDetectorTag.h:76
 AliDetectorTag.h:77
 AliDetectorTag.h:78
 AliDetectorTag.h:79
 AliDetectorTag.h:80
 AliDetectorTag.h:81
 AliDetectorTag.h:82
 AliDetectorTag.h:83
 AliDetectorTag.h:84
 AliDetectorTag.h:85
 AliDetectorTag.h:86
 AliDetectorTag.h:87
 AliDetectorTag.h:88
 AliDetectorTag.h:89
 AliDetectorTag.h:90
 AliDetectorTag.h:91
 AliDetectorTag.h:92
 AliDetectorTag.h:93
 AliDetectorTag.h:94
 AliDetectorTag.h:95
 AliDetectorTag.h:96
 AliDetectorTag.h:97
 AliDetectorTag.h:98
 AliDetectorTag.h:99
 AliDetectorTag.h:100
 AliDetectorTag.h:101
 AliDetectorTag.h:102
 AliDetectorTag.h:103
 AliDetectorTag.h:104
 AliDetectorTag.h:105
 AliDetectorTag.h:106
 AliDetectorTag.h:107
 AliDetectorTag.h:108
 AliDetectorTag.h:109
 AliDetectorTag.h:110
 AliDetectorTag.h:111
 AliDetectorTag.h:112