]>
Commit | Line | Data |
---|---|---|
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 | ||
24 | #include "AliDetectorTag.h" | |
c5caed45 | 25 | #include "AliLog.h" |
fca2ac22 | 26 | #include "TObjString.h" |
f3a97c86 | 27 | |
28 | ClassImp(AliDetectorTag) | |
29 | ||
719bd672 | 30 | //___________________________________________________________________________ |
fe12e09c | 31 | AliDetectorTag::AliDetectorTag() : |
32 | TObject(), | |
fca2ac22 | 33 | fDetectorArray(new TObjArray()), |
c5caed45 | 34 | fMask(0), |
35 | fITSSPD(kFALSE), | |
36 | fITSSDD(kFALSE), | |
37 | fITSSSD(kFALSE), | |
fe12e09c | 38 | fTPC(kFALSE), |
39 | fTRD(kFALSE), | |
40 | fTOF(kFALSE), | |
41 | fHMPID(kFALSE), | |
42 | fPHOS(kFALSE), | |
fe12e09c | 43 | fPMD(kFALSE), |
c5caed45 | 44 | fMUON(kFALSE), |
45 | fFMD(kFALSE), | |
46 | fTZERO(kFALSE), | |
fe12e09c | 47 | fVZERO(kFALSE), |
c5caed45 | 48 | fZDC(kFALSE), |
49 | fEMCAL(kFALSE) | |
f3a97c86 | 50 | { |
e16601cf | 51 | // Default constructor |
c5caed45 | 52 | for(Int_t k = 0; k < 20; k++) fDetectors[k] = 0; |
f3a97c86 | 53 | } |
54 | ||
719bd672 | 55 | //___________________________________________________________________________ |
fe12e09c | 56 | AliDetectorTag::AliDetectorTag(const AliDetectorTag & detTag) : |
57 | TObject(detTag), | |
fca2ac22 | 58 | fDetectorArray(detTag.fDetectorArray), |
c5caed45 | 59 | fMask(detTag.fMask), |
60 | fITSSPD(detTag.fITSSPD), | |
61 | fITSSDD(detTag.fITSSDD), | |
62 | fITSSSD(detTag.fITSSSD), | |
fe12e09c | 63 | fTPC(detTag.fTPC), |
64 | fTRD(detTag.fTRD), | |
65 | fTOF(detTag.fTOF), | |
66 | fHMPID(detTag.fHMPID), | |
67 | fPHOS(detTag.fPHOS), | |
fe12e09c | 68 | fPMD(detTag.fPMD), |
c5caed45 | 69 | fMUON(detTag.fMUON), |
70 | fFMD(detTag.fFMD), | |
71 | fTZERO(detTag.fTZERO), | |
fe12e09c | 72 | fVZERO(detTag.fVZERO), |
c5caed45 | 73 | fZDC(detTag.fZDC), |
74 | fEMCAL(detTag.fEMCAL) | |
fe12e09c | 75 | { |
f3a97c86 | 76 | // DetectorTag copy constructor |
c5caed45 | 77 | for(Int_t k = 0; k < 20; k++) fDetectors[k] = detTag.fDetectors[k]; |
f3a97c86 | 78 | } |
79 | ||
719bd672 | 80 | //___________________________________________________________________________ |
81 | AliDetectorTag & AliDetectorTag::operator=(const AliDetectorTag &detTag) { | |
82 | //DetectorTag assignment operator | |
83 | if (this != &detTag) { | |
84 | TObject::operator=(detTag); | |
85 | ||
fca2ac22 | 86 | fDetectorArray = detTag.fDetectorArray; |
c5caed45 | 87 | fMask = detTag.fMask; |
88 | fITSSPD = detTag.fITSSPD; | |
89 | fITSSDD = detTag.fITSSDD; | |
90 | fITSSSD = detTag.fITSSSD; | |
fe12e09c | 91 | fTPC = detTag.fTPC; |
92 | fTRD = detTag.fTRD; | |
93 | fTOF = detTag.fTOF; | |
94 | fHMPID = detTag.fHMPID; | |
95 | fPHOS = detTag.fPHOS; | |
fe12e09c | 96 | fPMD = detTag.fPMD; |
c5caed45 | 97 | fMUON = detTag.fMUON; |
98 | fFMD = detTag.fFMD; | |
fe12e09c | 99 | fTZERO = detTag.fTZERO; |
c5caed45 | 100 | fVZERO = detTag.fVZERO; |
101 | fZDC = detTag.fZDC; | |
102 | fEMCAL = detTag.fEMCAL; | |
103 | for(Int_t k = 0; k < 20; k++) fDetectors[k] = detTag.fDetectors[k]; | |
719bd672 | 104 | } |
105 | return *this; | |
106 | } | |
107 | ||
719bd672 | 108 | //___________________________________________________________________________ |
109 | AliDetectorTag::~AliDetectorTag() { | |
e16601cf | 110 | // Destructor |
fca2ac22 | 111 | delete fDetectorArray; |
f3a97c86 | 112 | } |
c5caed45 | 113 | |
114 | //___________________________________________________________________________ | |
115 | void AliDetectorTag::Int2Bin() { | |
116 | // Convert the integer into binary | |
117 | Int_t j=0; | |
118 | UInt_t mask = fMask; | |
119 | for(Int_t k = 0; k < 20; k++) fDetectors[k] = 0; | |
120 | while(mask > 0) { | |
121 | fDetectors[j] = mask%2; | |
122 | mask = mask/2; | |
123 | j++; | |
124 | } | |
125 | SetDetectorConfiguration(); | |
126 | } | |
127 | ||
128 | //___________________________________________________________________________ | |
129 | void AliDetectorTag::SetDetectorConfiguration() { | |
130 | //sets the detector configuration | |
fca2ac22 | 131 | if(fDetectors[0] == 1) { |
132 | SetITSSPD(); fDetectorArray->Add(new TObjString("SPD"));} | |
133 | if(fDetectors[1] == 1) { | |
134 | SetITSSDD(); fDetectorArray->Add(new TObjString("SDD"));} | |
135 | if(fDetectors[2] == 1) { | |
136 | SetITSSSD(); fDetectorArray->Add(new TObjString("SSD"));} | |
137 | if(fDetectors[3] == 1) { | |
138 | SetTPC(); fDetectorArray->Add(new TObjString("TPC"));} | |
139 | if(fDetectors[4] == 1) { | |
140 | SetTRD(); fDetectorArray->Add(new TObjString("TRD"));} | |
141 | if(fDetectors[5] == 1) { | |
142 | SetTOF(); fDetectorArray->Add(new TObjString("TOF"));} | |
143 | if(fDetectors[6] == 1) { | |
144 | SetHMPID();fDetectorArray->Add(new TObjString("HMPID"));} | |
145 | if(fDetectors[7] == 1) { | |
146 | SetPHOS(); fDetectorArray->Add(new TObjString("PHOS"));} | |
147 | if(fDetectors[9] == 1) { | |
148 | SetPMD(); fDetectorArray->Add(new TObjString("PMD"));} | |
149 | if(fDetectors[10] == 1) { | |
150 | SetMUON(); fDetectorArray->Add(new TObjString("MUON"));} | |
151 | if(fDetectors[12] == 1) { | |
152 | SetFMD(); fDetectorArray->Add(new TObjString("FMD"));} | |
153 | if(fDetectors[13] == 1) { | |
154 | SetTZERO(); fDetectorArray->Add(new TObjString("T0"));} | |
155 | if(fDetectors[14] == 1) { | |
156 | SetVZERO(); fDetectorArray->Add(new TObjString("VZERO"));} | |
157 | if(fDetectors[15] == 1) { | |
158 | SetZDC(); fDetectorArray->Add(new TObjString("ZDC"));} | |
159 | if(fDetectors[18] == 1) { | |
160 | SetEMCAL(); fDetectorArray->Add(new TObjString("EMCAL"));} | |
c5caed45 | 161 | } |
162 | ||
163 | //___________________________________________________________________________ | |
164 | void AliDetectorTag::PrintDetectorMask() { | |
165 | //prints the detector mask | |
166 | AliInfo( Form( "ITS-SPD: %d", GetITSSPD()) ); | |
167 | AliInfo( Form( "ITS-SDD: %d", GetITSSDD()) ); | |
168 | AliInfo( Form( "ITS-SSD: %d", GetITSSSD()) ); | |
169 | AliInfo( Form( "TPC: %d", GetTPC()) ); | |
170 | AliInfo( Form( "TRD: %d", GetTRD()) ); | |
171 | AliInfo( Form( "TOF: %d", GetTOF()) ); | |
172 | AliInfo( Form( "HMPID: %d", GetHMPID()) ); | |
173 | AliInfo( Form( "PHOS: %d", GetPHOS()) ); | |
174 | AliInfo( Form( "PMD: %d", GetPMD()) ); | |
175 | AliInfo( Form( "MUON: %d", GetMUON()) ); | |
176 | AliInfo( Form( "FMD: %d", GetFMD()) ); | |
177 | AliInfo( Form( "TZERO: %d", GetTZERO()) ); | |
178 | AliInfo( Form( "VZERO: %d", GetVZERO()) ); | |
179 | AliInfo( Form( "ZDC: %d", GetZDC()) ); | |
180 | AliInfo( Form( "EMCAL: %d", GetEMCAL()) ); | |
181 | } |