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 ///////////////////////////////////////////////////////////////////////////////
20 // TRD calibration class for status of chambers //
22 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliTRDCalChamberStatus.h"
27 ClassImp(AliTRDCalChamberStatus)
29 //_____________________________________________________________________________
30 AliTRDCalChamberStatus::AliTRDCalChamberStatus()
34 // AliTRDCalChamberStatus default constructor
37 for (Int_t idet = 0; idet < kNdet; idet++) {
43 //_____________________________________________________________________________
44 AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t *title)
48 // AliTRDCalChamberStatus constructor
51 for (Int_t idet = 0; idet < kNdet; idet++) {
56 //_____________________________________________________________________________
57 void AliTRDCalChamberStatus::SetStatus(Int_t det, Char_t status)
61 // set the chamber status
67 case AliTRDCalChamberStatus::kGood:
68 SETBIT(fStatus[det], kGood);
69 CLRBIT(fStatus[det], kNoData);
70 CLRBIT(fStatus[det], kBadCalibrated);
72 case AliTRDCalChamberStatus::kNoData:
73 CLRBIT(fStatus[det], kGood);
74 SETBIT(fStatus[det], kNoData);
75 SETBIT(fStatus[det], kNoDataHalfChamberSideA);
76 SETBIT(fStatus[det], kNoDataHalfChamberSideB);
77 // SETBIT(fStatus[det], kBadCalibrated);
79 case AliTRDCalChamberStatus::kNoDataHalfChamberSideA:
80 SETBIT(fStatus[det], kNoDataHalfChamberSideA);
81 if(TESTBIT(fStatus[det], kNoDataHalfChamberSideB)){
82 SETBIT(fStatus[det], kNoData);
83 CLRBIT(fStatus[det], kGood);
86 case AliTRDCalChamberStatus::kNoDataHalfChamberSideB:
87 SETBIT(fStatus[det], kNoDataHalfChamberSideB);
88 if(TESTBIT(fStatus[det], kNoDataHalfChamberSideA)) {
89 CLRBIT(fStatus[det], kGood);
90 SETBIT(fStatus[det], kNoData);
93 case AliTRDCalChamberStatus::kBadCalibrated:
94 CLRBIT(fStatus[det], kGood);
95 SETBIT(fStatus[det], kBadCalibrated);
98 CLRBIT(fStatus[det], kGood);
99 CLRBIT(fStatus[det], kNoData);
100 CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
101 CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
102 CLRBIT(fStatus[det], kBadCalibrated);
106 //_____________________________________________________________________________
107 void AliTRDCalChamberStatus::UnsetStatusBit(Int_t det, Char_t status)
111 // unset the chamber status bit
117 case AliTRDCalChamberStatus::kGood:
118 CLRBIT(fStatus[det], kGood);
120 case AliTRDCalChamberStatus::kNoData:
121 CLRBIT(fStatus[det], kNoData);
123 case AliTRDCalChamberStatus::kNoDataHalfChamberSideA:
124 CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
126 case AliTRDCalChamberStatus::kNoDataHalfChamberSideB:
127 CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
129 case AliTRDCalChamberStatus::kBadCalibrated:
130 CLRBIT(fStatus[det], kBadCalibrated);
133 CLRBIT(fStatus[det], kGood);
134 CLRBIT(fStatus[det], kNoData);
135 CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
136 CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
137 CLRBIT(fStatus[det], kBadCalibrated);
141 //_____________________________________________________________________________
142 TH2D* AliTRDCalChamberStatus::Plot(Int_t sm, Int_t rphi)
145 // Plot chamber status for supermodule and halfchamberside
146 // as a function of layer and stack
149 TH2D *h2 = new TH2D(Form("sm_%d_rphi_%d",sm,rphi),Form("sm_%d_rphi_%d",sm,rphi),5,0.0,5.0,6,0.0,6.0);
151 h2->SetXTitle("stack");
152 h2->SetYTitle("layer");
155 Int_t end = (sm+1)*30;
157 for(Int_t i=start; i<end; i++) {
159 Int_t stackn = static_cast<int>((i-start)/6.);
160 Int_t status = GetStatus(i);
161 h2->Fill(stackn,layer,status);
163 if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideB)) h2->Fill(stackn,layer,status);
166 if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideA)) h2->Fill(stackn,layer,status);
173 //_____________________________________________________________________________
174 TH2D* AliTRDCalChamberStatus::PlotNoData(Int_t sm, Int_t rphi)
177 // Plot chamber data status for supermodule and halfchamberside
178 // as a function of layer and stack
181 TH2D *h2 = new TH2D(Form("sm_%d_rphi_%d_data",sm,rphi),Form("sm_%d_rphi_%d_data",sm,rphi),5,0.0,5.0,6,0.0,6.0);
183 h2->SetXTitle("stack");
184 h2->SetYTitle("layer");
187 Int_t end = (sm+1)*30;
189 for(Int_t i=start; i<end; i++) {
191 Int_t stackn = static_cast<int>((i-start)/6.);
193 if(TESTBIT(fStatus[i], kNoDataHalfChamberSideB)) h2->Fill(stackn,layer,1);
194 if(TESTBIT(fStatus[i], kNoData)) h2->Fill(stackn,layer,1);
197 if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideA)) h2->Fill(stackn,layer,1);
198 if(!TESTBIT(fStatus[i], kNoData)) h2->Fill(stackn,layer,1);
205 //_____________________________________________________________________________
206 TH2D* AliTRDCalChamberStatus::PlotBadCalibrated(Int_t sm, Int_t rphi)
209 // Plot chamber calibration status for supermodule and halfchamberside
210 // as a function of layer and stack
213 TH2D *h2 = new TH2D(Form("sm_%d_rphi_%d_calib",sm,rphi),Form("sm_%d_rphi_%d_calib",sm,rphi),5,0.0,5.0,6,0.0,6.0);
215 h2->SetXTitle("stack");
216 h2->SetYTitle("layer");
219 Int_t end = (sm+1)*30;
221 for(Int_t i=start; i<end; i++) {
223 Int_t stackn = static_cast<int>((i-start)/6.);
225 if(TESTBIT(fStatus[i], kBadCalibrated)) h2->Fill(stackn,layer,1);
228 if(TESTBIT(fStatus[i], kBadCalibrated)) h2->Fill(stackn,layer,1);
235 //_____________________________________________________________________________
236 TH2D* AliTRDCalChamberStatus::Plot(Int_t sm)
239 // Plot chamber status for supermodule and halfchamberside
240 // as a function of layer and stack
243 TH2D *h2 = new TH2D(Form("sm_%d",sm),Form("sm_%d",sm),5,0.0,5.0,6,0.0,6.0);
245 h2->SetXTitle("stack");
246 h2->SetYTitle("layer");
249 Int_t end = (sm+1)*30;
251 for(Int_t i=start; i<end; i++) {
253 Int_t stackn = static_cast<int>((i-start)/6.);
254 Int_t status = GetStatus(i);
255 h2->Fill(stackn,layer,status);