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