ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

/* $Id$ */

//-----------------------------------------------------------------
//           Implementation of the DetectorTag class
//   This is the class to deal with the tags in the detector level
//   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(),
  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),
  fMaskDAQ(detTag.fMaskDAQ),
  fMaskReco(detTag.fMaskReco),
  fDetectorValidityRange(),
  fDetectorStatus() 
{
  // DetectorTag copy constructor
  
  for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
    fDetectorValidityRange[iter] = detTag.GetDetectorValidityRange(iter);
    fDetectorStatus[iter] = detTag.GetDetectorStatus(iter);
  }
}

//___________________________________________________________________________
AliDetectorTag & AliDetectorTag::operator=(const AliDetectorTag &detTag) {
  //DetectorTag assignment operator
  if (this != &detTag) {
    TObject::operator=(detTag);
    
    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()) );
}
 AliDetectorTag.cxx:1
 AliDetectorTag.cxx:2
 AliDetectorTag.cxx:3
 AliDetectorTag.cxx:4
 AliDetectorTag.cxx:5
 AliDetectorTag.cxx:6
 AliDetectorTag.cxx:7
 AliDetectorTag.cxx:8
 AliDetectorTag.cxx:9
 AliDetectorTag.cxx:10
 AliDetectorTag.cxx:11
 AliDetectorTag.cxx:12
 AliDetectorTag.cxx:13
 AliDetectorTag.cxx:14
 AliDetectorTag.cxx:15
 AliDetectorTag.cxx:16
 AliDetectorTag.cxx:17
 AliDetectorTag.cxx:18
 AliDetectorTag.cxx:19
 AliDetectorTag.cxx:20
 AliDetectorTag.cxx:21
 AliDetectorTag.cxx:22
 AliDetectorTag.cxx:23
 AliDetectorTag.cxx:24
 AliDetectorTag.cxx:25
 AliDetectorTag.cxx:26
 AliDetectorTag.cxx:27
 AliDetectorTag.cxx:28
 AliDetectorTag.cxx:29
 AliDetectorTag.cxx:30
 AliDetectorTag.cxx:31
 AliDetectorTag.cxx:32
 AliDetectorTag.cxx:33
 AliDetectorTag.cxx:34
 AliDetectorTag.cxx:35
 AliDetectorTag.cxx:36
 AliDetectorTag.cxx:37
 AliDetectorTag.cxx:38
 AliDetectorTag.cxx:39
 AliDetectorTag.cxx:40
 AliDetectorTag.cxx:41
 AliDetectorTag.cxx:42
 AliDetectorTag.cxx:43
 AliDetectorTag.cxx:44
 AliDetectorTag.cxx:45
 AliDetectorTag.cxx:46
 AliDetectorTag.cxx:47
 AliDetectorTag.cxx:48
 AliDetectorTag.cxx:49
 AliDetectorTag.cxx:50
 AliDetectorTag.cxx:51
 AliDetectorTag.cxx:52
 AliDetectorTag.cxx:53
 AliDetectorTag.cxx:54
 AliDetectorTag.cxx:55
 AliDetectorTag.cxx:56
 AliDetectorTag.cxx:57
 AliDetectorTag.cxx:58
 AliDetectorTag.cxx:59
 AliDetectorTag.cxx:60
 AliDetectorTag.cxx:61
 AliDetectorTag.cxx:62
 AliDetectorTag.cxx:63
 AliDetectorTag.cxx:64
 AliDetectorTag.cxx:65
 AliDetectorTag.cxx:66
 AliDetectorTag.cxx:67
 AliDetectorTag.cxx:68
 AliDetectorTag.cxx:69
 AliDetectorTag.cxx:70
 AliDetectorTag.cxx:71
 AliDetectorTag.cxx:72
 AliDetectorTag.cxx:73
 AliDetectorTag.cxx:74
 AliDetectorTag.cxx:75
 AliDetectorTag.cxx:76
 AliDetectorTag.cxx:77
 AliDetectorTag.cxx:78
 AliDetectorTag.cxx:79
 AliDetectorTag.cxx:80
 AliDetectorTag.cxx:81
 AliDetectorTag.cxx:82
 AliDetectorTag.cxx:83
 AliDetectorTag.cxx:84
 AliDetectorTag.cxx:85
 AliDetectorTag.cxx:86
 AliDetectorTag.cxx:87
 AliDetectorTag.cxx:88
 AliDetectorTag.cxx:89
 AliDetectorTag.cxx:90
 AliDetectorTag.cxx:91
 AliDetectorTag.cxx:92
 AliDetectorTag.cxx:93
 AliDetectorTag.cxx:94
 AliDetectorTag.cxx:95
 AliDetectorTag.cxx:96
 AliDetectorTag.cxx:97
 AliDetectorTag.cxx:98
 AliDetectorTag.cxx:99
 AliDetectorTag.cxx:100
 AliDetectorTag.cxx:101
 AliDetectorTag.cxx:102
 AliDetectorTag.cxx:103
 AliDetectorTag.cxx:104
 AliDetectorTag.cxx:105
 AliDetectorTag.cxx:106
 AliDetectorTag.cxx:107
 AliDetectorTag.cxx:108
 AliDetectorTag.cxx:109
 AliDetectorTag.cxx:110
 AliDetectorTag.cxx:111
 AliDetectorTag.cxx:112
 AliDetectorTag.cxx:113
 AliDetectorTag.cxx:114
 AliDetectorTag.cxx:115
 AliDetectorTag.cxx:116
 AliDetectorTag.cxx:117
 AliDetectorTag.cxx:118
 AliDetectorTag.cxx:119
 AliDetectorTag.cxx:120
 AliDetectorTag.cxx:121
 AliDetectorTag.cxx:122
 AliDetectorTag.cxx:123
 AliDetectorTag.cxx:124
 AliDetectorTag.cxx:125
 AliDetectorTag.cxx:126
 AliDetectorTag.cxx:127
 AliDetectorTag.cxx:128
 AliDetectorTag.cxx:129
 AliDetectorTag.cxx:130
 AliDetectorTag.cxx:131
 AliDetectorTag.cxx:132
 AliDetectorTag.cxx:133
 AliDetectorTag.cxx:134
 AliDetectorTag.cxx:135
 AliDetectorTag.cxx:136
 AliDetectorTag.cxx:137
 AliDetectorTag.cxx:138
 AliDetectorTag.cxx:139
 AliDetectorTag.cxx:140
 AliDetectorTag.cxx:141
 AliDetectorTag.cxx:142
 AliDetectorTag.cxx:143
 AliDetectorTag.cxx:144
 AliDetectorTag.cxx:145
 AliDetectorTag.cxx:146