1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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 //-----------------------------------------------------------------
26 #include "AliDetectorTag.h"
28 #include "TObjString.h"
30 ClassImp(AliDetectorTag)
32 //___________________________________________________________________________
33 AliDetectorTag::AliDetectorTag() :
35 fDetectorArray(new TObjArray()),
53 // Default constructor
54 for(Int_t k = 0; k < 32; k++) fDetectors[k] = 0;
57 //___________________________________________________________________________
58 AliDetectorTag::AliDetectorTag(const AliDetectorTag & detTag) :
60 fDetectorArray(detTag.fDetectorArray),
62 fITSSPD(detTag.fITSSPD),
63 fITSSDD(detTag.fITSSDD),
64 fITSSSD(detTag.fITSSSD),
68 fHMPID(detTag.fHMPID),
73 fTZERO(detTag.fTZERO),
74 fVZERO(detTag.fVZERO),
78 // DetectorTag copy constructor
79 for(Int_t k = 0; k < 32; k++) fDetectors[k] = detTag.fDetectors[k];
82 //___________________________________________________________________________
83 AliDetectorTag & AliDetectorTag::operator=(const AliDetectorTag &detTag) {
84 //DetectorTag assignment operator
85 if (this != &detTag) {
86 TObject::operator=(detTag);
88 fDetectorArray = detTag.fDetectorArray;
90 fITSSPD = detTag.fITSSPD;
91 fITSSDD = detTag.fITSSDD;
92 fITSSSD = detTag.fITSSSD;
96 fHMPID = detTag.fHMPID;
101 fTZERO = detTag.fTZERO;
102 fVZERO = detTag.fVZERO;
104 fEMCAL = detTag.fEMCAL;
105 for(Int_t k = 0; k < 32; k++) fDetectors[k] = detTag.fDetectors[k];
110 //___________________________________________________________________________
111 AliDetectorTag::~AliDetectorTag() {
113 delete fDetectorArray;
116 //___________________________________________________________________________
117 void AliDetectorTag::Int2Bin() {
118 // Convert the integer into binary
121 for(Int_t k = 0; k < 32; k++) fDetectors[k] = 0;
123 fDetectors[j] = mask%2;
127 SetDetectorConfiguration();
130 //___________________________________________________________________________
131 UInt_t AliDetectorTag::GetIntDetectorMask() {
132 // Returns the detector mask UInt_t
134 for(Int_t k = 0; k < 32; k++)
135 if(fDetectors[k] == 1) mask += (UInt_t)TMath::Power(2,k);
140 //___________________________________________________________________________
141 void AliDetectorTag::SetDetectorConfiguration() {
142 //sets the detector configuration
143 if(fDetectors[0] == 1) {
144 SetITSSPD(); fDetectorArray->Add(new TObjString("SPD"));}
145 if(fDetectors[1] == 1) {
146 SetITSSDD(); fDetectorArray->Add(new TObjString("SDD"));}
147 if(fDetectors[2] == 1) {
148 SetITSSSD(); fDetectorArray->Add(new TObjString("SSD"));}
149 if(fDetectors[3] == 1) {
150 SetTPC(); fDetectorArray->Add(new TObjString("TPC"));}
151 if(fDetectors[4] == 1) {
152 SetTRD(); fDetectorArray->Add(new TObjString("TRD"));}
153 if(fDetectors[5] == 1) {
154 SetTOF(); fDetectorArray->Add(new TObjString("TOF"));}
155 if(fDetectors[6] == 1) {
156 SetHMPID();fDetectorArray->Add(new TObjString("HMPID"));}
157 if(fDetectors[7] == 1) {
158 SetPHOS(); fDetectorArray->Add(new TObjString("PHOS"));}
159 if(fDetectors[9] == 1) {
160 SetPMD(); fDetectorArray->Add(new TObjString("PMD"));}
161 if(fDetectors[10] == 1) {
162 SetMUON(); fDetectorArray->Add(new TObjString("MUON"));}
163 if(fDetectors[12] == 1) {
164 SetFMD(); fDetectorArray->Add(new TObjString("FMD"));}
165 if(fDetectors[13] == 1) {
166 SetTZERO(); fDetectorArray->Add(new TObjString("T0"));}
167 if(fDetectors[14] == 1) {
168 SetVZERO(); fDetectorArray->Add(new TObjString("VZERO"));}
169 if(fDetectors[15] == 1) {
170 SetZDC(); fDetectorArray->Add(new TObjString("ZDC"));}
171 if(fDetectors[18] == 1) {
172 SetEMCAL(); fDetectorArray->Add(new TObjString("EMCAL"));}
175 //___________________________________________________________________________
176 void AliDetectorTag::PrintDetectorMask() {
177 //prints the detector mask
178 AliInfo( Form( "ITS-SPD: %d", GetITSSPD()) );
179 AliInfo( Form( "ITS-SDD: %d", GetITSSDD()) );
180 AliInfo( Form( "ITS-SSD: %d", GetITSSSD()) );
181 AliInfo( Form( "TPC: %d", GetTPC()) );
182 AliInfo( Form( "TRD: %d", GetTRD()) );
183 AliInfo( Form( "TOF: %d", GetTOF()) );
184 AliInfo( Form( "HMPID: %d", GetHMPID()) );
185 AliInfo( Form( "PHOS: %d", GetPHOS()) );
186 AliInfo( Form( "PMD: %d", GetPMD()) );
187 AliInfo( Form( "MUON: %d", GetMUON()) );
188 AliInfo( Form( "FMD: %d", GetFMD()) );
189 AliInfo( Form( "TZERO: %d", GetTZERO()) );
190 AliInfo( Form( "VZERO: %d", GetVZERO()) );
191 AliInfo( Form( "ZDC: %d", GetZDC()) );
192 AliInfo( Form( "EMCAL: %d", GetEMCAL()) );