]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliDetectorTag.cxx
Coverity 14106
[u/mrichter/AliRoot.git] / STEER / AliDetectorTag.cxx
CommitLineData
f3a97c86 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18//-----------------------------------------------------------------
19// Implementation of the DetectorTag class
20// This is the class to deal with the tags in the detector level
21// Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
22//-----------------------------------------------------------------
23
52314abc 24#include "TMath.h"
25
f3a97c86 26#include "AliDetectorTag.h"
c5caed45 27#include "AliLog.h"
fca2ac22 28#include "TObjString.h"
f3a97c86 29
30ClassImp(AliDetectorTag)
31
719bd672 32//___________________________________________________________________________
fe12e09c 33AliDetectorTag::AliDetectorTag() :
34 TObject(),
3ace8f92 35 fMaskDAQ(0),
04cb11d4 36 fMaskReco(0),
37 fDetectorValidityRange(),
38 fDetectorStatus()
f3a97c86 39{
e16601cf 40 // Default constructor
04cb11d4 41 for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
42 fDetectorValidityRange[iter] = 0;
43 fDetectorStatus[iter] = "";
44 }
f3a97c86 45}
46
719bd672 47//___________________________________________________________________________
fe12e09c 48AliDetectorTag::AliDetectorTag(const AliDetectorTag & detTag) :
49 TObject(detTag),
3ace8f92 50 fMaskDAQ(detTag.fMaskDAQ),
04cb11d4 51 fMaskReco(detTag.fMaskReco),
52 fDetectorValidityRange(),
53 fDetectorStatus()
54{
f3a97c86 55 // DetectorTag copy constructor
04cb11d4 56
57 for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
58 fDetectorValidityRange[iter] = detTag.GetDetectorValidityRange(iter);
59 fDetectorStatus[iter] = detTag.GetDetectorStatus(iter);
60 }
f3a97c86 61}
62
719bd672 63//___________________________________________________________________________
64AliDetectorTag & AliDetectorTag::operator=(const AliDetectorTag &detTag) {
65 //DetectorTag assignment operator
66 if (this != &detTag) {
67 TObject::operator=(detTag);
68
3ace8f92 69 fMaskDAQ = detTag.fMaskDAQ;
70 fMaskReco = detTag.fMaskReco;
04cb11d4 71 for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
72 fDetectorValidityRange[iter] = detTag.GetDetectorValidityRange(iter);
73 fDetectorStatus[iter] = detTag.GetDetectorStatus(iter);
74 }
719bd672 75 }
76 return *this;
77}
78
719bd672 79//___________________________________________________________________________
80AliDetectorTag::~AliDetectorTag() {
e16601cf 81 // Destructor
f3a97c86 82}
c5caed45 83
04cb11d4 84void AliDetectorTag::UpdateFromRunTable(AliDetectorTag &detTag)
85{
86 for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
87 fDetectorValidityRange[iter] = detTag.GetDetectorValidityRange(iter);
88 fDetectorStatus[iter] = detTag.GetDetectorStatus(iter);
89 }
90}
91
c5caed45 92
52314abc 93//___________________________________________________________________________
3ace8f92 94// void AliDetectorTag::SetDetectorConfiguration() {
95// //sets the detector configuration
96// if(fDetectors[0] == 1) {
97// SetITSSPD(); fDetectorArray->Add(new TObjString("SPD"));}
98// if(fDetectors[1] == 1) {
99// SetITSSDD(); fDetectorArray->Add(new TObjString("SDD"));}
100// if(fDetectors[2] == 1) {
101// SetITSSSD(); fDetectorArray->Add(new TObjString("SSD"));}
102// if(fDetectors[3] == 1) {
103// SetTPC(); fDetectorArray->Add(new TObjString("TPC"));}
104// if(fDetectors[4] == 1) {
105// SetTRD(); fDetectorArray->Add(new TObjString("TRD"));}
106// if(fDetectors[5] == 1) {
107// SetTOF(); fDetectorArray->Add(new TObjString("TOF"));}
108// if(fDetectors[6] == 1) {
109// SetHMPID();fDetectorArray->Add(new TObjString("HMPID"));}
110// if(fDetectors[7] == 1) {
111// SetPHOS(); fDetectorArray->Add(new TObjString("PHOS"));}
112// if(fDetectors[9] == 1) {
113// SetPMD(); fDetectorArray->Add(new TObjString("PMD"));}
114// if(fDetectors[10] == 1) {
115// SetMUON(); fDetectorArray->Add(new TObjString("MUON"));}
116// if(fDetectors[12] == 1) {
117// SetFMD(); fDetectorArray->Add(new TObjString("FMD"));}
118// if(fDetectors[13] == 1) {
119// SetTZERO(); fDetectorArray->Add(new TObjString("T0"));}
120// if(fDetectors[14] == 1) {
121// SetVZERO(); fDetectorArray->Add(new TObjString("VZERO"));}
122// if(fDetectors[15] == 1) {
123// SetZDC(); fDetectorArray->Add(new TObjString("ZDC"));}
124// if(fDetectors[18] == 1) {
125// SetEMCAL(); fDetectorArray->Add(new TObjString("EMCAL"));}
126// }
c5caed45 127
128//___________________________________________________________________________
129void AliDetectorTag::PrintDetectorMask() {
130 //prints the detector mask
131 AliInfo( Form( "ITS-SPD: %d", GetITSSPD()) );
132 AliInfo( Form( "ITS-SDD: %d", GetITSSDD()) );
133 AliInfo( Form( "ITS-SSD: %d", GetITSSSD()) );
134 AliInfo( Form( "TPC: %d", GetTPC()) );
135 AliInfo( Form( "TRD: %d", GetTRD()) );
136 AliInfo( Form( "TOF: %d", GetTOF()) );
137 AliInfo( Form( "HMPID: %d", GetHMPID()) );
138 AliInfo( Form( "PHOS: %d", GetPHOS()) );
139 AliInfo( Form( "PMD: %d", GetPMD()) );
140 AliInfo( Form( "MUON: %d", GetMUON()) );
141 AliInfo( Form( "FMD: %d", GetFMD()) );
142 AliInfo( Form( "TZERO: %d", GetTZERO()) );
143 AliInfo( Form( "VZERO: %d", GetVZERO()) );
144 AliInfo( Form( "ZDC: %d", GetZDC()) );
145 AliInfo( Form( "EMCAL: %d", GetEMCAL()) );
146}