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 //-----------------------------------------------------------------
24 #include "AliDetectorTag.h"
26 #include "TObjString.h"
28 ClassImp(AliDetectorTag)
30 //___________________________________________________________________________
31 AliDetectorTag::AliDetectorTag() :
33 fDetectorArray(new TObjArray()),
51 // Default constructor
52 for(Int_t k = 0; k < 20; k++) fDetectors[k] = 0;
55 //___________________________________________________________________________
56 AliDetectorTag::AliDetectorTag(const AliDetectorTag & detTag) :
58 fDetectorArray(detTag.fDetectorArray),
60 fITSSPD(detTag.fITSSPD),
61 fITSSDD(detTag.fITSSDD),
62 fITSSSD(detTag.fITSSSD),
66 fHMPID(detTag.fHMPID),
71 fTZERO(detTag.fTZERO),
72 fVZERO(detTag.fVZERO),
76 // DetectorTag copy constructor
77 for(Int_t k = 0; k < 20; k++) fDetectors[k] = detTag.fDetectors[k];
80 //___________________________________________________________________________
81 AliDetectorTag & AliDetectorTag::operator=(const AliDetectorTag &detTag) {
82 //DetectorTag assignment operator
83 if (this != &detTag) {
84 TObject::operator=(detTag);
86 fDetectorArray = detTag.fDetectorArray;
88 fITSSPD = detTag.fITSSPD;
89 fITSSDD = detTag.fITSSDD;
90 fITSSSD = detTag.fITSSSD;
94 fHMPID = detTag.fHMPID;
99 fTZERO = detTag.fTZERO;
100 fVZERO = detTag.fVZERO;
102 fEMCAL = detTag.fEMCAL;
103 for(Int_t k = 0; k < 20; k++) fDetectors[k] = detTag.fDetectors[k];
108 //___________________________________________________________________________
109 AliDetectorTag::~AliDetectorTag() {
111 delete fDetectorArray;
114 //___________________________________________________________________________
115 void AliDetectorTag::Int2Bin() {
116 // Convert the integer into binary
119 for(Int_t k = 0; k < 20; k++) fDetectors[k] = 0;
121 fDetectors[j] = mask%2;
125 SetDetectorConfiguration();
128 //___________________________________________________________________________
129 void AliDetectorTag::SetDetectorConfiguration() {
130 //sets the detector configuration
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"));}
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()) );